Skip to contentSkip to conversation

Add Display support

PATCH Superseded Biju Das 3 participants 19 messages Oct 1, 2019 – Oct 2, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Biju Das

author
#0 lore raw

cover Add Display support

This patch adds display support for hihope RZ/G2N board.

This patch depend upon
https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=177939

Biju Das (8):
arm64: dts: renesas: hihope-common: Move du clk properties out of
common dtsi
arm64: dts: renesas: r8a774b1: Add DU device to DT
arm64: dts: renesas: r8a774b1: Add HDMI encoder instance
arm64: dts: renesas: r8a774b1-hihope-rzg2n: Add display clock
properties
arm64: dts: renesas: r8a774b1: Add FDP1 device nodes
arm64: dts: renesas: r8a774b1: Add PWM device nodes
arm64: dts: renesas: hihope-rzg2-ex: Enable backlight
arm64: dts: renesas: hihope-rzg2-ex: Add LVDS panel support

 arch/arm64/boot/dts/renesas/hihope-common.dtsi     |   8 --
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi    |  50 ++++++++
 .../boot/dts/renesas/r8a774a1-hihope-rzg2m.dts     |  11 ++
 .../boot/dts/renesas/r8a774b1-hihope-rzg2n.dts     |  11 ++
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi          | 133 +++++++++++++++++++++
 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi   |  37 ++++++
 6 files changed, 242 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/8 arm64: dts: renesas: hihope-common: Move du clk properties out of common dtsi

RZ/G2N board is pin compatible with RZ/G2M board. However on the SoC side RZ/G2N uses DU3 where as RZ/G2M uses DU2 for the DPAD. In order to reuse the common dtsi for both the boards, it is required to move du clock properties from common dtsi to board specific dts.

---
 arch/arm64/boot/dts/renesas/hihope-common.dtsi        |  8 --------
 arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dts | 11 +++++++++++
 2 files changed, 11 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/renesas/hihope-common.dtsi +0 -8
index 3e376d2..355d0a2 100644
@@ -142,14 +142,6 @@
 };
 
 &du {
-	clocks = <&cpg CPG_MOD 724>,
-		 <&cpg CPG_MOD 723>,
-		 <&cpg CPG_MOD 722>,
-		 <&versaclock5 1>,
-		 <&x302_clk>,
-		 <&versaclock5 2>;
-	clock-names = "du.0", "du.1", "du.2",
-		      "dclkin.0", "dclkin.1", "dclkin.2";
 	status = "okay";
 };
 
arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dts +11 -0
index 93ca973..96f2fb0 100644
@@ -24,3 +24,14 @@
 		reg = <0x6 0x00000000 0x0 0x80000000>;
 	};
 };
+
+&du {
+	clocks = <&cpg CPG_MOD 724>,
+		 <&cpg CPG_MOD 723>,
+		 <&cpg CPG_MOD 722>,
+		 <&versaclock5 1>,
+		 <&x302_clk>,
+		 <&versaclock5 2>;
+	clock-names = "du.0", "du.1", "du.2",
+		      "dclkin.0", "dclkin.1", "dclkin.2";
+};
Signature · 1 line
2.7.4
Reviewed-by on v1 1/8
#2 lore raw

Re: [PATCH 1/8] arm64: dts: renesas: hihope-common: Move du clk properties out of common dtsi

Hi Biju,

Thank you for the patch.

Quoted 6 lines · Biju Das

RZ/G2N board is pin compatible with RZ/G2M board. However on the SoC side RZ/G2N uses DU3 where as RZ/G2M uses DU2 for the DPAD. In order to reuse the common dtsi for both the boards, it is required to move du clock properties from common dtsi to board specific dts.

It would be nice if DT had a syntax that allowed extending an existing property. It would allow us to write

&du {
	clocks += <&versaclock5 1>,
		  <&x302_clk>,
		  <&versaclock5 2>;
	clock-names += "dclkin.0", "dclkin.1", "dclkin.2";
};

in hihope-common.dtsi and be done with it.

Rob, do you think that's something worth adding ?

In any case, until we have that, this patch looks good to me.

Quoted 43 lines
---
 arch/arm64/boot/dts/renesas/hihope-common.dtsi        |  8 --------
 arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dts | 11 +++++++++++
 2 files changed, 11 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/renesas/hihope-common.dtsi +0 -8
