@@ -32,6 +32,15 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
3232#define HSFLL_NODE DT_NODELABEL(cpurad_hsfll)
3333#endif
3434
35+ #ifdef CONFIG_USE_DT_CODE_PARTITION
36+ #define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition))
37+ #elif defined(CONFIG_FLASH_LOAD_OFFSET )
38+ #define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET
39+ #endif
40+
41+ #define PARTITION_IS_RUNNING_APP_PARTITION (label ) \
42+ (DT_REG_ADDR(DT_NODELABEL(label)) == FLASH_LOAD_OFFSET)
43+
3544sys_snode_t soc_node ;
3645
3746#define FICR_ADDR_GET (node_id , name ) \
@@ -44,8 +53,6 @@ sys_snode_t soc_node;
4453 ADDRESS_DOMAIN_Msk | \
4554 ADDRESS_BUS_Msk)))
4655
47- #define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition)
48-
4956static void power_domain_init (void )
5057{
5158 /*
@@ -172,11 +179,26 @@ void soc_late_init_hook(void)
172179 */
173180 uint8_t * msg = NULL ;
174181 size_t msg_size = 0 ;
175-
176- void * radiocore_address =
177- (void * )(DT_REG_ADDR (DT_GPARENT (DT_NODELABEL_CPURAD_SLOT0_PARTITION )) +
178- DT_REG_ADDR (DT_NODELABEL_CPURAD_SLOT0_PARTITION ) +
182+ void * radiocore_address = NULL ;
183+
184+ #if DT_NODE_EXISTS (DT_NODELABEL (cpurad_slot1_partition ))
185+ if (PARTITION_IS_RUNNING_APP_PARTITION (slot1_partition )) {
186+ radiocore_address =
187+ (void * )(DT_REG_ADDR (DT_GPARENT (DT_NODELABEL (cpurad_slot1_partition ))) +
188+ DT_REG_ADDR (DT_NODELABEL (cpurad_slot1_partition )) +
189+ CONFIG_ROM_START_OFFSET );
190+ } else {
191+ radiocore_address =
192+ (void * )(DT_REG_ADDR (DT_GPARENT (DT_NODELABEL (cpurad_slot0_partition ))) +
193+ DT_REG_ADDR (DT_NODELABEL (cpurad_slot0_partition )) +
194+ CONFIG_ROM_START_OFFSET );
195+ }
196+ #else
197+ radiocore_address =
198+ (void * )(DT_REG_ADDR (DT_GPARENT (DT_NODELABEL (cpurad_slot0_partition ))) +
199+ DT_REG_ADDR (DT_NODELABEL (cpurad_slot0_partition )) +
179200 CONFIG_ROM_START_OFFSET );
201+ #endif
180202
181203 if (IS_ENABLED (CONFIG_SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR ) &&
182204 sys_read32 ((mem_addr_t )radiocore_address ) == 0xFFFFFFFFUL ) {
0 commit comments