Skip to content

Commit 8007e24

Browse files
SebastianBoekartben
authored andcommitted
soc: nrf53: Port SYS_INIT nrf53_cpunet_init to soc_late_init_hook
Port SYS_INIT nrf53_cpunet_init to soc_late_init_hook as SYS_INIT are legacy. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 5d9f554 commit 8007e24

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

soc/nordic/nrf53/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config SOC_SERIES_NRF53X
88
select ARM
99
select SOC_COMPATIBLE_NRF53X
1010
select SOC_EARLY_INIT_HOOK
11-
select SOC_LATE_INIT_HOOK
11+
select SOC_LATE_INIT_HOOK if SOC_NRF53_RTC_PRETICK || SOC_NRF53_CPUNET_ENABLE
1212
select CPU_CORTEX_M33
1313
select CPU_CORTEX_M_HAS_DWT
1414
select CPU_HAS_ARM_MPU

soc/nordic/nrf53/nrf53_cpunet_mgmt.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void nrf53_cpunet_enable(bool on)
101101
}
102102

103103
#ifdef CONFIG_SOC_NRF53_CPUNET_ENABLE
104-
static int nrf53_cpunet_init(void)
104+
void nrf53_cpunet_init(void)
105105
{
106106
#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)
107107
/* Retain nRF5340 Network MCU in Secure domain (bus
@@ -120,9 +120,5 @@ static int nrf53_cpunet_init(void)
120120

121121
nrf53_cpunet_enable(true);
122122
#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */
123-
124-
return 0;
125123
}
126-
127-
SYS_INIT(nrf53_cpunet_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
128124
#endif /* CONFIG_SOC_NRF53_CPUNET_ENABLE */

soc/nordic/nrf53/nrf53_cpunet_mgmt.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@
2828
*/
2929
void nrf53_cpunet_enable(bool on);
3030

31+
/**
32+
* @brief Configure the security setting of the network CPU and then enable it.
33+
*/
34+
void nrf53_cpunet_init(void);
35+
3136
#endif /* NRF53_CPUNET_MGMT_H__ */

soc/nordic/nrf53/soc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
#include <cmsis_core.h>
4040

41+
#include "nrf53_cpunet_mgmt.h"
42+
4143
#define PIN_XL1 0
4244
#define PIN_XL2 1
4345

@@ -562,6 +564,9 @@ void soc_late_init_hook(void)
562564
(void)err;
563565
#endif
564566

567+
#ifdef CONFIG_SOC_NRF53_CPUNET_ENABLE
568+
nrf53_cpunet_init();
569+
#endif
565570
}
566571

567572
void arch_busy_wait(uint32_t time_us)

0 commit comments

Comments
 (0)