index 3e376d2..355d0a2 100644
@@ -142,14 +142,6 @@
 };
 
 &du {
-	clocks = <&cpg CPG_MOD 724>,
-		 <&cpg CPG_MOD 723>,
-		 <&cpg CPG_MOD 722>,
-		 <&versaclock5 1>,
-		 <&x302_clk>,
-		 <&versaclock5 2>;
-	clock-names = "du.0", "du.1", "du.2",
-		      "dclkin.0", "dclkin.1", "dclkin.2";
 	status = "okay";
 };
 
arch/arm64/boot/dts/renesas/r8a774a1-hihope-rzg2m.dts +11 -0
index 93ca973..96f2fb0 100644
@@ -24,3 +24,14 @@
 		reg = <0x6 0x00000000 0x0 0x80000000>;
 	};
 };
+
+&du {
+	clocks = <&cpg CPG_MOD 724>,
+		 <&cpg CPG_MOD 723>,
+		 <&cpg CPG_MOD 722>,
+		 <&versaclock5 1>,
+		 <&x302_clk>,
+		 <&versaclock5 2>;
+	clock-names = "du.0", "du.1", "du.2",
+		      "dclkin.0", "dclkin.1", "dclkin.2";
+};
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

Re: [PATCH 1/8] arm64: dts: renesas: hihope-common: Move du clk properties out of common dtsi

Hi Laurent,

Quoted 18 lines · Laurent Pinchart
Quoted 6 lines · Biju Das

RZ/G2N board is pin compatible with RZ/G2M board. However on the SoC side RZ/G2N uses DU3 where as RZ/G2M uses DU2 for the DPAD. In order to reuse the common dtsi for both the boards, it is required to move du clock properties from common dtsi to board specific dts.

It would be nice if DT had a syntax that allowed extending an existing property. It would allow us to write

&du {
        clocks += <&versaclock5 1>,
                  <&x302_clk>,
                  <&versaclock5 2>;
        clock-names += "dclkin.0", "dclkin.1", "dclkin.2";
};
Quoted 3 lines

in hihope-common.dtsi and be done with it.

Rob, do you think that's something worth adding ?

Yeah, we already have /delete-property/, but not yet /append-property/.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
author
#4 lore raw

PATCH 2/8 arm64: dts: renesas: r8a774b1: Add DU device to DT

In reply to Biju Das

Add the DU device to r8a774b1 SoC DT.

---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 38 +++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +38 -0
index 9d5630a..777b45d 100644
@@ -1285,7 +1285,18 @@
 		};
 
 		du: display@feb00000 {
+			compatible = "renesas,du-r8a774b1";
 			reg = <0 0xfeb00000 0 0x80000>;
+			interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 724>,
+				 <&cpg CPG_MOD 723>,
+				 <&cpg CPG_MOD 721>;
+			clock-names = "du.0", "du.1", "du.3";
+			status = "disabled";
+
+			vsps = <&vspd0 0>, <&vspd1 0>, <&vspd0 1>;
 
 			ports {
 				#address-cells = <1>;
@@ -1304,6 +1315,33 @@
 				port@2 {
 					reg = <2>;
 					du_out_lvds0: endpoint {
+						remote-endpoint = <&lvds0_in>;
+					};
+				};
+			};
+		};
+
+		lvds0: lvds@feb90000 {
+			compatible = "renesas,r8a774b1-lvds";
+			reg = <0 0xfeb90000 0 0x14>;
+			clocks = <&cpg CPG_MOD 727>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 727>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					lvds0_in: endpoint {
+						remote-endpoint = <&du_out_lvds0>;
+					};
+				};
+				port@1 {
+					reg = <1>;
+					lvds0_out: endpoint {
 					};
 				};
 			};
Signature · 1 line
2.7.4
Reviewed-by on v1 2/8
#5 lore raw

Re: [PATCH 2/8] arm64: dts: renesas: r8a774b1: Add DU device to DT

Hi Biju,

Thank you for the patch.

Quoted 3 lines · Biju Das

Add the DU device to r8a774b1 SoC DT.

