linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2)
@ 2017-12-30 11:30 Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes Icenowy Zheng
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

This patchset is the remaining part of Allwinner DE2 SimpleFB support in
Linux. Some H3/5-related patches are already applied into the sunxi
tree.

PATCH 1 adds the final SimpleFB nodes to the H3/H5 device tree. With it
applied the SimpleFB will be usable on H3/H5.

PATCH 2/3 are for the SRAM requirment of the A64 SoC; PATCH 2 is the
device tree binding of it and PATCH 3 is the implementation in DE2 CCU
of it.

PATCH 4/5 are A64 DTSI file parts; PATCH 4 adds DE2 CCU device node and
PATCH 5 adds SimpleFB device node.

PATCH 6 are A64 per-board DTS file changes, which keeps the regulator
for HVCC pin (a power supply pin on A64 SoC that is used by the HDMI
controller) on these boards.

Icenowy Zheng (6):
  ARM: sunxi: h3/h5: add simplefb nodes
  dt-bindings: add binding for A64 DE2 CCU SRAM
  clk: sunxi-ng: add support for Allwinner A64 DE2 CCU
  arm64: allwinner: a64: add DE2 CCU for A64 SoC
  arm64: allwinner: a64: add simplefb for A64 SoC
  arm64: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi

 .../devicetree/bindings/clock/sun8i-de2.txt        |   5 +
 arch/arm/boot/dts/sunxi-h3-h5.dtsi                 |  24 +++++
 .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts |   4 +
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   |   4 +
 .../boot/dts/allwinner/sun50i-a64-olinuxino.dts    |   4 +
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts |   4 +
 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |   4 +
 .../dts/allwinner/sun50i-a64-sopine-baseboard.dts  |   4 +
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      |  60 +++++++++++
 drivers/clk/sunxi-ng/ccu-sun8i-de2.c               | 117 ++++++++++++++-------
 10 files changed, 190 insertions(+), 40 deletions(-)

-- 
2.14.2

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

* [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes
  2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
@ 2017-12-30 11:30 ` Icenowy Zheng
  2018-01-02  8:11   ` [linux-sunxi] " Chen-Yu Tsai
  2017-12-30 11:30 ` [PATCH v4 2/6] dt-bindings: add binding for A64 DE2 CCU SRAM Icenowy Zheng
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

The H3/H5 SoCs have a HDMI output and a TV Composite output.

Add simplefb nodes for these outputs.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v4:
- Dropped extra clocks (bus clocks and HDMI DDC clocks), only keep the
  clocks that are needed to display framebuffer to the monitor.

 arch/arm/boot/dts/sunxi-h3-h5.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index fcb909658cf0..7a83b15225c7 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -53,6 +53,30 @@
 	#address-cells = <1>;
 	#size-cells = <1>;
 
+	chosen {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		framebuffer-hdmi {
+			compatible = "allwinner,simple-framebuffer",
+				     "simple-framebuffer";
+			allwinner,pipeline = "mixer0-lcd0-hdmi";
+			clocks = <&display_clocks CLK_MIXER0>,
+				 <&ccu CLK_TCON0>, <&ccu CLK_HDMI>;
+			status = "disabled";
+		};
+
+		framebuffer-tve {
+			compatible = "allwinner,simple-framebuffer",
+				     "simple-framebuffer";
+			allwinner,pipeline = "mixer1-lcd1-tve";
+			clocks = <&display_clocks CLK_MIXER1>,
+				 <&ccu CLK_TVE>;
+			status = "disabled";
+		};
+	};
+
 	clocks {
 		#address-cells = <1>;
 		#size-cells = <1>;
-- 
2.14.2

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

* [PATCH v4 2/6] dt-bindings: add binding for A64 DE2 CCU SRAM
  2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes Icenowy Zheng
@ 2017-12-30 11:30 ` Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 3/6] clk: sunxi-ng: add support for Allwinner A64 DE2 CCU Icenowy Zheng
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

A64's Display Engine 2.0 needs a section of SRAM (SRAM C) to be claimed,
otherwise the whole DE2 memory zone cannot be accessed (kept to all 0).

Add binding for this, in order to make the DE2 CCU able to claim the
SRAM and enable access to the DE2 clock and reset registers.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v4:
- Added Rob's ACK.

