Skip to content

Commit 9caabe6

Browse files
travis3630tomi-font
authored andcommitted
[nrf fromtree] platform: nordic_nrf: nrf7120: Fix build failures for CI
This fixes build issue of nordic_nrf/nrf7120dk_nrf7120_cpuapp on tf-m upstream. The fix also aligns consistent with nrf54l series. Change-Id: I74a551accc6ee2d62b8dbeed193346bc1d7fd000 Signed-off-by: Travis Lam <travis.lam@nordicsemi.no> (cherry picked from commit 553f21c)
1 parent 1e62418 commit 9caabe6

6 files changed

Lines changed: 21 additions & 10 deletions

File tree

platform/ext/target/nordic_nrf/common/core/target_cfg_71.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include <hal/nrf_mramc.h>
3838
#include <hal/nrf_mpc.h>
3939
#include <hal/nrf_cache.h>
40-
#include "tfm_spm_log.h"
41-
4240

4341
#if !defined(DAUTH_CHIP_DEFAULT)
4442
#error "Debug access on this platform can only be configured by programming the corresponding registers in UICR."
@@ -313,6 +311,8 @@ void peripheral_configuration(void)
313311
uint32_t uart_periph_start = tfm_peripheral_uarte22.periph_start;
314312
#elif NRF_SECURE_UART_INSTANCE == 30
315313
uint32_t uart_periph_start = tfm_peripheral_uarte30.periph_start;
314+
#else
315+
#error "Unsupported NRF_SECURE_UART_INSTANCE for nrf71 series. Supported instances: 00, 20, 21, 22, 30"
316316
#endif
317317
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_LOCKED);
318318
#endif /* SECURE_UART1 */

platform/ext/target/nordic_nrf/common/nrf7120/config.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
include(${PLATFORM_PATH}/common/core/config.cmake)
1010

11-
set(SECURE_UART30 ON CACHE BOOL "Enable secure UART")
1211
set(BL2 OFF CACHE BOOL "Whether to build BL2" FORCE)
1312
set(NRF_NS_SECONDARY OFF CACHE BOOL "Enable non-secure secondary partition" FORCE)
14-
set(NRF_SECURE_UART_INSTANCE 30 CACHE STRING "The UART instance number to use for secure UART")
13+
set(NRF_SECURE_UART_INSTANCE 30 CACHE STRING "The UART instance number to use for secure UART" FORCE)

platform/ext/target/nordic_nrf/common/nrf7120/nrf71_init.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define FLASH_PAGE_ERASE_MAX_TIME_US 42000UL
1616
#define FLASH_PAGE_MAX_CNT 381UL
1717

18+
#ifdef DT_HAS_COMPAT_STATUS_OKAY
1819
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc)
1920

2021
#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(__NRF_TFM__)
@@ -25,6 +26,7 @@
2526

2627
#define PWR_ANTSWC_ENABLE (0x3UL)
2728
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) */
29+
#endif /* DT_HAS_COMPAT_STATUS_OKAY */
2830

2931
/* This handler needs to be ported to the upstream TF-M project when Cracen is supported there.
3032
* The implementation of this is currently in sdk-nrf. We define it to avoid warnings when we build
@@ -54,16 +56,20 @@ int __attribute__((weak)) soc_early_init_hook(void){
5456
wifi_setup();
5557
#endif
5658

59+
#ifdef DT_HAS_COMPAT_STATUS_OKAY
5760
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc)
5861
*(volatile uint32_t *)PWR_ANTSWC_REG |= PWR_ANTSWC_ENABLE;
59-
#endif
62+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_pwr_antswc) */
63+
#endif /* DT_HAS_COMPAT_STATUS_OKAY */
6064

6165
/* Configure LFXO capacitive load if internal load capacitors are used */
66+
#ifdef DT_ENUM_HAS_VALUE
6267
#if DT_ENUM_HAS_VALUE(LFXO_NODE, load_capacitors, internal)
6368
nrf_lfxo_cload_set(NRF_LFXO,
6469
(uint8_t)(DT_PROP(LFXO_NODE, load_capacitance_femtofarad) / 1000));
65-
#endif
70+
#endif /* DT_ENUM_HAS_VALUE(LFXO_NODE, load_capacitors, internal) */
71+
#endif /* DT_ENUM_HAS_VALUE */
6672

67-
#endif
73+
#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE && !__NRF_TFM__ */
6874
return 0;
6975
}

platform/ext/target/nordic_nrf/common/nrf7120/partition/region_defs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@
9797
#define PSA_TEST_SCRATCH_AREA_SIZE (0x400)
9898

9999
/* Even though BL2 is not supported now this needs to be defined becaused it is used by scatter files */
100+
#define BOOT_TFM_SHARED_DATA_BASE S_RAM_ALIAS_BASE
100101
#define BOOT_TFM_SHARED_DATA_SIZE (0x0)
102+
#define BOOT_TFM_SHARED_DATA_LIMIT (BOOT_TFM_SHARED_DATA_BASE + BOOT_TFM_SHARED_DATA_SIZE - 1)
103+
#define SHARED_BOOT_MEASUREMENT_BASE BOOT_TFM_SHARED_DATA_BASE
104+
#define SHARED_BOOT_MEASUREMENT_SIZE BOOT_TFM_SHARED_DATA_SIZE
105+
#define SHARED_BOOT_MEASUREMENT_LIMIT BOOT_TFM_SHARED_DATA_LIMIT
101106

102107
#ifdef PSA_API_TEST_IPC
103108
/* Firmware Framework test suites */

platform/ext/target/nordic_nrf/nrf7120dk_nrf7120_cpuapp/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ if(BL2)
3434
PUBLIC
3535
partition
3636
../common/nrf7120/partition
37-
PRIVATE
3837
.
3938
)
4039
endif()
@@ -60,7 +59,7 @@ endif()
6059

6160
install(FILES RTE_Device.h
6261
device_cfg.h
63-
ns/CMakeLists.txt
62+
../common/nrf7120/ns/CMakeLists.txt
6463
config.cmake
6564
DESTINATION ${INSTALL_PLATFORM_NS_DIR}
6665
)

platform/ext/target/nordic_nrf/nrf7120dk_nrf7120_cpuapp/tfm_peripherals_config.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ extern "C" {
1212
#endif
1313

1414
#ifdef SECURE_UART1
15-
#if NRF_SECURE_UART_INSTANCE == 30
15+
#if NRF_SECURE_UART_INSTANCE == 20
16+
#define TFM_PERIPHERAL_UARTE20_SECURE 1
17+
#elif NRF_SECURE_UART_INSTANCE == 30
1618
#define TFM_PERIPHERAL_UARTE30_SECURE 1
1719
#endif
1820
#endif

0 commit comments

Comments
 (0)