Skip to content

Commit 292e44a

Browse files
committed
[nrf fromlist] 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. Upstream PR #: 88908 Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 6d0ab59 commit 292e44a

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

soc/nordic/common/dmm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,10 @@ int dmm_init(void)
295295

296296
return 0;
297297
}
298+
299+
/*
300+
* dmm_init relies on kheap, initialized in PRE_KERNEL_1 at
301+
* CONFIG_KERNEL_INIT_PRIORITY_OBJECTS. To enable early device use of
302+
* dmm, we initialize immediately after kheap.
303+
*/
304+
SYS_INIT(dmm_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

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: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,15 @@ 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
{
131-
int err;
132-
133131
sys_cache_instr_enable();
134132
sys_cache_data_enable();
135133

136134
power_domain_init();
137135

138136
trim_hsfll();
139137

140-
err = dmm_init();
141-
if (err < 0) {
142-
return err;
143-
}
144-
145138
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ccm030))
146139
/* DMASEC is set to non-secure by default, which prevents CCM from
147140
* accessing secure memory. Change DMASEC to secure.
@@ -156,13 +149,9 @@ static int nordicsemi_nrf54h_init(void)
156149
DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) {
157150
nrf_nfct_pad_config_enable_set(NRF_NFCT, false);
158151
}
159-
160-
return 0;
161152
}
162153

163154
void arch_busy_wait(uint32_t time_us)
164155
{
165156
nrfx_coredep_delay_us(time_us);
166157
}
167-
168-
SYS_INIT(nordicsemi_nrf54h_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

0 commit comments

Comments
 (0)