soc: arm: nordic_nrf: nrf53: Add init priority for sync_rtc

Add configurable init priority for nrf53 synchronized rtc module.
Add build time assert to ensure that initialization is done after
mbox.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-03-01 14:33:26 +01:00 committed by Maureen Helm
commit f0825801f6
2 changed files with 12 additions and 1 deletions

View file

@ -240,6 +240,12 @@ module = SYNC_RTC
module-str = Synchronized RTC
source "subsys/logging/Kconfig.template.log_config"
config NRF53_SYNC_RTC_INIT_PRIORITY
int "nRF53 Synchronized RTC init priority"
default APPLICATION_INIT_PRIORITY
help
nRF53 Synchronized RTC initialization priority.
config NRF_RTC_TIMER_USER_CHAN_COUNT
default 1

View file

@ -306,4 +306,9 @@ bail:
return rv;
}
SYS_INIT(sync_rtc_setup, POST_KERNEL, 0);
#if defined(CONFIG_MBOX_INIT_PRIORITY)
BUILD_ASSERT(CONFIG_NRF53_SYNC_RTC_INIT_PRIORITY > CONFIG_MBOX_INIT_PRIORITY,
"RTC Sync must be initialized after MBOX driver.");
#endif
SYS_INIT(sync_rtc_setup, POST_KERNEL, CONFIG_NRF53_SYNC_RTC_INIT_PRIORITY);