Skip to content

Commit 50136f0

Browse files
travis3630rlubos
authored andcommitted
boards: nordic: add support for TF-m to nrf7120
Add nrf7120 to tf-m Kconfig to support ns build Add tfm-boards for nrf7120_cpuapp to point to trusted-firmware-m build Update soc/nordic/nrf71 for tf-m build Signed-off-by: Travis Lam <[email protected]>
1 parent adcaf09 commit 50136f0

File tree

16 files changed

+146
-50
lines changed

16 files changed

+146
-50
lines changed

boards/nordic/nrf54lv10dk/nrf54lv10dk_nrf54lv10a_cpuapp_ns_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ CONFIG_TFM_LOG_LEVEL_SILENCE=n
3333
# from the non secure application directly. This needs to be set
3434
# otherwise nrfx will try to configure them, resulting in a bus
3535
# fault.
36-
CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y
36+
CONFIG_NRF_SKIP_CLOCK_CONFIG=y

boards/nordic/nrf7120pdk/nrf7120pdk_nrf7120_cpuapp_ns.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
model = "Nordic nRF7120 PDK nRF7120 Application MCU";
1616

1717
chosen {
18+
zephyr,code-partition = &slot0_ns_partition;
1819
zephyr,sram = &cpuapp_sram;
1920
};
2021
};

dts/common/nordic/nrf7120_enga.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,28 @@
871871
status = "disabled";
872872
#mbox-cells = <1>;
873873
};
874+
875+
mram_controller: mram-controller@5004e000 {
876+
compatible = "nordic,nrf-mramc";
877+
reg = <0x5004e000 0x1000>;
878+
#address-cells = <1>;
879+
#size-cells = <1>;
880+
interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>;
881+
882+
cpuapp_mram: mram@0 {
883+
compatible = "soc-nv-flash";
884+
reg = <0 DT_SIZE_K(3972)>;
885+
erase-block-size = <4096>;
886+
write-block-size = <4>;
887+
};
888+
889+
cpuflpr_mram: mram@3e1000 {
890+
compatible = "soc-nv-flash";
891+
reg = <0x3e1000 DT_SIZE_K(116)>;
892+
erase-block-size = <4096>;
893+
write-block-size = <4>;
894+
};
895+
};
874896
};
875897

