stm32h7: add SMPS PWR option for STM32H7X7

The dual core STM32H747 / STM32H757 there is an additional option to
select SMPS rather than LDO as the power selection.

This commit adds this option to the STM32H747 config and the
stm32h7x7xx source.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes 2023-01-16 14:52:44 +13:00 committed by Xiang Xiao
parent fc623949a3
commit 22fa59074f
2 changed files with 9 additions and 0 deletions

View File

@ -149,6 +149,7 @@ config ARCH_CHIP_STM32H747XI
select STM32H7_IO_CONFIG_X
select STM32H7_HAVE_FDCAN1
select STM32H7_HAVE_FDCAN2
select STM32H7_HAVE_SMPS
---help---
Dual core STM32 H7 Cortex M7+M4, 2048 Kb FLASH, 1024K Kb SRAM
TFBGA240

View File

@ -826,9 +826,17 @@ void stm32_stdclockconfig(void)
* N.B. The system shall be power cycled before writing a new value.
*/
#if defined(CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY)
regval = getreg32(STM32_PWR_CR3);
regval &= ~(STM32_PWR_CR3_BYPASS | STM32_PWR_CR3_LDOEN |
STM32_PWR_CR3_SMPSEXTHP | STM32_PWR_CR3_SMPSLEVEL_MASK);
regval |= STM32_PWR_CR3_LDOESCUEN;
putreg32(regval, STM32_PWR_CR3);
#else
regval = getreg32(STM32_PWR_CR3);
regval |= STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_LDOESCUEN;
putreg32(regval, STM32_PWR_CR3);
#endif
/* Set the voltage output scale */