| # Copyright 2026 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| |
| load("@rules_cc//cc:defs.bzl", "cc_library") |
| load("@zephyr//:cc.bzl", "zephyr_cc_library", "zephyr_soc_library") |
| load("@zephyr//:flags.bzl", "flags_from_dict") |
| load("@zephyr-bazel//:bazel/openair_helpers.bzl", "safe_glob", "select_drivers") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| exports_files([ |
| "zephyr/module.yml", |
| "soc/atmosic/ATM34/linker.ld", |
| "soc/atmosic/ATM33/linker.ld", |
| ]) |
| |
| cc_library( |
| name = "atmosic_headers_common", |
| defines = ["ADC_GAIN_1_8=0x80"], |
| hdrs = glob( |
| [ |
| "include/**/*.h", |
| "include/**/*.ih", |
| "modules/hal_atmosic/include/**/*.h", |
| "modules/hal_atmosic/include/**/*.ih", |
| "drivers/**/*.h", |
| "drivers/**/*.ih", |
| "modules/hal_atmosic/drivers/**/*.h", |
| "modules/hal_atmosic/drivers/**/*.ih", |
| "lib/**/*.h", |
| "lib/**/*.ih", |
| "subsys/**/*.h", |
| "subsys/**/*.ih", |
| "soc/**/*.h", |
| "soc/**/*.ih", |
| ], |
| allow_empty = True, |
| ) + [ |
| "@zephyr//drivers/gpio:gpio_cmsdk_ahb.c", |
| "@zephyr//drivers/adc:adc_context.h", |
| "@zephyr//drivers/i2c:i2c-priv.h", |
| "@zephyr//drivers/spi:spi_context.h", |
| ], |
| includes = [ |
| "include", |
| "modules/hal_atmosic/include", |
| "lib/app_batt", |
| "lib/app_work_q", |
| "lib/at_cmd", |
| "lib/at_cmd_set", |
| "lib/atm_asm", |
| "lib/atm_bthci_utils", |
| "lib/atm_cs", |
| "lib/atm_debug_auth", |
| "lib/atm_fmna", |
| "lib/atm_gfp", |
| "lib/atm_hci_uart", |
| "lib/atm_mcuboot_ext", |
| "lib/atm_test_common", |
| "lib/atm_utils_c", |
| "lib/atm_utils_endian", |
| "lib/atm_utils_math", |
| "lib/atm_utils_reg", |
| "lib/atm_utils_slist", |
| "lib/atm_vendor", |
| "lib/atm_vendor/api_include", |
| "lib/dtm_2wire/include", |
| "lib/gfp_crypto", |
| "lib/micro-ecc", |
| "lib/ranging_oob_de", |
| "lib/sec_assert", |
| "lib/sec_service", |
| "subsys/bluetooth/services/atm_bt_tput", |
| "subsys/bluetooth/services/atm_bt_tput/include", |
| "subsys/bluetooth/services/dult", |
| "subsys/bluetooth/services/gfp", |
| "subsys/bluetooth/services/gfp/dis", |
| "subsys/bluetooth/services/gfp/fmdn", |
| "subsys/bluetooth/services/ras", |
| "subsys/bluetooth/services/ras/include", |
| "subsys/settings", |
| "soc/atmosic/include", |
| "modules/hal_atmosic/drivers/at_tz_mpc", |
| "modules/hal_atmosic/drivers/at_tz_sau", |
| "modules/hal_atmosic/drivers/atm_aes", |
| "modules/hal_atmosic/drivers/atm_bp_clock", |
| "modules/hal_atmosic/drivers/atm_sha2", |
| "modules/hal_atmosic/drivers/atm_spe_sec_fault_storage", |
| "modules/hal_atmosic/drivers/batt_model", |
| "modules/hal_atmosic/drivers/ccbm", |
| "modules/hal_atmosic/drivers/dma", |
| "modules/hal_atmosic/drivers/eui", |
| "modules/hal_atmosic/drivers/pc_ctr", |
| "modules/hal_atmosic/drivers/pc_ctr_sleep", |
| "modules/hal_atmosic/drivers/radio_hal_ble", |
| "modules/hal_atmosic/drivers/radio_hal_ble_cs", |
| "modules/hal_atmosic/drivers/radio_hal_ble_cte", |
| "modules/hal_atmosic/drivers/radio_hal_common", |
| "modules/hal_atmosic/drivers/radio_hal_frc", |
| "modules/hal_atmosic/drivers/radio_hal_log", |
| "modules/hal_atmosic/drivers/radio_hal_mgr", |
| "modules/hal_atmosic/drivers/radio_hal_prof", |
| "modules/hal_atmosic/drivers/radio_req_ble", |
| "modules/hal_atmosic/drivers/radio_status", |
| "modules/hal_atmosic/drivers/reset", |
| "modules/hal_atmosic/drivers/rram_rom_prot", |
| "modules/hal_atmosic/drivers/sec_cache", |
| "modules/hal_atmosic/drivers/sec_debug", |
| "modules/hal_atmosic/drivers/sec_reset", |
| "modules/hal_atmosic/drivers/sec_wdog_disable", |
| ], |
| ) |
| |
| cc_library( |
| name = "atmosic_headers_atm34", |
| hdrs = glob( |
| [ |
| "modules/hal_atmosic/ATM34xx/include/**/*.h", |
| "modules/hal_atmosic/ATM34xx/include/**/*.ih", |
| "modules/hal_atmosic/ATM34xx/rev-5/include/**/*.h", |
| "modules/hal_atmosic/ATM34xx/rev-5/include/**/*.ih", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/**/*.h", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/**/*.ih", |
| "modules/hal_atmosic/ATM34xx/drivers/**/*.h", |
| "modules/hal_atmosic/ATM34xx/drivers/**/*.ih", |
| ], |
| allow_empty = True, |
| ), |
| includes = [ |
| "modules/hal_atmosic/ATM34xx/include", |
| "modules/hal_atmosic/ATM34xx/rev-5/include", |
| "modules/hal_atmosic/ATM34xx/rev-5/include/arm", |
| "modules/hal_atmosic/ATM34xx/rev-5/include/armgcc", |
| "modules/hal_atmosic/ATM34xx/rev-5/include/reg", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/blell/controller/include/ble", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/blell/controller/include/common", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/blell/platform/include", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/blell/wsf/include", |
| "modules/hal_atmosic/ATM34xx/rev-5/lib/blell/wsf/include/util", |
| "drivers/adc", |
| "modules/hal_atmosic/ATM34xx/drivers/at_tz_ppc", |
| "modules/hal_atmosic/ATM34xx/drivers/atm_otp", |
| "modules/hal_atmosic/ATM34xx/drivers/atm_vendor_drv", |
| "modules/hal_atmosic/ATM34xx/drivers/ble/include", |
| "modules/hal_atmosic/ATM34xx/drivers/brwnout", |
| "modules/hal_atmosic/ATM34xx/drivers/hw_cfg", |
| "modules/hal_atmosic/ATM34xx/drivers/key_sideload", |
| "modules/hal_atmosic/ATM34xx/drivers/pinmux", |
| "modules/hal_atmosic/ATM34xx/drivers/pmu", |
| "modules/hal_atmosic/ATM34xx/drivers/radio_hal_154", |
| "modules/hal_atmosic/ATM34xx/drivers/radio_req_154", |
| "modules/hal_atmosic/ATM34xx/drivers/rep_vec", |
| "modules/hal_atmosic/ATM34xx/drivers/rf", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_cache", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_counter", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_debug", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_dev_lockout", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_hw_cfg", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_jrnl", |
| "modules/hal_atmosic/ATM34xx/drivers/sec_reset", |
| "modules/hal_atmosic/ATM34xx/drivers/spi", |
| "modules/hal_atmosic/ATM34xx/drivers/timer", |
| "modules/hal_atmosic/ATM34xx/drivers/pseq", |
| "modules/hal_atmosic/ATM34xx/drivers/trng", |
| "soc/atmosic/ATM34", |
| ], |
| deps = [":atmosic_headers_common"], |
| ) |
| |
| cc_library( |
| name = "atmosic_headers_atm33", |
| hdrs = glob( |
| [ |
| "modules/hal_atmosic/ATM33xx-5/include/**/*.h", |
| "modules/hal_atmosic/ATM33xx-5/include/**/*.ih", |
| "modules/hal_atmosic/ATM33xx-5/drivers/**/*.h", |
| "modules/hal_atmosic/ATM33xx-5/drivers/**/*.ih", |
| ], |
| allow_empty = True, |
| ), |
| includes = [ |
| "modules/hal_atmosic/ATM33xx-5/include", |
| "modules/hal_atmosic/ATM33xx-5/include/arm", |
| "modules/hal_atmosic/ATM33xx-5/include/armgcc", |
| "modules/hal_atmosic/ATM33xx-5/include/ble", |
| "modules/hal_atmosic/ATM33xx-5/include/reg_ble", |
| "modules/hal_atmosic/ATM33xx-5/include/reg", |
| "modules/hal_atmosic/ATM33xx-5/drivers/reg", |
| "modules/hal_atmosic/ATM33xx-5/drivers/at_tz_ppc", |
| "modules/hal_atmosic/ATM33xx-5/drivers/atm_otp", |
| "modules/hal_atmosic/ATM33xx-5/drivers/atm_vendor_drv", |
| "modules/hal_atmosic/ATM33xx-5/drivers/ble/include", |
| "modules/hal_atmosic/ATM33xx-5/drivers/brwnout", |
| "modules/hal_atmosic/ATM33xx-5/drivers/hw_cfg", |
| "modules/hal_atmosic/ATM33xx-5/drivers/key_sideload", |
| "modules/hal_atmosic/ATM33xx-5/drivers/pinmux", |
| "modules/hal_atmosic/ATM33xx-5/drivers/pmu", |
| "modules/hal_atmosic/ATM33xx-5/drivers/rep_vec", |
| "modules/hal_atmosic/ATM33xx-5/drivers/rf", |
| "modules/hal_atmosic/ATM33xx-5/drivers/sec_cache", |
| "modules/hal_atmosic/ATM33xx-5/drivers/sec_counter", |
| "modules/hal_atmosic/ATM33xx-5/drivers/sec_dev_lockout", |
| "modules/hal_atmosic/ATM33xx-5/drivers/sec_hw_cfg", |
| "modules/hal_atmosic/ATM33xx-5/drivers/sec_jrnl", |
| "modules/hal_atmosic/ATM33xx-5/drivers/sec_reset", |
| "modules/hal_atmosic/ATM33xx-5/drivers/spi", |
| "modules/hal_atmosic/ATM33xx-5/drivers/timer", |
| "modules/hal_atmosic/ATM33xx-5/drivers/pseq", |
| "modules/hal_atmosic/ATM33xx-5/drivers/trng", |
| "modules/hal_atmosic/ATM33xx-5/drivers/workarounds", |
| "soc/atmosic/ATM33", |
| ], |
| deps = [":atmosic_headers_common"], |
| ) |
| |
| # Dynamically copy all out-of-tree .po files to standard .o files so that |
| # Bazel's cc_library recognizes them as pre-compiled object files and passes |
| # them directly to the linker. |
| [ |
| genrule( |
| name = "copy_atm34_" + f.replace("modules/hal_atmosic/ATM34xx/rev-5/", "").replace("/", "_").replace(".po", ""), |
| srcs = [f], |
| outs = [f.replace(".po", ".o")], |
| cmd = "cp $< $@", |
| ) |
| for f in glob(["modules/hal_atmosic/ATM34xx/rev-5/**/*.po"]) |
| ] |
| |
| [ |
| genrule( |
| name = "copy_atm33_" + f.replace("modules/hal_atmosic/ATM33xx-5/", "").replace("/", "_").replace(".po", ""), |
| srcs = [f], |
| outs = [f.replace(".po", ".o")], |
| cmd = "cp $< $@", |
| ) |
| for f in glob(["modules/hal_atmosic/ATM33xx-5/**/*.po"]) |
| ] |
| |
| # Common drivers sources conditional on Kconfig |
| COMMON_DRIVERS_SRCS_MAP = { |
| "CONFIG_ADC": safe_glob(["drivers/adc/**/*.c"]), |
| "CONFIG_ATM_ANTENNA_SWITCH": safe_glob(["drivers/atm_antenna/**/*.c"]), |
| "CONFIG_ATM_BUZZER": safe_glob(["drivers/atm_buzzer/**/*.c"]), |
| "CONFIG_AUDIO": safe_glob(["drivers/audio/**/*.c"]), |
| "CONFIG_CMSDK_TIMER": safe_glob(["drivers/timer/**/*.c"]), |
| "CONFIG_ENTROPY_GENERATOR": safe_glob(["drivers/entropy/**/*.c"]), |
| "CONFIG_FLASH": safe_glob(["drivers/flash/**/*.c"]), |
| # gpio_atm.c is excluded because it has an incompatible include path. We use a genrule |
| # to modify this file and include the modified one. |
| "CONFIG_GPIO": safe_glob(["drivers/gpio/**/*.c"], exclude = ["drivers/gpio/gpio_atm.c"]), |
| "CONFIG_I2C": safe_glob(["drivers/i2c/**/*.c"]), |
| "CONFIG_I2S": safe_glob(["drivers/i2s/**/*.c"]), |
| "CONFIG_IEEE802154": safe_glob(["drivers/ieee802154/**/*.c"]), |
| "CONFIG_INPUT": safe_glob(["drivers/input/**/*.c"]), |
| "CONFIG_PINCTRL": safe_glob(["drivers/pinctrl/**/*.c"]), |
| "CONFIG_PWM": safe_glob(["drivers/pwm/**/*.c"]), |
| "CONFIG_RETAINED_MEM": safe_glob(["drivers/retained_mem/**/*.c"]), |
| "CONFIG_SENSOR": safe_glob(["drivers/sensor/**/*.c"]), |
| "CONFIG_SERIAL": safe_glob(["drivers/serial/**/*.c"]), |
| "CONFIG_SPI": safe_glob(["drivers/spi/**/*.c"]), |
| "CONFIG_WATCHDOG": safe_glob(["drivers/watchdog/**/*.c"]), |
| "CONFIG_WURX": safe_glob(["drivers/wurx/**/*.c"]), |
| |
| # hal_atmosic common drivers |
| "CONFIG_ATM_AES_ATM_CORE": ["modules/hal_atmosic/drivers/atm_aes/atm_aes.c"], |
| "CONFIG_ATM_AES_HW": ["modules/hal_atmosic/drivers/atm_aes/aes_alt.c"], |
| "CONFIG_ATM_SHA2": ["modules/hal_atmosic/drivers/atm_sha2/atm_sha2.c"], |
| "CONFIG_ATM_SHA2_HW": ["modules/hal_atmosic/drivers/atm_sha2/sha256_alt.c"], |
| "CONFIG_ATM_RESET": ["modules/hal_atmosic/drivers/reset/reset.c"], |
| "CONFIG_ATM_CCBM": ["modules/hal_atmosic/drivers/ccbm/ccbm.c"], |
| "CONFIG_ATM_LPC": ["modules/hal_atmosic/drivers/lpc/lpc.c"], |
| "CONFIG_ATM_RADIO_HAL_COMMON": ["modules/hal_atmosic/drivers/radio_hal_common/radio_hal_common.c"], |
| "CONFIG_ATM_RADIO_HAL_FRC": ["modules/hal_atmosic/drivers/radio_hal_frc/radio_hal_frc.c"], |
| "CONFIG_ATM_RADIO_HAL_LOG": ["modules/hal_atmosic/drivers/radio_hal_log/radio_hal_log.c"], |
| "CONFIG_ATM_RADIO_HAL_MGR": ["modules/hal_atmosic/drivers/radio_hal_mgr/radio_hal_mgr.c"], |
| "CONFIG_ATM_RADIO_HAL_PROF": ["modules/hal_atmosic/drivers/radio_hal_prof/radio_hal_prof.c"], |
| "CONFIG_ATM_RADIO_STATUS": ["modules/hal_atmosic/drivers/radio_status/radio_status.c"], |
| "CONFIG_ATM_BP_CLOCK": ["modules/hal_atmosic/drivers/atm_bp_clock/atm_bp_clock.c"], |
| "CONFIG_ATM_RRAM_ROM_PROT": ["modules/hal_atmosic/drivers/rram_rom_prot/rram_rom_prot.c"], |
| } |
| |
| # ATM34 specific driver sources conditional on Kconfig |
| ATM34_DRIVERS_SRCS_MAP = { |
| "CONFIG_ATM_OTP": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/atm_otp/**/*.c"]), |
| "CONFIG_ATM_PMU": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/pmu/**/*.c"]), |
| "CONFIG_ATM_PSEQ": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/pseq/**/*.c"]), |
| "CONFIG_ATM_HW_CFG": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/hw_cfg/**/*.c"]), |
| "CONFIG_ATM_KEY_SIDELOAD": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/key_sideload/**/*.c"]), |
| "CONFIG_ATM_SEC_COUNTER": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_counter/**/*.c"]), |
| "CONFIG_ATM_SEC_DEBUG": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_debug/**/*.c"]), |
| "CONFIG_ATM_SEC_DEV_LOCKOUT": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_dev_lockout/**/*.c"]), |
| "CONFIG_ATM_SEC_HW_CFG": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_hw_cfg/**/*.c"]), |
| "CONFIG_ATM_SEC_JRNL": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_jrnl/**/*.c"]), |
| "CONFIG_ATM_SEC_RESET": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_reset/**/*.c"]), |
| "CONFIG_ATM_SEC_CACHE": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/sec_cache/**/*.c"]), |
| "CONFIG_ATM_SPI": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/spi/**/*.c"]), |
| "CONFIG_PM": safe_glob(["modules/hal_atmosic/ATM34xx/src/power.c", "modules/hal_atmosic/ATM34xx/drivers/rep_vec/**/*.c"]), |
| "CONFIG_ATM_BROWNOUT": safe_glob(["modules/hal_atmosic/ATM34xx/drivers/brwnout/**/*.c"]), |
| } |
| |
| # ATM33 specific driver sources conditional on Kconfig |
| ATM33_DRIVERS_SRCS_MAP = { |
| "CONFIG_ATM_OTP": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/atm_otp/**/*.c"]), |
| "CONFIG_ATM_PMU": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/pmu/**/*.c"]), |
| "CONFIG_ATM_PSEQ": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/pseq/**/*.c"]), |
| "CONFIG_ATM_HW_CFG": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/hw_cfg/**/*.c"]), |
| "CONFIG_ATM_KEY_SIDELOAD": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/key_sideload/**/*.c"]), |
| "CONFIG_ATM_SEC_COUNTER": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/sec_counter/**/*.c"]), |
| "CONFIG_ATM_SEC_DEV_LOCKOUT": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/sec_dev_lockout/**/*.c"]), |
| "CONFIG_ATM_SEC_HW_CFG": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/sec_hw_cfg/**/*.c"]), |
| "CONFIG_ATM_SEC_JRNL": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/sec_jrnl/**/*.c"]), |
| "CONFIG_ATM_SPI": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/spi/**/*.c"]), |
| "CONFIG_PM": safe_glob(["modules/hal_atmosic/ATM33xx-5/src/power.c"]), |
| "CONFIG_ATM_LPC_RCOS": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/lpc_rcos/**/*.c"]), |
| "CONFIG_USE_FIXED_ATMWSTK": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/fixed_atmwstk/**/*.c"]), |
| "CONFIG_ATM_WORKAROUNDS": safe_glob(["modules/hal_atmosic/ATM33xx-5/drivers/workarounds/**/*.c"]), |
| "CONFIG_ATM_SEC_RESET": ["modules/hal_atmosic/drivers/sec_reset/sec_reset.c"], |
| "CONFIG_ATM_SEC_CACHE": ["modules/hal_atmosic/drivers/sec_cache/sec_cache.c"], |
| } |
| |
| # ATM34 specific precompiled objects conditional on Kconfig |
| ATM34_DRIVERS_OBJS_MAP = { |
| "CONFIG_ATM_RADIO_HAL_COMMON": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/radio_hal_common/radio_hal_common_core.o"], |
| "CONFIG_ATM_PSEQ": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/pseq/pseq_core.o"], |
| "CONFIG_ATM_PMU": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/pmu/pmu_core.o"], |
| "CONFIG_ATM_HW_CFG": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/hw_cfg/hw_cfg_core.o"], |
| "CONFIG_ATM_BROWNOUT": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/brwnout/brwnout_core.o"], |
| "CONFIG_ATM_SEC_HW_CFG": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/sec_hw_cfg/sec_hw_cfg_core.o"], |
| "CONFIG_ATM_VENDOR_DRIVER": ["modules/hal_atmosic/ATM34xx/rev-5/drivers/atm_vendor_drv/atm_vendor_drv_core.o"], |
| } |
| |
| # ATM33 specific precompiled objects conditional on Kconfig |
| ATM33_DRIVERS_OBJS_MAP = { |
| "CONFIG_ATM_PSEQ": ["modules/hal_atmosic/ATM33xx-5/drivers/pseq/pseq_core.o"], |
| "CONFIG_ATM_PMU": ["modules/hal_atmosic/ATM33xx-5/drivers/pmu/pmu_core.o"], |
| "CONFIG_ATM_HW_CFG": ["modules/hal_atmosic/ATM33xx-5/drivers/hw_cfg/hw_cfg_core.o"], |
| "CONFIG_ATM_BROWNOUT": ["modules/hal_atmosic/ATM33xx-5/drivers/brwnout/brwnout_core.o"], |
| "CONFIG_ATM_SEC_HW_CFG": ["modules/hal_atmosic/ATM33xx-5/drivers/sec_hw_cfg/sec_hw_cfg_core.o"], |
| "CONFIG_ATM_VENDOR_DRIVER": ["modules/hal_atmosic/ATM33xx-5/drivers/atm_vendor_drv/atm_vendor_drv_core.o"], |
| } |
| |
| filegroup( |
| name = "atmosic_driver_srcs_common", |
| srcs = select_drivers(COMMON_DRIVERS_SRCS_MAP), |
| ) |
| |
| filegroup( |
| name = "atmosic_driver_srcs_atm34", |
| srcs = [":atmosic_driver_srcs_common"] + select_drivers(ATM34_DRIVERS_SRCS_MAP), |
| ) |
| |
| filegroup( |
| name = "atmosic_driver_srcs_atm33", |
| srcs = [":atmosic_driver_srcs_common"] + select_drivers(ATM33_DRIVERS_SRCS_MAP), |
| ) |
| |
| cc_library( |
| name = "hal_soc_headers_library_atm34", |
| deps = [ |
| ":atmosic_headers_atm34", |
| ], |
| ) |
| |
| cc_library( |
| name = "hal_soc_headers_library_atm33", |
| deps = [ |
| ":atmosic_headers_atm33", |
| ], |
| ) |
| |
| filegroup( |
| name = "atmosic_extra_srcs_atm34", |
| srcs = [ |
| "modules/hal_atmosic/ATM34xx/src/soc.c", |
| ], |
| ) |
| |
| filegroup( |
| name = "atmosic_extra_srcs_atm33", |
| srcs = [ |
| "modules/hal_atmosic/ATM33xx-5/src/soc.c", |
| ], |
| ) |
| |
| zephyr_soc_library( |
| name = "soc_atm34", |
| srcs = [], |
| copts = [ |
| "-DATM_GPIO_CMSDK_AHB_PATH=\\\"drivers/gpio/gpio_cmsdk_ahb.c\\\"", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/adc", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/i2c", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/spi", |
| "-DLL_HEAP_SIZE=CONFIG_ATM_LL_HEAP_SIZE", |
| "-DCFG_NO_SPE", |
| "-DCFG_NO_TZ", |
| ], |
| ) |
| |
| zephyr_soc_library( |
| name = "soc_atm33", |
| srcs = [], |
| copts = [ |
| "-DATM_GPIO_CMSDK_AHB_PATH=\\\"drivers/gpio/gpio_cmsdk_ahb.c\\\"", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/adc", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/i2c", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/spi", |
| "-DLL_HEAP_SIZE=CONFIG_ATM_LL_HEAP_SIZE", |
| "-DCFG_NO_SPE", |
| "-DCFG_NO_TZ", |
| ], |
| ) |
| |
| # The atmosic gpio_atm.c file contained a relative include that only works with a specific |
| # directory setup and a CMake build. This removes the relative portion of the path to fix it. |
| genrule( |
| name = "patch_gpio_atm", |
| srcs = ["drivers/gpio/gpio_atm.c"], |
| outs = ["drivers/gpio/gpio_atm_patched.c"], |
| cmd = "sed 's|../../zephyr/drivers/gpio/gpio_cmsdk_ahb.c|drivers/gpio/gpio_cmsdk_ahb.c|' $< > $@", |
| ) |
| |
| zephyr_cc_library( |
| name = "atmosic_drivers_atm34", |
| srcs = [":atmosic_driver_srcs_atm34", ":patch_gpio_atm"] + select_drivers(ATM34_DRIVERS_OBJS_MAP), |
| copts = [ |
| "-DATM_GPIO_CMSDK_AHB_PATH=\\\"drivers/gpio/gpio_cmsdk_ahb.c\\\"", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/adc", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/i2c", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/spi", |
| "-DLL_HEAP_SIZE=CONFIG_ATM_LL_HEAP_SIZE", |
| "-DCFG_NO_SPE", |
| "-DCFG_NO_TZ", |
| ], |
| deps = [ |
| ":atmosic_headers_atm34", |
| ], |
| ) |
| |
| zephyr_cc_library( |
| name = "atmosic_drivers_atm33", |
| srcs = [":atmosic_driver_srcs_atm33", ":patch_gpio_atm"] + select_drivers(ATM33_DRIVERS_OBJS_MAP), |
| copts = [ |
| "-DATM_GPIO_CMSDK_AHB_PATH=\\\"drivers/gpio/gpio_cmsdk_ahb.c\\\"", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/adc", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/i2c", |
| "-isystem external/zephyr-bazel++zephyr_patch_file+zephyr/drivers/spi", |
| "-DLL_HEAP_SIZE=CONFIG_ATM_LL_HEAP_SIZE", |
| "-DCFG_NO_SPE", |
| "-DCFG_NO_TZ", |
| ], |
| deps = [ |
| ":atmosic_headers_atm33", |
| ], |
| ) |
| |
| platform( |
| name = "ATM34xx-5", |
| constraint_values = [ |
| "@platforms//cpu:armv8-m", |
| "@zephyr//constraints/arm:cortex-m33", |
| ], |
| flags = flags_from_dict({ |
| "@zephyr//:board_deps": "@openair//:atmosic_drivers_atm34", |
| "@zephyr//:hal_soc_extra_srcs": "@openair//:atmosic_extra_srcs_atm34", |
| "@zephyr//:hal_soc_headers_library": "@openair//:hal_soc_headers_library_atm34", |
| "@zephyr//:soc": "@openair//:soc_atm34", |
| "@zephyr//:soc_linkerscript_template": "@openair//:soc/atmosic/ATM34/linker.ld", |
| }), |
| parents = ["@zephyr//platforms:cortex_m"], |
| ) |
| |
| platform( |
| name = "ATM33xx-5", |
| constraint_values = [ |
| "@platforms//cpu:armv8-m", |
| "@zephyr//constraints/arm:cortex-m33", |
| ], |
| flags = flags_from_dict({ |
| "@zephyr//:board_deps": "@openair//:atmosic_drivers_atm33", |
| "@zephyr//:hal_soc_extra_srcs": "@openair//:atmosic_extra_srcs_atm33", |
| "@zephyr//:hal_soc_headers_library": "@openair//:hal_soc_headers_library_atm33", |
| "@zephyr//:soc": "@openair//:soc_atm33", |
| "@zephyr//:soc_linkerscript_template": "@openair//:soc/atmosic/ATM33/linker.ld", |
| }), |
| parents = ["@zephyr//platforms:cortex_m"], |
| ) |
| |
| # ATM34 Boards |
| platform(name = "ATMEVK-3405-YBV-5/ATM34xx-5", parents = [":ATM34xx-5"]) |
| platform(name = "ATMEVK-3405-PQK-5/ATM34xx-5", parents = [":ATM34xx-5"]) |
| platform(name = "ATMEVK-3430e-YQN-5/ATM34xx-5", parents = [":ATM34xx-5"]) |
| platform(name = "ATMBTCSTAG-3405/ATM34xx-5", parents = [":ATM34xx-5"]) |
| platform(name = "ATMMOD-3405/ATM34xx-5", parents = [":ATM34xx-5"]) |
| platform(name = "ATMEVK-3405-WQK-5/ATM34xx-5", parents = [":ATM34xx-5"]) |
| platform(name = "ATMEVK-3405-PBV-5/ATM34xx-5", parents = [":ATM34xx-5"]) |
| |
| # ATM33 Boards |
| platform(name = "ATMEVK-3330-QN-6/ATM33xx-5", parents = [":ATM33xx-5"]) |
| platform(name = "ATMEVK-3330e-QN-6/ATM33xx-5", parents = [":ATM33xx-5"]) |
| platform(name = "ATMEVK-3330e-QN-7/ATM33xx-5", parents = [":ATM33xx-5"]) |
| platform(name = "ATMEVK-3325-CM-6/ATM33xx-5", parents = [":ATM33xx-5"]) |
| platform(name = "ATMEVK-3325-QK-6/ATM33xx-5", parents = [":ATM33xx-5"]) |
| platform(name = "ATMEVK-3325-LQK-6/ATM33xx-5", parents = [":ATM33xx-5"]) |