stm32mp1: Add PMIC support
If a PMIC companion chip is present on board, it has to be configured
for regulators supplies.
This check is done with board DT configuration.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Pascal Paillet <p.paillet@st.com>
diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c
index 97abdc4..84484e1 100644
--- a/plat/st/stm32mp1/bl2_plat_setup.c
+++ b/plat/st/stm32mp1/bl2_plat_setup.c
@@ -18,6 +18,7 @@
#include <platform_def.h>
#include <stm32mp1_clk.h>
#include <stm32mp1_dt.h>
+#include <stm32mp1_pmic.h>
#include <stm32mp1_private.h>
#include <stm32mp1_context.h>
#include <stm32mp1_pwr.h>
@@ -34,6 +35,10 @@
void bl2_platform_setup(void)
{
+ if (dt_check_pmic()) {
+ initialize_pmic();
+ }
+
INFO("BL2 runs SP_MIN setup\n");
}
diff --git a/plat/st/stm32mp1/platform.mk b/plat/st/stm32mp1/platform.mk
index 9c97f72..bd74d0f 100644
--- a/plat/st/stm32mp1/platform.mk
+++ b/plat/st/stm32mp1/platform.mk
@@ -42,6 +42,9 @@
drivers/st/clk/stm32mp1_clk.c \
drivers/st/clk/stm32mp1_clkfunc.c \
drivers/st/gpio/stm32_gpio.c \
+ drivers/st/pmic/stm32_i2c.c \
+ drivers/st/pmic/stm32mp1_pmic.c \
+ drivers/st/pmic/stpmu1.c \
drivers/st/reset/stm32mp1_reset.c \
plat/st/stm32mp1/stm32mp1_context.c \
plat/st/stm32mp1/stm32mp1_dt.c \