Skip to contentSkip to conversation

arm64: allwinner: Add A64 DE2 HDMI support

PATCH Superseded Jagan Teki 6 participants 50 messages Apr 30, 2018 – May 15, 2018

Subsystems (7)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

cover arm64: allwinner: Add A64 DE2 HDMI support

Allwinner A64 has display engine pipeline like other Allwinner SOC's A83T/H3/H5.

A64 DE2 behaviour similar to Allwinner A83T where mixer0, connected to tcon0 with RGB, LVDS MIPI-DSI and mixer1, connected to tcon1 with HDMI as per Display System Block DiagramAllwinner_A64_User_Manual_V1.1.pdf

This is the first series on Allwinner A64 DE2 HDMI support which followed with previous RFC series [1] (thanks to Maxime, Jernej for comments on RFC series) and rest will add in future patches.

patch 1: dt-bindings for a64 de2 ccu

patch 2: add node support for a64 de2 ccu

patch 3: enable DE2_CCU for Allwinner 64-bit SoCs

patch 4: dt-bindings for a64 de2 pipeline

patch 5: add support for a64 de2

patch 6: defconfig: enable CONFIG_DRM_SUN4I

patch 7 -8: dt-bindings for a64 HDMI and HDMI PHY

patch 9: add support for a64 HDMI

patch 10: enable DesignWare HDMI for Allwinner 64-bit SoCs

patch 11 - 12: dt-bindings for a64 mixer1 and tcon1

patch 13: enable de2 mixer for Allwinner 64-bit SoCs

patch 14: add support for a64 HDMI pipeline

patch 15: add support for HVCC regulator

patch 16: enable HDMI out for bananapi-m64

patch 17: enable HDMI out for nanopi-a64

patch 18: enable HDMI out for orangepi-win

patch 19: enable HDMI out for a64-olinuxino

patch 20: enable HDMI out for pine64

patch 21: enable HDMI out for sopine

Since this series added HDMI through mixer1 through tcon1,
I have used CLK_PLL_VIDEO1 as pll-0 we need to update the driver to support both CLK_PLL_VIDEO0 and 1 once we have add hdmi through mixer0.

Note:
with pine64 and sopine, I'm unable to see any display on screen but loadded fine, request to verify anyone.

Log:
---

# modprobe -a sun4i-drm sun8i-mixer sun4i_tv sun4i-drm-hdmi sun8i-drm-hdmi          
[   13.390465] sun4i-drm display-engine: bound 1200000.mixer (ops sun8i_mixer_ops [sun8i_mixer])
[   13.399247] sun4i-drm display-engine: No panel or bridge found... RGB output disabled
[   13.407113] sun4i-drm display-engine: bound 1c0d000.lcd-controller (ops sun4i_tcon_ops [sun4i_tcon])
[   13.417386] sun8i-dw-hdmi 1ee0000.hdmi: Detected HDMI TX controller v1.32a with HDCP (sun8i_dw_hdmi_ph
y)                                                                                  
[   13.427436] sun8i-dw-hdmi 1ee0000.hdmi: registered DesignWare HDMI I2C bus driver
[   13.435987] sun4i-drm display-engine: bound 1ee0000.hdmi (ops sun8i_dw_hdmi_ops [sun8i_drm_hdmi])
[   13.444868] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).          
[   13.451498] [drm] No driver support for vblank timestamp query.                  
[   13.922226] Console: switching to colour frame buffer device 320x90              
[   14.008789] sun4i-drm display-engine: fb0:  frame buffer device                  
[   14.028297] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0

[1] https://lkml.org/lkml/2018/4/24/547

Icenowy Zheng (1):
drm: sun4i: add support for HVCC regulator for DWC HDMI glue

Jagan Teki (20):
dt-bindings: clock: Add compatible for A64 DE2 CCU
arm64: dts: allwinner: a64: Add DE2 CCU
clk: sunxi-ng: Enable DE2_CCU for Allwinner 64-bit SoCs
bindings: display: Add compatible for A64 DE2 pipeline drm/sun4i: Add support for A64 display engine
arm64: defconfig: Enable CONFIG_DRM_SUN4I
bindings: display: Add compatible for A64 HDMI
bindings: display: Add compatible for A64 HDMI PHY
arm64: dts: allwinner: a64: Add HDMI support drm/sun4i: Enable DesignWare HDMI for Allwinner 64-bit SoCs
bindings: display: Add compatible for A64 Mixer1
bindings: display: Add compatible for A64 tcon-tv drm/sun4i: Enable DE2 Mixer for Allwinner 64-bit SoCs
arm64: dts: allwinner: a64: Add HDMI pipeline
arm64: dts: allwinner: a64: bananapi-m64: Enable HDMI output
arm64: dts: allwinner: a64: nanopi-a64: Enable HDMI output
arm64: dts: allwinner: a64: orangepi-win: Enable HDMI output
arm64: dts: allwinner: a64: a64-olinuxino: Enable HDMI output
arm64: dts: allwinner: a64: pine64: Enable HDMI output
arm64: dts: allwinner: a64: sopine: Enable HDMI output

 .../devicetree/bindings/clock/sun8i-de2.txt        |   1 +
 .../bindings/display/sunxi/sun4i-drm.txt           |   5 +
 .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts |  26 +++++
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   |  26 +++++
 .../boot/dts/allwinner/sun50i-a64-olinuxino.dts    |  26 +++++
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts |  26 +++++
 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |  26 +++++
 .../dts/allwinner/sun50i-a64-sopine-baseboard.dts  |  26 +++++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      | 126 +++++++++++++++++++++
 arch/arm64/configs/defconfig                       |   1 +
 drivers/clk/sunxi-ng/Kconfig                       |   2 +
 drivers/gpu/drm/sun4i/Kconfig                      |   3 +-
 drivers/gpu/drm/sun4i/sun4i_drv.c                  |   1 +
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c              |  14 +++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h              |   2 +
 include/dt-bindings/clock/sun50i-a64-ccu.h         |   2 +
 16 files changed, 312 insertions(+), 1 deletion(-)
Signature · 1 line
2.14.3
author
#1 lore raw

PATCH 1/21 dt-bindings: clock: Add compatible for A64 DE2 CCU

Allwinner A64 has DE2 CCU which is similar to H3/H5 SoC.

---
 Documentation/devicetree/bindings/clock/sun8i-de2.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/clock/sun8i-de2.txt +1 -0
index f2fa87c4765c..7f425bc0e820 100644
@@ -7,6 +7,7 @@ Required properties :
 		- "allwinner,sun8i-h3-de2-clk"
 		- "allwinner,sun8i-v3s-de2-clk"
 		- "allwinner,sun50i-h5-de2-clk"
+		- "allwinner,sun50i-a64-de2-clk"
 
 - reg: Must contain the registers base address and length
 - clocks: phandle to the clocks feeding the display engine subsystem.
Signature · 1 line
2.14.3
#3 lore raw

Re: [PATCH 01/21] dt-bindings: clock: Add compatible for A64 DE2 CCU

Quoted 9 lines · Rob Herring
Quoted 6 lines · Jagan Teki

Allwinner A64 has DE2 CCU which is similar to H3/H5 SoC.

---
 Documentation/devicetree/bindings/clock/sun8i-de2.txt | 1 +
 1 file changed, 1 insertion(+)

Hi Rob,

Do we need to add this if it's just a soc-specific compatible we add in the device tree to future proof things in case we discover quirks later on?

AFAIK we haven't been doing this, and this is likely to create some confusion, because they aren't actually mentioned anywhere in the driver.

ChenYu

maintainer
#4 lore raw

Re: [PATCH 01/21] dt-bindings: clock: Add compatible for A64 DE2 CCU

Quoted 9 lines · Chen-Yu Tsai
Quoted 8 lines · Rob Herring
Quoted 6 lines · Jagan Teki

Allwinner A64 has DE2 CCU which is similar to H3/H5 SoC.

