devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add SCMI regulators desciption on STM32MP25
@ 2024-06-19  8:35 Pascal Paillet
  2024-06-19  8:35 ` [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings Pascal Paillet
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Pascal Paillet @ 2024-06-19  8:35 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue, Liam Girdwood,
	Mark Brown, linux-arm-kernel, linux-kernel, devicetree,
	linux-stm32
  Cc: p.paillet, Etienne Carriere

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.

Pascal Paillet (4):
  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                  |  1 +
 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, 118 insertions(+), 9 deletions(-)
 create mode 100644 include/dt-bindings/regulator/st,stm32mp25-regulator.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings
  2024-06-19  8:35 [PATCH 0/4] Add SCMI regulators desciption on STM32MP25 Pascal Paillet
@ 2024-06-19  8:35 ` Pascal Paillet
  2024-06-19  9:23   ` Krzysztof Kozlowski
  2024-06-19  8:36 ` [PATCH 2/4] arm64: dts: st: add scmi regulators on stm32mp25 Pascal Paillet
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Pascal Paillet @ 2024-06-19  8:35 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue, Liam Girdwood,
	Mark Brown, linux-arm-kernel, linux-kernel, devicetree,
	linux-stm32
  Cc: p.paillet, Etienne Carriere

These bindings will be used for the SCMI voltage domain.

Signed-off-by: Pascal Paillet <p.paillet@foss.st.com>
---
 .../regulator/st,stm32mp25-regulator.h        | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 include/dt-bindings/regulator/st,stm32mp25-regulator.h

diff --git a/include/dt-bindings/regulator/st,stm32mp25-regulator.h b/include/dt-bindings/regulator/st,stm32mp25-regulator.h
new file mode 100644
index 000000000000..3c3d30911dd0
--- /dev/null
+++ b/include/dt-bindings/regulator/st,stm32mp25-regulator.h
@@ -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 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] arm64: dts: st: add scmi regulators on stm32mp25
  2024-06-19  8:35 [PATCH 0/4] Add SCMI regulators desciption on STM32MP25 Pascal Paillet
  2024-06-19  8:35 ` [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings Pascal Paillet
@ 2024-06-19  8:36 ` Pascal Paillet
  2024-06-19  8:36 ` [PATCH 3/4] arm64: dts: st: describe power supplies for stm32mp257f-ev1 board Pascal Paillet
  2024-06-19  8:36 ` [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32 Pascal Paillet
  3 siblings, 0 replies; 7+ messages in thread
From: Pascal Paillet @ 2024-06-19  8:36 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue, Liam Girdwood,
	Mark Brown, linux-arm-kernel, linux-kernel, devicetree,
	linux-stm32
  Cc: p.paillet, Etienne Carriere

Add SCMI regulators description on STM32MP25.

Signed-off-by: Pascal Paillet <p.paillet@foss.st.com>
---
 arch/arm64/boot/dts/st/stm32mp251.dtsi | 35 ++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index 96d6de29c14c..18094dadc9c4 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -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";
+					};
+				};
+			};
 		};
 	};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] arm64: dts: st: describe power supplies for stm32mp257f-ev1 board
  2024-06-19  8:35 [PATCH 0/4] Add SCMI regulators desciption on STM32MP25 Pascal Paillet
  2024-06-19  8:35 ` [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings Pascal Paillet
  2024-06-19  8:36 ` [PATCH 2/4] arm64: dts: st: add scmi regulators on stm32mp25 Pascal Paillet
