Skip to contentSkip to conversation

Add SCMI regulators desciption on STM32MP25

PATCH In review Pascal Paillet 3 participants 7 messages Jun 28, 2024 – Jul 5, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Add SCMI regulators desciption on STM32MP25

Add the description for SCMI regulators provided by OP-TEE firmware. The binding file named st,stm32mp25-regulator.h will be also used in the OP-TEE firmware.

Changes in v2:
- fix regulator binding commit title in patch 0001
- add regulator selection for stm32 in patch 0004

Pascal Paillet (4):
regulators: dt-bindings: add STM32MP25 regulator bindings
arm64: dts: st: add scmi regulators on stm32mp25
arm64: dts: st: describe power supplies for stm32mp257f-ev1 board
arm64: stm32: enable scmi regulator for stm32

 arch/arm64/Kconfig.platforms                  |  2 +
 arch/arm64/boot/dts/st/stm32mp251.dtsi        | 35 ++++++++++++++
 arch/arm64/boot/dts/st/stm32mp257f-ev1.dts    | 43 +++++++++++++----
 .../regulator/st,stm32mp25-regulator.h        | 48 +++++++++++++++++++
 4 files changed, 119 insertions(+), 9 deletions(-)
 create mode 100644 include/dt-bindings/regulator/st,stm32mp25-regulator.h
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 regulators: dt-bindings: add STM32MP25 regulator bindings

These bindings will be used for the SCMI voltage domain.

---
 .../regulator/st,stm32mp25-regulator.h        | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 include/dt-bindings/regulator/st,stm32mp25-regulator.h
include/dt-bindings/regulator/st,stm32mp25-regulator.h new file +48 -0
new file mode 100644
index 000000000000..3c3d30911dd0
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
+ */
+
+#ifndef __DT_BINDINGS_REGULATOR_ST_STM32MP25_REGULATOR_H
+#define __DT_BINDINGS_REGULATOR_ST_STM32MP25_REGULATOR_H
+
+/* SCMI voltage domains identifiers */
+
+/* SOC Internal regulators */
+#define VOLTD_SCMI_VDDIO1		0
+#define VOLTD_SCMI_VDDIO2		1
+#define VOLTD_SCMI_VDDIO3		2
+#define VOLTD_SCMI_VDDIO4		3
+#define VOLTD_SCMI_VDDIO		4
+#define VOLTD_SCMI_UCPD			5
+#define VOLTD_SCMI_USB33		6
+#define VOLTD_SCMI_ADC			7
+#define VOLTD_SCMI_GPU			8
+#define VOLTD_SCMI_VREFBUF		9
+
+/* STPMIC2 regulators */
+#define VOLTD_SCMI_STPMIC2_BUCK1	10
+#define VOLTD_SCMI_STPMIC2_BUCK2	11
+#define VOLTD_SCMI_STPMIC2_BUCK3	12
+#define VOLTD_SCMI_STPMIC2_BUCK4	13
+#define VOLTD_SCMI_STPMIC2_BUCK5	14
+#define VOLTD_SCMI_STPMIC2_BUCK6	15
+#define VOLTD_SCMI_STPMIC2_BUCK7	16
+#define VOLTD_SCMI_STPMIC2_LDO1		17
+#define VOLTD_SCMI_STPMIC2_LDO2		18
+#define VOLTD_SCMI_STPMIC2_LDO3		19
+#define VOLTD_SCMI_STPMIC2_LDO4		20
+#define VOLTD_SCMI_STPMIC2_LDO5		21
+#define VOLTD_SCMI_STPMIC2_LDO6		22
+#define VOLTD_SCMI_STPMIC2_LDO7		23
+#define VOLTD_SCMI_STPMIC2_LDO8		24
+#define VOLTD_SCMI_STPMIC2_REFDDR	25
+
+/* External regulators */
+#define VOLTD_SCMI_REGU0		26
+#define VOLTD_SCMI_REGU1		27
+#define VOLTD_SCMI_REGU2		28
+#define VOLTD_SCMI_REGU3		29
+#define VOLTD_SCMI_REGU4		30
+
+#endif /*__DT_BINDINGS_REGULATOR_ST_STM32MP25_REGULATOR_H */
Signature · 1 line
2.34.1
maintainer Acked-by on v2 1/4
#2 lore raw

Re: [PATCH v2 1/4] regulators: dt-bindings: add STM32MP25 regulator bindings

Quoted 1 line · Pascal Paillet

These bindings will be used for the SCMI voltage domain.

Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.

#3 lore raw

PATCH v2 2/4 arm64: dts: st: add scmi regulators on stm32mp25

In reply to Pascal Paillet

Add SCMI regulators description on STM32MP25.

---
 arch/arm64/boot/dts/st/stm32mp251.dtsi | 35 ++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/st/stm32mp251.dtsi +35 -0
index 96d6de29c14c..18094dadc9c4 100644
@@ -6,6 +6,7 @@
 #include <dt-bindings/clock/st,stm32mp25-rcc.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/st,stm32mp25-rcc.h>
