Skip to content

Commit dd71a2d

Browse files
ozersakartben
authored andcommitted
modules: trusted-firmware-m: Define BL1 flags
Define BL1 and sign key for BL2 configs and pass them to the TF-M This will allow to trigger BL1 over zephyr and specify BL2 sign key Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
1 parent a584534 commit dd71a2d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ set(TFM_VALID_PARTITIONS
1818
if (CONFIG_BUILD_WITH_TFM)
1919
# PSA API awareness for the Non-Secure application
2020
target_compile_definitions(app PRIVATE "TFM_PSA_API")
21+
22+
if(CONFIG_TFM_BL1)
23+
list(APPEND TFM_CMAKE_ARGS -DBL1:BOOL=ON)
24+
if(CONFIG_TFM_BL2_SIGNING_KEY_PATH)
25+
list(APPEND TFM_CMAKE_ARGS -DTFM_BL2_SIGNING_KEY_PATH=${CONFIG_TFM_BL2_SIGNING_KEY_PATH})
26+
endif()
27+
endif()
28+
2129
if (CONFIG_TFM_SFN)
2230
list(APPEND TFM_CMAKE_ARGS -DCONFIG_TFM_SPM_BACKEND="SFN")
2331
else() # CONFIG_TFM_IPC

modules/trusted-firmware-m/Kconfig.tfm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ config TFM_IMAGE_VERSION_NS
206206
help
207207
Version of the non-secure image.
208208

209+
config TFM_BL1
210+
bool "Add BL1 to TFM"
211+
help
212+
TFM is designed to run with BL1 in a certain configuration.
213+
This config adds BL1 to the build - built via TFM's build system.
214+
209215
config TFM_BL2
210216
bool "Add MCUboot to TFM"
211217
depends on !TFM_BL2_NOT_SUPPORTED
@@ -240,6 +246,18 @@ config TFM_CONNECTION_BASED_SERVICE_API
240246
system. When this option is not enabled in the TF-M build system this
241247
will result in compilation error.
242248

249+
250+
if TFM_BL1
251+
252+
config TFM_BL2_SIGNING_KEY_PATH
253+
string "Path to private key used to sign BL2 firmware images."
254+
help
255+
Path to binary BL2 signing private key
256+
Default is ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/bl1/bl1_2/bl1_dummy_rotpk
257+
if it has not been changed on TF-M side for your board
258+
259+
endif # TFM_BL1
260+
243261
if TFM_BL2
244262

245263
config TFM_IMAGE_SECURITY_COUNTER

0 commit comments

Comments
 (0)