@ 2024-06-19  8:36 ` Pascal Paillet
  2024-06-19  8:36 ` [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32 Pascal Paillet
  3 siblings, 0 replies; 7+ messages in thread
From: Pascal Paillet @ 2024-06-19  8:36 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue, Liam Girdwood,
	Mark Brown, linux-arm-kernel, linux-kernel, devicetree,
	linux-stm32
  Cc: p.paillet, Etienne Carriere

Describe power supplies for stm32mp257f-ev1 board.

Signed-off-by: Pascal Paillet <p.paillet@foss.st.com>
---
 arch/arm64/boot/dts/st/stm32mp257f-ev1.dts | 43 +++++++++++++++++-----
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
index 18c6266532b2..979847e0ea05 100644
--- a/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
+++ b/arch/arm64/boot/dts/st/stm32mp257f-ev1.dts
@@ -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";
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32
  2024-06-19  8:35 [PATCH 0/4] Add SCMI regulators desciption on STM32MP25 Pascal Paillet
                   ` (2 preceding siblings ...)
  2024-06-19  8:36 ` [PATCH 3/4] arm64: dts: st: describe power supplies for stm32mp257f-ev1 board Pascal Paillet
@ 2024-06-19  8:36 ` Pascal Paillet
  2024-06-20 18:48   ` kernel test robot
  3 siblings, 1 reply; 7+ messages in thread
From: Pascal Paillet @ 2024-06-19  8:36 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue, Liam Girdwood,
	Mark Brown, linux-arm-kernel, linux-kernel, devicetree,
	linux-stm32
  Cc: p.paillet, Etienne Carriere

Add SCMI ARM REGULATOR configuration for stm32.

Signed-off-by: Pascal Paillet <p.paillet@foss.st.com>
---
 arch/arm64/Kconfig.platforms | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index a52618073de2..dab964bc70ca 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -312,6 +312,7 @@ config ARCH_STM32
 	select STM32_EXTI
 	select ARM_SMC_MBOX
 	select ARM_SCMI_PROTOCOL
+	select REGULATOR_ARM_SCMI
 	select COMMON_CLK_SCMI
 	select STM32_FIREWALL
 	help
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings
  2024-06-19  8:35 ` [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings Pascal Paillet
@ 2024-06-19  9:23   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-19  9:23 UTC (permalink / raw)
  To: Pascal Paillet, Catalin Marinas, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Liam Girdwood, Mark Brown, linux-arm-kernel,
	linux-kernel, devicetree, linux-stm32
  Cc: Etienne Carriere

On 19/06/2024 10:35, Pascal Paillet wrote:
> These bindings will be used for the SCMI voltage domain.
> 
> Signed-off-by: Pascal Paillet <p.paillet@foss.st.com>

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

regulator: dt-bindings:

A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32
  2024-06-19  8:36 ` [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32 Pascal Paillet
@ 2024-06-20 18:48   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2024-06-20 18:48 UTC (permalink / raw)
  To: Pascal Paillet, Catalin Marinas, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Liam Girdwood, Mark Brown, linux-arm-kernel,
	linux-kernel, devicetree, linux-stm32
  Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all, p.paillet,
	Etienne Carriere

Hi Pascal,

kernel test robot noticed the following build warnings:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on atorgue-stm32/stm32-next robh/for-next linus/master v6.10-rc4 next-20240620]
[cannot apply to arm-perf/for-next/perf]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Pascal-Paillet/dt-bindings-add-STM32MP25-regulator-bindings/20240619-163908
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
patch link:    https://lore.kernel.org/r/20240619083602.33007-5-p.paillet%40foss.st.com
patch subject: [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32
config: arm64-kismet-CONFIG_REGULATOR_ARM_SCMI-CONFIG_ARCH_STM32-0-0 (https://download.01.org/0day-ci/archive/20240621/202406210259.JQqO3vyI-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20240621/202406210259.JQqO3vyI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406210259.JQqO3vyI-lkp@intel.com/

kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for REGULATOR_ARM_SCMI when selected by ARCH_STM32
   WARNING: unmet direct dependencies detected for REGULATOR_ARM_SCMI
     Depends on [n]: REGULATOR [=n] && ARM_SCMI_PROTOCOL [=y] && OF [=y]
     Selected by [y]:
     - ARCH_STM32 [=y]

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-20 18:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19  8:35 [PATCH 0/4] Add SCMI regulators desciption on STM32MP25 Pascal Paillet
2024-06-19  8:35 ` [PATCH 1/4] dt-bindings: add STM32MP25 regulator bindings Pascal Paillet
2024-06-19  9:23   ` Krzysztof Kozlowski
2024-06-19  8:36 ` [PATCH 2/4] arm64: dts: st: add scmi regulators on stm32mp25 Pascal Paillet
2024-06-19  8:36 ` [PATCH 3/4] arm64: dts: st: describe power supplies for stm32mp257f-ev1 board Pascal Paillet
2024-06-19  8:36 ` [PATCH 4/4] arm64: stm32: enable scmi regulator for stm32 Pascal Paillet
2024-06-20 18:48   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).