linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus
@ 2018-06-22 12:45 Icenowy Zheng
  2018-06-22 12:45 ` [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2 Icenowy Zheng
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-22 12:45 UTC (permalink / raw)
  To: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi, Icenowy Zheng

All the sub-blocks of Allwinner A64 DE2 needs the SRAM C on A64 SoC to
be claimed, otherwise the whole DE2 space is inaccessible.

Add a device tree binding of the DE2 part as a sub-bus.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
No changes since v1.

 .../bindings/bus/sun50i-de2-bus.txt           | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt

diff --git a/Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt b/Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt
new file mode 100644
index 000000000000..87dfb33fb3be
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt
@@ -0,0 +1,37 @@
+Device tree bindings for Allwinner A64 DE2 bus
+
+The Allwinner A64 DE2 is on a special bus, which needs a SRAM region (SRAM C)
+to be claimed for enabling the access.
+
+Required properties:
+
+ - compatible:		Should contain "allwinner,sun50i-a64-de2"
+ - reg:			A resource specifier for the register space
+ - #address-cells:	Must be set to 1
+ - #size-cells:		Must be set to 1
+ - ranges:		Must be set up to map the address space inside the
+			DE2, for the sub-blocks of DE2.
+ - allwinner,sram:	the SRAM that needs to be claimed
+
+Example:
+
+	de2@1000000 {
+		compatible = "allwinner,sun50i-a64-de2";
+		reg = <0x1000000 0x400000>;
+		allwinner,sram = <&de2_sram 1>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0x1000000 0x400000>;
+
+		display_clocks: clock@0 {
+			compatible = "allwinner,sun50i-a64-de2-clk";
+			reg = <0x0 0x100000>;
+			clocks = <&ccu CLK_DE>,
+				 <&ccu CLK_BUS_DE>;
+			clock-names = "mod",
+				      "bus";
+			resets = <&ccu RST_BUS_DE>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+		};
+	};
-- 
2.17.1


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

* [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2
  2018-06-22 12:45 [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Icenowy Zheng
@ 2018-06-22 12:45 ` Icenowy Zheng
  2018-06-25 15:58   ` Maxime Ripard
  2018-06-22 12:45 ` [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string Icenowy Zheng
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-22 12:45 UTC (permalink / raw)
  To: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi, Icenowy Zheng

The "Display Engine 2.0" (usually called DE2) on the Allwinner A64 SoC
is different from the ones on other Allwinner SoCs. It requires a SRAM
region to be claimed, otherwise all DE2 subblocks won't be accessible.

Add a bus driver for the Allwinner A64 DE2 part which claims the SRAM
region when probing.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
No changes since v1.

 drivers/bus/Kconfig      | 10 ++++++++
 drivers/bus/Makefile     |  1 +
 drivers/bus/sun50i-de2.c | 49 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)
 create mode 100644 drivers/bus/sun50i-de2.c

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index d1c0b60e9326..1851112ccc29 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -103,6 +103,16 @@ config SIMPLE_PM_BUS
 	  Controller (BSC, sometimes called "LBSC within Bus Bridge", or
 	  "External Bus Interface") as found on several Renesas ARM SoCs.
 
+config SUN50I_DE2_BUS
+	bool "Allwinner A64 DE2 Bus Driver"
+	  default ARM64
+	  depends on ARCH_SUNXI
+	  select SUNXI_SRAM
+	  help
+	  Say y here to enable support for Allwinner A64 DE2 bus driver. It's
+	  mostly transparent, but a SRAM region needs to be claimed in the SRAM
+	  controller to make the all blocks in the DE2 part accessible.
+
 config SUNXI_RSB
 	tristate "Allwinner sunXi Reduced Serial Bus Driver"
 	  default MACH_SUN8I || MACH_SUN9I || ARM64
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index b8f036cca7ff..ca300b1914ce 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_OMAP_INTERCONNECT)	+= omap_l3_smx.o omap_l3_noc.o
 
 obj-$(CONFIG_OMAP_OCP2SCP)	+= omap-ocp2scp.o
 obj-$(CONFIG_QCOM_EBI2)		+= qcom-ebi2.o
