soc: stm32: Make POWER_SUPPLY_CHOICE available for SOC_STM32WBA55XX

POWER_SUPPLY_CHOICE is available for SOC_STM32WBA55XX, with two
possible options: LDO or SMPS.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
This commit is contained in:
Erwan Gouriou 2023-12-01 16:40:45 +01:00 committed by Fabio Baltieri
commit 7c96ebc2a8
2 changed files with 17 additions and 8 deletions

View file

@ -24,7 +24,8 @@ config USE_STM32_ASSERT
choice POWER_SUPPLY_CHOICE
prompt "STM32 power supply configuration"
default POWER_SUPPLY_LDO
depends on SOC_SERIES_STM32H7X || SOC_SERIES_STM32U5X
depends on SOC_SERIES_STM32H7X || SOC_SERIES_STM32U5X || \
SOC_STM32WBA55XX
config POWER_SUPPLY_LDO
bool "LDO supply"
@ -34,30 +35,30 @@ config POWER_SUPPLY_DIRECT_SMPS
config POWER_SUPPLY_SMPS_1V8_SUPPLIES_LDO
bool "SMPS 1.8V supplies LDO (no external supply)"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
config POWER_SUPPLY_SMPS_2V5_SUPPLIES_LDO
bool "SMPS 2.5V supplies LDO (no external supply)"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
config POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT_AND_LDO
bool "External SMPS 1.8V supply, supplies LDO"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
config POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT_AND_LDO
bool "External SMPS 2.5V supply, supplies LDO"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
config POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT
bool "External SMPS 1.8V supply and bypass"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
config POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT
bool "External SMPS 2.5V supply and bypass"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
config POWER_SUPPLY_EXTERNAL_SOURCE
bool "Bypass"
depends on !SOC_SERIES_STM32U5X
depends on !SOC_SERIES_STM32U5X && !SOC_SERIES_STM32WBAX
endchoice

View file

@ -13,6 +13,7 @@
#include <zephyr/init.h>
#include <stm32_ll_bus.h>
#include <stm32_ll_pwr.h>
#include <stm32_ll_rcc.h>
#include <stm32_ll_icache.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/irq.h>
@ -44,6 +45,13 @@ static int stm32wba_init(void)
/* Enable PWR */
LL_AHB4_GRP1_EnableClock(LL_AHB4_GRP1_PERIPH_PWR);
#if defined(CONFIG_POWER_SUPPLY_DIRECT_SMPS)
LL_PWR_SetRegulatorSupply(LL_PWR_SMPS_SUPPLY);
#elif defined(CONFIG_POWER_SUPPLY_LDO)
LL_PWR_SetRegulatorSupply(LL_PWR_LDO_SUPPLY);
#endif
return 0;
}