Quoted 61 lines
---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 38 +++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +38 -0
index 9d5630a..777b45d 100644
@@ -1285,7 +1285,18 @@
 		};
 
 		du: display@feb00000 {
+			compatible = "renesas,du-r8a774b1";
 			reg = <0 0xfeb00000 0 0x80000>;
+			interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 724>,
+				 <&cpg CPG_MOD 723>,
+				 <&cpg CPG_MOD 721>;
+			clock-names = "du.0", "du.1", "du.3";
+			status = "disabled";
+
+			vsps = <&vspd0 0>, <&vspd1 0>, <&vspd0 1>;
 
 			ports {
 				#address-cells = <1>;
@@ -1304,6 +1315,33 @@
 				port@2 {
 					reg = <2>;
 					du_out_lvds0: endpoint {
+						remote-endpoint = <&lvds0_in>;
+					};
+				};
+			};
+		};
+
+		lvds0: lvds@feb90000 {
+			compatible = "renesas,r8a774b1-lvds";
+			reg = <0 0xfeb90000 0 0x14>;
+			clocks = <&cpg CPG_MOD 727>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 727>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					lvds0_in: endpoint {
+						remote-endpoint = <&du_out_lvds0>;
+					};
+				};
+				port@1 {
+					reg = <1>;
+					lvds0_out: endpoint {
 					};
 				};
 			};
Signature · 3 lines
Regards,

Laurent Pinchart
author
#6 lore raw

PATCH 3/8 arm64: dts: renesas: r8a774b1: Add HDMI encoder instance

In reply to Biju Das

Add the HDMI encoder to the R8A774B1 DT in disabled state.

---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +15 -0
index 777b45d..979be5a 100644
@@ -1267,7 +1267,16 @@
 		};
 
 		hdmi0: hdmi@fead0000 {
+			compatible = "renesas,r8a774b1-hdmi",
+				     "renesas,rcar-gen3-hdmi";
 			reg = <0 0xfead0000 0 0x10000>;
+			interrupts = <GIC_SPI 389 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 729>,
+				 <&cpg CPG_CORE R8A774B1_CLK_HDMI>;
+			clock-names = "iahb", "isfr";
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 729>;
+			status = "disabled";
 
 			ports {
 				#address-cells = <1>;
@@ -1276,11 +1285,16 @@
 				port@0 {
 					reg = <0>;
 					dw_hdmi0_in: endpoint {
+						remote-endpoint = <&du_out_hdmi0>;
 					};
 				};
 				port@1 {
 					reg = <1>;
 				};
+				port@2 {
+					/* HDMI sound */
+					reg = <2>;
+				};
 			};
 		};
 
@@ -1310,6 +1324,7 @@
 				port@1 {
 					reg = <1>;
 					du_out_hdmi0: endpoint {
+						remote-endpoint = <&dw_hdmi0_in>;
 					};
 				};
 				port@2 {
Signature · 1 line
2.7.4
Reviewed-by on v1 3/8
#7 lore raw

Re: [PATCH 3/8] arm64: dts: renesas: r8a774b1: Add HDMI encoder instance

Hi Biju,

Thank you for the patch.

Quoted 3 lines · Biju Das

Add the HDMI encoder to the R8A774B1 DT in disabled state.

Quoted 50 lines
---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +15 -0
index 777b45d..979be5a 100644
@@ -1267,7 +1267,16 @@
 		};
 
 		hdmi0: hdmi@fead0000 {
+			compatible = "renesas,r8a774b1-hdmi",
+				     "renesas,rcar-gen3-hdmi";
 			reg = <0 0xfead0000 0 0x10000>;
+			interrupts = <GIC_SPI 389 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 729>,
+				 <&cpg CPG_CORE R8A774B1_CLK_HDMI>;
+			clock-names = "iahb", "isfr";
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 729>;
+			status = "disabled";
 
 			ports {
 				#address-cells = <1>;
@@ -1276,11 +1285,16 @@
 				port@0 {
 					reg = <0>;
 					dw_hdmi0_in: endpoint {
+						remote-endpoint = <&du_out_hdmi0>;
 					};
 				};
 				port@1 {
 					reg = <1>;
 				};
+				port@2 {
+					/* HDMI sound */
+					reg = <2>;
+				};
 			};
 		};
 
@@ -1310,6 +1324,7 @@
 				port@1 {
 					reg = <1>;
 					du_out_hdmi0: endpoint {
+						remote-endpoint = <&dw_hdmi0_in>;
 					};
 				};
 				port@2 {
Signature · 3 lines
Regards,

Laurent Pinchart
author
#8 lore raw

PATCH 4/8 arm64: dts: renesas: r8a774b1-hihope-rzg2n: Add display clock properties

In reply to Biju Das

Add display clock properties for the HiHope RZ/G2N board.

---
 arch/arm64/boot/dts/renesas/r8a774b1-hihope-rzg2n.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1-hihope-rzg2n.dts +11 -0
index c9e2119..9910c1a 100644
@@ -25,6 +25,17 @@
 	};
 };
 