876898
wifi: wifi {

dts/common/nordic/nrf7120_enga_secure_peripherals.dtsi

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,6 @@ kmu: kmu@49000 {
2121
status = "disabled";
2222
};
2323

24-
mram_controller: mram-controller@4e000 {
25-
compatible = "nordic,nrf-mramc";
26-
reg = <0x4e000 0x1000>;
27-
#address-cells = <1>;
28-
#size-cells = <1>;
29-
interrupts = <78 NRF_DEFAULT_IRQ_PRIORITY>;
30-
31-
cpuapp_mram: mram@0 {
32-
compatible = "soc-nv-flash";
33-
reg = <0 DT_SIZE_K(3972)>;
34-
erase-block-size = <4096>;
35-
write-block-size = <4>;
36-
};
37-
38-
cpuflpr_mram: mram@3e1000 {
39-
compatible = "soc-nv-flash";
40-
reg = <0x3e1000 DT_SIZE_K(116)>;
41-
erase-block-size = <4096>;
42-
write-block-size = <4>;
43-
};
44-
};
45-
4624
spu10: spu@80000 {
4725
compatible = "nordic,nrf-spu";
4826
reg = <0x80000 0x1000>;

modules/trusted-firmware-m/Kconfig

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,16 @@ config TFM_ITS_BUF_SIZE
217217

218218
config TFM_ITS_STACK_SIZE
219219
hex "Stack size"
220-
default 0x1000 if SOC_SERIES_NRF54LX
221-
default 0x720 if !SOC_SERIES_NRF54LX
220+
default 0x1000 if NRF_PLATFORM_LUMOS
221+
default 0x720 if !NRF_PLATFORM_LUMOS
222222

223223
# Nordic additions to ITS Kconfig
224224
config TFM_ITS_ENCRYPTED
225225
bool
226226
prompt "PSA Internal Trusted Storage with encryption"
227227
depends on !CRACEN_NEED_MULTIPART_WORKAROUNDS
228-
default y if SOC_SERIES_NRF54LX
229-
select PSA_WANT_ALG_CHACHA20_POLY1305 if SOC_SERIES_NRF54LX
228+
default y if NRF_PLATFORM_LUMOS
229+
select PSA_WANT_ALG_CHACHA20_POLY1305 if NRF_PLATFORM_LUMOS
230230
select PSA_WANT_GENERATE_RANDOM
231231
help
232232
Enables authenticated encryption for PSA Internal Trusted Storage files
@@ -338,7 +338,7 @@ endchoice
338338
config TFM_CPU_FREQ_MHZ
339339
int
340340
default $(div, $(dt_node_int_prop_int,/clocks/hfpll,clock-frequency), 1000000) \
341-
if SOC_SERIES_NRF54LX
341+
if NRF_PLATFORM_LUMOS
342342
default $(div, $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency), 1000000) \
343343
if $(dt_node_has_prop,/cpus/cpu@0,clock-frequency)
344344
default $(div, $(dt_node_int_prop_int,/cpus/cpu@1,clock-frequency), 1000000) \
@@ -391,7 +391,7 @@ config TFM_SECURE_UART_SHARE_INSTANCE
391391
choice TFM_SECURE_UART_INSTANCE
392392
prompt "TF-M logging UART instance"
393393
default TFM_SECURE_UART20 if SOC_NRF54LV10A_ENGA_CPUAPP
394-
default TFM_SECURE_UART30 if SOC_SERIES_NRF54LX
394+
default TFM_SECURE_UART30 if NRF_PLATFORM_LUMOS
395395
default TFM_SECURE_UART1
396396

397397
config TFM_SECURE_UART0
@@ -516,6 +516,7 @@ config TFM_S_CODE_VECTOR_TABLE_SIZE
516516
default 0x144 if SOC_SERIES_NRF91X
517517
default 0x154 if SOC_NRF5340_CPUAPP
518518
default 0x47c if SOC_SERIES_NRF54LX
519+
default 0x504 if SOC_SERIES_NRF71X
519520
default 0xffffffff # Invalid value to discover missing SOC support.
520521
help
521522
The TF-M interrupt vector table size.

modules/trusted-firmware-m/Kconfig.tfm.defconfig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ config TFM_BOARD
1313
default "$(ZEPHYR_NRF_MODULE_DIR)/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp" if SOC_NRF54L15_CPUAPP
1414
default "$(ZEPHYR_NRF_MODULE_DIR)/modules/trusted-firmware-m/tfm_boards/nrf54l10_cpuapp" if SOC_NRF54L10_CPUAPP
1515
default "$(ZEPHYR_NRF_MODULE_DIR)/modules/trusted-firmware-m/tfm_boards/nrf54lv10a_cpuapp" if SOC_NRF54LV10A_ENGA_CPUAPP
16+
default "${ZEPHYR_NRF_MODULE_DIR}/modules/trusted-firmware-m/tfm_boards/nrf7120_cpuapp" if SOC_NRF7120_ENGA_CPUAPP
1617
depends on TRUSTED_EXECUTION_NONSECURE
1718

1819
if BUILD_WITH_TFM
@@ -27,8 +28,8 @@ config TFM_DUMMY_PROVISIONING
2728

2829
config TFM_REGRESSION_NS
2930
bool
30-
select NRF_TIMER0_SECURE if !SOC_SERIES_NRF54LX
31-
select NRF_TIMER00_SECURE if SOC_SERIES_NRF54LX
31+
select NRF_TIMER0_SECURE if !NRF_PLATFORM_LUMOS
32+
select NRF_TIMER00_SECURE if NRF_PLATFORM_LUMOS
3233

3334
config TFM_LOG_LEVEL_SILENCE
3435
# Overrule zephyr disable TF-M secure output if the uart1 node has not
@@ -43,7 +44,8 @@ config TFM_LOG_LEVEL_SILENCE
4344
$(dt_nodelabel_has_prop,uart30,pinctrl-names)
4445

4546
choice TFM_PROFILE_TYPE
46-
default TFM_PROFILE_TYPE_NOT_SET if SOC_SERIES_NRF54LX || BT_CRYPTO || BT_MESH_USES_TFM_PSA || OPENTHREAD
47+
default TFM_PROFILE_TYPE_NOT_SET if NRF_PLATFORM_LUMOS || \
48+
BT_CRYPTO || BT_MESH_USES_TFM_PSA || OPENTHREAD
4749
default TFM_PROFILE_TYPE_MINIMAL
4850
endchoice
4951

@@ -83,7 +85,7 @@ config TFM_PARTITION_PROTECTED_STORAGE
8385
select PSA_WANT_KEY_TYPE_AES
8486
select PSA_WANT_ALG_CCM if SOC_SERIES_NRF91X
8587
select PSA_WANT_ALG_GCM if SOC_NRF5340_CPUAPP
86-
select PSA_WANT_ALG_GCM if SOC_SERIES_NRF54LX
88+
select PSA_WANT_ALG_GCM if NRF_PLATFORM_LUMOS
8789

8890
# Override TF-M crypto dependency on ITS when using KMU
8991
config TFM_PARTITION_CRYPTO

modules/trusted-firmware-m/Kconfig.tfm.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ config PM_PARTITION_SIZE_TFM_SRAM
1515
# assigning 0x16000 of RAM to TFM will not leave enough RAM for
1616
# Matter. So we use 0x13000 of RAM on 54L.
1717
default 0x13000 if SOC_NRF54L15_CPUAPP
18+
default 0x13000 if SOC_NRF7120_ENGA_CPUAPP
1819
# Set the of TFM_SRAM to 0x10000(64kB) since the nR54L10
1920
# has less RAM. The number was selected based on the observed memory
2021
# usage of TFM in crypto samples and it can be changed later if needed.
@@ -28,18 +29,19 @@ config PM_PARTITION_SIZE_TFM
2829
hex
2930
prompt "Memory reserved for TFM" if !TFM_PROFILE_TYPE_MINIMAL
3031
default 0xE800 if TFM_PROFILE_TYPE_MINIMAL && TFM_CMAKE_BUILD_TYPE_DEBUG && \
31-
BOOTLOADER_MCUBOOT && SOC_SERIES_NRF54LX
32+
BOOTLOADER_MCUBOOT && NRF_PLATFORM_LUMOS
3233
default 0xFE00 if TFM_PROFILE_TYPE_MINIMAL && TFM_CMAKE_BUILD_TYPE_DEBUG && \
3334
BOOTLOADER_MCUBOOT
3435
default 0x10000 if TFM_PROFILE_TYPE_MINIMAL && TFM_CMAKE_BUILD_TYPE_DEBUG
35-
default 0x6800 if TFM_PROFILE_TYPE_MINIMAL && BOOTLOADER_MCUBOOT && SOC_NRF54L15_CPUAPP
36+
default 0x6800 if TFM_PROFILE_TYPE_MINIMAL && BOOTLOADER_MCUBOOT && \
37+
(SOC_NRF54L15_CPUAPP || SOC_NRF7120_ENGA_CPUAPP)
3638
default 0x7E00 if TFM_PROFILE_TYPE_MINIMAL && BOOTLOADER_MCUBOOT
3739
default 0x8000 if TFM_PROFILE_TYPE_MINIMAL
3840
# NCSDK-13503: Temporarily bump size while regressions are being fixed
3941
default 0x60000 if TFM_REGRESSION_S
4042
default 0x4FE00 if TFM_CMAKE_BUILD_TYPE_DEBUG && BOOTLOADER_MCUBOOT
4143
default 0x50000 if TFM_CMAKE_BUILD_TYPE_DEBUG
42-
default 0x3F800 if BOOTLOADER_MCUBOOT && SOC_NRF54L15_CPUAPP
44+
default 0x3F800 if BOOTLOADER_MCUBOOT && (SOC_NRF54L15_CPUAPP || SOC_NRF7120_ENGA_CPUAPP)
4345
default 0x3FE00 if BOOTLOADER_MCUBOOT
4446
default 0x40000
4547
help

modules/trusted-firmware-m/tfm_boards/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ if(${TFM_PARTITION_CRYPTO})
8888
$<$<BOOL:${CONFIG_HW_UNIQUE_KEY_RANDOM}>:CONFIG_HW_UNIQUE_KEY_RANDOM>
8989
)
9090

