-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soc: silabs: Separate Series 2 soc.c
Series 2 always uses the device init HAL, while Series 0/1 never do. Create a separate soc.c for Series 2 to make both versions easier to read. Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
- Loading branch information
Showing
4 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_include_directories(config) | ||
|
||
zephyr_sources(soc.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <zephyr/kernel.h> | ||
#include <zephyr/logging/log.h> | ||
|
||
#include <em_chip.h> | ||
#include <sl_device_init_dcdc.h> | ||
#include <sl_clock_manager_init.h> | ||
#include <sl_hfxo_manager.h> | ||
#include <sl_power_manager.h> | ||
|
||
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(); | ||
} | ||
} |