Changes in v2:
- Adds description of the situation when the SRAM is not claimed.

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

diff --git a/Documentation/devicetree/bindings/clock/sun8i-de2.txt b/Documentation/devicetree/bindings/clock/sun8i-de2.txt
index f2fa87c4765c..a7d558a2b9b2 100644
--- a/Documentation/devicetree/bindings/clock/sun8i-de2.txt
+++ b/Documentation/devicetree/bindings/clock/sun8i-de2.txt
@@ -6,6 +6,7 @@ Required properties :
 		- "allwinner,sun8i-a83t-de2-clk"
 		- "allwinner,sun8i-h3-de2-clk"
 		- "allwinner,sun8i-v3s-de2-clk"
+		- "allwinner,sun50i-a64-de2-clk"
 		- "allwinner,sun50i-h5-de2-clk"
 
 - reg: Must contain the registers base address and length
@@ -18,6 +19,10 @@ Required properties :
 - #clock-cells : must contain 1
 - #reset-cells : must contain 1
 
+Additional required properties for "allwinner,sun50i-a64-de2-clk" :
+- allwinner,sram: See Documentation/devicetree/bindings/sram/sunxi-sram.txt,
+		  should be the SRAM C section on A64 SoC.
+
 Example:
 de2_clocks: clock at 1000000 {
 	compatible = "allwinner,sun8i-h3-de2-clk";
-- 
2.14.2

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

* [PATCH v4 3/6] clk: sunxi-ng: add support for Allwinner A64 DE2 CCU
  2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 2/6] dt-bindings: add binding for A64 DE2 CCU SRAM Icenowy Zheng
