From 5d9f5543b9b3bdf5cbb554d0f4836960690ba5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Fri, 25 Apr 2025 08:45:43 +0200 Subject: [PATCH] soc: nrf53: Port SYS_INIT rtc_pretick_init to soc_late_init_hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port the SYS_INIT for rtc_pretick_init to use soc_late_init_hook as SYS_INIT's are legacy. Signed-off-by: Sebastian Bøe --- soc/nordic/nrf53/Kconfig | 1 + soc/nordic/nrf53/soc.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 1ab7a7ac95e..d221f7772ff 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -8,6 +8,7 @@ config SOC_SERIES_NRF53X select ARM select SOC_COMPATIBLE_NRF53X select SOC_EARLY_INIT_HOOK + select SOC_LATE_INIT_HOOK select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT select CPU_HAS_ARM_MPU diff --git a/soc/nordic/nrf53/soc.c b/soc/nordic/nrf53/soc.c index 75c6e5e0a4d..e15622b458c 100644 --- a/soc/nordic/nrf53/soc.c +++ b/soc/nordic/nrf53/soc.c @@ -551,6 +551,16 @@ void soc_early_init_hook(void) #if defined(CONFIG_SOC_DCDC_NRF53X_HV) || DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(vregh)) nrf_regulators_vreg_enable_set(NRF_REGULATORS, NRF_REGULATORS_VREG_HIGH, true); #endif +} + +void soc_late_init_hook(void) +{ +#ifdef CONFIG_SOC_NRF53_RTC_PRETICK + int err = rtc_pretick_init(); + + __ASSERT_NO_MSG(err == 0); + (void)err; +#endif } @@ -558,8 +568,3 @@ void arch_busy_wait(uint32_t time_us) { nrfx_coredep_delay_us(time_us); } - - -#ifdef CONFIG_SOC_NRF53_RTC_PRETICK -SYS_INIT(rtc_pretick_init, POST_KERNEL, 0); -#endif