From 48a2aedb78f4c659a2a926d0f88ead77804fd41c Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Tue, 1 Oct 2024 11:57:21 +0200 Subject: [PATCH] soc: st: stm32h7rs serie requires specific power rails Enables the XSPIM2 rail when using GPIO bank N Enables the XSPIM1 rail when using GPIO bank O or P Enables the USBvoltage detector when using the GPIO M Signed-off-by: Francois Ramu --- soc/st/stm32/stm32h7rsx/soc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/soc/st/stm32/stm32h7rsx/soc.c b/soc/st/stm32/stm32h7rsx/soc.c index 5bf2bfe43af..75cf6aa62b8 100644 --- a/soc/st/stm32/stm32h7rsx/soc.c +++ b/soc/st/stm32/stm32h7rsx/soc.c @@ -68,4 +68,14 @@ void soc_early_init_hook(void) LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1); while (LL_PWR_IsActiveFlag_VOSRDY() == 0) { } + +#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpioo), okay) || DT_NODE_HAS_STATUS(DT_NODELABEL(gpiop), okay) + LL_PWR_EnableXSPIM1(); /* Required for powering GPIO O and P */ +#endif /* gpioo || gpio p */ +#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpion), okay) + LL_PWR_EnableXSPIM2(); /* Required for powering GPIO N */ +#endif /* gpio n */ +#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpiom), okay) + LL_PWR_EnableUSBVoltageDetector(); /* Required for powering GPIO M */ +#endif /* gpiom */ }