Skip to contentSkip to conversation

continue mt7988 devicetree work

PATCH Superseded Frank Wunderlich 4 participants 51 messages Dec 2, 2024 – Dec 4, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover continue mt7988 devicetree work

From: Frank Wunderlich <[email protected]>

This series adds some missing labels and new nodes to mt7988 DTS.

based on pinctrl-series
https://patchwork.kernel.org/project/linux-mediatek/list/?series=913700

changes:
v2:
- reorder and squash label-commits to where they are used
- add some more nodes
- add changes to bananapi-r4 board
- moving some nodes from SoC dtsi to board dts

Frank Wunderlich (18):
arm64: dts: mediatek: mt7988: enable watchdog on bpi-r4
arm64: dts: mediatek: mt7988: add mmc support
arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3
arm64: dts: mediatek: mt7988: add lvts node
arm64: dts: mediatek: mt7988: add thermal-zone
arm64: dts: mediatek: mt7988: add thermal trips to bpi-r4
arm64: dts: mediatek: mt7988: add reserved memory
arm64: dts: mediatek: mt7988: add mcu-sys node for cpu
arm64: dts: mediatek: mt7988: add operating-points
arm64: dts: mediatek: mt7988: enable serial0 on bpi-r4
arm64: dts: mediatek: mt7988: add chosen node on bpi-r4
arm64: dts: mediatek: mt7988: add missing clock-div property for i2c
arm64: dts: mediatek: mt7988: add i2c to bpi-r4 board
arm64: dts: mediatek: mt7988: add pmic on bpi-r4
arm64: dts: mediatek: mt7988: add proc-supply for cpus on bpi-r4
arm64: dts: mediatek: mt7988: add i2c-mux on bpi-r4
arm64: dts: mediatek: mt7988: enable ssusb1 on bpi-r4
arm64: dts: mediatek: mt7988: enable pwm on bpi-r4

 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 186 ++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi     | 137 +++++++++++--
 2 files changed, 311 insertions(+), 12 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/18 arm64: dts: mediatek: mt7988: enable watchdog on bpi-r4

From: Frank Wunderlich <[email protected]>

Enable the watchdog on Bananapi R4 board.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +4 -0
index aa2dabc041fd..d914eae2b524 100644
@@ -198,3 +198,7 @@ mux {
 		};
 	};
 };
+
+&watchdog {
+	status = "okay";
+};
Signature · 1 line
2.43.0
#3 lore raw

PATCH v2 2/18 arm64: dts: mediatek: mt7988: add mmc support

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add devicetree node for MMC controller.

---
changes:
v2:
squash "add missing label for apmixedsys"

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 24 ++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +23 -1
index 46969577c87a..5e40446cb7b3 100644
@@ -100,7 +100,7 @@ watchdog: watchdog@1001c000 {
 			#reset-cells = <1>;
 		};
 
