soc: silabs: Initialize clock manager HAL from DT

Swap from the deprecated device_init_* functions to clock manager
for clock tree configuration. Populate config headers using
device tree representation of clock tree and oscillator config.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
This commit is contained in:
Aksel Skauge Mellbye 2024-10-02 22:30:28 +02:00 committed by Henrik Brix Andersen
commit 955aca6c09
5 changed files with 511 additions and 27 deletions

View file

@ -1,17 +0,0 @@
/*
* Copyright (c) 2023 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef SL_DEVICE_INIT_HFXO_CONFIG_H
#define SL_DEVICE_INIT_HFXO_CONFIG_H
#include <zephyr/devicetree.h>
#define SL_DEVICE_INIT_HFXO_MODE cmuHfxoOscMode_Crystal
#define SL_DEVICE_INIT_HFXO_FREQ DT_PROP(DT_NODELABEL(clk_hfxo), clock_frequency)
#define SL_DEVICE_INIT_HFXO_CTUNE DT_PROP(DT_NODELABEL(clk_hfxo), ctune)
#define SL_DEVICE_INIT_HFXO_PRECISION DT_PROP(DT_NODELABEL(clk_hfxo), precision)
#endif /* SL_DEVICE_INIT_HFXO_CONFIG_H */

View file

@ -21,8 +21,7 @@
#ifdef CONFIG_SOC_GECKO_DEV_INIT
#include <sl_device_init_dcdc.h>
#include <sl_device_init_dpll.h>
#include <sl_device_init_hfxo.h>
#include <sl_clock_manager_init.h>
#ifdef CONFIG_PM
#include <sl_hfxo_manager.h>
@ -217,8 +216,7 @@ void soc_early_init_hook(void)
if (DT_HAS_COMPAT_STATUS_OKAY(silabs_series2_dcdc)) {
sl_device_init_dcdc();
}
sl_device_init_hfxo();
sl_device_init_dpll();
sl_clock_manager_init();
#ifdef CONFIG_PM
sl_power_manager_init();