@@ -32,6 +32,15 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
32
32
#define HSFLL_NODE DT_NODELABEL(cpurad_hsfll)
33
33
#endif
34
34
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
+
35
44
sys_snode_t soc_node ;
36
45
37
46
#define FICR_ADDR_GET (node_id , name ) \
@@ -44,8 +53,6 @@ sys_snode_t soc_node;
44
53
ADDRESS_DOMAIN_Msk | \
45
54
ADDRESS_BUS_Msk)))
46
55
47
- #define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition)
48
-
49
56
static void power_domain_init (void )
50
57
{
51
58
/*
@@ -172,11 +179,26 @@ void soc_late_init_hook(void)
172
179
*/
173
180
uint8_t * msg = NULL ;
174
181
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 )) +
179
200
CONFIG_ROM_START_OFFSET );
201
+ #endif
180
202
181
203
/* Don't wait as this is not yet supported. */
182
204
bool cpu_wait = false;
0 commit comments