@ 2017-12-30 11:30 ` Icenowy Zheng
  2018-01-02  8:09   ` [linux-sunxi] " Chen-Yu Tsai
  2017-12-30 11:30 ` [PATCH v4 4/6] arm64: allwinner: a64: add DE2 CCU for A64 SoC Icenowy Zheng
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

Allwinner A64's DE2 needs to claim a section of SRAM (SRAM C) to work.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v4:
- Use a struct to maintain both ccu desc and quirks as Chen-Yu Tsai
  suggested.

 drivers/clk/sunxi-ng/ccu-sun8i-de2.c | 117 +++++++++++++++++++++++------------
 1 file changed, 77 insertions(+), 40 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
index 468d1abaf0ee..b65953b32bd0 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
@@ -17,6 +17,7 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
+#include <linux/soc/sunxi/sunxi_sram.h>
 
 #include "ccu_common.h"
 #include "ccu_div.h"
@@ -156,44 +157,70 @@ static struct ccu_reset_map sun50i_a64_de2_resets[] = {
 	[RST_WB]	= { 0x08, BIT(2) },
 };
 
-static const struct sunxi_ccu_desc sun8i_a83t_de2_clk_desc = {
-	.ccu_clks	= sun8i_a83t_de2_clks,
-	.num_ccu_clks	= ARRAY_SIZE(sun8i_a83t_de2_clks),
+struct de2_ccu {
+	struct sunxi_ccu_desc desc;
+	bool sram_needed;
+};
+
+static const struct de2_ccu sun8i_a83t_de2_clk = {
+	.desc = {
+		.ccu_clks	= sun8i_a83t_de2_clks,
+		.num_ccu_clks	= ARRAY_SIZE(sun8i_a83t_de2_clks),
+
+		.hw_clks	= &sun8i_a83t_de2_hw_clks,
+
+		.resets		= sun8i_a83t_de2_resets,
+		.num_resets	= ARRAY_SIZE(sun8i_a83t_de2_resets),
+	},
+};
+
+static const struct de2_ccu sun8i_h3_de2_clk = {
+	.desc = {
+		.ccu_clks	= sun8i_h3_de2_clks,
+		.num_ccu_clks	= ARRAY_SIZE(sun8i_h3_de2_clks),
 
-	.hw_clks	= &sun8i_a83t_de2_hw_clks,
+		.hw_clks	= &sun8i_h3_de2_hw_clks,
 
-	.resets		= sun8i_a83t_de2_resets,
-	.num_resets	= ARRAY_SIZE(sun8i_a83t_de2_resets),
+		.resets		= sun8i_a83t_de2_resets,
+		.num_resets	= ARRAY_SIZE(sun8i_a83t_de2_resets),
+	},
 };
 
-static const struct sunxi_ccu_desc sun8i_h3_de2_clk_desc = {
-	.ccu_clks	= sun8i_h3_de2_clks,
-	.num_ccu_clks	= ARRAY_SIZE(sun8i_h3_de2_clks),
+static const struct de2_ccu sun50i_a64_de2_clk = {
+	.desc = {
+		.ccu_clks	= sun8i_h3_de2_clks,
+		.num_ccu_clks	= ARRAY_SIZE(sun8i_h3_de2_clks),
 
-	.hw_clks	= &sun8i_h3_de2_hw_clks,
+		.hw_clks	= &sun8i_h3_de2_hw_clks,
 
-	.resets		= sun8i_a83t_de2_resets,
-	.num_resets	= ARRAY_SIZE(sun8i_a83t_de2_resets),
+		.resets		= sun50i_a64_de2_resets,
+		.num_resets	= ARRAY_SIZE(sun50i_a64_de2_resets),
+	},
+	.sram_needed = true,
 };
 
-static const struct sunxi_ccu_desc sun50i_a64_de2_clk_desc = {
-	.ccu_clks	= sun8i_h3_de2_clks,
-	.num_ccu_clks	= ARRAY_SIZE(sun8i_h3_de2_clks),
+static const struct de2_ccu sun50i_h5_de2_clk = {
+	.desc = {
+		.ccu_clks	= sun8i_h3_de2_clks,
+		.num_ccu_clks	= ARRAY_SIZE(sun8i_h3_de2_clks),
 
-	.hw_clks	= &sun8i_h3_de2_hw_clks,
+		.hw_clks	= &sun8i_h3_de2_hw_clks,
 
-	.resets		= sun50i_a64_de2_resets,
-	.num_resets	= ARRAY_SIZE(sun50i_a64_de2_resets),
+		.resets		= sun50i_a64_de2_resets,
+		.num_resets	= ARRAY_SIZE(sun50i_a64_de2_resets),
+	},
 };
 
-static const struct sunxi_ccu_desc sun8i_v3s_de2_clk_desc = {
-	.ccu_clks	= sun8i_v3s_de2_clks,
-	.num_ccu_clks	= ARRAY_SIZE(sun8i_v3s_de2_clks),
+static const struct de2_ccu sun8i_v3s_de2_clk = {
+	.desc = {
+		.ccu_clks	= sun8i_v3s_de2_clks,
+		.num_ccu_clks	= ARRAY_SIZE(sun8i_v3s_de2_clks),
 
-	.hw_clks	= &sun8i_v3s_de2_hw_clks,
+		.hw_clks	= &sun8i_v3s_de2_hw_clks,
 
-	.resets		= sun8i_a83t_de2_resets,
-	.num_resets	= ARRAY_SIZE(sun8i_a83t_de2_resets),
+		.resets		= sun8i_a83t_de2_resets,
+		.num_resets	= ARRAY_SIZE(sun8i_a83t_de2_resets),
+	},
 };
 
 static int sunxi_de2_clk_probe(struct platform_device *pdev)
@@ -202,11 +229,11 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev)
 	struct clk *bus_clk, *mod_clk;
 	struct reset_control *rstc;
 	void __iomem *reg;
-	const struct sunxi_ccu_desc *ccu_desc;
+	const struct de2_ccu *ccu;
 	int ret;
 
-	ccu_desc = of_device_get_match_data(&pdev->dev);
-	if (!ccu_desc)
+	ccu = of_device_get_match_data(&pdev->dev);
+	if (!ccu)
 		return -EINVAL;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -239,11 +266,20 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	if (ccu->sram_needed) {
+		ret = sunxi_sram_claim(&pdev->dev);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Error couldn't map SRAM to device\n");
+			return ret;
+		}
+	}
+
 	/* The clocks need to be enabled for us to access the registers */
 	ret = clk_prepare_enable(bus_clk);
 	if (ret) {
 		dev_err(&pdev->dev, "Couldn't enable bus clk: %d\n", ret);
-		return ret;
+		goto err_release_sram;
 	}
 
 	ret = clk_prepare_enable(mod_clk);
@@ -260,7 +296,7 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev)
 		goto err_disable_mod_clk;
 	}
 
-	ret = sunxi_ccu_probe(pdev->dev.of_node, reg, ccu_desc);
+	ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &ccu->desc);
 	if (ret)
 		goto err_assert_reset;
 
@@ -272,33 +308,34 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev)
 	clk_disable_unprepare(mod_clk);
 err_disable_bus_clk:
 	clk_disable_unprepare(bus_clk);
+err_release_sram:
+	if (ccu->sram_needed)
+		sunxi_sram_release(&pdev->dev);
+
 	return ret;
 }
 
 static const struct of_device_id sunxi_de2_clk_ids[] = {
 	{
 		.compatible = "allwinner,sun8i-a83t-de2-clk",
-		.data = &sun8i_a83t_de2_clk_desc,
+		.data = &sun8i_a83t_de2_clk,
 	},
 	{
 		.compatible = "allwinner,sun8i-h3-de2-clk",
-		.data = &sun8i_h3_de2_clk_desc,
+		.data = &sun8i_h3_de2_clk,
 	},
 	{
 		.compatible = "allwinner,sun8i-v3s-de2-clk",
-		.data = &sun8i_v3s_de2_clk_desc,
+		.data = &sun8i_v3s_de2_clk,
+	},
+	{
+		.compatible = "allwinner,sun50i-a64-de2-clk",
+		.data = &sun50i_a64_de2_clk,
 	},
 	{
 		.compatible = "allwinner,sun50i-h5-de2-clk",
-		.data = &sun50i_a64_de2_clk_desc,
+		.data = &sun50i_h5_de2_clk,
 	},
-	/*
-	 * The Allwinner A64 SoC needs some bit to be poke in syscon to make
-	 * DE2 really working.
-	 * So there's currently no A64 compatible here.
-	 * H5 shares the same reset line with A64, so here H5 is using the
-	 * clock description of A64.
-	 */
 	{ }
 };
 
-- 
2.14.2

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

* [PATCH v4 4/6] arm64: allwinner: a64: add DE2 CCU for A64 SoC
  2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
                   ` (2 preceding siblings ...)
  2017-12-30 11:30 ` [PATCH v4 3/6] clk: sunxi-ng: add support for Allwinner A64 DE2 CCU Icenowy Zheng
@ 2017-12-30 11:30 ` Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 5/6] arm64: allwinner: a64: add simplefb " Icenowy Zheng
  2017-12-30 11:30 ` [PATCH v4 6/6] arm64: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi Icenowy Zheng
  5 siblings, 0 replies; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

The A64 SoC features a DE2 CCU like the one in H5, but needs to claim a
section of SRAM (SRAM C) to be accessed.

Adds the device tree nodes for the SRAM controller and the DE2 CCU.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v3:
- Fixed the alliwnner,sram property (the 1 after SRAM phadle is missing
  in v2).

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

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index d783d164b9c3..fb8ea7c414e1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -130,6 +130,40 @@
 		#size-cells = <1>;
 		ranges;
 
+		display_clocks: clock at 1000000 {
+			compatible = "allwinner,sun50i-a64-de2-clk";
+			reg = <0x01000000 0x100000>;
+			clocks = <&ccu CLK_DE>,
+				 <&ccu CLK_BUS_DE>;
+			clock-names = "mod",
+				      "bus";
+			resets = <&ccu RST_BUS_DE>;
+			allwinner,sram = <&de2_sram 1>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+
+		sram-controller at 1c00000 {
+			compatible = "allwinner,sun50i-a64-sram-controller";
+			reg = <0x01c00000 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			sram_c: sram at 18000 {
+				compatible = "mmio-sram";
+				reg = <0x00018000 0x28000>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x00018000 0x28000>;
+
+				de2_sram: sram-section at 0 {
+					compatible = "allwinner,sun50i-a64-sram-c";
+					reg = <0x0000 0x28000>;
+				};
+			};
+		};
+
 		syscon: syscon at 1c00000 {
 			compatible = "allwinner,sun50i-a64-system-controller",
 				"syscon";
-- 
2.14.2

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

* [PATCH v4 5/6] arm64: allwinner: a64: add simplefb for A64 SoC
  2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
                   ` (3 preceding siblings ...)
  2017-12-30 11:30 ` [PATCH v4 4/6] arm64: allwinner: a64: add DE2 CCU for A64 SoC Icenowy Zheng
@ 2017-12-30 11:30 ` Icenowy Zheng
  2018-01-02  8:30   ` [linux-sunxi] " Chen-Yu Tsai
  2017-12-30 11:30 ` [PATCH v4 6/6] arm64: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi Icenowy Zheng
  5 siblings, 1 reply; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

