2018-06-22 12:48:20

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus

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 <[email protected]>
---
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



2018-06-22 12:49:10

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2

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 <[email protected]>
---
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 <[email protected]>
+ */
+
+#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


2018-06-22 12:50:18

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string

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 <[email protected]>
---
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


2018-06-22 12:51:42

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU

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 <[email protected]>
---
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


2018-06-22 12:54:47

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb

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 <[email protected]>
---
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


2018-06-23 14:07:48

by Julian Calaby

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU

Hi Icenowy,

On Fri, Jun 22, 2018 at 10:49 PM Icenowy Zheng <[email protected]> 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 <[email protected]>
> ---
> 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: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

2018-06-23 14:35:11

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU



于 2018年6月23日 GMT+08:00 下午10:06:27, Julian Calaby <[email protected]> 写到:
>Hi Icenowy,
>
>On Fri, Jun 22, 2018 at 10:49 PM Icenowy Zheng <[email protected]> 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 <[email protected]>
>> ---
>> 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,

2018-06-23 14:51:39

by Julian Calaby

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH v2 5/7] arm64: allwinner: a64: add necessary device tree nodes for DE2 CCU

Hi Icenowy,

On Sun, Jun 24, 2018 at 12:34 AM Icenowy Zheng <[email protected]> wrote:
>
>
>
> 于 2018年6月23日 GMT+08:00 下午10:06:27, Julian Calaby <[email protected]> 写到:
> >Hi Icenowy,
> >
> >On Fri, Jun 22, 2018 at 10:49 PM Icenowy Zheng <[email protected]> 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 <[email protected]>
> >> ---
> >> 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: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

2018-06-25 16:01:29

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2 4/7] clk: sunxi-ng: add A64 compatible string

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 <[email protected]>
> ---
> 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


Attachments:
(No filename) (1.58 kB)
signature.asc (849.00 B)
Download all attachments

2018-06-25 16:01:31

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2

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 <[email protected]>
> ---
> 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


Attachments:
(No filename) (1.75 kB)
signature.asc (849.00 B)
Download all attachments

2018-06-25 16:01:35

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb

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 <[email protected]>
> ---
> 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


Attachments:
(No filename) (1.37 kB)
signature.asc (849.00 B)
Download all attachments

2018-06-25 16:05:32

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] bus: add bus driver for accessing Allwinner A64 DE2



于 2018年6月25日 GMT+08:00 下午11:58:05, Maxime Ripard <[email protected]> 写到:
>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 <[email protected]>
>> ---
>> 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

2018-06-25 20:19:29

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 2/7] dt-bindings: add binding for the Allwinner A64 DE2 bus

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 <[email protected]>
> ---
> 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 <[email protected]>

2018-06-26 03:34:38

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH v2 6/7] arm64: allwinner: a64: add device tree node for HDMI simplefb

On Fri, Jun 22, 2018 at 8:45 PM, Icenowy Zheng <[email protected]> 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 <[email protected]>

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 [email protected].
> For more options, visit https://groups.google.com/d/optout.