+obj-$(CONFIG_SUN50I_DE2_BUS)	+= sun50i-de2.o
 obj-$(CONFIG_SUNXI_RSB)		+= sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)	+= simple-pm-bus.o
 obj-$(CONFIG_TEGRA_ACONNECT)	+= tegra-aconnect.o
diff --git a/drivers/bus/sun50i-de2.c b/drivers/bus/sun50i-de2.c
new file mode 100644
index 000000000000..836828ef96d5
--- /dev/null
+++ b/drivers/bus/sun50i-de2.c
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Allwinner A64 Display Engine 2.0 Bus Driver
+ *
+ * Copyright (C) 2018 Icenowy Zheng <icenowy@aosc.io>
+ */
+
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/soc/sunxi/sunxi_sram.h>
+
+static int sun50i_de2_bus_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	int ret;
+
+	ret = sunxi_sram_claim(&pdev->dev);
+	if (ret) {
+		dev_err(&pdev->dev, "Error couldn't map SRAM to device\n");
+		return ret;
+	}
+
+	if (np)
+		of_platform_populate(np, NULL, NULL, &pdev->dev);
+
+	return 0;
+}
+
+static int sun50i_de2_bus_remove(struct platform_device *pdev)
+{
+	sunxi_sram_release(&pdev->dev);
+	return 0;
+}
+
+static const struct of_device_id sun50i_de2_bus_of_match[] = {
+	{ .compatible = "allwinner,sun50i-a64-de2", },
+	{ /* sentinel */ }
+};
+
+static struct platform_driver sun50i_de2_bus_driver = {
+	.probe = sun50i_de2_bus_probe,
+	.remove = sun50i_de2_bus_remove,
+	.driver = {
+		.name = "sun50i-de2-bus",
+		.of_match_table = sun50i_de2_bus_of_match,
+	},
+};
+
+builtin_platform_driver(sun50i_de2_bus_driver);
-- 
2.17.1


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

