soc: silabs: Only initialize HFXO Manager if HFXO is enabled

Only initialize the HFXO Manager HAL driver if the HFXO is enabled in
DeviceTree, the device uses SYSRTC for timekeeping, and Power Manager
is enabled. HFXO Manager integrates with the Sleeptimer HAL driver for
SYSRTC to autonomously wake the HFXO prior to Sleeptimer wakeup from
deep sleep. It is not needed on devices that don't have HFXO-SYSRTC
integration, and it is not needed if the application doesn't use deep
sleep.

Add missing call to init_hardware() prior to init().

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
This commit is contained in:
Aksel Skauge Mellbye 2024-10-21 12:19:58 +02:00 committed by Alberto Escolar
commit 8fc5514a94
7 changed files with 58 additions and 16 deletions

View file

@ -128,6 +128,12 @@ config SOC_SILABS_SLEEPTIMER
help
Set if the Sleeptimer HAL module is used.
config SOC_SILABS_HFXO_MANAGER
bool
default y if PM && $(dt_nodelabel_enabled,sysrtc0) && $(dt_nodelabel_enabled,hfxo)
help
Set if the HFXO Manager HAL module is used.
if PM
config SOC_GECKO_PM_BACKEND_PMGR

View file

@ -32,6 +32,10 @@
LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
#if defined(CONFIG_SOC_SILABS_HFXO_MANAGER)
Z_ISR_DECLARE_DIRECT(DT_IRQ(DT_NODELABEL(hfxo), irq), 0, sl_hfxo_manager_irq_handler);
#endif
void soc_early_init_hook(void)
{
/* Handle chip errata */
@ -42,9 +46,12 @@ void soc_early_init_hook(void)
}
sl_clock_manager_init();
if (IS_ENABLED(CONFIG_SOC_SILABS_HFXO_MANAGER)) {
sl_hfxo_manager_init_hardware();
sl_hfxo_manager_init();
}
if (IS_ENABLED(CONFIG_PM)) {
sl_power_manager_init();
sl_hfxo_manager_init();
}
}