+&du {
+	clocks = <&cpg CPG_MOD 724>,
+		 <&cpg CPG_MOD 723>,
+		 <&cpg CPG_MOD 721>,
+		 <&versaclock5 1>,
+		 <&x302_clk>,
+		 <&versaclock5 2>;
+	clock-names = "du.0", "du.1", "du.3",
+		      "dclkin.0", "dclkin.1", "dclkin.3";
+};
+
 &sdhi3 {
 	mmc-hs400-1_8v;
 };
Signature · 1 line
2.7.4
Reviewed-by on v1 4/8
#9 lore raw

Re: [PATCH 4/8] arm64: dts: renesas: r8a774b1-hihope-rzg2n: Add display clock properties

Hi Biju,

Thank you for the patch.

Quoted 3 lines · Biju Das

Add display clock properties for the HiHope RZ/G2N board.

Quoted 26 lines
---
 arch/arm64/boot/dts/renesas/r8a774b1-hihope-rzg2n.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1-hihope-rzg2n.dts +11 -0
index c9e2119..9910c1a 100644
@@ -25,6 +25,17 @@
 	};
 };
 
+&du {
+	clocks = <&cpg CPG_MOD 724>,
+		 <&cpg CPG_MOD 723>,
+		 <&cpg CPG_MOD 721>,
+		 <&versaclock5 1>,
+		 <&x302_clk>,
+		 <&versaclock5 2>;
+	clock-names = "du.0", "du.1", "du.3",
+		      "dclkin.0", "dclkin.1", "dclkin.3";
+};
+
 &sdhi3 {
 	mmc-hs400-1_8v;
 };
Signature · 3 lines
Regards,

Laurent Pinchart
author
#10 lore raw

PATCH 5/8 arm64: dts: renesas: r8a774b1: Add FDP1 device nodes

In reply to Biju Das

The r8a774b1 has a single FDP1 instance.

---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +10 -0
index 979be5a..93b2e88 100644
@@ -1182,6 +1182,16 @@
 			/* placeholder */
 		};
 
+		fdp1@fe940000 {
+			compatible = "renesas,fdp1";
+			reg = <0 0xfe940000 0 0x2400>;
+			interrupts = <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 119>;
+			power-domains = <&sysc R8A774B1_PD_A3VP>;
+			resets = <&cpg 119>;
+			renesas,fcp = <&fcpf0>;
+		};
+
 		fcpf0: fcp@fe950000 {
 			compatible = "renesas,fcpf";
 			reg = <0 0xfe950000 0 0x200>;
Signature · 1 line
2.7.4
Reviewed-by on v1 5/8
#11 lore raw

Re: [PATCH 5/8] arm64: dts: renesas: r8a774b1: Add FDP1 device nodes

Hi Biju,

Thank you for the patch.

Quoted 3 lines · Biju Das

The r8a774b1 has a single FDP1 instance.

Quoted 25 lines
---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +10 -0
index 979be5a..93b2e88 100644
@@ -1182,6 +1182,16 @@
 			/* placeholder */
 		};
 
+		fdp1@fe940000 {
+			compatible = "renesas,fdp1";
+			reg = <0 0xfe940000 0 0x2400>;
+			interrupts = <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 119>;
+			power-domains = <&sysc R8A774B1_PD_A3VP>;
+			resets = <&cpg 119>;
+			renesas,fcp = <&fcpf0>;
+		};
+
 		fcpf0: fcp@fe950000 {
 			compatible = "renesas,fcpf";
 			reg = <0 0xfe950000 0 0x200>;
Signature · 3 lines
Regards,

Laurent Pinchart
author
#12 lore raw

PATCH 6/8 arm64: dts: renesas: r8a774b1: Add PWM device nodes

In reply to Biju Das

This patch adds PWM device nodes to r8a774b1 SoC DT.

---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 70 +++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +70 -0
index 93b2e88..538e9ce 100644
@@ -940,6 +940,76 @@
 			/* placeholder */
 		};
 
