Skip to content

Commit c0c4170

Browse files
SebastianBoekartben
authored andcommitted
soc: nrf54: Port SYS_INIT to use soc_early_init_hook
Port SYS_INIT to use soc_early_init_hook as SYS_INITs are legacy. Due to moving dmm_init() from PRE_KERNEL_1 SYS_INIT to soc_early_init_hook(), the DMM test is also updated to ensure that its setup function runs before dmm_init(). Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no> Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
1 parent 2ba5d46 commit c0c4170

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

soc/nordic/nrf54h/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config SOC_SERIES_NRF54HX
77
select HAS_NRFS
88
select HAS_NRFX
99
select HAS_NORDIC_DRIVERS
10+
select SOC_EARLY_INIT_HOOK if ARM
1011
select NRF_PLATFORM_HALTIUM
1112

1213
config SOC_NRF54H20_CPUAPP_COMMON

soc/nordic/nrf54h/soc.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ bool z_arm_on_enter_cpu_idle(void)
126126
}
127127
#endif
128128

129-
static int nordicsemi_nrf54h_init(void)
129+
void soc_early_init_hook(void)
130130
{
131131
int err;
132132

@@ -138,9 +138,7 @@ static int nordicsemi_nrf54h_init(void)
138138
trim_hsfll();
139139

140140
err = dmm_init();
141-
if (err < 0) {
142-
return err;
143-
}
141+
__ASSERT_NO_MSG(err == 0);
144142

145143
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ccm030))
146144
/* DMASEC is set to non-secure by default, which prevents CCM from
@@ -156,13 +154,9 @@ static int nordicsemi_nrf54h_init(void)
156154
DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) {
157155
nrf_nfct_pad_config_enable_set(NRF_NFCT, false);
158156
}
159-
160-
return 0;
161157
}
162158

163159
void arch_busy_wait(uint32_t time_us)
164160
{
165161
nrfx_coredep_delay_us(time_us);
166162
}
167-
168-
SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

tests/boards/nrf/dmm/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,5 @@ int dmm_test_prepare(void)
228228
return 0;
229229
}
230230

231-
SYS_INIT(dmm_test_prepare, PRE_KERNEL_1, 0);
231+
/* Needs to execute before DMM initialization. */
232+
SYS_INIT(dmm_test_prepare, EARLY, 0);

0 commit comments

Comments
 (0)