devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/2] Add Pmic to Bpi-R4
@ 2024-12-20 16:38 Frank Wunderlich
  2024-12-20 16:38 ` [PATCH v8 1/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC Frank Wunderlich
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Frank Wunderlich @ 2024-12-20 16:38 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: Frank Wunderlich, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

From: Frank Wunderlich <frank-w@public-files.de>

After these 2 Patches are dropped from my dts-series [1] i verified these
with mtk and changed based on this.

The problem was that voltages from BUCK4 and LDO were not matching the
voltages from schematic.

These 2 are not software-controlled, but should show the right voltage
in regulator overview.

[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=918585

Frank Wunderlich (2):
  arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A
    PMIC
  arm64: dts: mediatek: mt7988a-bpi-r4: Add proc-supply for cpus

 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 66 +++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi     |  8 +--
 2 files changed, 70 insertions(+), 4 deletions(-)

-- 
2.43.0


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

* [PATCH v8 1/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC
  2024-12-20 16:38 [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
@ 2024-12-20 16:38 ` Frank Wunderlich
  2024-12-20 16:38 ` [PATCH v8 2/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add proc-supply for cpus Frank Wunderlich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Frank Wunderlich @ 2024-12-20 16:38 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: Frank Wunderlich, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

From: Frank Wunderlich <frank-w@public-files.de>

Bananapi R4 Board contains a MT6682A pmic which is compatible to rt5190a.
Add its node to the i2 controller.

The BananaPi R4 board has a MediaTek MT6682A PMIC, a rebrand of the
Richtek RT5190A chip, connected to the I2C0 bus.

Add the relevant node and, while at it, also configure the regulators
from this PMIC that are used on this board.

Only Buck2/Buck3 voltage can be controlled by software.

BUCK4 input is 5V from BUCK1 output, and the resistor (mapped to RP30/RP31
on BPI-R4) configures BUCK4 output to 1.8V.
LDO input is 3.3V from 3.3VD, and the resistor (mapped to RP38/RP40 on
BPI-R4) configures LDO output to 1.8V.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
v8:
- fixed buck4 and ldo voltage and extended commit-Message
- readded (send separately) after verifying with mtk
- left RB from angelo as this is imho only minor change
v7:
- dropped this patch due to voltage mismatch compared to schematic
v4:
- change regulator-allowed-modes of pmic as 2 items
v3:
- change commit title and text
---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
index d6f1fca3323c..27edc6b84f80 100644
--- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
@@ -3,6 +3,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
 
 #include "mt7988a.dtsi"
 
@@ -66,6 +67,55 @@ &i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c0_pins>;
 	status = "okay";
+
+	rt5190a_64: rt5190a@64 {
+		compatible = "richtek,rt5190a";
+		reg = <0x64>;
+		vin2-supply = <&rt5190_buck1>;
+		vin3-supply = <&rt5190_buck1>;
+		vin4-supply = <&rt5190_buck1>;
+
+		regulators {
+			rt5190_buck1: buck1 {
+				regulator-name = "rt5190a-buck1";
+				regulator-min-microvolt = <5090000>;
+				regulator-max-microvolt = <5090000>;
+				regulator-allowed-modes =
+				<RT5190A_OPMODE_AUTO>, <RT5190A_OPMODE_FPWM>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+			buck2 {
+				regulator-name = "vcore";
+				regulator-min-microvolt = <600000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+			rt5190_buck3: buck3 {
+				regulator-name = "vproc";
+				regulator-min-microvolt = <600000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-boot-on;
+			};
+			buck4 {
+				regulator-name = "rt5190a-buck4";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-allowed-modes =
+				<RT5190A_OPMODE_AUTO>, <RT5190A_OPMODE_FPWM>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+			ldo {
+				regulator-name = "rt5190a-ldo";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
 };
 
 &i2c2 {
-- 
2.43.0


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

* [PATCH v8 2/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add proc-supply for cpus
  2024-12-20 16:38 [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
  2024-12-20 16:38 ` [PATCH v8 1/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC Frank Wunderlich
@ 2024-12-20 16:38 ` Frank Wunderlich
  2024-12-20 16:44 ` Aw: [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
  2025-01-02 12:46 ` AngeloGioacchino Del Regno
  3 siblings, 0 replies; 5+ messages in thread
From: Frank Wunderlich @ 2024-12-20 16:38 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: Frank Wunderlich, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

From: Frank Wunderlich <frank-w@public-files.de>

Add proc-supply property to cpus on Bananapi R4 board.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
changes:
v3:
- change commit title to have prefix for r4
---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts     | 16 ++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi        |  8 ++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
index 27edc6b84f80..6623112c24c7 100644
--- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
@@ -35,6 +35,22 @@ reg_3p3v: regulator-3p3v {
 	};
 };
 
+&cpu0 {
+	proc-supply = <&rt5190_buck3>;
+};
+
+&cpu1 {
+	proc-supply = <&rt5190_buck3>;
+};
+
+&cpu2 {
+	proc-supply = <&rt5190_buck3>;
+};
+
+&cpu3 {
+	proc-supply = <&rt5190_buck3>;
+};
+
 &cpu_thermal {
 	trips {
 		cpu_trip_hot: hot {
diff --git a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
index 7a5e16a97476..88b56a24efca 100644
--- a/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7988a.dtsi
@@ -16,7 +16,7 @@ cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		cpu@0 {
+		cpu0: cpu@0 {
 			compatible = "arm,cortex-a73";
 			reg = <0x0>;
 			device_type = "cpu";
@@ -27,7 +27,7 @@ cpu@0 {
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
-		cpu@1 {
+		cpu1: cpu@1 {
 			compatible = "arm,cortex-a73";
 			reg = <0x1>;
 			device_type = "cpu";
@@ -38,7 +38,7 @@ cpu@1 {
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
-		cpu@2 {
+		cpu2: cpu@2 {
 			compatible = "arm,cortex-a73";
 			reg = <0x2>;
 			device_type = "cpu";
@@ -49,7 +49,7 @@ cpu@2 {
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
-		cpu@3 {
+		cpu3: cpu@3 {
 			compatible = "arm,cortex-a73";
 			reg = <0x3>;
 			device_type = "cpu";
-- 
2.43.0


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

* Aw: [PATCH v8 0/2] Add Pmic to Bpi-R4
  2024-12-20 16:38 [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
  2024-12-20 16:38 ` [PATCH v8 1/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC Frank Wunderlich
  2024-12-20 16:38 ` [PATCH v8 2/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add proc-supply for cpus Frank Wunderlich
@ 2024-12-20 16:44 ` Frank Wunderlich
  2025-01-02 12:46 ` AngeloGioacchino Del Regno
  3 siblings, 0 replies; 5+ messages in thread
From: Frank Wunderlich @ 2024-12-20 16:44 UTC (permalink / raw)
  To: linux, robh, krzk+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-mediatek

Sorry, seems i made mistake with version-number...

these 2 patches were dropped from the linked v3.

there is no v4-v7

not sure why i had increased my changelog in first patch to v7 before...
maybe mixed with the pinctrl series

regards Frank

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

* Re: [PATCH v8 0/2] Add Pmic to Bpi-R4
  2024-12-20 16:38 [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
                   ` (2 preceding siblings ...)
  2024-12-20 16:44 ` Aw: [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
@ 2025-01-02 12:46 ` AngeloGioacchino Del Regno
  3 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-02 12:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Frank Wunderlich
  Cc: Frank Wunderlich, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

On Fri, 20 Dec 2024 17:38:34 +0100, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> After these 2 Patches are dropped from my dts-series [1] i verified these
> with mtk and changed based on this.
> 
> The problem was that voltages from BUCK4 and LDO were not matching the
> voltages from schematic.
> 
> [...]

Applied to v6.13-next/dts64, thanks!

[1/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC
      commit: 32dfd25b2f7b8073d016aea12e9c1b7612aa3daa
[2/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add proc-supply for cpus
      commit: 2798f51df86eefd8584557c9b9ee10f92c674849

Cheers,
Angelo



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

end of thread, other threads:[~2025-01-02 12:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-20 16:38 [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
2024-12-20 16:38 ` [PATCH v8 1/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC Frank Wunderlich
2024-12-20 16:38 ` [PATCH v8 2/2] arm64: dts: mediatek: mt7988a-bpi-r4: Add proc-supply for cpus Frank Wunderlich
2024-12-20 16:44 ` Aw: [PATCH v8 0/2] Add Pmic to Bpi-R4 Frank Wunderlich
2025-01-02 12:46 ` AngeloGioacchino Del Regno

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).