91-
# nrf54l15/nrf54l10 use the PSA headers in the hw_unique_key_cracen_kmu.c file, which means
92-
# that we need to make sure that the nrf_security PSA headers are included
93-
# before any other PSA-related headers.
94-
if(NRF_SOC_VARIANT MATCHES "nrf54l1[05]" OR NRF_SOC_VARIANT MATCHES "nrf54lv10a")
91+
# nrf54l15/nrf54l10/nrf7120 use the PSA headers in the hw_unique_key_cracen_kmu.c
92+
# file, which means that we need to make sure that the nrf_security PSA headers
93+
# are included before any other PSA-related headers.
94+
if((NRF_SOC_VARIANT MATCHES "nrf54l1[05]") OR
95+
(NRF_SOC_VARIANT MATCHES "nrf54lv10a") OR (NRF_SOC_VARIANT MATCHES "nrf7120"))
9596
target_link_libraries(platform_crypto_keys
9697
PRIVATE
9798
psa_crypto_library_config
@@ -222,7 +223,8 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/common
222223
DESTINATION ${INSTALL_PLATFORM_NS_DIR})
223224

224225

225-
if(NRF_SOC_VARIANT MATCHES "nrf54l1[05]" OR NRF_SOC_VARIANT MATCHES "nrf54lv10a")
226+
if((NRF_SOC_VARIANT MATCHES "nrf54l1[05]") OR
227+
(NRF_SOC_VARIANT MATCHES "nrf54lv10a") OR (NRF_SOC_VARIANT MATCHES "nrf7120"))
226228
file(COPY ${ZEPHYR_NRF_MODULE_DIR}/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_key_ids.h
227229
DESTINATION ${INSTALL_INTERFACE_INC_DIR})
228230
file(COPY ${ZEPHYR_NRF_MODULE_DIR}/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_kmu.h

modules/trusted-firmware-m/tfm_boards/board/RTE_Device.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@
3333

3434
#define RTE_USART0 1
3535

36-
#else /* NRF_UARTE0_S - 54L15 devices*/
36+
#else /* NRF_UARTE0_S - 54L15 or 7120 devices*/
3737

38-
/* Only UART20 and UART30 are supported for TF-M tests, which are the
39-
* Non-secure applications build via the TF-M build system
38+
/* UART20 and UART30 are supported for TF-M tests on NRF54LX,
39+
* while UART00 and UART30 are supported on NRF71X
4040
*/
41-
#if defined(CONFIG_TFM_SECURE_UART30)
41+
#if defined(CONFIG_SOC_SERIES_NRF54LX) && defined(CONFIG_TFM_SECURE_UART30)
4242
#define RTE_USART20 1
43+
#elif defined(CONFIG_SOC_SERIES_NRF71X) && defined(CONFIG_TFM_SECURE_UART30)
44+
#define RTE_USART00 1
4345
#else
4446
#define RTE_USART30 1
4547
#endif

modules/trusted-firmware-m/tfm_boards/board/device_cfg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <zephyr/devicetree.h>
1515

1616

17-
#if defined(NRF54L15_XXAA) || defined(NRF54L10_XXAA) || defined(NRF54LV10A_ENGA_XXAA)
18-
17+
#if defined(NRF54L15_XXAA) || defined(NRF54L10_XXAA) || defined(NRF54LV10A_ENGA_XXAA) || \
18+
defined(NRF7120_ENGA_XXAA)
1919
#if defined(CONFIG_TFM_SECURE_UART00) && DOMAIN_NS != 1U
2020
#define TFM_UART uart00
2121
#endif /* defined(CONFIG_TFM_SECURE_UART00) */
@@ -46,7 +46,7 @@
4646
#define TFM_UART uart1
4747
#endif /* defined(CONFIG_TFM_SECURE_UART1) */
4848

49-
#endif /* NRF54L15_XXAA || NRF54L10_XXAA */
49+
#endif /* NRF54L15_XXAA || NRF54L10_XXAA || NRF54LV10A_ENGA_XXAA || NRF7120_ENGA_XXAA */
5050

5151
#define DEFAULT_UART_BAUDRATE DT_PROP_OR(DT_NODELABEL(TFM_UART), current_speed, 115200)
5252

0 commit comments

Comments
 (0)