+		pwm0: pwm@e6e30000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e30000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm1: pwm@e6e31000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e31000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm2: pwm@e6e32000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e32000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm3: pwm@e6e33000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e33000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm4: pwm@e6e34000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e34000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm5: pwm@e6e35000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e35000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm6: pwm@e6e36000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e36000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
 		scif0: serial@e6e60000 {
 			compatible = "renesas,scif-r8a774b1",
 				     "renesas,rcar-gen3-scif", "renesas,scif";
Signature · 1 line
2.7.4
Reviewed-by on v1 6/8
#13 lore raw

Re: [PATCH 6/8] arm64: dts: renesas: r8a774b1: Add PWM device nodes

Hi Biju,

Thank you for the patch.

Quoted 3 lines · Biju Das

This patch adds PWM device nodes to r8a774b1 SoC DT.

Quoted 85 lines
---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 70 +++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
arch/arm64/boot/dts/renesas/r8a774b1.dtsi +70 -0
index 93b2e88..538e9ce 100644
@@ -940,6 +940,76 @@
 			/* placeholder */
 		};
 
+		pwm0: pwm@e6e30000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e30000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm1: pwm@e6e31000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e31000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm2: pwm@e6e32000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e32000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm3: pwm@e6e33000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e33000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm4: pwm@e6e34000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e34000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm5: pwm@e6e35000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e35000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
+		pwm6: pwm@e6e36000 {
+			compatible = "renesas,pwm-r8a774b1", "renesas,pwm-rcar";
+			reg = <0 0xe6e36000 0 0x8>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 523>;
+			resets = <&cpg 523>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
 		scif0: serial@e6e60000 {
 			compatible = "renesas,scif-r8a774b1",
 				     "renesas,rcar-gen3-scif", "renesas,scif";
Signature · 3 lines
Regards,

Laurent Pinchart
author
#14 lore raw

PATCH 7/8 arm64: dts: renesas: hihope-rzg2-ex: Enable backlight

In reply to Biju Das

This patch enables backlight support.

---
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +20 -0
index 4280b19..70f9a2a 100644
@@ -13,6 +13,14 @@
 	chosen {
 		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
 	};
+
+	backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm0 0 50000>;
+
+		brightness-levels = <0 2 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+	};
 };
 
 &avb {
@@ -82,4 +90,16 @@
 		groups = "can1_data";
 		function = "can1";
 	};
+
+	pwm0_pins: pwm0 {
+		groups = "pwm0";
+		function = "pwm0";
+	};
+};
+
+&pwm0 {
+	pinctrl-0 = <&pwm0_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
 };
Signature · 1 line
2.7.4
Reviewed-by on v1 7/8
#15 lore raw

Re: [PATCH 7/8] arm64: dts: renesas: hihope-rzg2-ex: Enable backlight

Hi Biju,

Thank you for the patch.

Quoted 3 lines · Biju Das

This patch enables backlight support.

Quoted 40 lines
---
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +20 -0
index 4280b19..70f9a2a 100644
@@ -13,6 +13,14 @@
 	chosen {
 		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
 	};
+
+	backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm0 0 50000>;
+
+		brightness-levels = <0 2 8 16 32 64 128 255>;
+		default-brightness-level = <6>;
+	};
 };
 
 &avb {
@@ -82,4 +90,16 @@
 		groups = "can1_data";
 		function = "can1";
 	};
+
+	pwm0_pins: pwm0 {
+		groups = "pwm0";
+		function = "pwm0";
+	};
+};
+
+&pwm0 {
+	pinctrl-0 = <&pwm0_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
 };
Signature · 3 lines
Regards,

Laurent Pinchart
author
#16 lore raw

PATCH 8/8 arm64: dts: renesas: hihope-rzg2-ex: Add LVDS panel support

In reply to Biju Das

This patch adds support for Advantech idk-1110wr LVDS panel. The HiHope RZ/G2[MN] is advertised as compatible with panel idk-1110wr from Advantech, however the panel isn't sold alongside the board.

---
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi  | 30 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi | 37 ++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +30 -0
index 70f9a2a..ae1ef2d 100644
@@ -5,6 +5,8 @@
  * Copyright (C) 2019 Renesas Electronics Corp.
  */
 
