diff --git a/soc/silabs/common/CMakeLists.txt b/soc/silabs/common/CMakeLists.txt index 7d1ed73666741f6..e19ac55906181f7 100644 --- a/soc/silabs/common/CMakeLists.txt +++ b/soc/silabs/common/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_FAMILY_SILABS_S0 OR CONFIG_SOC_FAMILY_SILABS_S1 OR CONFIG_SOC_FAMILY_SILABS_S2) +if(CONFIG_SOC_FAMILY_SILABS_S0 OR CONFIG_SOC_FAMILY_SILABS_S1) zephyr_sources(soc.c) endif() diff --git a/soc/silabs/common/soc.c b/soc/silabs/common/soc.c index f853820573f3d6a..5dfaafdc8776e7a 100644 --- a/soc/silabs/common/soc.c +++ b/soc/silabs/common/soc.c @@ -19,17 +19,6 @@ #include #include -#ifdef CONFIG_SOC_GECKO_DEV_INIT -#include -#include - -#ifdef CONFIG_PM -#include -#include -#endif - -#endif - LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); #ifdef CONFIG_CMU_HFCLK_HFXO @@ -212,19 +201,6 @@ void soc_early_init_hook(void) init_lfxo(); #endif -#ifdef CONFIG_SOC_GECKO_DEV_INIT - if (DT_HAS_COMPAT_STATUS_OKAY(silabs_series2_dcdc)) { - sl_device_init_dcdc(); - } - sl_clock_manager_init(); - -#ifdef CONFIG_PM - sl_power_manager_init(); - sl_hfxo_manager_init(); -#endif - -#else /* !CONFIG_SOC_GECKO_DEV_INIT */ - #ifdef CONFIG_SOC_GECKO_EMU_DCDC dcdc_init(); #endif @@ -236,5 +212,4 @@ void soc_early_init_hook(void) /* Configure SWO debug output */ swo_init(); #endif -#endif /* !CONFIG_SOC_GECKO_DEV_INIT */ } diff --git a/soc/silabs/silabs_s2/CMakeLists.txt b/soc/silabs/silabs_s2/CMakeLists.txt index e6ce558b5962b9c..2069aad6e806ad2 100644 --- a/soc/silabs/silabs_s2/CMakeLists.txt +++ b/soc/silabs/silabs_s2/CMakeLists.txt @@ -2,3 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 zephyr_include_directories(config) + +zephyr_sources(soc.c) diff --git a/soc/silabs/silabs_s2/soc.c b/soc/silabs/silabs_s2/soc.c new file mode 100644 index 000000000000000..7d503aa27add062 --- /dev/null +++ b/soc/silabs/silabs_s2/soc.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Silicon Laboratories Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief SoC initialization for Silicon Labs Series 2 products + */ + +#include +#include + +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); + +void soc_early_init_hook(void) +{ + /* Handle chip errata */ + CHIP_Init(); + + if (DT_HAS_COMPAT_STATUS_OKAY(silabs_series2_dcdc)) { + sl_device_init_dcdc(); + } + sl_clock_manager_init(); + + if (IS_ENABLED(CONFIG_PM)) { + sl_power_manager_init(); + sl_hfxo_manager_init(); + } +}