The A64 SoC features two display pipelines, one has a LCD output, the
other has a HDMI output.

Add support for simplefb for these pipelines on A64 SoC.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v4:
- Dropped extra clocks.
- Added labels to the SimpleFB device tree nodes as boards may have
  extra regulator for display pipeline.

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

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index fb8ea7c414e1..d803c115d362 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -42,9 +42,11 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/sun8i-de2.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
 
 / {
@@ -52,6 +54,30 @@
 	#address-cells = <1>;
 	#size-cells = <1>;
 
+	chosen {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		simplefb_lcd: framebuffer-lcd {
+			compatible = "allwinner,simple-framebuffer",
+				     "simple-framebuffer";
+			allwinner,pipeline = "mixer0-lcd0";
+			clocks = <&display_clocks CLK_MIXER0>,
+				 <&ccu CLK_TCON0>;
+			status = "disabled";
+		};
+
+		simplefb_hdmi: framebuffer-hdmi {
+			compatible = "allwinner,simple-framebuffer",
+				     "simple-framebuffer";
+			allwinner,pipeline = "mixer1-lcd1-hdmi";
+			clocks = <&display_clocks CLK_MIXER1>,
+				 <&ccu CLK_TCON1>, <&ccu CLK_HDMI>;
+			status = "disabled";
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
2.14.2

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

* [PATCH v4 6/6] arm64: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi
  2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
                   ` (4 preceding siblings ...)
  2017-12-30 11:30 ` [PATCH v4 5/6] arm64: allwinner: a64: add simplefb " Icenowy Zheng
@ 2017-12-30 11:30 ` Icenowy Zheng
  5 siblings, 0 replies; 13+ messages in thread
From: Icenowy Zheng @ 2017-12-30 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

On usual A64 board design the power of HDMI controller is connected to
DLDO1 of the AXP803 PMIC. If this regulator is shut down, the HDMI
output will be blank. Therefore the simplefb driver should keep this
regulator on.

Add the regulator to all currently available A64 boards' simplefb_hdmi
device node.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
New patch introduced in v4.

 arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts     | 4 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts       | 4 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts        | 4 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts     | 4 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts           | 4 ++++
 arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 4 ++++
 6 files changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
index a6975670cd1c..f98c496e1f30 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
@@ -283,6 +283,10 @@
 	regulator-name = "vcc-rtc";
 };
 
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dldo1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
index 2beef9e6cb88..7cbbbf238f4f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
@@ -196,6 +196,10 @@
 	regulator-name = "vcc-rtc";
 };
 
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dldo1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
index 8807664f363a..568de83427d0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
@@ -215,6 +215,10 @@
 	regulator-name = "vcc-rtc";
 };
 
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dldo1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
index 240d35731d10..ce38080db324 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
@@ -192,6 +192,10 @@
 	regulator-name = "vcc-rtc";
 };
 
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dldo1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 604cdaedac38..40d9802959c4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -230,6 +230,10 @@
 	regulator-name = "vcc-rtc";
 };
 
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dldo1>;
+};
+
 /* On Exp and Euler connectors */
 &uart0 {
 	pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
index abe179de35d7..c21f2331add6 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
@@ -134,6 +134,10 @@
 	regulator-name = "vcc-wifi";
 };
 
+&simplefb_hdmi {
+	vcc-hdmi-supply = <&reg_dldo1>;
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
-- 
2.14.2

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

* [linux-sunxi] [PATCH v4 3/6] clk: sunxi-ng: add support for Allwinner A64 DE2 CCU
  2017-12-30 11:30 ` [PATCH v4 3/6] clk: sunxi-ng: add support for Allwinner A64 DE2 CCU Icenowy Zheng
@ 2018-01-02  8:09   ` Chen-Yu Tsai
  0 siblings, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2018-01-02  8:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Dec 30, 2017 at 7:30 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> Allwinner A64's DE2 needs to claim a section of SRAM (SRAM C) to work.
>
> Add support for it.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> Changes in v4:
> - Use a struct to maintain both ccu desc and quirks as Chen-Yu Tsai
>   suggested.

This made the patch slightly messy. Could you split it into two patches?
The first just adds the struct (without the sram_needed field) and migrates
everything to that. This patch should mention it is preperation for the
next patch, which adds the a field to the struct (otherwise it makes no
sense and just looks like churn.) The second patch will add the .sram_needed
field and support for the A64 DE2 CCU.


Thanks
ChenYu

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

* [linux-sunxi] [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes
  2017-12-30 11:30 ` [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes Icenowy Zheng
@ 2018-01-02  8:11   ` Chen-Yu Tsai
  2018-01-02  8:14     ` Icenowy Zheng
  0 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2018-01-02  8:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Dec 30, 2017 at 7:30 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> The H3/H5 SoCs have a HDMI output and a TV Composite output.
>
> Add simplefb nodes for these outputs.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> Changes in v4:
> - Dropped extra clocks (bus clocks and HDMI DDC clocks), only keep the
>   clocks that are needed to display framebuffer to the monitor.

Looks good. I assume you've tested this? It does continue to work
with the bus and DDC clocks disabled, right?

Thanks
ChenYu

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

* [linux-sunxi] [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes
  2018-01-02  8:11   ` [linux-sunxi] " Chen-Yu Tsai
@ 2018-01-02  8:14     ` Icenowy Zheng
  2018-01-02  8:31       ` Jernej Škrabec
  2018-01-03  2:47       ` Chen-Yu Tsai
  0 siblings, 2 replies; 13+ messages in thread
From: Icenowy Zheng @ 2018-01-02  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

? 2018?1?2???? CST ??4:11:04?Chen-Yu Tsai ???
> On Sat, Dec 30, 2017 at 7:30 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> > The H3/H5 SoCs have a HDMI output and a TV Composite output.
> > 
> > Add simplefb nodes for these outputs.
> > 
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > ---
> > Changes in v4:
> > - Dropped extra clocks (bus clocks and HDMI DDC clocks), only keep the
> > 
> >   clocks that are needed to display framebuffer to the monitor.
> 
> Looks good. I assume you've tested this? It does continue to work
> with the bus and DDC clocks disabled, right?

Yes. This patchset is tested in Orange Pi PC and SoPine w/ Baseboard "Model 
A".

> 
> Thanks
> ChenYu

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

* [linux-sunxi] [PATCH v4 5/6] arm64: allwinner: a64: add simplefb for A64 SoC
  2017-12-30 11:30 ` [PATCH v4 5/6] arm64: allwinner: a64: add simplefb " Icenowy Zheng
@ 2018-01-02  8:30   ` Chen-Yu Tsai
  0 siblings, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2018-01-02  8:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Dec 30, 2017 at 7:30 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> The A64 SoC features two display pipelines, one has a LCD output, the
> other has a HDMI output.
>
> Add support for simplefb for these pipelines on A64 SoC.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> Changes in v4:
> - Dropped extra clocks.
> - Added labels to the SimpleFB device tree nodes as boards may have
>   extra regulator for display pipeline.
>
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index fb8ea7c414e1..d803c115d362 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -42,9 +42,11 @@
>   *     OTHER DEALINGS IN THE SOFTWARE.
>   */
>
> +#include <dt-bindings/clock/sun8i-de2.h>
>  #include <dt-bindings/clock/sun50i-a64-ccu.h>
>  #include <dt-bindings/clock/sun8i-r-ccu.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/reset/sun8i-de2.h>

Nit: This isn't used anywhere. Please add it when DE2 DRM support is added.

ChenYu

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

* [linux-sunxi] [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes
  2018-01-02  8:14     ` Icenowy Zheng
@ 2018-01-02  8:31       ` Jernej Škrabec
  2018-01-03  2:47       ` Chen-Yu Tsai
  1 sibling, 0 replies; 13+ messages in thread
From: Jernej Škrabec @ 2018-01-02  8:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Dne torek, 02. januar 2018 ob 09:14:37 CET je Icenowy Zheng napisal(a):
> ? 2018?1?2???? CST ??4:11:04?Chen-Yu Tsai ???
> 
> > On Sat, Dec 30, 2017 at 7:30 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> > > The H3/H5 SoCs have a HDMI output and a TV Composite output.
> > > 
> > > Add simplefb nodes for these outputs.
> > > 
> > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > > ---
> > > Changes in v4:
> > > - Dropped extra clocks (bus clocks and HDMI DDC clocks), only keep the
> > > 
> > >   clocks that are needed to display framebuffer to the monitor.
> > 
> > Looks good. I assume you've tested this? It does continue to work
> > with the bus and DDC clocks disabled, right?
> 
> Yes. This patchset is tested in Orange Pi PC and SoPine w/ Baseboard "Model
> A".

I think DDC clock is misnamed and according to DW HDMI binding should be named 
ISFR (clock for special function registers). I did few test tests when writing 
U-Boot driver and it has to be enabled all the time for driver to work 
correctly. I did few additional tests few days back - if only DDC clock is 
enabled and PLL video/HDMI clock disabled, DW HDMI registers are accessible.

I guess DDC clock in your case is not needed because controller is already 
configured correctly.

Best regards,
Jernej

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

* [linux-sunxi] [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes
  2018-01-02  8:14     ` Icenowy Zheng
  2018-01-02  8:31       ` Jernej Škrabec
@ 2018-01-03  2:47       ` Chen-Yu Tsai
  1 sibling, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2018-01-03  2:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 2, 2018 at 4:14 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> ? 2018?1?2???? CST ??4:11:04?Chen-Yu Tsai ???
>> On Sat, Dec 30, 2017 at 7:30 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
>> > The H3/H5 SoCs have a HDMI output and a TV Composite output.
>> >
>> > Add simplefb nodes for these outputs.
>> >
>> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> > ---
>> > Changes in v4:
>> > - Dropped extra clocks (bus clocks and HDMI DDC clocks), only keep the
>> >
>> >   clocks that are needed to display framebuffer to the monitor.
>>
>> Looks good. I assume you've tested this? It does continue to work
>> with the bus and DDC clocks disabled, right?
>
> Yes. This patchset is tested in Orange Pi PC and SoPine w/ Baseboard "Model
> A".

Applied this one.

ChenYu

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

end of thread, other threads:[~2018-01-03  2:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-30 11:30 [PATCH v4 0/6] Allwinner H3/H5/A64(DE2) SimpleFB support (Part 2) Icenowy Zheng
2017-12-30 11:30 ` [PATCH v4 1/6] ARM: sunxi: h3/h5: add simplefb nodes Icenowy Zheng
2018-01-02  8:11   ` [linux-sunxi] " Chen-Yu Tsai
2018-01-02  8:14     ` Icenowy Zheng
2018-01-02  8:31       ` Jernej Škrabec
2018-01-03  2:47       ` Chen-Yu Tsai
2017-12-30 11:30 ` [PATCH v4 2/6] dt-bindings: add binding for A64 DE2 CCU SRAM Icenowy Zheng
2017-12-30 11:30 ` [PATCH v4 3/6] clk: sunxi-ng: add support for Allwinner A64 DE2 CCU Icenowy Zheng
2018-01-02  8:09   ` [linux-sunxi] " Chen-Yu Tsai
2017-12-30 11:30 ` [PATCH v4 4/6] arm64: allwinner: a64: add DE2 CCU for A64 SoC Icenowy Zheng
2017-12-30 11:30 ` [PATCH v4 5/6] arm64: allwinner: a64: add simplefb " Icenowy Zheng
2018-01-02  8:30   ` [linux-sunxi] " Chen-Yu Tsai
2017-12-30 11:30 ` [PATCH v4 6/6] arm64: allwinner: a64: add HDMI regulator to all DTs' simplefb_hdmi Icenowy Zheng

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