Skip to content

Commit 01c5f03

Browse files
committed
soc: adi: Add config flag to manage tf-m hal_adi repository
Add configuration flag to manage tf-m hal_adi repository during build hal_adi can be used either over zephyr or download during build Signed-off-by: Sadik Ozer <[email protected]>
1 parent 7063af1 commit 01c5f03

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

modules/trusted-firmware-m/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ if (CONFIG_BUILD_WITH_TFM)
246246
list(APPEND TFM_CMAKE_ARGS -DTFM_PLATFORM_NXP_HAL_FILE_PATH=${TFM_PLATFORM_NXP_HAL_FILE_PATH})
247247
endif()
248248

249+
if(CONFIG_BOARD_MAX32657EVKIT_MAX32657_NS AND CONFIG_TFM_HAL_ADI_PATH_LOCAL)
250+
# Supply path to hal_adi for TF-M build
251+
list(APPEND TFM_CMAKE_ARGS -DHAL_ADI_PATH=${ZEPHYR_ADI_MODULE_DIR})
252+
endif()
253+
249254
if(CONFIG_TFM_BL2 AND CONFIG_TFM_MCUBOOT_PATH_LOCAL)
250255
# Supply path to MCUboot for TF-M build
251256
list(APPEND TFM_CMAKE_ARGS -DMCUBOOT_PATH=${ZEPHYR_MCUBOOT_MODULE_DIR})

soc/adi/max32/Kconfig

+25
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,29 @@ config BUILD_WITH_TFM
7373
help
7474
Auto set WITH_TFM for a Non-Secure version of the board,
7575

76+
choice TFM_HAL_ADI_PATH
77+
prompt "Path to hal_adi or DOWNLOAD to fetch automatically"
78+
default TFM_HAL_ADI_PATH_LOCAL
79+
help
80+
Path to hal_adi for TF-M builds. The default option
81+
is to use Zephyr hal_adi module. As an alternative,
82+
users may switch to the 'download' version; in that
83+
case hal_adi will be fetched by the TF-M build during
84+
build time. The default option ensures that Zephyr builds
85+
with TF-M do not fetch external trees.
86+
87+
config TFM_HAL_ADI_PATH_LOCAL
88+
bool "TF-M to use Zephyr hal_adi"
89+
help
90+
TF-M builds will use the Zephyr hal_adi version,
91+
which is present in the hal_adi module.
92+
93+
config TFM_HAL_ADI_PATH_DOWNLOAD
94+
bool "TF-M to automatically download hal_adi during build"
95+
help
96+
TF-M builds will let the TF-M build to automatically
97+
fetch and check-out the hal_adi version to use in the build.
98+
99+
endchoice
100+
76101
endif # SOC_FAMILY_MAX32

0 commit comments

Comments
 (0)