* [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string
  2018-06-22 12:45 [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Icenowy Zheng
  2018-06-22 12:45 ` [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2 Icenowy Zheng
@ 2018-06-22 12:45 ` Icenowy Zheng
  2018-06-25 15:58   ` Maxime Ripard
  2018-06-22 12:45 ` [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU Icenowy Zheng
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-22 12:45 UTC (permalink / raw)
  To: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi, Icenowy Zheng

As claiming Allwinner A64 SRAM C is a prerequisite for all sub-blocks of
the A64 DE2, not only the CCU sub-block, a bus driver is then written for
enabling the access to the whole DE2 part by claiming the SRAM.

In this situation, the A64 compatible string will be just added with no
other requirments, as they're processed by the parent bus driver.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
No changes since v1.

 drivers/clk/sunxi-ng/ccu-sun8i-de2.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
index 468d1abaf0ee..8df7cd93453e 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
@@ -292,13 +292,10 @@ static const struct of_device_id sunxi_de2_clk_ids[] = {
 		.compatible = "allwinner,sun50i-h5-de2-clk",
 		.data = &sun50i_a64_de2_clk_desc,
 	},
-	/*
-	 * 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.
-	 */
+	{
+		.compatible = "allwinner,sun50i-a64-de2-clk",
+		.data = &sun50i_a64_de2_clk_desc,
+	},
 	{ }
 };
 
-- 
2.17.1


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

* [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU
  2018-06-22 12:45 [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Icenowy Zheng
  2018-06-22 12:45 ` [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2 Icenowy Zheng
  2018-06-22 12:45 ` [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string Icenowy Zheng
@ 2018-06-22 12:45 ` Icenowy Zheng
  2018-06-23 14:06   ` [linux-sunxi] " Julian Calaby
  2018-06-22 12:45 ` [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb Icenowy Zheng
  2018-06-25 20:18 ` [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Rob Herring
  4 siblings, 1 reply; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-22 12:45 UTC (permalink / raw)
  To: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi, Icenowy Zheng

As we have all necessary parts to enable the DE2 CCU on the Allwinner
A64 SoC, add the needed device tree nodes, including the DE2 CCU itself
and the DE2 bus.

The "mixer0-lcd0" simplefb device node is updated to use the DE2 CCU.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v2:
- Drop SRAM controller device tree node addition (as it's already added
  as part of syscon change.)
- Fix the clock reference in LCD SimpleFB.

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

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index ff2ddde1e117..318c4ba8ae9f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -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>
 #include <dt-bindings/reset/sun8i-r-ccu.h>
 
 / {
@@ -58,17 +60,12 @@
 		#size-cells = <1>;
 		ranges;
 
-/*
- * The pipeline mixer0-lcd0 depends on clock CLK_MIXER0 from DE2 CCU.
- * However there is no support for this clock on A64 yet, so we depend
- * on the upstream clocks here to keep them (and thus CLK_MIXER0) up.
- */
 		simplefb_lcd: framebuffer-lcd {
 			compatible = "allwinner,simple-framebuffer",
 				     "simple-framebuffer";
 			allwinner,pipeline = "mixer0-lcd0";
 			clocks = <&ccu CLK_TCON0>,
-				 <&ccu CLK_DE>, <&ccu CLK_BUS_DE>;
+				 <&display_clocks CLK_MIXER0>;
 			status = "disabled";
 		};
 	};
@@ -169,6 +166,27 @@
 		#size-cells = <1>;
 		ranges;
 
+		de2@1000000 {
+			compatible = "allwinner,sun50i-a64-de2";
+			reg = <0x1000000 0x400000>;
+			allwinner,sram = <&de2_sram 1>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x1000000 0x400000>;
+
+			display_clocks: clock@0 {
+				compatible = "allwinner,sun50i-a64-de2-clk";
+				reg = <0x0 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-control";
 			reg = <0x01c00000 0x1000>;
-- 
2.17.1


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

* [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb
  2018-06-22 12:45 [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Icenowy Zheng
                   ` (2 preceding siblings ...)
  2018-06-22 12:45 ` [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU Icenowy Zheng
@ 2018-06-22 12:45 ` Icenowy Zheng
  2018-06-25 15:59   ` Maxime Ripard
  2018-06-26  3:32   ` [linux-sunxi] " Chen-Yu Tsai
  2018-06-25 20:18 ` [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Rob Herring
  4 siblings, 2 replies; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-22 12:45 UTC (permalink / raw)
  To: Rob Herring, Maxime Ripard, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi, Icenowy Zheng

As the U-Boot bootloader now is also capable of initialize the HDMI on
A64 boards, add a simplefb device tree node for accessing the HDMI
framebuffer initialized by the bootloader.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v2:
- Dropped LCD SimpleFB as it's already added. LCD SimpleFB needs some
  fix but the fix is present when adding DE2 CCU.

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

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 318c4ba8ae9f..840753432ea5 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -68,6 +68,15 @@
 				 <&display_clocks CLK_MIXER0>;
 			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 {
-- 
2.17.1


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

* Re: [linux-sunxi] [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU
  2018-06-22 12:45 ` [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU Icenowy Zheng
@ 2018-06-23 14:06   ` Julian Calaby
  2018-06-23 14:18     ` Icenowy Zheng
  0 siblings, 1 reply; 14+ messages in thread
From: Julian Calaby @ 2018-06-23 14:06 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, jagan, jernej.skrabec,
	devicetree, Mailing List, Arm, linux-kernel,
	open list:COMMON CLK FRAMEWORK, linux-sunxi

Hi Icenowy,

On Fri, Jun 22, 2018 at 10:49 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>
> As we have all necessary parts to enable the DE2 CCU on the Allwinner
> A64 SoC, add the needed device tree nodes, including the DE2 CCU itself
> and the DE2 bus.
>
> The "mixer0-lcd0" simplefb device node is updated to use the DE2 CCU.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> Changes in v2:
> - Drop SRAM controller device tree node addition (as it's already added
>   as part of syscon change.)
> - Fix the clock reference in LCD SimpleFB.
>
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 30 +++++++++++++++----
>  1 file changed, 24 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index ff2ddde1e117..318c4ba8ae9f 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -58,17 +60,12 @@
>                 #size-cells = <1>;
>                 ranges;
>
> -/*
> - * The pipeline mixer0-lcd0 depends on clock CLK_MIXER0 from DE2 CCU.
> - * However there is no support for this clock on A64 yet, so we depend
> - * on the upstream clocks here to keep them (and thus CLK_MIXER0) up.
> - */
>                 simplefb_lcd: framebuffer-lcd {
>                         compatible = "allwinner,simple-framebuffer",
>                                      "simple-framebuffer";
>                         allwinner,pipeline = "mixer0-lcd0";
>                         clocks = <&ccu CLK_TCON0>,
> -                                <&ccu CLK_DE>, <&ccu CLK_BUS_DE>;
> +                                <&display_clocks CLK_MIXER0>;

Doesn't this technically break simplefb if this DT is used with a
Linux that doesn't have the display clock driver?

Do we care about breaking that use-case?

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

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

* Re: [linux-sunxi] [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU
  2018-06-23 14:06   ` [linux-sunxi] " Julian Calaby
@ 2018-06-23 14:18     ` Icenowy Zheng
  2018-06-23 14:49       ` Julian Calaby
  0 siblings, 1 reply; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-23 14:18 UTC (permalink / raw)
  To: julian.calaby, Julian Calaby
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, jagan, jernej.skrabec,
	devicetree, Mailing List, Arm, linux-kernel,
	open list:COMMON CLK FRAMEWORK, linux-sunxi



于 2018年6月23日 GMT+08:00 下午10:06:27, Julian Calaby <julian.calaby@gmail.com> 写到:
>Hi Icenowy,
>
>On Fri, Jun 22, 2018 at 10:49 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>>
>> As we have all necessary parts to enable the DE2 CCU on the Allwinner
>> A64 SoC, add the needed device tree nodes, including the DE2 CCU
>itself
>> and the DE2 bus.
>>
>> The "mixer0-lcd0" simplefb device node is updated to use the DE2 CCU.
>>
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> ---
>> Changes in v2:
>> - Drop SRAM controller device tree node addition (as it's already
>added
>>   as part of syscon change.)
>> - Fix the clock reference in LCD SimpleFB.
>>
>>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 30
>+++++++++++++++----
>>  1 file changed, 24 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> index ff2ddde1e117..318c4ba8ae9f 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> @@ -58,17 +60,12 @@
>>                 #size-cells = <1>;
>>                 ranges;
>>
>> -/*
>> - * The pipeline mixer0-lcd0 depends on clock CLK_MIXER0 from DE2
>CCU.
>> - * However there is no support for this clock on A64 yet, so we
>depend
>> - * on the upstream clocks here to keep them (and thus CLK_MIXER0)
>up.
>> - */
>>                 simplefb_lcd: framebuffer-lcd {
>>                         compatible = "allwinner,simple-framebuffer",
>>                                      "simple-framebuffer";
>>                         allwinner,pipeline = "mixer0-lcd0";
>>                         clocks = <&ccu CLK_TCON0>,
>> -                                <&ccu CLK_DE>, <&ccu CLK_BUS_DE>;
>> +                                <&display_clocks CLK_MIXER0>;
>
>Doesn't this technically break simplefb if this DT is used with a
>Linux that doesn't have the display clock driver?

1. DT doesn't care forware compatibility.

2. This is a fix for not accurate HW representation. In
fact I have sent the DT with simplefb using DE2 CCU before, but
when they're pending, someone who just wants the simplefb
sent the not temporary version.This must be fixed.

>
>Do we care about breaking that use-case?
>
>Thanks,

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

* Re: [linux-sunxi] [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU
  2018-06-23 14:18     ` Icenowy Zheng
@ 2018-06-23 14:49       ` Julian Calaby
  0 siblings, 0 replies; 14+ messages in thread
From: Julian Calaby @ 2018-06-23 14:49 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Rob Herring, Maxime Ripard, Chen-Yu Tsai, jagan, jernej.skrabec,
	devicetree, Mailing List, Arm, linux-kernel,
	open list:COMMON CLK FRAMEWORK, linux-sunxi

Hi Icenowy,

On Sun, Jun 24, 2018 at 12:34 AM Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
>
> 于 2018年6月23日 GMT+08:00 下午10:06:27, Julian Calaby <julian.calaby@gmail.com> 写到:
> >Hi Icenowy,
> >
> >On Fri, Jun 22, 2018 at 10:49 PM Icenowy Zheng <icenowy@aosc.io> wrote:
> >>
> >> As we have all necessary parts to enable the DE2 CCU on the Allwinner
> >> A64 SoC, add the needed device tree nodes, including the DE2 CCU
> >itself
> >> and the DE2 bus.
> >>
> >> The "mixer0-lcd0" simplefb device node is updated to use the DE2 CCU.
> >>
> >> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> >> ---
> >> Changes in v2:
> >> - Drop SRAM controller device tree node addition (as it's already
> >added
> >>   as part of syscon change.)
> >> - Fix the clock reference in LCD SimpleFB.
> >>
> >>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 30
> >+++++++++++++++----
> >>  1 file changed, 24 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >> index ff2ddde1e117..318c4ba8ae9f 100644
> >> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >> @@ -58,17 +60,12 @@
> >>                 #size-cells = <1>;
> >>                 ranges;
> >>
> >> -/*
> >> - * The pipeline mixer0-lcd0 depends on clock CLK_MIXER0 from DE2
> >CCU.
> >> - * However there is no support for this clock on A64 yet, so we
> >depend
> >> - * on the upstream clocks here to keep them (and thus CLK_MIXER0)
> >up.
> >> - */
> >>                 simplefb_lcd: framebuffer-lcd {
> >>                         compatible = "allwinner,simple-framebuffer",
> >>                                      "simple-framebuffer";
> >>                         allwinner,pipeline = "mixer0-lcd0";
> >>                         clocks = <&ccu CLK_TCON0>,
> >> -                                <&ccu CLK_DE>, <&ccu CLK_BUS_DE>;
> >> +                                <&display_clocks CLK_MIXER0>;
> >
> >Doesn't this technically break simplefb if this DT is used with a
> >Linux that doesn't have the display clock driver?
>
> 1. DT doesn't care forware compatibility.

Ah, fair enough, that answers my question.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

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

* Re: [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2
  2018-06-22 12:45 ` [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2 Icenowy Zheng
@ 2018-06-25 15:58   ` Maxime Ripard
  2018-06-25 15:59     ` Icenowy Zheng
  0 siblings, 1 reply; 14+ messages in thread
From: Maxime Ripard @ 2018-06-25 15:58 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Rob Herring, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec,
	devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]

On Fri, Jun 22, 2018 at 08:45:36PM +0800, Icenowy Zheng wrote:
> The "Display Engine 2.0" (usually called DE2) on the Allwinner A64 SoC
> is different from the ones on other Allwinner SoCs. It requires a SRAM
> region to be claimed, otherwise all DE2 subblocks won't be accessible.
> 
> Add a bus driver for the Allwinner A64 DE2 part which claims the SRAM
> region when probing.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> No changes since v1.
> 
>  drivers/bus/Kconfig      | 10 ++++++++
>  drivers/bus/Makefile     |  1 +
>  drivers/bus/sun50i-de2.c | 49 ++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 60 insertions(+)
>  create mode 100644 drivers/bus/sun50i-de2.c
> 
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index d1c0b60e9326..1851112ccc29 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -103,6 +103,16 @@ config SIMPLE_PM_BUS
>  	  Controller (BSC, sometimes called "LBSC within Bus Bridge", or
>  	  "External Bus Interface") as found on several Renesas ARM SoCs.
>  
> +config SUN50I_DE2_BUS
> +	bool "Allwinner A64 DE2 Bus Driver"
> +	  default ARM64
> +	  depends on ARCH_SUNXI
> +	  select SUNXI_SRAM
> +	  help

The alignment here should be one tab.

> +static int sun50i_de2_bus_probe(struct platform_device *pdev)
> +{
> +	struct device_node *np = pdev->dev.of_node;
> +	int ret;
> +
> +	ret = sunxi_sram_claim(&pdev->dev);
> +	if (ret) {
> +		dev_err(&pdev->dev, "Error couldn't map SRAM to device\n");
> +		return ret;
> +	}
> +
> +	if (np)
> +		of_platform_populate(np, NULL, NULL, &pdev->dev);

Why do you need to test np here?

Maxime

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string
  2018-06-22 12:45 ` [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string Icenowy Zheng
@ 2018-06-25 15:58   ` Maxime Ripard
  0 siblings, 0 replies; 14+ messages in thread
From: Maxime Ripard @ 2018-06-25 15:58 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Rob Herring, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec,
	devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

On Fri, Jun 22, 2018 at 08:45:37PM +0800, Icenowy Zheng wrote:
> As claiming Allwinner A64 SRAM C is a prerequisite for all sub-blocks of
> the A64 DE2, not only the CCU sub-block, a bus driver is then written for
> enabling the access to the whole DE2 part by claiming the SRAM.
> 
> In this situation, the A64 compatible string will be just added with no
> other requirments, as they're processed by the parent bus driver.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> No changes since v1.
> 
>  drivers/clk/sunxi-ng/ccu-sun8i-de2.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
> index 468d1abaf0ee..8df7cd93453e 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
> @@ -292,13 +292,10 @@ static const struct of_device_id sunxi_de2_clk_ids[] = {
>  		.compatible = "allwinner,sun50i-h5-de2-clk",
>  		.data = &sun50i_a64_de2_clk_desc,
>  	},
> -	/*
> -	 * 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.
> -	 */
> +	{
> +		.compatible = "allwinner,sun50i-a64-de2-clk",
> +		.data = &sun50i_a64_de2_clk_desc,
> +	},

This should be before the h5 (and possibly others?) compatible.

Maxime

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb
  2018-06-22 12:45 ` [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb Icenowy Zheng
@ 2018-06-25 15:59   ` Maxime Ripard
  2018-06-26  3:32   ` [linux-sunxi] " Chen-Yu Tsai
  1 sibling, 0 replies; 14+ messages in thread
From: Maxime Ripard @ 2018-06-25 15:59 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Rob Herring, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec,
	devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

On Fri, Jun 22, 2018 at 08:45:39PM +0800, Icenowy Zheng wrote:
> As the U-Boot bootloader now is also capable of initialize the HDMI on
> A64 boards, add a simplefb device tree node for accessing the HDMI
> framebuffer initialized by the bootloader.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> Changes in v2:
> - Dropped LCD SimpleFB as it's already added. LCD SimpleFB needs some
>   fix but the fix is present when adding DE2 CCU.
> 
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 318c4ba8ae9f..840753432ea5 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -68,6 +68,15 @@
>  				 <&display_clocks CLK_MIXER0>;
>  			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";
> +		};

This node should be before the lcd node

Maxime

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2
  2018-06-25 15:58   ` Maxime Ripard
@ 2018-06-25 15:59     ` Icenowy Zheng
  0 siblings, 0 replies; 14+ messages in thread
From: Icenowy Zheng @ 2018-06-25 15:59 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Rob Herring, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec,
	devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi



于 2018年6月25日 GMT+08:00 下午11:58:05, Maxime Ripard <maxime.ripard@bootlin.com> 写到:
>On Fri, Jun 22, 2018 at 08:45:36PM +0800, Icenowy Zheng wrote:
>> The "Display Engine 2.0" (usually called DE2) on the Allwinner A64
>SoC
>> is different from the ones on other Allwinner SoCs. It requires a
>SRAM
>> region to be claimed, otherwise all DE2 subblocks won't be
>accessible.
>> 
>> Add a bus driver for the Allwinner A64 DE2 part which claims the SRAM
>> region when probing.
>> 
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> ---
>> No changes since v1.
>> 
>>  drivers/bus/Kconfig      | 10 ++++++++
>>  drivers/bus/Makefile     |  1 +
>>  drivers/bus/sun50i-de2.c | 49
>++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 60 insertions(+)
>>  create mode 100644 drivers/bus/sun50i-de2.c
>> 
>> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
>> index d1c0b60e9326..1851112ccc29 100644
>> --- a/drivers/bus/Kconfig
>> +++ b/drivers/bus/Kconfig
>> @@ -103,6 +103,16 @@ config SIMPLE_PM_BUS
>>  	  Controller (BSC, sometimes called "LBSC within Bus Bridge", or
>>  	  "External Bus Interface") as found on several Renesas ARM SoCs.
>>  
>> +config SUN50I_DE2_BUS
>> +	bool "Allwinner A64 DE2 Bus Driver"
>> +	  default ARM64
>> +	  depends on ARCH_SUNXI
>> +	  select SUNXI_SRAM
>> +	  help
>
>The alignment here should be one tab.
>
>> +static int sun50i_de2_bus_probe(struct platform_device *pdev)
>> +{
>> +	struct device_node *np = pdev->dev.of_node;
>> +	int ret;
>> +
>> +	ret = sunxi_sram_claim(&pdev->dev);
>> +	if (ret) {
>> +		dev_err(&pdev->dev, "Error couldn't map SRAM to device\n");
>> +		return ret;
>> +	}
>> +
>> +	if (np)
>> +		of_platform_populate(np, NULL, NULL, &pdev->dev);
>
>Why do you need to test np here?

Oh thanks. Currently it's only probeable via dt.

>
>Maxime

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

* Re: [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus
  2018-06-22 12:45 [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Icenowy Zheng
                   ` (3 preceding siblings ...)
  2018-06-22 12:45 ` [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb Icenowy Zheng
@ 2018-06-25 20:18 ` Rob Herring
  4 siblings, 0 replies; 14+ messages in thread
From: Rob Herring @ 2018-06-25 20:18 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Maxime Ripard, Chen-Yu Tsai, Jagan Teki, Jernej Skrabec,
	devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi

On Fri, Jun 22, 2018 at 08:45:35PM +0800, Icenowy Zheng wrote:
> All the sub-blocks of Allwinner A64 DE2 needs the SRAM C on A64 SoC to
> be claimed, otherwise the whole DE2 space is inaccessible.
> 
> Add a device tree binding of the DE2 part as a sub-bus.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> No changes since v1.
> 
>  .../bindings/bus/sun50i-de2-bus.txt           | 37 +++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [linux-sunxi] [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb
  2018-06-22 12:45 ` [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb Icenowy Zheng
  2018-06-25 15:59   ` Maxime Ripard
@ 2018-06-26  3:32   ` Chen-Yu Tsai
  1 sibling, 0 replies; 14+ messages in thread
From: Chen-Yu Tsai @ 2018-06-26  3:32 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Rob Herring, Maxime Ripard, Jagan Teki, Jernej Skrabec,
	devicetree, linux-arm-kernel, linux-kernel, linux-clk,
	linux-sunxi

On Fri, Jun 22, 2018 at 8:45 PM, Icenowy Zheng <icenowy@aosc.io> wrote:
> As the U-Boot bootloader now is also capable of initialize the HDMI on
> A64 boards, add a simplefb device tree node for accessing the HDMI
> framebuffer initialized by the bootloader.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

The subject should have "dts" in it, like:

    arm64: dts: allwinner: a64: ....

Seems we've been missing them for half the patches this coming cycle.

ChenYu

> ---
> Changes in v2:
> - Dropped LCD SimpleFB as it's already added. LCD SimpleFB needs some
>   fix but the fix is present when adding DE2 CCU.
>
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 318c4ba8ae9f..840753432ea5 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -68,6 +68,15 @@
>                                  <&display_clocks CLK_MIXER0>;
>                         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 {
> --
> 2.17.1
>
> --
> 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@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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

end of thread, other threads:[~2018-06-26  3:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 12:45 [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Icenowy Zheng
2018-06-22 12:45 ` [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2 Icenowy Zheng
2018-06-25 15:58   ` Maxime Ripard
2018-06-25 15:59     ` Icenowy Zheng
2018-06-22 12:45 ` [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string Icenowy Zheng
2018-06-25 15:58   ` Maxime Ripard
2018-06-22 12:45 ` [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU Icenowy Zheng
2018-06-23 14:06   ` [linux-sunxi] " Julian Calaby
2018-06-23 14:18     ` Icenowy Zheng
2018-06-23 14:49       ` Julian Calaby
2018-06-22 12:45 ` [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb Icenowy Zheng
2018-06-25 15:59   ` Maxime Ripard
2018-06-26  3:32   ` [linux-sunxi] " Chen-Yu Tsai
2018-06-25 20:18 ` [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus Rob Herring

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