---
 Documentation/devicetree/bindings/clock/sun8i-de2.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 7 lines
Quoted 1 line

Hi Rob,

Do we need to add this if it's just a soc-specific compatible we add in the device tree to future proof things in case we discover quirks later on?

Yes, but the fallbacks should be documented too as I found in the rest of the series.

Quoted 3 lines

AFAIK we haven't been doing this, and this is likely to create some confusion, because they aren't actually mentioned anywhere in the driver.

The binding doc needs to written such that compatible can be validated to contain the correct set of strings. We can't do that now with free form text, but when we move to a schema we will.

Rob

author
#5 lore raw

PATCH 2/21 arm64: dts: allwinner: a64: Add DE2 CCU

In reply to Jagan Teki

DE2 in A64 has clock control unit and behavior is
same like H3/H5, so reuse the same in A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +15 -0
index 1b2ef28c42bd..67b80bbe5bf5 100644
@@ -43,9 +43,11 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 
 / {
 	interrupt-parent = <&gic>;
@@ -168,6 +170,19 @@
 		#size-cells = <1>;
 		ranges;
 
+		display_clocks: clock@1000000 {
+			compatible = "allwinner,sun50i-a64-de2-clk",
+				     "allwinner,sun50i-h5-de2-clk";
+			reg = <0x01000000 0x100000>;
+			clocks = <&ccu CLK_DE>,
+				 <&ccu CLK_BUS_DE>;
+			clock-names = "mod",
+				      "bus";
+			resets = <&ccu RST_BUS_DE>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+
 		syscon: syscon@1c00000 {
 			compatible = "allwinner,sun50i-a64-system-controller",
 				"syscon";
Signature · 1 line
2.14.3
#6 lore raw

Re: [PATCH 02/21] arm64: dts: allwinner: a64: Add DE2 CCU

Quoted 25 lines · Jagan Teki

DE2 in A64 has clock control unit and behavior is
same like H3/H5, so reuse the same in A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -0
index 1b2ef28c42bd..67b80bbe5bf5 100644
@@ -43,9 +43,11 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 
 / {
 	interrupt-parent = <&gic>;

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 175

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 -0
@@ -168,6 +170,19 @@
 		#size-cells = <1>;
 		ranges;
 
+		display_clocks: clock@1000000 {
+			compatible = "allwinner,sun50i-a64-de2-clk",
+				     "allwinner,sun50i-h5-de2-clk";

The A64 was released before the H5, so that should be the other way around.

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 185

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +10 -0
+			reg = <0x01000000 0x100000>;
+			clocks = <&ccu CLK_DE>,
+				 <&ccu CLK_BUS_DE>;
+			clock-names = "mod",
+				      "bus";
+			resets = <&ccu RST_BUS_DE>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+

So it turns out we don't need the SRAM to access the CCU driver?

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

Re: [linux-sunxi] Re: [PATCH 02/21] arm64: dts: allwinner: a64: Add DE2 CCU

于 2018年5月2日 GMT+08:00 下午7:32:50, Maxime Ripard <[email protected]> 写到:

Quoted 37 lines · Jagan Teki

Review

Quoted 9 lines

DE2 in A64 has clock control unit and behavior is
same like H3/H5, so reuse the same in A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

Quoted 16 lines

index 1b2ef28c42bd..67b80bbe5bf5 100644

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -0
@@ -43,9 +43,11 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 
 / {
 	interrupt-parent = <&gic>;

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 175

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 -0
@@ -168,6 +170,19 @@
 		#size-cells = <1>;
 		ranges;
 
+		display_clocks: clock@1000000 {
+			compatible = "allwinner,sun50i-a64-de2-clk",
+				     "allwinner,sun50i-h5-de2-clk";

The A64 was released before the H5, so that should be the other way around.

Quoted 12 lines

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 185

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +10 -0
+			reg = <0x01000000 0x100000>;
+			clocks = <&ccu CLK_DE>,
+				 <&ccu CLK_BUS_DE>;
+			clock-names = "mod",
+				      "bus";
+			resets = <&ccu RST_BUS_DE>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+

So it turns out we don't need the SRAM to access the CCU driver?

As now U-Boot claims SRAM, people may forget thus :-(

Quoted 2 lines

Maxime

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
#8 lore raw

Re: [linux-sunxi] Re: [PATCH 02/21] arm64: dts: allwinner: a64: Add DE2 CCU

Quoted 53 lines · Icenowy Zheng

于 2018年5月2日 GMT+08:00 下午7:32:50, Maxime Ripard <[email protected]> 写到:

Quoted 37 lines · Jagan Teki

Review

Quoted 9 lines

DE2 in A64 has clock control unit and behavior is
same like H3/H5, so reuse the same in A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

Quoted 16 lines

index 1b2ef28c42bd..67b80bbe5bf5 100644

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -0
@@ -43,9 +43,11 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 
 / {
 	interrupt-parent = <&gic>;

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 175

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 -0
@@ -168,6 +170,19 @@
 		#size-cells = <1>;
 		ranges;
 
+		display_clocks: clock@1000000 {
+			compatible = "allwinner,sun50i-a64-de2-clk",
+				     "allwinner,sun50i-h5-de2-clk";

The A64 was released before the H5, so that should be the other way around.

Quoted 12 lines

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 185

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +10 -0
+			reg = <0x01000000 0x100000>;
+			clocks = <&ccu CLK_DE>,
+				 <&ccu CLK_BUS_DE>;
+			clock-names = "mod",
+				      "bus";
+			resets = <&ccu RST_BUS_DE>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+

So it turns out we don't need the SRAM to access the CCU driver?

Quoted 1 line

As now U-Boot claims SRAM, people may forget thus :-(

This is definitely not ok. We should have that described in the DT as well.

Maxime

Signature · 8 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
#9 lore raw

Re: [linux-sunxi] Re: [PATCH 02/21] arm64: dts: allwinner: a64: Add DE2 CCU

In reply to Icenowy Zheng
Quoted 51 lines · Icenowy Zheng

于 2018年5月2日 GMT+08:00 下午7:32:50, Maxime Ripard <[email protected]> 写到:

Quoted 48 lines · Jagan Teki

Review

Quoted 9 lines

DE2 in A64 has clock control unit and behavior is
same like H3/H5, so reuse the same in A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

Quoted 16 lines

index 1b2ef28c42bd..67b80bbe5bf5 100644

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -0
@@ -43,9 +43,11 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 
 / {
     interrupt-parent = <&gic>;

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 175

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 -0
@@ -168,6 +170,19 @@
             #size-cells = <1>;
             ranges;
 
+            display_clocks: clock@1000000 {
+                    compatible = "allwinner,sun50i-a64-de2-clk",
+                                 "allwinner,sun50i-h5-de2-clk";

The A64 was released before the H5, so that should be the other way around.

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +10 -0
+                    reg = <0x01000000 0x100000>;
+                    clocks = <&ccu CLK_DE>,
+                             <&ccu CLK_BUS_DE>;
+                    clock-names = "mod",
+                                  "bus";
+                    resets = <&ccu RST_BUS_DE>;
+                    #clock-cells = <1>;
+                    #reset-cells = <1>;
+            };
+
Quoted 3 lines
Quoted 1 line

So it turns out we don't need the SRAM to access the CCU driver?

As now U-Boot claims SRAM, people may forget thus :-(

I've sent few mails about how we represent de2 with sram_c [1] but none response after. Can I get further inputs so-that we can include sram_c in proper manner.

[1] https://patchwork.kernel.org/patch/10289737/

Jagan.

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
#10 lore raw

Re: [linux-sunxi] Re: [PATCH 02/21] arm64: dts: allwinner: a64: Add DE2 CCU

于 2018年5月2日 GMT+08:00 下午7:50:19, Jagan Teki <[email protected]> 写到:

Quoted 53 lines · Icenowy Zheng
Quoted 3 lines

于 2018年5月2日 GMT+08:00 下午7:32:50, Maxime Ripard

<[email protected]> 写到:

Quoted 48 lines
Quoted 48 lines · Jagan Teki

Review

Quoted 9 lines

DE2 in A64 has clock control unit and behavior is
same like H3/H5, so reuse the same in A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

Quoted 16 lines

index 1b2ef28c42bd..67b80bbe5bf5 100644

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -0
@@ -43,9 +43,11 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 
 / {
     interrupt-parent = <&gic>;

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 175

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 -0
@@ -168,6 +170,19 @@
             #size-cells = <1>;
             ranges;
 
+            display_clocks: clock@1000000 {
+                    compatible = "allwinner,sun50i-a64-de2-clk",
+                                 "allwinner,sun50i-h5-de2-clk";

The A64 was released before the H5, so that should be the other way around.

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +10 -0
+                    reg = <0x01000000 0x100000>;
+                    clocks = <&ccu CLK_DE>,
+                             <&ccu CLK_BUS_DE>;
+                    clock-names = "mod",
+                                  "bus";
+                    resets = <&ccu RST_BUS_DE>;
+                    #clock-cells = <1>;
+                    #reset-cells = <1>;
+            };
+
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

So it turns out we don't need the SRAM to access the CCU driver?

As now U-Boot claims SRAM, people may forget thus :-(

I've sent few mails about how we represent de2 with sram_c [1] but none response after. Can I get further inputs so-that we can include sram_c in proper manner.

Please wait for the SRAMC driver sent by Chen-Yu (and commited by me) and the DE2 bus driver pending for the SRAMC part.

Quoted 9 lines

[1] https://patchwork.kernel.org/patch/10289737/

Jagan.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#11 lore raw

PATCH 3/21 clk: sunxi-ng: Enable DE2_CCU for Allwinner 64-bit SoCs

In reply to Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DE2 CCU so enable them as default.

---
 drivers/clk/sunxi-ng/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/sunxi-ng/Kconfig +2 -0
index 79dfd296c3d1..1fffd3bf6ff3 100644
@@ -58,6 +58,8 @@ config SUN8I_V3S_CCU
 
 config SUN8I_DE2_CCU
 	bool "Support for the Allwinner SoCs DE2 CCU"
+	default ARM64 && ARCH_SUNXI
+	depends on (DRM_SUN4I && (ARM64 && ARCH_SUNXI)) || COMPILE_TEST
 
 config SUN8I_R40_CCU
 	bool "Support for the Allwinner R40 CCU"
Signature · 1 line
2.14.3
#12 lore raw

Re: [PATCH 03/21] clk: sunxi-ng: Enable DE2_CCU for Allwinner 64-bit SoCs

Quoted 13 lines · Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DE2 CCU so enable them as default.

---
 drivers/clk/sunxi-ng/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/sunxi-ng/Kconfig +0 -0
index 79dfd296c3d1..1fffd3bf6ff3 100644

drivers/clk/sunxi-ng/Kconfig config SUN8I_V3S_CCU · line 62

Quoted 5 lines
drivers/clk/sunxi-ng/Kconfig +2 -0
@@ -58,6 +58,8 @@ config SUN8I_V3S_CCU
 
 config SUN8I_DE2_CCU
        bool "Support for the Allwinner SoCs DE2 CCU"
+       default ARM64 && ARCH_SUNXI
+       depends on (DRM_SUN4I && (ARM64 && ARCH_SUNXI)) || COMPILE_TEST

There is no reason to depend on DRM_SUN4I. There is no compile dependency.

Also, this is needed on SUN8I as well, pretty much anything with DE 2.0. So you shouldn't limit it to ARM64. That pretty much breaks things for people with A83T's or H3's. In fact you should enable it by default for these as well.

ChenYu

Quoted 6 lines
drivers/clk/sunxi-ng/Kconfig +0 -1
 config SUN8I_R40_CCU
        bool "Support for the Allwinner R40 CCU"
--

2.14.3

author
#13 lore raw

Re: [PATCH 03/21] clk: sunxi-ng: Enable DE2_CCU for Allwinner 64-bit SoCs

Quoted 15 lines · Chen-Yu Tsai
Quoted 14 lines · Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DE2 CCU so enable them as default.

---
 drivers/clk/sunxi-ng/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/sunxi-ng/Kconfig +0 -0
index 79dfd296c3d1..1fffd3bf6ff3 100644
@@ -58,6 +58,8 @@ config SUN8I_V3S_CCU
 
Quoted 6 lines

drivers/clk/sunxi-ng/Kconfig config SUN8I_V3S_CCU · line 62

Quoted 4 lines
drivers/clk/sunxi-ng/Kconfig +2 -0
 config SUN8I_DE2_CCU
        bool "Support for the Allwinner SoCs DE2 CCU"
+       default ARM64 && ARCH_SUNXI
+       depends on (DRM_SUN4I && (ARM64 && ARCH_SUNXI)) || COMPILE_TEST

There is no reason to depend on DRM_SUN4I. There is no compile dependency.

Since this CCU is for DE2 I've make DRM_SUN4I for that matter, any problem?

Quoted 5 lines

Also, this is needed on SUN8I as well, pretty much anything with DE 2.0. So you shouldn't limit it to ARM64. That pretty much breaks things for people with A83T's or H3's. In fact you should enable it by default for these as well.

True, I've skipped SUN8I since this series for A64.

Jagan.

Signature · 4 lines
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#14 lore raw

Re: [PATCH 03/21] clk: sunxi-ng: Enable DE2_CCU for Allwinner 64-bit SoCs

Quoted 16 lines · Jagan Teki
Quoted 15 lines · Chen-Yu Tsai
Quoted 14 lines · Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DE2 CCU so enable them as default.

---
 drivers/clk/sunxi-ng/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/sunxi-ng/Kconfig +0 -0
index 79dfd296c3d1..1fffd3bf6ff3 100644
@@ -58,6 +58,8 @@ config SUN8I_V3S_CCU
 
Quoted 8 lines
Quoted 6 lines

drivers/clk/sunxi-ng/Kconfig config SUN8I_V3S_CCU · line 62

Quoted 4 lines
drivers/clk/sunxi-ng/Kconfig +2 -0
 config SUN8I_DE2_CCU
        bool "Support for the Allwinner SoCs DE2 CCU"
+       default ARM64 && ARCH_SUNXI
+       depends on (DRM_SUN4I && (ARM64 && ARCH_SUNXI)) || COMPILE_TEST

There is no reason to depend on DRM_SUN4I. There is no compile dependency.

Since this CCU is for DE2 I've make DRM_SUN4I for that matter, any problem?

Users may very well be just using simplefb, but with all the clock drivers enabled. That is a valid, if very limited, use case. So again, you should not limit this driver based on DRM_SUN4I. There is no compile dependency.

Quoted 8 lines
Quoted 6 lines

Also, this is needed on SUN8I as well, pretty much anything with DE 2.0. So you shouldn't limit it to ARM64. That pretty much breaks things for people with A83T's or H3's. In fact you should enable it by default for these as well.

True, I've skipped SUN8I since this series for A64.

And yet you are breaking existing users, which is a big no-no.

ChenYu

author
#15 lore raw

PATCH 4/21 bindings: display: Add compatible for A64 DE2 pipeline

In reply to Jagan Teki

Allwinner A64 has DE2 pipeline similar to other Allwinner SOC's like A83T, H3/H5.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index 3346c1e2a7a0..f0fd9274a25d 100644
@@ -343,6 +343,7 @@ Required properties:
     * allwinner,sun8i-h3-display-engine
     * allwinner,sun8i-v3s-display-engine
     * allwinner,sun9i-a80-display-engine
+    * allwinner,sun50i-a64-display-engine
 
   - allwinner,pipelines: list of phandle to the display engine
     frontends (DE 1.0) or mixers (DE 2.0) available.
Signature · 1 line
2.14.3
maintainer Reviewed-by on v1 4/21
#16 lore raw

Re: [PATCH 04/21] bindings: display: Add compatible for A64 DE2 pipeline

Quoted 2 lines · Jagan Teki

Allwinner A64 has DE2 pipeline similar to other Allwinner SOC's like A83T, H3/H5.

'dt-bindings: ' for the subject prefix.

Quoted 5 lines
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)

Otherwise,

#17 lore raw

Re: [PATCH 04/21] bindings: display: Add compatible for A64 DE2 pipeline

Quoted 7 lines · Rob Herring
Quoted 2 lines · Jagan Teki

Allwinner A64 has DE2 pipeline similar to other Allwinner SOC's like A83T, H3/H5.

'dt-bindings: ' for the subject prefix.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)

Otherwise,

Would it make sense to put all the display component related compatible string additions in the same patch? i.e. "Add compatible strings for all documented display component blocks". MIPI-DSI is missing, but it's not documented.

ChenYu

maintainer
#18 lore raw

Re: [PATCH 04/21] bindings: display: Add compatible for A64 DE2 pipeline

Quoted 13 lines · Chen-Yu Tsai
Quoted 12 lines · Rob Herring
Quoted 2 lines · Jagan Teki

Allwinner A64 has DE2 pipeline similar to other Allwinner SOC's like A83T, H3/H5.

'dt-bindings: ' for the subject prefix.

Quoted 5 lines
---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 8 lines
Quoted 3 lines

Otherwise,

Would it make sense to put all the display component related compatible string additions in the same patch? i.e. "Add compatible strings for all documented display component blocks". MIPI-DSI is missing, but it's not documented.

That's fine by me.

Rob

author
#19 lore raw

PATCH 5/21 drm/sun4i: Add support for A64 display engine

In reply to Jagan Teki

A64 display engine has two mixers which are connected to LVDS/RGB/MIPI-DSI and HDMI output through tcon0 and tcon1.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -0
index 50d19605c38f..c84102a750f8 100644
@@ -368,6 +368,7 @@ static const struct of_device_id sun4i_drv_of_table[] = {
 	{ .compatible = "allwinner,sun8i-h3-display-engine" },
 	{ .compatible = "allwinner,sun8i-v3s-display-engine" },
 	{ .compatible = "allwinner,sun9i-a80-display-engine" },
+	{ .compatible = "allwinner,sun50i-a64-display-engine" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sun4i_drv_of_table);
Signature · 1 line
2.14.3
author
#20 lore raw

PATCH 6/21 arm64: defconfig: Enable CONFIG_DRM_SUN4I

In reply to Jagan Teki

Enable DRM Support for Allwinner Display Engine, built as a module.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 8ac1feafe563..723e6a5121fa 100644
@@ -410,6 +410,7 @@ CONFIG_DRM_EXYNOS_DSI=y
 CONFIG_DRM_EXYNOS_HDMI=y
 CONFIG_DRM_EXYNOS_MIC=y
 CONFIG_DRM_ROCKCHIP=m
+CONFIG_DRM_SUN4I=m
 CONFIG_ROCKCHIP_ANALOGIX_DP=y
 CONFIG_ROCKCHIP_CDN_DP=y
 CONFIG_ROCKCHIP_DW_HDMI=y
Signature · 1 line
2.14.3
author
#21 lore raw

PATCH 7/21 bindings: display: Add compatible for A64 HDMI

In reply to Jagan Teki

HDMI on Allwinner A64 has similar like H3/H5.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index f0fd9274a25d..9ea4353caadd 100644
@@ -78,6 +78,7 @@ Required properties:
 
   - compatible: value must be one of:
     * "allwinner,sun8i-a83t-dw-hdmi"
+    * "allwinner,sun50i-a64-dw-hdmi"
   - reg: base address and size of memory-mapped region
   - reg-io-width: See dw_hdmi.txt. Shall be 1.
   - interrupts: HDMI interrupt number
Signature · 1 line
2.14.3
author
#22 lore raw

PATCH 8/21 bindings: display: Add compatible for A64 HDMI PHY

In reply to Jagan Teki

HDMI PHY on Allwinner A64 has similar like H3/H5.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index 9ea4353caadd..7dcd1d64dfe4 100644
@@ -104,6 +104,7 @@ Required properties:
   - compatible: value must be one of:
     * allwinner,sun8i-a83t-hdmi-phy
     * allwinner,sun8i-h3-hdmi-phy
+    * allwinner,sun50i-a64-hdmi-phy
   - reg: base address and size of memory-mapped region
   - clocks: phandles to the clocks feeding the HDMI PHY
     * bus: the HDMI PHY interface clock
Signature · 1 line
2.14.3
maintainer
#23 lore raw

Re: [PATCH 08/21] bindings: display: Add compatible for A64 HDMI PHY

Quoted 12 lines · Jagan Teki

HDMI PHY on Allwinner A64 has similar like H3/H5.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +0 -0
index 9ea4353caadd..7dcd1d64dfe4 100644

Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt Required properties: · line 107

Quoted 4 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
@@ -104,6 +104,7 @@ Required properties:
   - compatible: value must be one of:
     * allwinner,sun8i-a83t-hdmi-phy
     * allwinner,sun8i-h3-hdmi-phy
+    * allwinner,sun50i-a64-hdmi-phy

This should be one valid combination per line. The dts shows that the h3 string is a fallback which should be captured in the binding doc.

Quoted 6 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +0 -0
   - reg: base address and size of memory-mapped region
   - clocks: phandles to the clocks feeding the HDMI PHY
     * bus: the HDMI PHY interface clock
Signature · 1 line
2.14.3
author
#24 lore raw

Re: [PATCH 08/21] bindings: display: Add compatible for A64 HDMI PHY

Hi Rob,

Quoted 9 lines · Rob Herring
Quoted 7 lines · Jagan Teki

HDMI PHY on Allwinner A64 has similar like H3/H5.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt Required properties: · line 107

Quoted 9 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index 9ea4353caadd..7dcd1d64dfe4 100644
@@ -104,6 +104,7 @@ Required properties:
   - compatible: value must be one of:
     * allwinner,sun8i-a83t-hdmi-phy
     * allwinner,sun8i-h3-hdmi-phy
+    * allwinner,sun50i-a64-hdmi-phy

This should be one valid combination per line. The dts shows that the h3 string is a fallback which should be captured in the binding doc.

The fallback compatible "allwinner,sun8i-h3-hdmi-phy" is already documented above, what we need to capture here? or did I miss anything here?

maintainer
#25 lore raw

Re: [PATCH 08/21] bindings: display: Add compatible for A64 HDMI PHY

Quoted 25 lines · Jagan Teki

Hi Rob,

Quoted 9 lines · Rob Herring
Quoted 7 lines · Jagan Teki

HDMI PHY on Allwinner A64 has similar like H3/H5.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt Required properties: · line 107

Quoted 9 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index 9ea4353caadd..7dcd1d64dfe4 100644
@@ -104,6 +104,7 @@ Required properties:
   - compatible: value must be one of:
     * allwinner,sun8i-a83t-hdmi-phy
     * allwinner,sun8i-h3-hdmi-phy
+    * allwinner,sun50i-a64-hdmi-phy

This should be one valid combination per line. The dts shows that the h3 string is a fallback which should be captured in the binding doc.

Quoted 3 lines

The fallback compatible "allwinner,sun8i-h3-hdmi-phy" is already documented above, what we need to capture here? or did I miss anything here?

The documentation should make it clear which of these is valid in a dts:

"allwinner,sun50i-a64-hdmi-phy", "allwinner,sun8i-h3-hdmi-phy"

or:

"allwinner,sun50i-a64-hdmi-phy"

IOW, your list should look like this:

* "allwinner,sun8i-a83t-hdmi-phy", "allwinner,sun8i-h3-hdmi-phy"
* "allwinner,sun50i-a64-hdmi-phy", "allwinner,sun8i-h3-hdmi-phy"
* "allwinner,sun8i-h3-hdmi-phy"

Depending on whether the a83t is also compatible with h3.

Rob

author
#26 lore raw

PATCH 9/21 arm64: dts: allwinner: a64: Add HDMI support

In reply to Jagan Teki

HDMI on Allwinner A64 has similar behavior like H3/H5, so reuse the same dts node details for A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++++++++++
 include/dt-bindings/clock/sun50i-a64-ccu.h    |  2 ++
 2 files changed, 30 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +28 -0
index 67b80bbe5bf5..da9128ae836d 100644
@@ -644,6 +644,34 @@
 			#interrupt-cells = <3>;
 		};
 
+		hdmi: hdmi@1ee0000 {
+			compatible = "allwinner,sun50i-a64-dw-hdmi",
+				     "allwinner,sun8i-a83t-dw-hdmi";
+			reg = <0x01ee0000 0x10000>;
+			reg-io-width = <1>;
+			interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+				 <&ccu CLK_HDMI>;
+			clock-names = "iahb", "isfr", "tmds";
+			resets = <&ccu RST_BUS_HDMI1>;
+			reset-names = "ctrl";
+			phys = <&hdmi_phy>;
+			phy-names = "hdmi-phy";
+			status = "disabled";
+		};
+
+		hdmi_phy: hdmi-phy@1ef0000 {
+			compatible = "allwinner,sun50i-a64-hdmi-phy",
+				     "allwinner,sun8i-h3-hdmi-phy";
+			reg = <0x01ef0000 0x10000>;
+			clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+				 <&ccu CLK_PLL_VIDEO1>;
+			clock-names = "bus", "mod", "pll-0";
+			resets = <&ccu RST_BUS_HDMI0>;
+			reset-names = "phy";
+			#phy-cells = <0>;
+		};
+
 		rtc: rtc@1f00000 {
 			compatible = "allwinner,sun6i-a31-rtc";
 			reg = <0x01f00000 0x54>;
include/dt-bindings/clock/sun50i-a64-ccu.h +2 -0
index d66432c6e675..41c09df797ef 100644
@@ -45,6 +45,8 @@
 
 #define CLK_PLL_PERIPH0		11
 
+#define CLK_PLL_VIDEO1		15
+
 #define CLK_BUS_MIPI_DSI	28
 #define CLK_BUS_CE		29
 #define CLK_BUS_DMA		30
Signature · 1 line
2.14.3
maintainer
#27 lore raw

Re: [PATCH 09/21] arm64: dts: allwinner: a64: Add HDMI support

Quoted 33 lines · Jagan Teki

HDMI on Allwinner A64 has similar behavior like H3/H5, so reuse the same dts node details for A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++++++++++
 include/dt-bindings/clock/sun50i-a64-ccu.h    |  2 ++
 2 files changed, 30 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +16 -0
index 67b80bbe5bf5..da9128ae836d 100644
@@ -644,6 +644,34 @@
 			#interrupt-cells = <3>;
 		};
 
+		hdmi: hdmi@1ee0000 {
+			compatible = "allwinner,sun50i-a64-dw-hdmi",
+				     "allwinner,sun8i-a83t-dw-hdmi";
+			reg = <0x01ee0000 0x10000>;
+			reg-io-width = <1>;
+			interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+				 <&ccu CLK_HDMI>;
+			clock-names = "iahb", "isfr", "tmds";
+			resets = <&ccu RST_BUS_HDMI1>;
+			reset-names = "ctrl";
+			phys = <&hdmi_phy>;
+			phy-names = "hdmi-phy";
+			status = "disabled";
+		};
+

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 672

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +10 -0
+		hdmi_phy: hdmi-phy@1ef0000 {
+			compatible = "allwinner,sun50i-a64-hdmi-phy",
+				     "allwinner,sun8i-h3-hdmi-phy";
+			reg = <0x01ef0000 0x10000>;
+			clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+				 <&ccu CLK_PLL_VIDEO1>;
+			clock-names = "bus", "mod", "pll-0";
+			resets = <&ccu RST_BUS_HDMI0>;
+			reset-names = "phy";
+			#phy-cells = <0>;

HDMI is disabled by default, but the phy is not?

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +2 -0
+		};
+
 		rtc: rtc@1f00000 {
 			compatible = "allwinner,sun6i-a31-rtc";
 			reg = <0x01f00000 0x54>;
include/dt-bindings/clock/sun50i-a64-ccu.h +0 -0
index d66432c6e675..41c09df797ef 100644

include/dt-bindings/clock/sun50i-a64-ccu.h line 49

Quoted 5 lines
include/dt-bindings/clock/sun50i-a64-ccu.h +2 -0
@@ -45,6 +45,8 @@
 
 #define CLK_PLL_PERIPH0		11
 
+#define CLK_PLL_VIDEO1		15
+

This belongs in the clock binding patch.

Quoted 6 lines
include/dt-bindings/clock/sun50i-a64-ccu.h +0 -0
 #define CLK_BUS_MIPI_DSI	28
 #define CLK_BUS_CE		29
 #define CLK_BUS_DMA		30
Signature · 1 line
2.14.3
#28 lore raw

Re: [PATCH 09/21] arm64: dts: allwinner: a64: Add HDMI support

In reply to Jagan Teki

Hi,

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 668

Quoted 6 lines · Jagan Teki
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +6 -0
+		hdmi_phy: hdmi-phy@1ef0000 {
+			compatible = "allwinner,sun50i-a64-hdmi-phy",
+				     "allwinner,sun8i-h3-hdmi-phy";
+			reg = <0x01ef0000 0x10000>;
+			clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+				 <&ccu CLK_PLL_VIDEO1>;

You were discussing that the PLL0 could also be used to clock the PHY, has that been figured out?

Thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
author
#29 lore raw

Re: [PATCH 09/21] arm64: dts: allwinner: a64: Add HDMI support

Quoted 10 lines · Maxime Ripard

Hi,

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 668

Quoted 6 lines · Jagan Teki
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +6 -0
+             hdmi_phy: hdmi-phy@1ef0000 {
+                     compatible = "allwinner,sun50i-a64-hdmi-phy",
+                                  "allwinner,sun8i-h3-hdmi-phy";
+                     reg = <0x01ef0000 0x10000>;
+                     clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+                              <&ccu CLK_PLL_VIDEO1>;
Quoted 2 lines

You were discussing that the PLL0 could also be used to clock the PHY, has that been figured out?

This is what I understand from Fig: 3-3. Module Clock Diagram, both tcon0 and tcon1 are using HDMI. I'm thinking based on the tcon configuration we need use proper PLL or some logic to get common PLL don't know yet. Since this series adding tcon1 I've attached PLL1.

Jagan.

Signature · 4 lines
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#30 lore raw

Re: [PATCH 09/21] arm64: dts: allwinner: a64: Add HDMI support

Quoted 11 lines · Jagan Teki
Quoted 10 lines · Maxime Ripard

Hi,

Quoted 6 lines · Jagan Teki
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +6 -0
+             hdmi_phy: hdmi-phy@1ef0000 {
+                     compatible = "allwinner,sun50i-a64-hdmi-phy",
+                                  "allwinner,sun8i-h3-hdmi-phy";
+                     reg = <0x01ef0000 0x10000>;
+                     clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+                              <&ccu CLK_PLL_VIDEO1>;
Quoted 7 lines
Quoted 2 lines

You were discussing that the PLL0 could also be used to clock the PHY, has that been figured out?

This is what I understand from Fig: 3-3. Module Clock Diagram, both tcon0 and tcon1 are using HDMI. I'm thinking based on the tcon configuration we need use proper PLL or some logic to get common PLL don't know yet. Since this series adding tcon1 I've attached PLL1.

You're not describing the TCON node here though, but the HDMI one, and the HDMI block is listed in both the PLL video 0 and 1.

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
author
#31 lore raw

Re: [PATCH 09/21] arm64: dts: allwinner: a64: Add HDMI support

Quoted 15 lines · Maxime Ripard
Quoted 14 lines · Jagan Teki
Quoted 12 lines · Maxime Ripard

Hi,

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 668

Quoted 6 lines · Jagan Teki
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +6 -0
+             hdmi_phy: hdmi-phy@1ef0000 {
+                     compatible = "allwinner,sun50i-a64-hdmi-phy",
+                                  "allwinner,sun8i-h3-hdmi-phy";
+                     reg = <0x01ef0000 0x10000>;
+                     clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+                              <&ccu CLK_PLL_VIDEO1>;

You were discussing that the PLL0 could also be used to clock the PHY, has that been figured out?

Quoted 7 lines
Quoted 4 lines

This is what I understand from Fig: 3-3. Module Clock Diagram, both tcon0 and tcon1 are using HDMI. I'm thinking based on the tcon configuration we need use proper PLL or some logic to get common PLL don't know yet. Since this series adding tcon1 I've attached PLL1.

You're not describing the TCON node here though, but the HDMI one, and the HDMI block is listed in both the PLL video 0 and 1.

So how can we attach particular PLL with particular HDMI(PLL0 to HDMI0 and so-on) or do we need to attached both the PLL's any suggestion?

#32 lore raw

Re: [PATCH 09/21] arm64: dts: allwinner: a64: Add HDMI support

Quoted 22 lines · Jagan Teki
Quoted 20 lines · Maxime Ripard
Quoted 18 lines · Jagan Teki
Quoted 10 lines · Maxime Ripard

Hi,

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi line 668

Quoted 6 lines · Jagan Teki
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +6 -0
+             hdmi_phy: hdmi-phy@1ef0000 {
+                     compatible = "allwinner,sun50i-a64-hdmi-phy",
+                                  "allwinner,sun8i-h3-hdmi-phy";
+                     reg = <0x01ef0000 0x10000>;
+                     clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+                              <&ccu CLK_PLL_VIDEO1>;
Quoted 2 lines

You were discussing that the PLL0 could also be used to clock the PHY, has that been figured out?

This is what I understand from Fig: 3-3. Module Clock Diagram, both tcon0 and tcon1 are using HDMI. I'm thinking based on the tcon configuration we need use proper PLL or some logic to get common PLL don't know yet. Since this series adding tcon1 I've attached PLL1.

Quoted 5 lines
Quoted 2 lines

You're not describing the TCON node here though, but the HDMI one, and the HDMI block is listed in both the PLL video 0 and 1.

So how can we attach particular PLL with particular HDMI(PLL0 to HDMI0 and so-on) or do we need to attached both the PLL's any suggestion?

I'm not sure what your question is here, just add the possibility to have an extra PLL if that makes sense to the binding.

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
author
#33 lore raw

PATCH 10/21 drm/sun4i: Enable DesignWare HDMI for Allwinner 64-bit SoCs

In reply to Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DesignWare HDMI so enable them as default.

---
 drivers/gpu/drm/sun4i/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/sun4i/Kconfig +1 -0
index eee6bc0eaf97..60468a779a63 100644
@@ -42,6 +42,7 @@ config DRM_SUN4I_BACKEND
 
 config DRM_SUN8I_DW_HDMI
 	tristate "Support for Allwinner version of DesignWare HDMI"
+	default ARM64 && ARCH_SUNXI
 	depends on DRM_SUN4I
 	select DRM_DW_HDMI
 	help
Signature · 1 line
2.14.3
#34 lore raw

Re: [PATCH 10/21] drm/sun4i: Enable DesignWare HDMI for Allwinner 64-bit SoCs

Quoted 2 lines · Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DesignWare HDMI so enable them as default.

Should we not also enable it by default for SUN8I (A83T, H3, R40?, etc.)

Quoted 20 lines
---
 drivers/gpu/drm/sun4i/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/sun4i/Kconfig +1 -1
index eee6bc0eaf97..60468a779a63 100644
@@ -42,6 +42,7 @@ config DRM_SUN4I_BACKEND
 
 config DRM_SUN8I_DW_HDMI
        tristate "Support for Allwinner version of DesignWare HDMI"
+       default ARM64 && ARCH_SUNXI
        depends on DRM_SUN4I
        select DRM_DW_HDMI
        help
--

2.14.3

author
#35 lore raw

PATCH 11/21 bindings: display: Add compatible for A64 Mixer1

In reply to Jagan Teki

Mixer1 on Allwinner A64 has similar behavior like Allwinner A83T.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index 7dcd1d64dfe4..5d448ef2132f 100644
@@ -313,6 +313,7 @@ Required properties:
     * allwinner,sun8i-a83t-de2-mixer-1
     * allwinner,sun8i-h3-de2-mixer-0
     * allwinner,sun8i-v3s-de2-mixer
+    * allwinner,sun50i-a64-de2-mixer-1
   - reg: base address and size of the memory-mapped region.
   - clocks: phandles to the clocks feeding the mixer
     * bus: the mixer interface clock
Signature · 1 line
2.14.3
maintainer
#36 lore raw

Re: [PATCH 11/21] bindings: display: Add compatible for A64 Mixer1

Quoted 12 lines · Jagan Teki

Mixer1 on Allwinner A64 has similar behavior like Allwinner A83T.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +0 -0
index 7dcd1d64dfe4..5d448ef2132f 100644

Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt Required properties: · line 316

Quoted 4 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
@@ -313,6 +313,7 @@ Required properties:
     * allwinner,sun8i-a83t-de2-mixer-1
     * allwinner,sun8i-h3-de2-mixer-0
     * allwinner,sun8i-v3s-de2-mixer
+    * allwinner,sun50i-a64-de2-mixer-1

Need to capture fallbacks here.

Quoted 6 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +0 -0
   - reg: base address and size of the memory-mapped region.
   - clocks: phandles to the clocks feeding the mixer
     * bus: the mixer interface clock
Signature · 1 line
2.14.3
author
#37 lore raw

PATCH 12/21 bindings: display: Add compatible for A64 tcon-tv

In reply to Jagan Teki

tcon-tv on Allwinner A64 has similar behavior like Allwinner A83T.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
index 5d448ef2132f..8b6b4bc43d98 100644
@@ -150,6 +150,7 @@ Required properties:
    * allwinner,sun8i-v3s-tcon
    * allwinner,sun9i-a80-tcon-lcd
    * allwinner,sun9i-a80-tcon-tv
+   * allwinner,sun50i-a64-tcon-tv
  - reg: base address and size of memory-mapped region
  - interrupts: interrupt associated to this IP
  - clocks: phandles to the clocks feeding the TCON.
Signature · 1 line
2.14.3
maintainer
#38 lore raw

Re: [PATCH 12/21] bindings: display: Add compatible for A64 tcon-tv

Quoted 12 lines · Jagan Teki

tcon-tv on Allwinner A64 has similar behavior like Allwinner A83T.

---
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +0 -0
index 5d448ef2132f..8b6b4bc43d98 100644

Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt Required properties: · line 153

Quoted 4 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +1 -0
@@ -150,6 +150,7 @@ Required properties:
    * allwinner,sun8i-v3s-tcon
    * allwinner,sun9i-a80-tcon-lcd
    * allwinner,sun9i-a80-tcon-tv
+   * allwinner,sun50i-a64-tcon-tv

Fallback?

Quoted 6 lines
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +0 -0
  - reg: base address and size of memory-mapped region
  - interrupts: interrupt associated to this IP
  - clocks: phandles to the clocks feeding the TCON.
Signature · 1 line
2.14.3
author
#39 lore raw

PATCH 13/21 drm/sun4i: Enable DE2 Mixer for Allwinner 64-bit SoCs

In reply to Jagan Teki

Allwinner 64-bit SoC like H5/A64 has DE2 Mixer so enable them as default.

---
 drivers/gpu/drm/sun4i/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/Kconfig +1 -1
index 60468a779a63..95ae04964756 100644
@@ -52,7 +52,7 @@ config DRM_SUN8I_DW_HDMI
 
 config DRM_SUN8I_MIXER
 	tristate "Support for Allwinner Display Engine 2.0 Mixer"
-	default MACH_SUN8I
+	default MACH_SUN8I || (ARM64 && ARCH_SUNXI)
 	help
 	  Choose this option if you have an Allwinner SoC with the
 	  Allwinner Display Engine 2.0, which has a mixer to do some
Signature · 1 line
2.14.3
author
#40 lore raw

PATCH 14/21 arm64: dts: allwinner: a64: Add HDMI pipeline

In reply to Jagan Teki

HDMI pipeline on A64 has similar behavior like A83T where tcon1 is connected to HDMI. So reuse similar dts nodes for A64.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 83 +++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +83 -0
index da9128ae836d..f017baa4f5db 100644
@@ -107,6 +107,12 @@
 		};
 	};
 
+	de: display-engine {
+		compatible = "allwinner,sun50i-a64-display-engine";
+		allwinner,pipelines = <&mixer1>;
+		status = "disabled";
+	};
+
 	osc24M: osc24M_clk {
 		#clock-cells = <0>;
 		compatible = "fixed-clock";
@@ -183,6 +189,31 @@
 			#reset-cells = <1>;
 		};
 
+		mixer1: mixer@1200000 {
+			compatible = "allwinner,sun50i-a64-de2-mixer-1",
+				     "allwinner,sun8i-a83t-de2-mixer-1";
+			reg = <0x01200000 0x100000>;
+			clocks = <&display_clocks CLK_BUS_MIXER1>,
+				 <&display_clocks CLK_MIXER1>;
+			clock-names = "bus",
+				      "mod";
+			resets = <&display_clocks RST_WB>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				mixer1_out: port@1 {
+					reg = <1>;
+
+					mixer1_out_tcon1: endpoint {
+						remote-endpoint = <&tcon1_in_mixer1>;
+					};
+				};
+			};
+		};
+
+
 		syscon: syscon@1c00000 {
 			compatible = "allwinner,sun50i-a64-system-controller",
 				"syscon";
@@ -200,6 +231,41 @@
 			#dma-cells = <1>;
 		};
 
+		tcon1: lcd-controller@1c0d000 {
+			compatible = "allwinner,sun50i-a64-tcon-tv",
+				     "allwinner,sun8i-a83t-tcon-tv";
+			reg = <0x01c0d000 0x1000>;
+			interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_TCON1>, <&ccu CLK_TCON1>;
+			clock-names = "ahb", "tcon-ch1";
+			resets = <&ccu RST_BUS_TCON1>;
+			reset-names = "lcd";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				tcon1_in: port@0 {
+					reg = <0>;
+
+					tcon1_in_mixer1: endpoint {
+						remote-endpoint = <&mixer1_out_tcon1>;
+					};
+				};
+
+				tcon1_out: port@1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <1>;
+
+					tcon1_out_hdmi: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&hdmi_in_tcon1>;
+					};
+				};
+			};
+		};
+
 		mmc0: mmc@1c0f000 {
 			compatible = "allwinner,sun50i-a64-mmc";
 			reg = <0x01c0f000 0x1000>;
@@ -658,6 +724,23 @@
 			phys = <&hdmi_phy>;
 			phy-names = "hdmi-phy";
 			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				hdmi_in: port@0 {
+					reg = <0>;
+
+					hdmi_in_tcon1: endpoint {
+						remote-endpoint = <&tcon1_out_hdmi>;
+					};
+				};
+
+				hdmi_out: port@1 {
+					reg = <1>;
+				};
+			};
 		};
 
 		hdmi_phy: hdmi-phy@1ef0000 {
Signature · 1 line
2.14.3
author
#41 lore raw

PATCH 15/21 drm: sun4i: add support for HVCC regulator for DWC HDMI glue

In reply to Jagan Teki

From: Icenowy Zheng <[email protected]>

Allwinner SoCs with DWC HDMI controller have a "HVCC" power pin for the HDMI part, and on some boards it's connected to a dedicated regulator rather than the main 3.3v.

Add support for optional HVCC regulator. For boards that doesn't use a dedicated regulator to power it, the default dummy regulator is used.

---
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 14 ++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h |  2 ++
 2 files changed, 16 insertions(+)
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +14 -0
index 9f40a44b456b..7c33faff7ad4 100644
@@ -73,6 +73,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 	if (encoder->possible_crtcs == 0)
 		return -EPROBE_DEFER;
 
+	hdmi->vcc_hdmi = devm_regulator_get(dev, "hvcc");
+	if (IS_ERR(hdmi->vcc_hdmi)) {
+		dev_err(dev, "Could not get HDMI power supply\n");
+		return PTR_ERR(hdmi->vcc_hdmi);
+	}
+
 	hdmi->rst_ctrl = devm_reset_control_get(dev, "ctrl");
 	if (IS_ERR(hdmi->rst_ctrl)) {
 		dev_err(dev, "Could not get ctrl reset control\n");
@@ -91,6 +97,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
+	ret = regulator_enable(hdmi->vcc_hdmi);
+	if (ret) {
+		dev_err(dev, "Cannot enable HDMI power supply\n");
+		goto err_disable_vcc;
+	}
+
 	ret = clk_prepare_enable(hdmi->clk_tmds);
 	if (ret) {
 		dev_err(dev, "Could not enable tmds clock\n");
@@ -143,6 +155,8 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 	clk_disable_unprepare(hdmi->clk_tmds);
 err_assert_ctrl_reset:
 	reset_control_assert(hdmi->rst_ctrl);
+err_disable_vcc:
+	regulator_disable(hdmi->vcc_hdmi);
 
 	return ret;
 }
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +2 -0
index 79154f0f674a..c25d75ef9303 100644
@@ -10,6 +10,7 @@
 #include <drm/drm_encoder.h>
 #include <linux/clk.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 
 #define SUN8I_HDMI_PHY_DBG_CTRL_REG	0x0000
@@ -173,6 +174,7 @@ struct sun8i_dw_hdmi {
 	struct drm_encoder		encoder;
 	struct sun8i_hdmi_phy		*phy;
 	struct dw_hdmi_plat_data	plat_data;
+	struct regulator		*vcc_hdmi;
 	struct reset_control		*rst_ctrl;
 };
 
Signature · 1 line
2.14.3
#42 lore raw

Re: [PATCH 15/21] drm: sun4i: add support for HVCC regulator for DWC HDMI glue

Quoted 21 lines · Jagan Teki

From: Icenowy Zheng <[email protected]>

Allwinner SoCs with DWC HDMI controller have a "HVCC" power pin for the HDMI part, and on some boards it's connected to a dedicated regulator rather than the main 3.3v.

Add support for optional HVCC regulator. For boards that doesn't use a dedicated regulator to power it, the default dummy regulator is used.

---
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 14 ++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h |  2 ++
 2 files changed, 16 insertions(+)
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +0 -0
index 9f40a44b456b..7c33faff7ad4 100644

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, · line 81

Quoted 9 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +6 -0
@@ -73,6 +73,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 	if (encoder->possible_crtcs == 0)
 		return -EPROBE_DEFER;
 
+	hdmi->vcc_hdmi = devm_regulator_get(dev, "hvcc");
+	if (IS_ERR(hdmi->vcc_hdmi)) {
+		dev_err(dev, "Could not get HDMI power supply\n");
+		return PTR_ERR(hdmi->vcc_hdmi);
+	}
+

You're not making it optional here, unlike what your commit log says. Not that I'm fine with both, but we need to be consistent :)

Quoted 17 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +6 -0
 	hdmi->rst_ctrl = devm_reset_control_get(dev, "ctrl");
 	if (IS_ERR(hdmi->rst_ctrl)) {
 		dev_err(dev, "Could not get ctrl reset control\n");
@@ -91,6 +97,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
+	ret = regulator_enable(hdmi->vcc_hdmi);
+	if (ret) {
+		dev_err(dev, "Cannot enable HDMI power supply\n");
+		goto err_disable_vcc;
+	}
+
 	ret = clk_prepare_enable(hdmi->clk_tmds);
 	if (ret) {
 		dev_err(dev, "Could not enable tmds clock\n");

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, · line 159

Quoted 5 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +2 -0
@@ -143,6 +155,8 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 	clk_disable_unprepare(hdmi->clk_tmds);
 err_assert_ctrl_reset:
 	reset_control_assert(hdmi->rst_ctrl);
+err_disable_vcc:
+	regulator_disable(hdmi->vcc_hdmi);

The err_disable_vcc label will disable the regulator, but if there's an error in regulator_enable, it will disable it while it wasn't enabled in the first place, which is not really something we want to do.

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#43 lore raw

Re: [PATCH 15/21] drm: sun4i: add support for HVCC regulator for DWC HDMI glue

于 2018年5月2日 GMT+08:00 下午7:48:43, Maxime Ripard <[email protected]> 写到:

Quoted 29 lines · Jagan Teki
Quoted 3 lines

From: Icenowy Zheng <[email protected]>

Allwinner SoCs with DWC HDMI controller have a "HVCC" power pin for

the

Quoted 4 lines

HDMI part, and on some boards it's connected to a dedicated regulator rather than the main 3.3v.

Add support for optional HVCC regulator. For boards that doesn't use

a

Review

Quoted 10 lines

dedicated regulator to power it, the default dummy regulator is used.

---
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 14 ++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h |  2 ++
 2 files changed, 16 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev,

Quoted 4 lines

index 9f40a44b456b..7c33faff7ad4 100644

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +0 -0
@@ -73,6 +73,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev,

struct device *master,

Quoted 3 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +0 -0
 	if (encoder->possible_crtcs == 0)
 		return -EPROBE_DEFER;
 
Quoted 9 lines

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, · line 81

Quoted 6 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +6 -0
+	hdmi->vcc_hdmi = devm_regulator_get(dev, "hvcc");
+	if (IS_ERR(hdmi->vcc_hdmi)) {
+		dev_err(dev, "Could not get HDMI power supply\n");
+		return PTR_ERR(hdmi->vcc_hdmi);
+	}
+

You're not making it optional here, unlike what your commit log says. Not that I'm fine with both, but we need to be consistent :)

If it's not set, regulator subsystem will generate a dummy regulator as a spaceholder, except using the exclusive variant of the function.

The word "optional" is from DT perspectove, as it's possible that it's bound to some critical regulators.

Quoted 33 lines

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev,

Quoted 5 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +0 -0
 	hdmi->rst_ctrl = devm_reset_control_get(dev, "ctrl");
 	if (IS_ERR(hdmi->rst_ctrl)) {
 		dev_err(dev, "Could not get ctrl reset control\n");
@@ -91,6 +97,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev,

struct device *master,

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev,

Quoted 13 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +6 -0
 		return ret;
 	}
 
+	ret = regulator_enable(hdmi->vcc_hdmi);
+	if (ret) {
+		dev_err(dev, "Cannot enable HDMI power supply\n");
+		goto err_disable_vcc;
+	}
+
 	ret = clk_prepare_enable(hdmi->clk_tmds);
 	if (ret) {
 		dev_err(dev, "Could not enable tmds clock\n");
@@ -143,6 +155,8 @@ static int sun8i_dw_hdmi_bind(struct device *dev,

struct device *master,

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master, · line 159

Quoted 5 lines
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +2 -0
 	clk_disable_unprepare(hdmi->clk_tmds);
 err_assert_ctrl_reset:
 	reset_control_assert(hdmi->rst_ctrl);
+err_disable_vcc:
+	regulator_disable(hdmi->vcc_hdmi);

The err_disable_vcc label will disable the regulator, but if there's an error in regulator_enable, it will disable it while it wasn't enabled in the first place, which is not really something we want to do.

Maxime

Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
author
#44 lore raw

PATCH 16/21 arm64: dts: allwinner: a64: bananapi-m64: Enable HDMI output

In reply to Jagan Teki

Enable HDMI output on Bananpi-m64 board.

---
 .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +26 -0
index 2250dec9974c..69063c1fbddf 100644
@@ -60,6 +60,17 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 
@@ -86,6 +97,10 @@
 	};
 };
 
+&de {
+	status = "okay";
+};
+
 &ehci1 {
 	status = "okay";
 };
@@ -99,6 +114,17 @@
 	status = "okay";
 };
 
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_pins>;
Signature · 1 line
2.14.3
author
#45 lore raw

PATCH 17/21 arm64: dts: allwinner: a64: nanopi-a64: Enable HDMI output

In reply to Jagan Teki

Enable HDMI output on nanopi-a64 board.

---
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +26 -0
index e2dce48fa29a..19fe7eed45e9 100644
@@ -57,6 +57,21 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+};
+
+&de {
+	status = "okay";
 };
 
 &ehci0 {
@@ -67,6 +82,17 @@
 	status = "okay";
 };
 
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 /* i2c1 connected with gpio headers like pine64, bananapi */
 &i2c1 {
 	pinctrl-names = "default";
Signature · 1 line
2.14.3
author
#46 lore raw

PATCH 18/21 arm64: dts: allwinner: a64: orangepi-win: Enable HDMI output

In reply to Jagan Teki

Enable HDMI output on Orangepi-win board.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +26 -0
index bf42690a3361..b6fdd052d473 100644
@@ -57,12 +57,38 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+};
+
+&de {
+	status = "okay";
 };
 
 &ehci1 {
 	status = "okay";
 };
 
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
Signature · 1 line
2.14.3
author
#47 lore raw

PATCH 19/21 arm64: dts: allwinner: a64: a64-olinuxino: Enable HDMI output

In reply to Jagan Teki

Enable HDMI output on a64-olinuxino board.

---
 .../boot/dts/allwinner/sun50i-a64-olinuxino.dts    | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +26 -0
index 3b3081b10ecb..83329c8fec4f 100644
@@ -58,12 +58,38 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
 	};
 };
 
+&de {
+	status = "okay";
+};
+
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
Signature · 1 line
2.14.3
author
#48 lore raw

PATCH 20/21 arm64: dts: allwinner: a64: pine64: Enable HDMI output

In reply to Jagan Teki

Enable HDMI output on pine64 board.

---
 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +26 -0
index a75825798a71..a4ec0900a885 100644
@@ -62,6 +62,21 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+};
+
+&de {
+	status = "okay";
 };
 
 &ehci0 {
@@ -82,6 +97,17 @@
 
 };
 
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_pins>;
Signature · 1 line
2.14.3
author
#49 lore raw

PATCH 21/21 arm64: dts: allwinner: a64: sopine: Enable HDMI output

In reply to Jagan Teki

Enable HDMI output on sopine board.

---
 .../dts/allwinner/sun50i-a64-sopine-baseboard.dts  | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +26 -0
index abe179de35d7..72f29b78117c 100644
@@ -61,6 +61,17 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
 	reg_vcc1v8: vcc1v8 {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc1v8";
@@ -69,6 +80,10 @@
 	};
 };
 
+&de {
+	status = "okay";
+};
+
 &ehci0 {
 	status = "okay";
 };
@@ -86,6 +101,17 @@
 	status = "okay";
 };
 
+&hdmi {
+	hvcc-supply = <&reg_dldo1>;
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &mdio {
 	ext_rgmii_phy: ethernet-phy@1 {
 		compatible = "ethernet-phy-ieee802.3-c22";
Signature · 1 line
2.14.3