-		clock-controller@1001e000 {
+		apmixedsys: clock-controller@1001e000 {
 			compatible = "mediatek,mt7988-apmixedsys";
 			reg = <0 0x1001e000 0 0x1000>;
 			#clock-cells = <1>;
@@ -278,6 +278,28 @@ usb@11200000 {
 			clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck";
 		};
 
+		mmc0: mmc@11230000 {
+			compatible = "mediatek,mt7988-mmc";
+			reg = <0 0x11230000 0 0x1000>,
+			      <0 0x11D60000 0 0x1000>;
+			interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&infracfg CLK_INFRA_MSDC400>,
+				 <&infracfg CLK_INFRA_MSDC2_HCK>,
+				 <&infracfg CLK_INFRA_66M_MSDC_0_HCK>,
+				 <&infracfg CLK_INFRA_133M_MSDC_0_HCK>;
+			assigned-clocks = <&topckgen CLK_TOP_EMMC_250M_SEL>,
+					  <&topckgen CLK_TOP_EMMC_400M_SEL>;
+			assigned-clock-parents = <&topckgen CLK_TOP_NET1PLL_D5_D2>,
+						 <&apmixedsys CLK_APMIXED_MSDCPLL>;
+			clock-names = "source",
+				      "hclk",
+				      "axi_cg",
+				      "ahb_cg";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		clock-controller@11f40000 {
 			compatible = "mediatek,mt7988-xfi-pll";
 			reg = <0 0x11f40000 0 0x1000>;
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 2/18
#4 lore raw

Re: [PATCH v2 02/18] arm64: dts: mediatek: mt7988: add mmc support

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 37 lines

From: Frank Wunderlich <[email protected]>

Add devicetree node for MMC controller.

---
changes:
v2:
squash "add missing label for apmixedsys"

---
  arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 24 ++++++++++++++++++++++-
  1 file changed, 23 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +8 -1
index 46969577c87a..5e40446cb7b3 100644
@@ -100,7 +100,7 @@ watchdog: watchdog@1001c000 {
  			#reset-cells = <1>;
  		};
 
-		clock-controller@1001e000 {
+		apmixedsys: clock-controller@1001e000 {
  			compatible = "mediatek,mt7988-apmixedsys";
  			reg = <0 0x1001e000 0 0x1000>;
  			#clock-cells = <1>;
@@ -278,6 +278,28 @@ usb@11200000 {
  			clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck";
  		};
 
+		mmc0: mmc@11230000 {
+			compatible = "mediatek,mt7988-mmc";
+			reg = <0 0x11230000 0 0x1000>,
+			      <0 0x11D60000 0 0x1000>;
+			interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&infracfg CLK_INFRA_MSDC400>,
+				 <&infracfg CLK_INFRA_MSDC2_HCK>,

arch/arm64/boot/dts/mediatek/mt7988a.dtsi usb@11200000 { · line 297

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +10 -0
+				 <&infracfg CLK_INFRA_66M_MSDC_0_HCK>,
+				 <&infracfg CLK_INFRA_133M_MSDC_0_HCK>;
+			assigned-clocks = <&topckgen CLK_TOP_EMMC_250M_SEL>,
+					  <&topckgen CLK_TOP_EMMC_400M_SEL>;
+			assigned-clock-parents = <&topckgen CLK_TOP_NET1PLL_D5_D2>,
+						 <&apmixedsys CLK_APMIXED_MSDCPLL>;
+			clock-names = "source",
+				      "hclk",
+				      "axi_cg",
+				      "ahb_cg";

One last nitpick: all of the clock-names *do* fit in one line.

			clock-names = "source", "hclk", "axi_cg", "ahb_cg";

After which

#5 lore raw

PATCH v2 3/18 arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add regulator nodes used for mmc to Bananapi R4 board.

---
v2:
- move mmc regulators to board dts of bpi-r4

---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +18 -0
index d914eae2b524..df53512c6890 100644
@@ -8,6 +8,24 @@ / {
 	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
 	model = "Banana Pi BPI-R4";
 	chassis-type = "embedded";
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
 };
 
 &pio {
Signature · 1 line
2.43.0
#6 lore raw

Re: [PATCH v2 03/18] arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add regulator nodes used for mmc to Bananapi R4 board.

If you're adding the eMMC regulators, I assume that there's an eMMC, or that even if there's no device in some version of the board, these two regulators are always assigned to the eMMC device - right?

You should, at this point, do exactly that: you can leave the mmc0 disabled and only enable it in a DTBO.

&mmc0 {
	/* eMMC gets enabled by DTBO if present */
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_1p8v>;
};

Cheers,
Angelo

Quoted 36 lines

---
v2:
- move mmc regulators to board dts of bpi-r4

---
  .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +18 -0
index d914eae2b524..df53512c6890 100644
@@ -8,6 +8,24 @@ / {
  	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
  	model = "Banana Pi BPI-R4";
  	chassis-type = "embedded";
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
  };
 
  &pio {
#7 lore raw

Re: [PATCH v2 03/18] arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3

Am 3. Dezember 2024 10:40:54 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 10 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add regulator nodes used for mmc to Bananapi R4 board.

If you're adding the eMMC regulators, I assume that there's an eMMC, or that even if there's no device in some version of the board, these two regulators are always assigned to the eMMC device - right?

Like BPi-R3 there is one mmc controller mapped to either sd or emmc. I can move the regulators to the dtbo,but then they are defined twice (at least 3v3).

Quoted 2 lines

You should, at this point, do exactly that: you can leave the mmc0 disabled and only enable it in a DTBO.

I enable it only in dtbo...

Quoted 5 lines
&mmc0 {
	/* eMMC gets enabled by DTBO if present */
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_1p8v>;
};

Problem is here that sdcard uses only the 3v3 twice

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso

And emmc needs both

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso

Only defining the vmmc-supply in dts and set only the other in dtso is possible but but imho not nice.

Quoted 30 lines

Cheers,
Angelo

Quoted 27 lines

---
v2:
- move mmc regulators to board dts of bpi-r4

---
  .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +12 -0
index d914eae2b524..df53512c6890 100644
@@ -8,6 +8,24 @@ / {
  	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
  	model = "Banana Pi BPI-R4";
  	chassis-type = "embedded";
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
Quoted 10 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts / { · line 31

Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +6 -0
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
  };
    &pio {

regards Frank

#8 lore raw

Re: [PATCH v2 03/18] arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3

Il 03/12/24 11:51, Frank Wunderlich ha scritto:

Quoted 27 lines

Am 3. Dezember 2024 10:40:54 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 10 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add regulator nodes used for mmc to Bananapi R4 board.

If you're adding the eMMC regulators, I assume that there's an eMMC, or that even if there's no device in some version of the board, these two regulators are always assigned to the eMMC device - right?

Like BPi-R3 there is one mmc controller mapped to either sd or emmc. I can move the regulators to the dtbo,but then they are defined twice (at least 3v3).

Quoted 2 lines

You should, at this point, do exactly that: you can leave the mmc0 disabled and only enable it in a DTBO.

I enable it only in dtbo...

Quoted 5 lines
&mmc0 {
	/* eMMC gets enabled by DTBO if present */
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_1p8v>;
};

Problem is here that sdcard uses only the 3v3 twice

Quoted 8 lines

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso

And emmc needs both

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso

Only defining the vmmc-supply in dts and set only the other in dtso is possible but but imho not nice.

If you added that in the commit description in the first place, I wouldn't have sent you that suggestion ;-)

So, please add the reason that you just explained to me in the description of this commit and just leave the code as-is.

Cheers!

Quoted 43 lines
Quoted 30 lines

Cheers,
Angelo

Quoted 27 lines

---
v2:
- move mmc regulators to board dts of bpi-r4

---
   .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
   1 file changed, 18 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +12 -0
index d914eae2b524..df53512c6890 100644
@@ -8,6 +8,24 @@ / {
   	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
   	model = "Banana Pi BPI-R4";
   	chassis-type = "embedded";
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
Quoted 10 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts / { · line 31

Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +6 -0
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
   };
     &pio {

regards Frank

#9 lore raw

Re: [PATCH v2 03/18] arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3

Am 2024-12-03 15:20, schrieb AngeloGioacchino Del Regno:

Quoted 34 lines

Il 03/12/24 11:51, Frank Wunderlich ha scritto:

Quoted 33 lines

Am 3. Dezember 2024 10:40:54 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 10 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add regulator nodes used for mmc to Bananapi R4 board.

If you're adding the eMMC regulators, I assume that there's an eMMC, or that even if there's no device in some version of the board, these two regulators are always assigned to the eMMC device - right?

Like BPi-R3 there is one mmc controller mapped to either sd or emmc. I can move the regulators to the dtbo,but then they are defined twice (at least 3v3).

Quoted 2 lines

You should, at this point, do exactly that: you can leave the mmc0 disabled and only enable it in a DTBO.

I enable it only in dtbo...

Quoted 5 lines
&mmc0 {
	/* eMMC gets enabled by DTBO if present */
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_1p8v>;
};

Problem is here that sdcard uses only the 3v3 twice

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso

And emmc needs both

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso

Quoted 8 lines
Quoted 2 lines

Only defining the vmmc-supply in dts and set only the other in dtso is possible but but imho not nice.

If you added that in the commit description in the first place, I wouldn't have sent you that suggestion ;-)

So, please add the reason that you just explained to me in the description of this commit and just leave the code as-is.

OK, would this be ok?

arm64: dts: mediatek: mt7988a-bpi-r4: add fixed regulators for 1v8 and 3v3

Add regulator nodes used for mmc to Bananapi R4 board.
This board has 1 MMC controller used for SDMMC and eMMC where only one can be used at one time, selected by hardware switches. SD use 3v3 for both supplies and emmc uses both regulators.
So defining both regulators in board dts and referencing them in the dt overlay.

Quoted 46 lines

Cheers!

Quoted 44 lines
Quoted 31 lines

Cheers,
Angelo

Quoted 28 lines

---
v2:
- move mmc regulators to board dts of bpi-r4

---
   .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 
++++++++++++++++++
   1 file changed, 18 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +12 -0
index d914eae2b524..df53512c6890 100644
@@ -8,6 +8,24 @@ / {
   	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
   	model = "Banana Pi BPI-R4";
   	chassis-type = "embedded";
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
Quoted 10 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts / { · line 31

Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +6 -0
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
   };
     &pio {

regards Frank

#10 lore raw

PATCH v2 4/18 arm64: dts: mediatek: mt7988: add lvts node

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add Low Voltage Thermal Sensor (LVTS) node for mt7988 SoC.

---
changes:

v2:
squash
- "arm64: dts: mediatek: mt7988: add label for efuse"
- "arm64: dts: mediatek: mt7988: extend efuse node" (drop other efuse subnodes)

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +18 -1
index 5e40446cb7b3..f7748a840297 100644
@@ -4,6 +4,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/phy/phy.h>
 #include <dt-bindings/pinctrl/mt65xx.h>
+#include <dt-bindings/reset/mediatek,mt7988-resets.h>
 
 / {
 	compatible = "mediatek,mt7988a";
@@ -85,6 +86,7 @@ infracfg: clock-controller@10001000 {
 			compatible = "mediatek,mt7988-infracfg", "syscon";
 			reg = <0 0x10001000 0 0x1000>;
 			#clock-cells = <1>;
+			#reset-cells = <1>;
 		};
 
 		topckgen: clock-controller@1001b000 {
@@ -250,6 +252,17 @@ i2c@11005000 {
 			status = "disabled";
 		};
 
+		lvts: lvts@1100a000 {
+			compatible = "mediatek,mt7988-lvts-ap";
+			#thermal-sensor-cells = <1>;
+			reg = <0 0x1100a000 0 0x1000>;
+			clocks = <&infracfg CLK_INFRA_26M_THERM_SYSTEM>;
+			interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+			resets = <&infracfg MT7988_INFRA_RST1_THERM_CTRL_SWRST>;
+			nvmem-cells = <&lvts_calibration>;
+			nvmem-cell-names = "lvts-calib-data-1";
+		};
+
 		usb@11190000 {
 			compatible = "mediatek,mt7988-xhci", "mediatek,mtk-xhci";
 			reg = <0 0x11190000 0 0x2e00>,
@@ -307,11 +320,15 @@ clock-controller@11f40000 {
 			#clock-cells = <1>;
 		};
 
-		efuse@11f50000 {
+		efuse: efuse@11f50000 {
 			compatible = "mediatek,mt7988-efuse", "mediatek,efuse";
 			reg = <0 0x11f50000 0 0x1000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+
+			lvts_calibration: calib@918 {
+				reg = <0x918 0x28>;
+			};
 		};
 
 		clock-controller@15000000 {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 4/18
#11 lore raw

Re: [PATCH v2 04/18] arm64: dts: mediatek: mt7988: add lvts node

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 55 lines

From: Frank Wunderlich <[email protected]>

Add Low Voltage Thermal Sensor (LVTS) node for mt7988 SoC.

---
changes:

v2:
squash
- "arm64: dts: mediatek: mt7988: add label for efuse"
- "arm64: dts: mediatek: mt7988: extend efuse node" (drop other efuse subnodes)

---
  arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 19 ++++++++++++++++++-
  1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +13 -0
index 5e40446cb7b3..f7748a840297 100644
@@ -4,6 +4,7 @@
  #include <dt-bindings/interrupt-controller/arm-gic.h>
  #include <dt-bindings/phy/phy.h>
  #include <dt-bindings/pinctrl/mt65xx.h>
+#include <dt-bindings/reset/mediatek,mt7988-resets.h>
 
  / {
  	compatible = "mediatek,mt7988a";
@@ -85,6 +86,7 @@ infracfg: clock-controller@10001000 {
  			compatible = "mediatek,mt7988-infracfg", "syscon";
  			reg = <0 0x10001000 0 0x1000>;
  			#clock-cells = <1>;
+			#reset-cells = <1>;
  		};
 
  		topckgen: clock-controller@1001b000 {
@@ -250,6 +252,17 @@ i2c@11005000 {
  			status = "disabled";
  		};
 
+		lvts: lvts@1100a000 {
+			compatible = "mediatek,mt7988-lvts-ap";
+			#thermal-sensor-cells = <1>;
+			reg = <0 0x1100a000 0 0x1000>;
+			clocks = <&infracfg CLK_INFRA_26M_THERM_SYSTEM>;
+			interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+			resets = <&infracfg MT7988_INFRA_RST1_THERM_CTRL_SWRST>;
+			nvmem-cells = <&lvts_calibration>;
+			nvmem-cell-names = "lvts-calib-data-1";
+		};
+
  		usb@11190000 {
  			compatible = "mediatek,mt7988-xhci", "mediatek,mtk-xhci";
  			reg = <0 0x11190000 0 0x2e00>,

arch/arm64/boot/dts/mediatek/mt7988a.dtsi clock-controller@11f40000 { · line 323

Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
@@ -307,11 +320,15 @@ clock-controller@11f40000 {
  			#clock-cells = <1>;
  		};
 
-		efuse@11f50000 {
+		efuse: efuse@11f50000 {

Okay but why are you adding the efuse handle name to this node? You're not using it anywhere as far as I can see.

Please drop this change - after which:

Quoted 11 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +4 -0
  			compatible = "mediatek,mt7988-efuse", "mediatek,efuse";
  			reg = <0 0x11f50000 0 0x1000>;
  			#address-cells = <1>;
  			#size-cells = <1>;
+
+			lvts_calibration: calib@918 {
+				reg = <0x918 0x28>;
+			};
  		};
 
  		clock-controller@15000000 {
#12 lore raw

PATCH v2 5/18 arm64: dts: mediatek: mt7988: add thermal-zone

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add basic thermal-zone node.

---
v2:
- only add critical trip to SoC dtsi, lower trips have to go to board dts

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +15 -0
index f7748a840297..09dcb39ad098 100644
@@ -346,6 +346,21 @@ clock-controller@15031000 {
 		};
 	};
 
+	thermal-zones {
+		cpu_thermal: cpu-thermal {
+			polling-delay-passive = <1000>;
+			polling-delay = <1000>;
+			thermal-sensors = <&lvts 0>;
+			trips {
+				cpu_trip_crit: crit {
+					temperature = <125000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupt-parent = <&gic>;
Signature · 1 line
2.43.0
#14 lore raw

PATCH v2 6/18 arm64: dts: mediatek: mt7988: add thermal trips to bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add additional thermal trips to Bananapi R4 board. SoC only contains the critical trip.

---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +28 -0
index df53512c6890..8a320d9da443 100644
@@ -28,6 +28,34 @@ reg_3p3v: regulator-3p3v {
 	};
 };
 
+&cpu_thermal {
+	trips {
+		cpu_trip_hot: hot {
+			temperature = <120000>;
+			hysteresis = <2000>;
+			type = "hot";
+		};
+
+		cpu_trip_active_high: active-high {
+			temperature = <115000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_trip_active_med: active-med {
+			temperature = <85000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_trip_active_low: active-low {
+			temperature = <40000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+};
+
 &pio {
 	mdio0_pins: mdio0-pins {
 		mux {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 6/18
#15 lore raw

Re: [PATCH v2 06/18] arm64: dts: mediatek: mt7988: add thermal trips to bpi-r4

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Add thermal configuration

Quoted 4 lines

Add additional thermal trips to Bananapi R4 board. SoC only contains the critical trip.

#16 lore raw

PATCH v2 7/18 arm64: dts: mediatek: mt7988: add reserved memory

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add memory range handled by ATF to not be touched by linux kernel. ATF is SoC specific and not board-specific so add it to mt7988.dtsi.

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +12 -0
index 09dcb39ad098..1cf801486e61 100644
@@ -63,6 +63,18 @@ psci {
 		method = "smc";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* 320 KiB reserved for ARM Trusted Firmware (BL31 and BL32) */
+		secmon_reserved: secmon@43000000 {
+			reg = <0 0x43000000 0 0x50000>;
+			no-map;
+		};
+	};
+
 	soc {
 		compatible = "simple-bus";
 		ranges;
Signature · 1 line
2.43.0
#17 lore raw

Re: [PATCH v2 07/18] arm64: dts: mediatek: mt7988: add reserved memory

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 6 lines

From: Frank Wunderlich <[email protected]>

Add memory range handled by ATF to not be touched by linux kernel. ATF is SoC specific and not board-specific so add it to mt7988.dtsi.

Since you have to send a v3, can you please move this to be the first commit of the series?

Would make a lot of sense :-)

Quoted 9 lines
---
  arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 12 ++++++++++++
  1 file changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +0 -0
index 09dcb39ad098..1cf801486e61 100644

arch/arm64/boot/dts/mediatek/mt7988a.dtsi psci { · line 72

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +7 -0
@@ -63,6 +63,18 @@ psci {
  		method = "smc";
  	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* 320 KiB reserved for ARM Trusted Firmware (BL31 and BL32) */
+		secmon_reserved: secmon@43000000 {

Are you ever modifying this outside of mt7988a.dtsi?

No!

So you don't need to add the secmon_reserved handle..... :-)

Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +5 -0
+			reg = <0 0x43000000 0 0x50000>;
+			no-map;
+		};
+	};
+
  	soc {
  		compatible = "simple-bus";
  		ranges;
#18 lore raw

PATCH v2 8/18 arm64: dts: mediatek: mt7988: add mcu-sys node for cpu

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add mcu-sys node which is used later as clock-controller for cpus.

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +6 -0
index 1cf801486e61..2af440510c86 100644
@@ -192,6 +192,12 @@ pwm@10048000 {
 			status = "disabled";
 		};
 
+		mcusys: mcusys@100e0000 {
+			compatible = "mediatek,mt7988-mcusys", "syscon";
+			reg = <0 0x100e0000 0 0x1000>;
+			#clock-cells = <1>;
+		};
+
 		serial@11000000 {
 			compatible = "mediatek,mt7988-uart", "mediatek,mt6577-uart";
 			reg = <0 0x11000000 0 0x100>;
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 8/18
#19 lore raw

Re: [PATCH v2 08/18] arm64: dts: mediatek: mt7988: add mcu-sys node for cpu

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 3 lines

From: Frank Wunderlich <[email protected]>

Add mcu-sys node which is used later as clock-controller for cpus.

In preparation for adding support for CPU DVFS and clock tables for it, add the MCUSYS clock controller node.

Quoted 2 lines
#20 lore raw

PATCH v2 9/18 arm64: dts: mediatek: mt7988: add operating-points

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add operating points defining frequency/voltages of cpu cores.

---
changes:
v2:
- drop cpu-labels for now

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 38 +++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +38 -0
index 2af440510c86..5609e3619be9 100644
@@ -21,6 +21,10 @@ cpu@0 {
 			reg = <0x0>;
 			device_type = "cpu";
 			enable-method = "psci";
+			clocks = <&mcusys CLK_MCU_ARM_DIV_SEL>,
+				 <&topckgen CLK_TOP_XTAL>;
+			clock-names = "cpu", "intermediate";
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu@1 {
@@ -28,6 +32,10 @@ cpu@1 {
 			reg = <0x1>;
 			device_type = "cpu";
 			enable-method = "psci";
+			clocks = <&mcusys CLK_MCU_ARM_DIV_SEL>,
+				 <&topckgen CLK_TOP_XTAL>;
+			clock-names = "cpu", "intermediate";
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu@2 {
@@ -35,6 +43,10 @@ cpu@2 {
 			reg = <0x2>;
 			device_type = "cpu";
 			enable-method = "psci";
+			clocks = <&mcusys CLK_MCU_ARM_DIV_SEL>,
+				 <&topckgen CLK_TOP_XTAL>;
+			clock-names = "cpu", "intermediate";
+			operating-points-v2 = <&cluster0_opp>;
 		};
 
 		cpu@3 {
@@ -42,6 +54,32 @@ cpu@3 {
 			reg = <0x3>;
 			device_type = "cpu";
 			enable-method = "psci";
+			clocks = <&mcusys CLK_MCU_ARM_DIV_SEL>,
+				 <&topckgen CLK_TOP_XTAL>;
+			clock-names = "cpu", "intermediate";
+			operating-points-v2 = <&cluster0_opp>;
+		};
+
+		cluster0_opp: opp-table-0 {
+			compatible = "operating-points-v2";
+			opp-shared;
+
+			opp-800000000 {
+				opp-hz = /bits/ 64 <800000000>;
+				opp-microvolt = <850000>;
+			};
+			opp-1100000000 {
+				opp-hz = /bits/ 64 <1100000000>;
+				opp-microvolt = <850000>;
+			};
+			opp-1500000000 {
+				opp-hz = /bits/ 64 <1500000000>;
+				opp-microvolt = <850000>;
+			};
+			opp-1800000000 {
+				opp-hz = /bits/ 64 <1800000000>;
+				opp-microvolt = <900000>;
+			};
 		};
 	};
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 9/18
#21 lore raw

Re: [PATCH v2 09/18] arm64: dts: mediatek: mt7988: add operating-points

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988: Add CPU OPP table for clock scaling

Quoted 3 lines

Add operating points defining frequency/voltages of cpu cores.

#22 lore raw

PATCH v2 10/18 arm64: dts: mediatek: mt7988: enable serial0 on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Enable the debug uart on Bananapi R4 board.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 4 ++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi                | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +4 -0
index 8a320d9da443..9037f35857a9 100644
@@ -245,6 +245,10 @@ mux {
 	};
 };
 
+&serial0 {
+	status = "okay";
+};
+
 &watchdog {
 	status = "okay";
 };
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
index 5609e3619be9..abf81a7d02a5 100644
@@ -236,7 +236,7 @@ mcusys: mcusys@100e0000 {
 			#clock-cells = <1>;
 		};
 
-		serial@11000000 {
+		serial0: serial@11000000 {
 			compatible = "mediatek,mt7988-uart", "mediatek,mt6577-uart";
 			reg = <0 0x11000000 0 0x100>;
 			interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 10/18
#23 lore raw

Re: [PATCH v2 10/18] arm64: dts: mediatek: mt7988: enable serial0 on bpi-r4

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Enable serial0 debug uart

Quoted 3 lines

Enable the debug uart on Bananapi R4 board.

#24 lore raw

Re: [PATCH v2 10/18] arm64: dts: mediatek: mt7988: enable serial0 on bpi-r4

Am 3. Dezember 2024 10:40:45 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 5 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Enable serial0 debug uart

You want new prefix here? That will change all r4 commits,right?

Quoted 6 lines
Quoted 3 lines

Enable the debug uart on Bananapi R4 board.

regards Frank

#25 lore raw

Re: [PATCH v2 10/18] arm64: dts: mediatek: mt7988: enable serial0 on bpi-r4

Il 03/12/24 12:27, Frank Wunderlich ha scritto:

Quoted 9 lines

Am 3. Dezember 2024 10:40:45 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 5 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Enable serial0 debug uart

You want new prefix here? That will change all r4 commits,right?

Yeah - that prefix should be shortening the commit titles but mainly will make it more straightforward when reading the commit history with --oneline.

Thanks,
Angelo

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Enable the debug uart on Bananapi R4 board.

regards Frank

#26 lore raw

PATCH v2 11/18 arm64: dts: mediatek: mt7988: add chosen node on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add chosen node on Bananapi R4 board with stdout and default bootargs.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +5 -0
index 9037f35857a9..1c2a806f6f6c 100644
@@ -9,6 +9,11 @@ / {
 	model = "Banana Pi BPI-R4";
 	chassis-type = "embedded";
 
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1";
+	};
+
 	reg_1p8v: regulator-1p8v {
 		compatible = "regulator-fixed";
 		regulator-name = "fixed-1.8V";
Signature · 1 line
2.43.0
#27 lore raw

Re: [PATCH v2 11/18] arm64: dts: mediatek: mt7988: add chosen node on bpi-r4

Quoted 14 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add chosen node on Bananapi R4 board with stdout and default bootargs.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +0 -0
index 9037f35857a9..1c2a806f6f6c 100644

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts / { · line 14

Quoted 6 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +3 -0
@@ -9,6 +9,11 @@ / {
 	model = "Banana Pi BPI-R4";
 	chassis-type = "embedded";
 
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1";

Drop or merge into stdout path.

Best regards,
Krzysztof

#28 lore raw

Re: [PATCH v2 11/18] arm64: dts: mediatek: mt7988: add chosen node on bpi-r4

Am 2. Dezember 2024 14:46:24 MEZ schrieb Krzysztof Kozlowski <[email protected]>:

Quoted 18 lines · Frank Wunderlich
Quoted 17 lines

From: Frank Wunderlich <[email protected]>

Add chosen node on Bananapi R4 board with stdout and default bootargs.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +0 -0
index 9037f35857a9..1c2a806f6f6c 100644
@@ -9,6 +9,11 @@ / {
 	model = "Banana Pi BPI-R4";
 	chassis-type = "embedded";
 
Quoted 5 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts / { · line 14

Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +3 -0
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1";

Drop or merge into stdout path.

Have you an example to pass speed setting to stdout-path? As it is only a phandle it is not clear to me how to merge these 2...

Quoted 2 lines

Best regards,
Krzysztof

regards Frank

#29 lore raw

Re: [PATCH v2 11/18] arm64: dts: mediatek: mt7988: add chosen node on bpi-r4

Quoted 19 lines · Frank Wunderlich

Am 2. Dezember 2024 14:46:24 MEZ schrieb Krzysztof Kozlowski <[email protected]>:

Quoted 18 lines · Frank Wunderlich
Quoted 17 lines

From: Frank Wunderlich <[email protected]>

Add chosen node on Bananapi R4 board with stdout and default bootargs.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +0 -0
index 9037f35857a9..1c2a806f6f6c 100644
@@ -9,6 +9,11 @@ / {
 	model = "Banana Pi BPI-R4";
 	chassis-type = "embedded";
 
Quoted 7 lines
Quoted 5 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts / { · line 14

Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +3 -0
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1";

Drop or merge into stdout path.

Have you an example to pass speed setting to stdout-path? As it is only a phandle it is not clear to me how to merge these 2...

It is really trivial to find, considering that 66% of files have it.

git grep stdout

Best regards,
Krzysztof

#30 lore raw

Aw: Re: [PATCH v2 11/18] arm64: dts: mediatek: mt7988: add chosen node on bpi-r4

regards Frank

&gt; Gesendet: Montag, 2. Dezember 2024 um 16:58
&gt; Von: "Krzysztof Kozlowski" <[email protected]>
&gt; An: "Frank Wunderlich" <[email protected]>, "Rob Herring" <[email protected]>, "Krzysztof Kozlowski" <[email protected]>, "Conor Dooley" <[email protected]>, "Matthias Brugger" <[email protected]>, "AngeloGioacchino Del Regno" <[email protected]> &gt; CC: "Frank Wunderlich" <[email protected]>, [email protected], [email protected], [email protected], [email protected]
&gt; Betreff: Re: [PATCH v2 11/18] arm64: dts: mediatek: mt7988: add chosen node on bpi-r4
&gt;
&gt; On 02/12/2024 15:29, Frank Wunderlich wrote:
&gt; &gt; Am 2. Dezember 2024 14:46:24 MEZ schrieb Krzysztof Kozlowski <[email protected]>:
&gt; &gt;&gt; On 02/12/2024 13:25, Frank Wunderlich wrote:
&gt; &gt;&gt;&gt; From: Frank Wunderlich <[email protected]>
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; Add chosen node on Bananapi R4 board with stdout and default bootargs.
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; Signed-off-by: Frank Wunderlich <[email protected]>
&gt; &gt;&gt;&gt; ---
&gt; &gt;&gt;&gt; arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 5 +++++
&gt; &gt;&gt;&gt; 1 file changed, 5 insertions(+)
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
&gt; &gt;&gt;&gt; index 9037f35857a9..1c2a806f6f6c 100644
&gt; &gt;&gt;&gt; --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
&gt; &gt;&gt;&gt; +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
&gt; &gt;&gt;&gt; @@ -9,6 +9,11 @@ / {
&gt; &gt;&gt;&gt; model = "Banana Pi BPI-R4";
&gt; &gt;&gt;&gt; chassis-type = "embedded";
&gt; &gt;&gt;&gt;
&gt; &gt;&gt;&gt; + chosen {
&gt; &gt;&gt;&gt; + stdout-path = &amp;serial0;
&gt; &gt;&gt;&gt; + bootargs = "console=ttyS0,115200n1";
&gt; &gt;&gt;
&gt; &gt;&gt; Drop or merge into stdout path.
&gt; &gt;
&gt; &gt; Have you an example to pass speed setting to stdout-path? As it is only a phandle it is not clear to me how to merge these 2...
&gt; It is really trivial to find, considering that 66% of files have it.
&gt;
&gt; git grep stdout

thanks, wasn't aware that string is here also accepted...found it ("git grep stdout-path" is much better here :) )

will change both lines to this single one:

stdout-path = "serial0:115200n8";

&gt; Best regards,
&gt; Krzysztof
&gt; </[email protected]></[email protected]></[email protected]></[email protected]></[email protected]></[email protected]></[email protected]></[email protected]></[email protected]></[email protected]></[email protected]>

maintainer Reviewed-by on v2 11/18
#31 lore raw

Re: [PATCH v2 11/18] arm64: dts: mediatek: mt7988: add chosen node on bpi-r4

In reply to Frank Wunderlich

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Add default bootargs and UART stdout

Quoted 4 lines

Add chosen node on Bananapi R4 board with stdout and default bootargs.

Quoted 20 lines
---
  arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +5 -0
index 9037f35857a9..1c2a806f6f6c 100644
@@ -9,6 +9,11 @@ / {
  	model = "Banana Pi BPI-R4";
  	chassis-type = "embedded";
 
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1";
+	};
+
  	reg_1p8v: regulator-1p8v {
  		compatible = "regulator-fixed";
  		regulator-name = "fixed-1.8V";
#32 lore raw

PATCH v2 12/18 arm64: dts: mediatek: mt7988: add missing clock-div property for i2c

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

I2C binding requires clock-div property.

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +3 -0
index abf81a7d02a5..956f2be600a2 100644
@@ -274,6 +274,7 @@ i2c@11003000 {
 			reg = <0 0x11003000 0 0x1000>,
 			      <0 0x10217080 0 0x80>;
 			interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+			clock-div = <1>;
 			clocks = <&infracfg CLK_INFRA_I2C_BCK>,
 				 <&infracfg CLK_INFRA_66M_AP_DMA_BCK>;
 			clock-names = "main", "dma";
@@ -287,6 +288,7 @@ i2c@11004000 {
 			reg = <0 0x11004000 0 0x1000>,
 			      <0 0x10217100 0 0x80>;
 			interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
+			clock-div = <1>;
 			clocks = <&infracfg CLK_INFRA_I2C_BCK>,
 				 <&infracfg CLK_INFRA_66M_AP_DMA_BCK>;
 			clock-names = "main", "dma";
@@ -300,6 +302,7 @@ i2c@11005000 {
 			reg = <0 0x11005000 0 0x1000>,
 			      <0 0x10217180 0 0x80>;
 			interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+			clock-div = <1>;
 			clocks = <&infracfg CLK_INFRA_I2C_BCK>,
 				 <&infracfg CLK_INFRA_66M_AP_DMA_BCK>;
 			clock-names = "main", "dma";
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 12/18
#33 lore raw

Re: [PATCH v2 12/18] arm64: dts: mediatek: mt7988: add missing clock-div property for i2c

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

I2C binding requires clock-div property.

Can you please group all of the DTSI commits at the beginning, and all of the BPI-R4 commits after?
Of course, do that *only* where possible - like, this one can be moved as it is only touching the dtsi and *nothing else*.

...Besides, this commit also needs a Fixes tag ;-)

After adding the relevant Fixes tag:

#34 lore raw

PATCH v2 13/18 arm64: dts: mediatek: mt7988: add i2c to bpi-r4 board

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add basic i2c nodes to bananapi R4 board.

---
 .../boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts    | 12 ++++++++++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi            |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +12 -0
index 1c2a806f6f6c..13ca016d6a67 100644
@@ -61,6 +61,18 @@ cpu_trip_active_low: active-low {
 	};
 };
 
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins>;
+	status = "okay";
+};
+
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_1_pins>;
+	status = "okay";
+};
+
 &pio {
 	mdio0_pins: mdio0-pins {
 		mux {
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +3 -3
index 956f2be600a2..eebbdfe55774 100644
@@ -269,7 +269,7 @@ serial@11000200 {
 			status = "disabled";
 		};
 
-		i2c@11003000 {
+		i2c0: i2c@11003000 {
 			compatible = "mediatek,mt7981-i2c";
 			reg = <0 0x11003000 0 0x1000>,
 			      <0 0x10217080 0 0x80>;
@@ -283,7 +283,7 @@ i2c@11003000 {
 			status = "disabled";
 		};
 
-		i2c@11004000 {
+		i2c1: i2c@11004000 {
 			compatible = "mediatek,mt7981-i2c";
 			reg = <0 0x11004000 0 0x1000>,
 			      <0 0x10217100 0 0x80>;
@@ -297,7 +297,7 @@ i2c@11004000 {
 			status = "disabled";
 		};
 
-		i2c@11005000 {
+		i2c2: i2c@11005000 {
 			compatible = "mediatek,mt7981-i2c";
 			reg = <0 0x11005000 0 0x1000>,
 			      <0 0x10217180 0 0x80>;
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 13/18
#35 lore raw

Re: [PATCH v2 13/18] arm64: dts: mediatek: mt7988: add i2c to bpi-r4 board

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add basic i2c nodes to bananapi R4 board.

arm64: dts: mediatek: mt7988a-bpi-r4: Enable I2C controllers

Enable the I2C0, I2C2 controllers found on the BananaPi R4 board; these controllers are accessible at ... I don't know, a header on the board?

After which,

#36 lore raw

Re: [PATCH v2 13/18] arm64: dts: mediatek: mt7988: add i2c to bpi-r4 board

Am 3. Dezember 2024 10:40:38 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 11 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add basic i2c nodes to bananapi R4 board.

arm64: dts: mediatek: mt7988a-bpi-r4: Enable I2C controllers

Enable the I2C0, I2C2 controllers found on the BananaPi R4 board; these controllers are accessible at ... I don't know, a header on the board?

These 2 i2c have directly connected spare devices (pmic on i2c0 and i2c-mux on i2c2 added in later commits to have it a bit cleaner). I2c1 is on gpio header which i have not added to let user choose if he wants i2c option or gpio. I can also add i2c1 to r4 board with the right pinctrl but imho it should be disabled to have gpio function default.

Quoted 5 lines

After which,

regards Frank

#37 lore raw

Re: [PATCH v2 13/18] arm64: dts: mediatek: mt7988: add i2c to bpi-r4 board

Il 03/12/24 11:58, Frank Wunderlich ha scritto:

Quoted 6 lines

Am 3. Dezember 2024 10:40:38 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 5 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 4 lines

From: Frank Wunderlich <[email protected]>

Add basic i2c nodes to bananapi R4 board.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

arm64: dts: mediatek: mt7988a-bpi-r4: Enable I2C controllers

Enable the I2C0, I2C2 controllers found on the BananaPi R4 board; these controllers are accessible at ... I don't know, a header on the board?

These 2 i2c have directly connected spare devices (pmic on i2c0 and i2c-mux on i2c2 added in later commits to have it a bit cleaner). I2c1 is on gpio header which i have not added to let user choose if he wants i2c option or gpio. I can also add i2c1 to r4 board with the right pinctrl but imho it should be disabled to have gpio function default.

And again, you should really add all that information to the commit description, as that not only helps me to review your submission, but also helps other people checking the commit history....!

Cheers

Quoted 9 lines
Quoted 6 lines

After which,

regards Frank

#38 lore raw

Re: [PATCH v2 13/18] arm64: dts: mediatek: mt7988: add i2c to bpi-r4 board

Am 2024-12-03 15:22, schrieb AngeloGioacchino Del Regno:

Quoted 11 lines

Il 03/12/24 11:58, Frank Wunderlich ha scritto:

Quoted 10 lines

Am 3. Dezember 2024 10:40:38 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 9 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Add basic i2c nodes to bananapi R4 board.

arm64: dts: mediatek: mt7988a-bpi-r4: Enable I2C controllers

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Enable the I2C0, I2C2 controllers found on the BananaPi R4 board; these controllers are accessible at ... I don't know, a header on the board?

These 2 i2c have directly connected spare devices (pmic on i2c0 and i2c-mux on i2c2 added in later commits to have it a bit cleaner). I2c1 is on gpio header which i have not added to let user choose if he wants i2c option or gpio. I can also add i2c1 to r4 board with the right pinctrl but imho it should be disabled to have gpio function default.

And again, you should really add all that information to the commit description, as that not only helps me to review your submission, but also helps other people checking the commit history....!

this ine i would rephrase like this

arm64: dts: mediatek: mt7988a-bpi-r4: Enable I2C controllers

Enable the I2C0, I2C2 controllers found on the BananaPi R4 board. Both controllers are not accessible from user and having fixed spare devices. I2C0 have a pmic connected, I2C2 is used with
I2C-multiplexer
for e.g. SFP cages.
The missing I2C1 is connected to GPIO header which can have either
GPIO
mode or I2C mode.

Quoted 11 lines

Cheers

Quoted 9 lines
Quoted 6 lines

After which,

regards Frank

#39 lore raw

PATCH v2 14/18 arm64: dts: mediatek: mt7988: add pmic on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

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

---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +51 -0
index 13ca016d6a67..bc1ec73b8ddd 100644
@@ -2,6 +2,8 @@
 
 /dts-v1/;
 
+#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
 #include "mt7988a.dtsi"
 
 / {
@@ -65,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 = <850000>;
+				regulator-max-microvolt = <850000>;
+				regulator-allowed-modes =
+				<RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+			ldo {
+				regulator-name = "rt5190a-ldo";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
 };
 
 &i2c2 {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 14/18
#40 lore raw

Re: [PATCH v2 14/18] arm64: dts: mediatek: mt7988: add pmic on bpi-r4

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC

The BananaPi R4 board has a MediaTek MT8862A 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.

Quoted 30 lines

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

---
  .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 51 +++++++++++++++++++
  1 file changed, 51 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +7 -0
index 13ca016d6a67..bc1ec73b8ddd 100644
@@ -2,6 +2,8 @@
 
  /dts-v1/;
 
+#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
  #include "mt7988a.dtsi"
 
  / {
@@ -65,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>;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts &i2c0 { · line 84

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +10 -0
+		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>;

Does it work like that?

regulator-allowed-modes = <RT5190A_OPMODE_AUTO>,

			  <RT5190A_OPMODE_FPWM>;

If yes, please write it like that - if not, I'm sad - but regardless

#41 lore raw

Re: [PATCH v2 14/18] arm64: dts: mediatek: mt7988: add pmic on bpi-r4

Am 3. Dezember 2024 10:40:35 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 52 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988a-bpi-r4: Add MediaTek MT6682A/RT5190A PMIC

The BananaPi R4 board has a MediaTek MT8862A 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.

Quoted 27 lines

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

---
  .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 51 +++++++++++++++++++
  1 file changed, 51 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +6 -0
index 13ca016d6a67..bc1ec73b8ddd 100644
@@ -2,6 +2,8 @@
    /dts-v1/;
  +#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
  #include "mt7988a.dtsi"
    / {
@@ -65,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>;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts &i2c0 { · line 84

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +10 -0
+		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>;

Does it work like that?

Quoted 2 lines

regulator-allowed-modes = <RT5190A_OPMODE_AUTO>,

			  <RT5190A_OPMODE_FPWM>;

It seems working, dtbs_check accepts it and i can boot up with this change and see no errors caused by it.

Quoted 4 lines

If yes, please write it like that - if not, I'm sad - but regardless

regards Frank

#42 lore raw

PATCH v2 15/18 arm64: dts: mediatek: mt7988: add proc-supply for cpus on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

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

---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts     | 16 ++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi        |  8 ++++----
 2 files changed, 20 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +16 -0
index bc1ec73b8ddd..550c373b3d70 100644
@@ -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 {
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +4 -4
index eebbdfe55774..93c21a5248fa 100644
@@ -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";
Signature · 1 line
2.43.0
#44 lore raw

PATCH v2 16/18 arm64: dts: mediatek: mt7988: add i2c-mux on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Bananapi R4 uses an i2c multiplexer for SFP slots, rtc and eeprom. Add its node to the right i2c controller.

---

---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +40 -0
index 550c373b3d70..9ceefc990000 100644
@@ -2,6 +2,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
 
 #include "mt7988a.dtsi"
@@ -138,6 +139,45 @@ &i2c2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c2_1_pins>;
 	status = "okay";
+
+	pca9545: i2c-mux@70 {
+		reg = <0x70>;
+		compatible = "nxp,pca9545";
+		reset-gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		i2c@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;
+
+			pcf8563: rtc@51 {
+				compatible = "nxp,pcf8563";
+				reg = <0x51>;
+				#clock-cells = <0>;
+			};
+
+			eeprom@57 {
+				compatible = "atmel,24c02";
+				reg = <0x57>;
+				size = <256>;
+			};
+
+		};
+
+		i2c_sfp1: i2c@1 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <1>;
+		};
+
+		i2c_sfp2: i2c@2 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <2>;
+		};
+	};
 };
 
 &pio {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 16/18
#45 lore raw

Re: [PATCH v2 16/18] arm64: dts: mediatek: mt7988: add i2c-mux on bpi-r4

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 2 lines

From: Frank Wunderlich <[email protected]>

arm64: dts: mediatek: mt7988-bpi-r4: Add PCA9545 I2C Mux

Quoted 22 lines

Bananapi R4 uses an i2c multiplexer for SFP slots, rtc and eeprom. Add its node to the right i2c controller.

---

---
  .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts  | 40 +++++++++++++++++++
  1 file changed, 40 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +1 -0
index 550c373b3d70..9ceefc990000 100644
@@ -2,6 +2,7 @@
 
  /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
  #include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
 
  #include "mt7988a.dtsi"

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts &i2c2 { · line 145

Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +4 -0
@@ -138,6 +139,45 @@ &i2c2 {
  	pinctrl-names = "default";
  	pinctrl-0 = <&i2c2_1_pins>;
  	status = "okay";
+
+	pca9545: i2c-mux@70 {
+		reg = <0x70>;
+		compatible = "nxp,pca9545";

reg goes after compatible... :-)

After which

#46 lore raw

PATCH v2 17/18 arm64: dts: mediatek: mt7988: enable ssusb1 on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Enable front-usb on Bananapi R4 board.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 4 ++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi                | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +4 -0
index 9ceefc990000..12b45b18955b 100644
@@ -373,6 +373,10 @@ &serial0 {
 	status = "okay";
 };
 
+&ssusb1 {
+	status = "okay";
+};
+
 &watchdog {
 	status = "okay";
 };
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
index 93c21a5248fa..2be84acac06a 100644
@@ -336,7 +336,7 @@ usb@11190000 {
 			clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck";
 		};
 
-		usb@11200000 {
+		ssusb1: usb@11200000 {
 			compatible = "mediatek,mt7988-xhci", "mediatek,mtk-xhci";
 			reg = <0 0x11200000 0 0x2e00>,
 			      <0 0x11203e00 0 0x0100>;
Signature · 1 line
2.43.0
#48 lore raw

Re: [PATCH v2 17/18] arm64: dts: mediatek: mt7988: enable ssusb1 on bpi-r4

Am 2024-12-03 10:40, schrieb AngeloGioacchino Del Regno:

Quoted 8 lines

Il 02/12/24 13:25, Frank Wunderlich ha scritto:

Quoted 5 lines

From: Frank Wunderlich <[email protected]>

Enable front-usb on Bananapi R4 board.

thanks, but i noticed, that the controllers in dtsi are not disabled like in my final dtsi. Imho controllers should be disabled by default and only enabled when used on board. Should i add disabling in this patch too?

and i noticed that usb phys have to be added to get working usb. Here for ssusb1 a tphy is used where i now have prepared patch so i can add it in next version (reusing mt7986 compatible). ssusb0 uses a different phy (xsphy) which needs a bit more work before (driver and binding change).

regards Frank

#49 lore raw

PATCH v2 18/18 arm64: dts: mediatek: mt7988: enable pwm on bpi-r4

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Enable pwm on Bananapi R4 board.

---
 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 4 ++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi                | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +4 -0
index 12b45b18955b..181bb997cd8d 100644
@@ -369,6 +369,10 @@ mux {
 	};
 };
 
+&pwm {
+	status = "okay";
+};
+
 &serial0 {
 	status = "okay";
 };
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
index 2be84acac06a..11651f5e167d 100644
@@ -211,7 +211,7 @@ mux {
 			};
 		};
 
-		pwm@10048000 {
+		pwm: pwm@10048000 {
 			compatible = "mediatek,mt7988-pwm";
 			reg = <0 0x10048000 0 0x1000>;
 			clocks = <&infracfg CLK_INFRA_66M_PWM_BCK>,
Signature · 1 line
2.43.0