+#include "rzg2-panel-lvds.dtsi"
+
 / {
 	aliases {
 		ethernet0 = &avb;
@@ -51,6 +53,34 @@
 	status = "okay";
 };
 
+&gpio1 {
+	/*
+	 * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
+	 * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
+	 */
+	lvds-connector-en-gpio {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "lvds-connector-en-gpio";
+	};
+};
+
+&lvds0 {
+	/* Uncomment  below line to enable lvds panel connected to RZ/G2N board
+	 */
+
+	/* status = "okay"; */
+
+	ports {
+		port@1 {
+			lvds_connector: endpoint {
+				remote-endpoint = <&panel_in_advantech_idk_1110wr>;
+			};
+		};
+	};
+};
+
 &pciec0 {
 	status = "okay";
 };
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +37 -0
new file mode 100644
index 0000000..768a8ec
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the LVDS panels connected to RZ/G2 boards
+ *
+ * Copyright (C) 2019 Renesas Electronics Corp.
+ */
+
+/ {
+
+	panel-lvds {
+		compatible = "advantech,idk-1110wr", "panel-lvds";
+
+		width-mm = <223>;
+		height-mm = <125>;
+
+		data-mapping = "jeida-24";
+
+		panel-timing {
+			/* 1024x600 @60Hz */
+			clock-frequency = <51200000>;
+			hactive = <1024>;
+			vactive = <600>;
+			hsync-len = <240>;
+			hfront-porch = <40>;
+			hback-porch = <40>;
+			vfront-porch = <15>;
+			vback-porch = <10>;
+			vsync-len = <10>;
+		};
+
+		port {
+			panel_in_advantech_idk_1110wr: endpoint {
+				remote-endpoint = <&lvds_connector>;
+			};
+		};
+	};
+};
Signature · 1 line
2.7.4
#17 lore raw

Re: [PATCH 8/8] arm64: dts: renesas: hihope-rzg2-ex: Add LVDS panel support

Hi Biju,

Thank you for the patch.

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi

Quoted 64 lines · Biju Das

This patch adds support for Advantech idk-1110wr LVDS panel. The HiHope RZ/G2[MN] is advertised as compatible with panel idk-1110wr from Advantech, however the panel isn't sold alongside the board.

---
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi  | 30 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi | 37 ++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +30 -0
index 70f9a2a..ae1ef2d 100644
@@ -5,6 +5,8 @@
  * Copyright (C) 2019 Renesas Electronics Corp.
  */
 
+#include "rzg2-panel-lvds.dtsi"
+
 / {
 	aliases {
 		ethernet0 = &avb;
@@ -51,6 +53,34 @@
 	status = "okay";
 };
 
+&gpio1 {
+	/*
+	 * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
+	 * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
+	 */
+	lvds-connector-en-gpio {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "lvds-connector-en-gpio";
+	};
+};
+
+&lvds0 {
+	/* Uncomment  below line to enable lvds panel connected to RZ/G2N board
+	 */
+
+	/* status = "okay"; */
+
+	ports {
+		port@1 {
+			lvds_connector: endpoint {
+				remote-endpoint = <&panel_in_advantech_idk_1110wr>;
+			};
+		};
+	};
+};
+
 &pciec0 {
 	status = "okay";
 };
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +0 -0
new file mode 100644
index 0000000..768a8ec

Should this be named according to the panel name istead of just "panel-lvds" ? It could be used by any board, and this board could also use a different LVDS panel.

Quoted 23 lines
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +22 -0
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the LVDS panels connected to RZ/G2 boards
+ *
+ * Copyright (C) 2019 Renesas Electronics Corp.
+ */
+
+/ {
+
+	panel-lvds {
+		compatible = "advantech,idk-1110wr", "panel-lvds";
+
+		width-mm = <223>;
+		height-mm = <125>;
+
+		data-mapping = "jeida-24";
+
+		panel-timing {
+			/* 1024x600 @60Hz */
+			clock-frequency = <51200000>;
+			hactive = <1024>;
+			vactive = <600>;

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi line 32

Quoted 10 lines
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +10 -0
+			hsync-len = <240>;
+			hfront-porch = <40>;
+			hback-porch = <40>;
+			vfront-porch = <15>;
+			vback-porch = <10>;
+			vsync-len = <10>;
+		};
+
+		port {
+			panel_in_advantech_idk_1110wr: endpoint {

Could we abbreviate the label name to panel_in ? That way the board .dts wouldn't need to update the remote-endpoint phandle to use a different panel, only the #include would need to be changed.

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi line 37

Quoted 5 lines
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +5 -0
+				remote-endpoint = <&lvds_connector>;
+			};
+		};
+	};
+};

For the same reason I would set the remote-endpoint for &lvds_connector here. See arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi for an example.

Signature · 3 lines
Regards,

Laurent Pinchart
author
#18 lore raw

RE: [PATCH 8/8] arm64: dts: renesas: hihope-rzg2-ex: Add LVDS panel support

Hi Laurent,

Thanks for your feedback.

Quoted 74 lines

Subject: Re: [PATCH 8/8] arm64: dts: renesas: hihope-rzg2-ex: Add LVDS panel support

Hi Biju,

Thank you for the patch.

Quoted 8 lines · Biju Das

This patch adds support for Advantech idk-1110wr LVDS panel. The HiHope RZ/G2[MN] is advertised as compatible with panel idk-1110wr from Advantech, however the panel isn't sold alongside the board.

---
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi  | 30

+++++++++++++++++++ arch/arm64/boot/dts/renesas/rzg2-panel-

lvds.dtsi

Quoted 27 lines

| 37 ++++++++++++++++++++++++

 2 files changed, 67 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +7 -0
index 70f9a2a..ae1ef2d 100644
@@ -5,6 +5,8 @@
  * Copyright (C) 2019 Renesas Electronics Corp.
  */
 
+#include "rzg2-panel-lvds.dtsi"
+
 / {
 	aliases {
 		ethernet0 = &avb;
@@ -51,6 +53,34 @@
 	status = "okay";
 };
 
+&gpio1 {
+	/*
+	 * When GP1_20 is LOW LVDS0 is connected to the LVDS connector
+	 * When GP1_20 is HIGH LVDS0 is connected to the LT8918L
+	 */

arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi line 70

Quoted 10 lines
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +10 -0
+	lvds-connector-en-gpio {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "lvds-connector-en-gpio";
+	};
+};
+
+&lvds0 {
+	/* Uncomment  below line to enable lvds panel connected to

RZ/G2N board

arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi

Quoted 8 lines
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +8 -0
+	 */
+
+	/* status = "okay"; */
+
+	ports {
+		port@1 {
+			lvds_connector: endpoint {
+				remote-endpoint =

<&panel_in_advantech_idk_1110wr>;

Quoted 10 lines
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +5 -0
+			};
+		};
+	};
+};
+
 &pciec0 {
 	status = "okay";
 };
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi +0 -0
Quoted 8 lines

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi

Quoted 4 lines

new file mode 100644 advantech,idk-2121wr
index 0000000..768a8ec

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +0 -0

Should this be named according to the panel name istead of just "panel-lvds" ? It could be used by any board, and this board could also use a different LVDS panel.

I thought ,we can use a common file for all the LVDS panels used by RZ/G2 boards and refer the panel from board dtsi.
For eg:- RZ/G2[MN] will refer " panel_in_advantech_idk_1110wr" and RZ/G2E will refer " panel_in_advantech_idk_2121wr"
If user wants a different panel, then needs to define panel definitions in this file and use it. But I am not sure it is the right thing to do.

OK. Anyway I will create a panel specific dtsi file and send V2.

Quoted 29 lines
Quoted 29 lines
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +28 -0
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the LVDS panels connected to RZ/G2 boards
+ *
+ * Copyright (C) 2019 Renesas Electronics Corp.
+ */
+
+/ {
+
+	panel-lvds {
+		compatible = "advantech,idk-1110wr", "panel-lvds";
+
+		width-mm = <223>;
+		height-mm = <125>;
+
+		data-mapping = "jeida-24";
+
+		panel-timing {
+			/* 1024x600 @60Hz */
+			clock-frequency = <51200000>;
+			hactive = <1024>;
+			vactive = <600>;
+			hsync-len = <240>;
+			hfront-porch = <40>;
+			hback-porch = <40>;
+			vfront-porch = <15>;
+			vback-porch = <10>;
+			vsync-len = <10>;
Quoted 8 lines

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi line 32

Quoted 4 lines
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +4 -0
+		};
+
+		port {
+			panel_in_advantech_idk_1110wr: endpoint {

Could we abbreviate the label name to panel_in ? That way the board .dts wouldn't need to update the remote-endpoint phandle to use a different panel, only the #include would need to be changed.

OK. Will change this.

Quoted 8 lines

arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi line 37

Quoted 5 lines
arch/arm64/boot/dts/renesas/rzg2-panel-lvds.dtsi new file +5 -0
+				remote-endpoint = <&lvds_connector>;
+			};
+		};
+	};
+};

For the same reason I would set the remote-endpoint for &lvds_connector here. See arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi for an example.

OK. Will add this.

Regards,
Biju