diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 0373e00d07b..55dbbc7116f 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,6 +7,7 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS + select SOC_EARLY_INIT_HOOK if ARM select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP_COMMON diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 6dc8100e00c..ad2da0b30bf 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -126,7 +126,7 @@ bool z_arm_on_enter_cpu_idle(void) } #endif -static int nordicsemi_nrf54h_init(void) +void soc_early_init_hook(void) { int err; @@ -138,9 +138,7 @@ static int nordicsemi_nrf54h_init(void) trim_hsfll(); err = dmm_init(); - if (err < 0) { - return err; - } + __ASSERT_NO_MSG(err == 0); #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ccm030)) /* DMASEC is set to non-secure by default, which prevents CCM from @@ -156,13 +154,9 @@ static int nordicsemi_nrf54h_init(void) DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) { nrf_nfct_pad_config_enable_set(NRF_NFCT, false); } - - return 0; } void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); } - -SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 078edcdd39f..214a9069752 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -228,4 +228,5 @@ int dmm_test_prepare(void) return 0; } -SYS_INIT(dmm_test_prepare, PRE_KERNEL_1, 0); +/* Needs to execute before DMM initialization. */ +SYS_INIT(dmm_test_prepare, EARLY, 0);