diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index d221f7772ff..8aade63f54a 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -8,7 +8,7 @@ config SOC_SERIES_NRF53X select ARM select SOC_COMPATIBLE_NRF53X select SOC_EARLY_INIT_HOOK - select SOC_LATE_INIT_HOOK + select SOC_LATE_INIT_HOOK if SOC_NRF53_RTC_PRETICK || SOC_NRF53_CPUNET_ENABLE select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT select CPU_HAS_ARM_MPU diff --git a/soc/nordic/nrf53/nrf53_cpunet_mgmt.c b/soc/nordic/nrf53/nrf53_cpunet_mgmt.c index 9c869a2ecc0..f566fafff09 100644 --- a/soc/nordic/nrf53/nrf53_cpunet_mgmt.c +++ b/soc/nordic/nrf53/nrf53_cpunet_mgmt.c @@ -101,7 +101,7 @@ void nrf53_cpunet_enable(bool on) } #ifdef CONFIG_SOC_NRF53_CPUNET_ENABLE -static int nrf53_cpunet_init(void) +void nrf53_cpunet_init(void) { #if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) /* Retain nRF5340 Network MCU in Secure domain (bus @@ -120,9 +120,5 @@ static int nrf53_cpunet_init(void) nrf53_cpunet_enable(true); #endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ - - return 0; } - -SYS_INIT(nrf53_cpunet_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); #endif /* CONFIG_SOC_NRF53_CPUNET_ENABLE */ diff --git a/soc/nordic/nrf53/nrf53_cpunet_mgmt.h b/soc/nordic/nrf53/nrf53_cpunet_mgmt.h index 0273061c20c..5427af0be7f 100644 --- a/soc/nordic/nrf53/nrf53_cpunet_mgmt.h +++ b/soc/nordic/nrf53/nrf53_cpunet_mgmt.h @@ -28,4 +28,9 @@ */ void nrf53_cpunet_enable(bool on); +/** + * @brief Configure the security setting of the network CPU and then enable it. + */ +void nrf53_cpunet_init(void); + #endif /* NRF53_CPUNET_MGMT_H__ */ diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index e15622b458c..7fbe69b434b 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -38,6 +38,8 @@ #include +#include "nrf53_cpunet_mgmt.h" + #define PIN_XL1 0 #define PIN_XL2 1 @@ -562,6 +564,9 @@ void soc_late_init_hook(void) (void)err; #endif +#ifdef CONFIG_SOC_NRF53_CPUNET_ENABLE + nrf53_cpunet_init(); +#endif } void arch_busy_wait(uint32_t time_us)