+#include <dt-bindings/regulator/st,stm32mp25-regulator.h>
 
 / {
 	#address-cells = <2>;
@@ -75,6 +76,40 @@ scmi_reset: protocol@16 {
 				reg = <0x16>;
 				#reset-cells = <1>;
 			};
+
+			scmi_voltd: protocol@17 {
+				reg = <0x17>;
+
+				scmi_regu: regulators {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					scmi_vddio1: regulator@0 {
+						reg = <VOLTD_SCMI_VDDIO1>;
+						regulator-name = "vddio1";
+					};
+					scmi_vddio2: regulator@1 {
+						reg = <VOLTD_SCMI_VDDIO2>;
+						regulator-name = "vddio2";
+					};
+					scmi_vddio3: regulator@2 {
+						reg = <VOLTD_SCMI_VDDIO3>;
+						regulator-name = "vddio3";
+					};
+					scmi_vddio4: regulator@3 {
+						reg = <VOLTD_SCMI_VDDIO4>;
+						regulator-name = "vddio4";
+					};
+					scmi_vdd33ucpd: regulator@5 {
+						reg = <VOLTD_SCMI_UCPD>;
+						regulator-name = "vdd33ucpd";
+					};
+					scmi_vdda18adc: regulator@7 {
+						reg = <VOLTD_SCMI_ADC>;
+						regulator-name = "vdda18adc";
+					};
+				};
+			};
 		};
 	};
 
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 3/4 arm64: dts: st: describe power supplies for stm32mp257f-ev1 board

In reply to Pascal Paillet

Describe power supplies for stm32mp257f-ev1 board.

---
 arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | 43 +++++++++++++++++-----
 1 file changed, 34 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/st/stm32mp257f-ev1.dts +34 -9
index 18c6266532b2..979847e0ea05 100644
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/st,stm32mp25-regulator.h>
 #include "stm32mp257.dtsi"
 #include "stm32mp25xf.dtsi"
 #include "stm32mp25-pinctrl.dtsi"
@@ -41,14 +42,6 @@ fw@80000000 {
 			no-map;
 		};
 	};
-
-	vdd_sdcard: vdd-sdcard {
-		compatible = "regulator-fixed";
-		regulator-name = "vdd_sdcard";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		regulator-always-on;
-	};
 };
 
 &arm_wdt {
@@ -56,6 +49,37 @@ &arm_wdt {
 	status = "okay";
 };
 
+&scmi_regu {
+	scmi_vddio1: regulator@0 {
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+	};
+	scmi_vddcore: regulator@11  {
+		reg = <VOLTD_SCMI_STPMIC2_BUCK2>;
+		regulator-name = "vddcore";
+	};
+	scmi_v1v8: regulator@14  {
+		reg = <VOLTD_SCMI_STPMIC2_BUCK5>;
+		regulator-name = "v1v8";
+	};
+	scmi_v3v3: regulator@16 {
+		reg = <VOLTD_SCMI_STPMIC2_BUCK7>;
+		regulator-name = "v3v3";
+	};
+	scmi_vdd_emmc: regulator@18 {
+		reg = <VOLTD_SCMI_STPMIC2_LDO2>;
+		regulator-name = "vdd_emmc";
+	};
+	scmi_vdd3v3_usb: regulator@20 {
+		reg = <VOLTD_SCMI_STPMIC2_LDO4>;
+		regulator-name = "vdd3v3_usb";
+	};
+	scmi_vdd_sdcard: regulator@23 {
+		reg = <VOLTD_SCMI_STPMIC2_LDO7>;
+		regulator-name = "vdd_sdcard";
+	};
+};
+
 &i2c2 {
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&i2c2_pins_a>;
@@ -85,7 +109,8 @@ &sdmmc1 {
 	disable-wp;
 	st,neg-edge;
 	bus-width = <4>;
-	vmmc-supply = <&vdd_sdcard>;
+	vmmc-supply = <&scmi_vdd_sdcard>;
+	vqmmc-supply = <&scmi_vddio1>;
 	status = "okay";
 };
 
Signature · 1 line
2.34.1
#5 lore raw

PATCH v2 4/4 arm64: stm32: enable scmi regulator for stm32

In reply to Pascal Paillet

Add SCMI ARM REGULATOR configuration for stm32.

---
 arch/arm64/Kconfig.platforms | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/Kconfig.platforms +2 -0
index a52618073de2..3738a9fc2d6c 100644
@@ -312,6 +312,8 @@ config ARCH_STM32
 	select STM32_EXTI
 	select ARM_SMC_MBOX
 	select ARM_SCMI_PROTOCOL
+	select REGULATOR
+	select REGULATOR_ARM_SCMI
 	select COMMON_CLK_SCMI
 	select STM32_FIREWALL
 	help
Signature · 1 line
2.34.1
maintainer
#6 lore raw
In reply to Pascal Paillet

Hi pascal

Quoted 14 lines · Pascal Paillet

Add the description for SCMI regulators provided by OP-TEE firmware. The binding file named st,stm32mp25-regulator.h will be also used in the OP-TEE firmware.

Changes in v2:
- fix regulator binding commit title in patch 0001
- add regulator selection for stm32 in patch 0004

Pascal Paillet (4):
regulators: dt-bindings: add STM32MP25 regulator bindings
arm64: dts: st: add scmi regulators on stm32mp25
arm64: dts: st: describe power supplies for stm32mp257f-ev1 board
arm64: stm32: enable scmi regulator for stm32

Quoted 7 lines
  arch/arm64/Kconfig.platforms                  |  2 +
  arch/arm64/boot/dts/st/stm32mp251.dtsi        | 35 ++++++++++++++
  arch/arm64/boot/dts/st/stm32mp257f-ev1.dts    | 43 +++++++++++++----
  .../regulator/st,stm32mp25-regulator.h        | 48 +++++++++++++++++++
  4 files changed, 119 insertions(+), 9 deletions(-)

create mode 100644 include/dt-bindings/regulator/st,stm32mp25-regulator.h

Series applied on stm32-next.

Thanks
Alex