diff mbox

[v3,4/4] arm64: dts: allwinner: a64: add SRAM controller device tree node

Message ID 20180614153548.9644-5-wens@csie.org (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Chen-Yu Tsai June 14, 2018, 3:35 p.m. UTC
From: Icenowy Zheng <icenowy@aosc.io>

Allwinner A64 has a SRAM controller, and in the device tree currently
we have a syscon node to enable EMAC driver to access the EMAC clock
register. As SRAM controller driver can now export regmap for this
register, replace the syscon node to the SRAM controller device node,
and let EMAC driver to acquire its EMAC clock regmap.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
[wens@csie.org: Updated compatible string]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Comments

Jagan Teki June 14, 2018, 5:09 p.m. UTC | #1
On Thu, Jun 14, 2018 at 9:05 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> From: Icenowy Zheng <icenowy@aosc.io>
>
> Allwinner A64 has a SRAM controller, and in the device tree currently
> we have a syscon node to enable EMAC driver to access the EMAC clock
> register. As SRAM controller driver can now export regmap for this
> register, replace the syscon node to the SRAM controller device node,
> and let EMAC driver to acquire its EMAC clock regmap.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> [wens@csie.org: Updated compatible string]
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 1b2ef28c42bd..87968dafe1dc 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -169,9 +169,24 @@
>                 ranges;
>
>                 syscon: syscon@1c00000 {
> -                       compatible = "allwinner,sun50i-a64-system-controller",
> -                               "syscon";
> +                       compatible = "allwinner,sun50i-a64-system-control";
>                         reg = <0x01c00000 0x1000>;
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +                       ranges;
> +
> +                       sram_c: sram@18000 {
> +                               compatible = "mmio-sram";
> +                               reg = <0x00018000 0x28000>;
> +                               #address-cells = <1>;
> +                               #size-cells = <1>;
> +                               ranges = <0 0x00018000 0x28000>;
> +
> +                               de2_sram: sram-section@0 {

So, this can attach to display-engine node through allwinner,sram and
add support to claim the sram on sun4i/sun4i_drv.c, correct?
Jernej Škrabec June 14, 2018, 5:27 p.m. UTC | #2
Dne četrtek, 14. junij 2018 ob 19:09:56 CEST je Jagan Teki napisal(a):
> On Thu, Jun 14, 2018 at 9:05 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> > From: Icenowy Zheng <icenowy@aosc.io>
> > 
> > Allwinner A64 has a SRAM controller, and in the device tree currently
> > we have a syscon node to enable EMAC driver to access the EMAC clock
> > register. As SRAM controller driver can now export regmap for this
> > register, replace the syscon node to the SRAM controller device node,
> > and let EMAC driver to acquire its EMAC clock regmap.
> > 
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > [wens@csie.org: Updated compatible string]
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
> > 
> >  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++++++++++++++++--
> >  1 file changed, 17 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> > b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index
> > 1b2ef28c42bd..87968dafe1dc 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> > @@ -169,9 +169,24 @@
> > 
> >                 ranges;
> >                 
> >                 syscon: syscon@1c00000 {
> > 
> > -                       compatible =
> > "allwinner,sun50i-a64-system-controller", -                              
> > "syscon";
> > +                       compatible =
> > "allwinner,sun50i-a64-system-control";
> > 
> >                         reg = <0x01c00000 0x1000>;
> > 
> > +                       #address-cells = <1>;
> > +                       #size-cells = <1>;
> > +                       ranges;
> > +
> > +                       sram_c: sram@18000 {
> > +                               compatible = "mmio-sram";
> > +                               reg = <0x00018000 0x28000>;
> > +                               #address-cells = <1>;
> > +                               #size-cells = <1>;
> > +                               ranges = <0 0x00018000 0x28000>;
> > +
> > +                               de2_sram: sram-section@0 {
> 
> So, this can attach to display-engine node through allwinner,sram and
> add support to claim the sram on sun4i/sun4i_drv.c, correct?

Actually, it has to be added to display_clocks node and claimed in drivers/
clk/sunxi-ng/ccu-sun8i-de2.c

Best regards,
Jernej
Icenowy Zheng June 14, 2018, 11:09 p.m. UTC | #3
于 2018年6月15日 GMT+08:00 上午1:27:21, "Jernej Škrabec" <jernej.skrabec@gmail.com> 写到:
>Dne četrtek, 14. junij 2018 ob 19:09:56 CEST je Jagan Teki napisal(a):
>> On Thu, Jun 14, 2018 at 9:05 PM, Chen-Yu Tsai <wens@csie.org> wrote:
>> > From: Icenowy Zheng <icenowy@aosc.io>
>> > 
>> > Allwinner A64 has a SRAM controller, and in the device tree
>currently
>> > we have a syscon node to enable EMAC driver to access the EMAC
>clock
>> > register. As SRAM controller driver can now export regmap for this
>> > register, replace the syscon node to the SRAM controller device
>node,
>> > and let EMAC driver to acquire its EMAC clock regmap.
>> > 
>> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> > [wens@csie.org: Updated compatible string]
>> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> > ---
>> > 
>> >  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19
>+++++++++++++++++--
>> >  1 file changed, 17 insertions(+), 2 deletions(-)
>> > 
>> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> > b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index
>> > 1b2ef28c42bd..87968dafe1dc 100644
>> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> > @@ -169,9 +169,24 @@
>> > 
>> >                 ranges;
>> >                 
>> >                 syscon: syscon@1c00000 {
>> > 
>> > -                       compatible =
>> > "allwinner,sun50i-a64-system-controller", -                        
>     
>> > "syscon";
>> > +                       compatible =
>> > "allwinner,sun50i-a64-system-control";
>> > 
>> >                         reg = <0x01c00000 0x1000>;
>> > 
>> > +                       #address-cells = <1>;
>> > +                       #size-cells = <1>;
>> > +                       ranges;
>> > +
>> > +                       sram_c: sram@18000 {
>> > +                               compatible = "mmio-sram";
>> > +                               reg = <0x00018000 0x28000>;
>> > +                               #address-cells = <1>;
>> > +                               #size-cells = <1>;
>> > +                               ranges = <0 0x00018000 0x28000>;
>> > +
>> > +                               de2_sram: sram-section@0 {
>> 
>> So, this can attach to display-engine node through allwinner,sram and
>> add support to claim the sram on sun4i/sun4i_drv.c, correct?
>
>Actually, it has to be added to display_clocks node and claimed in
>drivers/
>clk/sunxi-ng/ccu-sun8i-de2.c

Sorry it's old practice.

My new way is to add a bus driver which claims the SRAM.

>
>Best regards,
>Jernej
>
>
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Jagan Teki June 19, 2018, 7:36 a.m. UTC | #4
On Fri, Jun 15, 2018 at 4:39 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
> 于 2018年6月15日 GMT+08:00 上午1:27:21, "Jernej Škrabec" <jernej.skrabec@gmail.com> 写到:
>>Dne četrtek, 14. junij 2018 ob 19:09:56 CEST je Jagan Teki napisal(a):
>>> On Thu, Jun 14, 2018 at 9:05 PM, Chen-Yu Tsai <wens@csie.org> wrote:
>>> > From: Icenowy Zheng <icenowy@aosc.io>
>>> >
>>> > Allwinner A64 has a SRAM controller, and in the device tree
>>currently
>>> > we have a syscon node to enable EMAC driver to access the EMAC
>>clock
>>> > register. As SRAM controller driver can now export regmap for this
>>> > register, replace the syscon node to the SRAM controller device
>>node,
>>> > and let EMAC driver to acquire its EMAC clock regmap.
>>> >
>>> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>> > [wens@csie.org: Updated compatible string]
>>> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>>> > ---
>>> >
>>> >  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19
>>+++++++++++++++++--
>>> >  1 file changed, 17 insertions(+), 2 deletions(-)
>>> >
>>> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>> > b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index
>>> > 1b2ef28c42bd..87968dafe1dc 100644
>>> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>> > @@ -169,9 +169,24 @@
>>> >
>>> >                 ranges;
>>> >
>>> >                 syscon: syscon@1c00000 {
>>> >
>>> > -                       compatible =
>>> > "allwinner,sun50i-a64-system-controller", -
>>
>>> > "syscon";
>>> > +                       compatible =
>>> > "allwinner,sun50i-a64-system-control";
>>> >
>>> >                         reg = <0x01c00000 0x1000>;
>>> >
>>> > +                       #address-cells = <1>;
>>> > +                       #size-cells = <1>;
>>> > +                       ranges;
>>> > +
>>> > +                       sram_c: sram@18000 {
>>> > +                               compatible = "mmio-sram";
>>> > +                               reg = <0x00018000 0x28000>;
>>> > +                               #address-cells = <1>;
>>> > +                               #size-cells = <1>;
>>> > +                               ranges = <0 0x00018000 0x28000>;
>>> > +
>>> > +                               de2_sram: sram-section@0 {
>>>
>>> So, this can attach to display-engine node through allwinner,sram and
>>> add support to claim the sram on sun4i/sun4i_drv.c, correct?
>>
>>Actually, it has to be added to display_clocks node and claimed in
>>drivers/
>>clk/sunxi-ng/ccu-sun8i-de2.c
>
> Sorry it's old practice.
>
> My new way is to add a bus driver which claims the SRAM.

Are you pointing this driver[1] ? if yes do we have recent version
patches for these changes so-that I can import.

[1] https://patchwork.kernel.org/patch/10290399/
Icenowy Zheng June 19, 2018, 2:27 p.m. UTC | #5
于 2018年6月19日 GMT+08:00 下午3:36:19, Jagan Teki <jagan@amarulasolutions.com> 写到:
>On Fri, Jun 15, 2018 at 4:39 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
>>
>>
>> 于 2018年6月15日 GMT+08:00 上午1:27:21, "Jernej Škrabec"
><jernej.skrabec@gmail.com> 写到:
>>>Dne četrtek, 14. junij 2018 ob 19:09:56 CEST je Jagan Teki
>napisal(a):
>>>> On Thu, Jun 14, 2018 at 9:05 PM, Chen-Yu Tsai <wens@csie.org>
>wrote:
>>>> > From: Icenowy Zheng <icenowy@aosc.io>
>>>> >
>>>> > Allwinner A64 has a SRAM controller, and in the device tree
>>>currently
>>>> > we have a syscon node to enable EMAC driver to access the EMAC
>>>clock
>>>> > register. As SRAM controller driver can now export regmap for
>this
>>>> > register, replace the syscon node to the SRAM controller device
>>>node,
>>>> > and let EMAC driver to acquire its EMAC clock regmap.
>>>> >
>>>> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>>> > [wens@csie.org: Updated compatible string]
>>>> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>>>> > ---
>>>> >
>>>> >  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19
>>>+++++++++++++++++--
>>>> >  1 file changed, 17 insertions(+), 2 deletions(-)
>>>> >
>>>> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>>> > b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index
>>>> > 1b2ef28c42bd..87968dafe1dc 100644
>>>> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>>> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>>> > @@ -169,9 +169,24 @@
>>>> >
>>>> >                 ranges;
>>>> >
>>>> >                 syscon: syscon@1c00000 {
>>>> >
>>>> > -                       compatible =
>>>> > "allwinner,sun50i-a64-system-controller", -
>>>
>>>> > "syscon";
>>>> > +                       compatible =
>>>> > "allwinner,sun50i-a64-system-control";
>>>> >
>>>> >                         reg = <0x01c00000 0x1000>;
>>>> >
>>>> > +                       #address-cells = <1>;
>>>> > +                       #size-cells = <1>;
>>>> > +                       ranges;
>>>> > +
>>>> > +                       sram_c: sram@18000 {
>>>> > +                               compatible = "mmio-sram";
>>>> > +                               reg = <0x00018000 0x28000>;
>>>> > +                               #address-cells = <1>;
>>>> > +                               #size-cells = <1>;
>>>> > +                               ranges = <0 0x00018000 0x28000>;
>>>> > +
>>>> > +                               de2_sram: sram-section@0 {
>>>>
>>>> So, this can attach to display-engine node through allwinner,sram
>and
>>>> add support to claim the sram on sun4i/sun4i_drv.c, correct?
>>>
>>>Actually, it has to be added to display_clocks node and claimed in
>>>drivers/
>>>clk/sunxi-ng/ccu-sun8i-de2.c
>>
>> Sorry it's old practice.
>>
>> My new way is to add a bus driver which claims the SRAM.
>
>Are you pointing this driver[1] ? if yes do we have recent version
>patches for these changes so-that I can import.

I'll resend it when this patchset is ready.

>
>[1] https://patchwork.kernel.org/patch/10290399/
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 1b2ef28c42bd..87968dafe1dc 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -169,9 +169,24 @@ 
 		ranges;
 
 		syscon: syscon@1c00000 {
-			compatible = "allwinner,sun50i-a64-system-controller",
-				"syscon";
+			compatible = "allwinner,sun50i-a64-system-control";
 			reg = <0x01c00000 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			sram_c: sram@18000 {
+				compatible = "mmio-sram";
+				reg = <0x00018000 0x28000>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0x00018000 0x28000>;
+
+				de2_sram: sram-section@0 {
+					compatible = "allwinner,sun50i-a64-sram-c";
+					reg = <0x0000 0x28000>;
+				};
+			};
 		};
 
 		dma: dma-controller@1c02000 {