From 967a8e63c33822680e3a4631430dcd9a4a64becd Mon Sep 17 00:00:00 2001
From: Pascal Paillet
Date: Fri, 29 Jan 2021 14:48:49 +0100
Subject: [PATCH] feat(stm32mp1): register fixed regulator
Register fixed regulator in BL2.
Change-Id: I24292f549b2cd24fb717fbb68eb95af7aa68e3b9
Signed-off-by: Pascal Paillet
Signed-off-by: Yann Gautier
---
plat/st/stm32mp1/bl2_plat_setup.c | 5 +++++
plat/st/stm32mp1/platform.mk | 1 +
plat/st/stm32mp1/stm32mp1_def.h | 2 ++
3 files changed, 8 insertions(+)
diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c
index 157efecbc..bac77bbe4 100644
--- a/plat/st/stm32mp1/bl2_plat_setup.c
+++ b/plat/st/stm32mp1/bl2_plat_setup.c
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -271,6 +272,10 @@ void bl2_el3_plat_arch_setup(void)
}
skip_console_init:
+ if (fixed_regulator_register() != 0) {
+ panic();
+ }
+
if (dt_pmic_status() > 0) {
initialize_pmic();
print_pmic_info_and_debug();
diff --git a/plat/st/stm32mp1/platform.mk b/plat/st/stm32mp1/platform.mk
index d6fe13105..fec4cb1fe 100644
--- a/plat/st/stm32mp1/platform.mk
+++ b/plat/st/stm32mp1/platform.mk
@@ -201,6 +201,7 @@ PLAT_BL_COMMON_SOURCES += drivers/arm/tzc/tzc400.c \
drivers/st/pmic/stm32mp_pmic.c \
drivers/st/pmic/stpmic1.c \
drivers/st/regulator/regulator_core.c \
+ drivers/st/regulator/regulator_fixed.c \
drivers/st/reset/stm32mp1_reset.c \
plat/st/common/stm32mp_dt.c \
plat/st/stm32mp1/stm32mp1_dbgmcu.c \
diff --git a/plat/st/stm32mp1/stm32mp1_def.h b/plat/st/stm32mp1/stm32mp1_def.h
index ee1644cb0..b43245f64 100644
--- a/plat/st/stm32mp1/stm32mp1_def.h
+++ b/plat/st/stm32mp1/stm32mp1_def.h
@@ -465,6 +465,8 @@ static inline uint32_t tamp_bkpr(uint32_t idx)
******************************************************************************/
/* 3 PWR + 1 VREFBUF + 14 PMIC regulators + 1 FIXED */
#define PLAT_NB_RDEVS U(19)
+/* 1 FIXED */
+#define PLAT_NB_FIXED_REGS U(1)
/*******************************************************************************
* Device Tree defines