Skip to contentSkip to conversation

Add R8A7792 SDHI support

PATCH New Sergei Shtylyov 3 participants 11 messages Jul 12, 2016 – Jul 20, 2016 Device tree bindings

lore
Share & tools
lore
#0 lore raw

cover Add R8A7792 SDHI support

Hello.

Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
'renesas-devel-20160711-v4.7-rc7' tag plus the R8A7792 PFC/GPIO/EtherAVB patchsets. We're adding the R8A7792 SDHI clocks and device nodes. They have been tested on the Blanche board -- I'm not posting the Blanche patch only because it has some strange interaction with the Ethernet chip, so that NFS root woedn't work anymore...

[1/2] ARM: dts: r8a7792: add SD clocks
[2/2] ARM: dts: r8a7792: add SDHI support

WBR, Sergei

#1 lore raw

PATCH 1/2 ARM: dts: r8a7792: add SD clocks

Describe the SDHI0 clock and its parent, SD clock in the R8A7792 device tree.

---
 arch/arm/boot/dts/r8a7792.dtsi |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm/boot/dts/r8a7792.dtsi +16 -0
Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===================================================================
@@ -511,6 +511,13 @@
 			clock-div = <8>;
 			clock-mult = <1>;
 		};
+		sd_clk: sd {
+			compatible = "fixed-factor-clock";
+			clocks = <&pll1_div2_clk>;
+			#clock-cells = <0>;
+			clock-div = <8>;
+			clock-mult = <1>;
+		};
 
 		/* Gate clocks */
 		mstp1_clks: mstp1_clks at e6150134 {
@@ -533,6 +540,15 @@
 			>;
 			clock-output-names = "sys-dmac1", "sys-dmac0";
 		};
+		mstp3_clks: mstp3_clks at e615013c {
+			compatible = "renesas,r8a7792-mstp-clocks",
+				     "renesas,cpg-mstp-clocks";
+			reg = <0 0xe615013c 0 4>, <0 0xe6150048 0 4>;
+			clocks = <&sd_clk>;
+			#clock-cells = <1>;
+			renesas,clock-indices = <R8A7792_CLK_SDHI0>;
+			clock-output-names = "sdhi0";
+		};
 		mstp4_clks: mstp4_clks at e6150140 {
 			compatible = "renesas,r8a7792-mstp-clocks",
 				     "renesas,cpg-mstp-clocks";
#3 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

In reply to Sergei Shtylyov

Define the generic R8A7792 part of the SDHI0 device node.

---
 arch/arm/boot/dts/r8a7792.dtsi |   12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/r8a7792.dtsi +12 -0
Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===================================================================
@@ -435,6 +435,18 @@
 			status = "disabled";
 		};
 
+		sdhi0: sd at ee100000 {
+			compatible = "renesas,sdhi-r8a7792";
+			reg = <0 0xee100000 0 0x200>;
+			interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+			dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+			       <&dmac1 0xcd>, <&dmac1 0xce>;
+			dma-names = "tx", "rx", "tx", "rx";
+			clocks = <&mstp3_clks R8A7792_CLK_SDHI0>;
+			power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
 		jpu: jpeg-codec at fe980000 {
 			compatible = "renesas,jpu-r8a7792",
 				     "renesas,rcar-gen2-jpu";
#2 lore raw

PATCH 1/2 ARM: dts: r8a7792: add SD clocks

In reply to Sergei Shtylyov
Quoted 3 lines · Sergei Shtylyov

Describe the SDHI0 clock and its parent, SD clock in the R8A7792 device tree.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#4 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

In reply to Sergei Shtylyov
Quoted 3 lines · Sergei Shtylyov

Define the generic R8A7792 part of the SDHI0 device node.

Quoted 11 lines
---
 arch/arm/boot/dts/r8a7792.dtsi |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===================================================================

arch/arm/boot/dts/r8a7792.dtsi +0 -0
@@ -435,6 +435,18 @@
                        status = "disabled";
                };

arch/arm/boot/dts/r8a7792.dtsi line 446

Quoted 10 lines
arch/arm/boot/dts/r8a7792.dtsi +9 -0
 
+               sdhi0: sd at ee100000 {
+                       compatible = "renesas,sdhi-r8a7792";
+                       reg = <0 0xee100000 0 0x200>;
+                       interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+                              <&dmac1 0xcd>, <&dmac1 0xce>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       clocks = <&mstp3_clks R8A7792_CLK_SDHI0>;
+                       power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;

Do we want a "max-frequency" property here? Note that this instance doesn't support SDR104/SDR50.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

In reply to Sergei Shtylyov
Quoted 13 lines · Sergei Shtylyov

Define the generic R8A7792 part of the SDHI0 device node.

---
 arch/arm/boot/dts/r8a7792.dtsi |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===================================================================

arch/arm/boot/dts/r8a7792.dtsi line 440

Quoted 6 lines
arch/arm/boot/dts/r8a7792.dtsi +3 -0
@@ -435,6 +435,18 @@
 			status = "disabled";
 		};
 
+		sdhi0: sd at ee100000 {
+			compatible = "renesas,sdhi-r8a7792";
+			reg = <0 0xee100000 0 0x200>;

I do not have the documentation available to check, however, I wonder if as per 66f47ed0e86d ("ARM: shmobile: r8a7790: tidyup SDHI register size on DTSI") the register size should be 0x328.

It also looks like register the DTS for the r8a7794 needs updating along the same lines.

Quoted 13 lines
arch/arm/boot/dts/r8a7792.dtsi +9 -0
+			interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+			dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+			       <&dmac1 0xcd>, <&dmac1 0xce>;
+			dma-names = "tx", "rx", "tx", "rx";
+			clocks = <&mstp3_clks R8A7792_CLK_SDHI0>;
+			power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
 		jpu: jpeg-codec at fe980000 {
 			compatible = "renesas,jpu-r8a7792",
 				     "renesas,rcar-gen2-jpu";
#6 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

Hello.

Quoted 16 lines · Simon Horman
Quoted 16 lines

Define the generic R8A7792 part of the SDHI0 device node.

---
 arch/arm/boot/dts/r8a7792.dtsi |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: renesas/arch/arm/boot/dts/r8a7792.dtsi
===================================================================

arch/arm/boot/dts/r8a7792.dtsi +0 -0
@@ -435,6 +435,18 @@
 			status = "disabled";
 		};
 
Quoted 5 lines

arch/arm/boot/dts/r8a7792.dtsi line 440

Quoted 3 lines
arch/arm/boot/dts/r8a7792.dtsi +3 -0
+		sdhi0: sd at ee100000 {
+			compatible = "renesas,sdhi-r8a7792";
+			reg = <0 0xee100000 0 0x200>;

I do not have the documentation available to check,

Me nether. The SDHI .zip only includes the manual for E2, H2, and M2.

Quoted 3 lines

however, I wonder if
as per 66f47ed0e86d ("ARM: shmobile: r8a7790: tidyup SDHI register size on DTSI") the register size should be 0x328.

I just don't know...

Quoted 2 lines

It also looks like register the DTS for the r8a7794 needs updating along the same lines.

Indeed.

Quoted 4 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7792.dtsi +4 -0
+			interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+			dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+			       <&dmac1 0xcd>, <&dmac1 0xce>;
+			dma-names = "tx", "rx", "tx", "rx";
Quoted 8 lines

arch/arm/boot/dts/r8a7792.dtsi line 452

Quoted 8 lines
arch/arm/boot/dts/r8a7792.dtsi +5 -0
+			clocks = <&mstp3_clks R8A7792_CLK_SDHI0>;
+			power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+			status = "disabled";
+		};
+
 		jpu: jpeg-codec at fe980000 {
 			compatible = "renesas,jpu-r8a7792",
 				     "renesas,rcar-gen2-jpu";

I also wonder whether whether a single per-SoC SDHI "compatible" is valid.
The registers and their offsets seem to differ b/w SDHI0 and the other SDHI cores...

MBR, Sergei

#7 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

Hi Sergei,

Quoted 34 lines · Sergei Shtylyov
Quoted 6 lines
Quoted 6 lines
arch/arm/boot/dts/r8a7792.dtsi +0 -0
@@ -435,6 +435,18 @@
                        status = "disabled";
                };
 
Quoted 6 lines

arch/arm/boot/dts/r8a7792.dtsi line 440

Quoted 3 lines
arch/arm/boot/dts/r8a7792.dtsi +3 -0
+               sdhi0: sd at ee100000 {
+                       compatible = "renesas,sdhi-r8a7792";
+                       reg = <0 0xee100000 0 0x200>;

I do not have the documentation available to check,

Me nether. The SDHI .zip only includes the manual for E2, H2, and M2.

Quoted 3 lines

however, I wonder if
as per 66f47ed0e86d ("ARM: shmobile: r8a7790: tidyup SDHI register size on DTSI") the register size should be 0x328.

I just don't know...

Quoted 4 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7792.dtsi +4 -0
+                       interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+                              <&dmac1 0xcd>, <&dmac1 0xce>;
+                       dma-names = "tx", "rx", "tx", "rx";
Quoted 8 lines

arch/arm/boot/dts/r8a7792.dtsi line 452

Quoted 8 lines
arch/arm/boot/dts/r8a7792.dtsi +5 -0
+                       clocks = <&mstp3_clks R8A7792_CLK_SDHI0>;
+                       power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+                       status = "disabled";
+               };
+
                jpu: jpeg-codec at fe980000 {
                        compatible = "renesas,jpu-r8a7792",
                                     "renesas,rcar-gen2-jpu";
Quoted 3 lines

I also wonder whether whether a single per-SoC SDHI "compatible" is
valid. The registers and their offsets seem to differ b/w SDHI0 and the other SDHI cores...

There's version register.

BTW, given SDHI on V2H doesn't support SDR50/SDR104, unlike the instances on other R-Car Gen2 SoCs, can you please tell us the version value, as read from CTL_VERSION in sh_mobile_sdhi_sdbuf_width()?

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#8 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

Quoted 38 lines · Geert Uytterhoeven
Quoted 34 lines
Quoted 6 lines
Quoted 6 lines
arch/arm/boot/dts/r8a7792.dtsi +0 -0
@@ -435,6 +435,18 @@
                        status = "disabled";
                };
 
Quoted 6 lines

arch/arm/boot/dts/r8a7792.dtsi line 440

Quoted 3 lines
arch/arm/boot/dts/r8a7792.dtsi +3 -0
+               sdhi0: sd at ee100000 {
+                       compatible = "renesas,sdhi-r8a7792";
+                       reg = <0 0xee100000 0 0x200>;

I do not have the documentation available to check,

Me nether. The SDHI .zip only includes the manual for E2, H2, and M2.

Quoted 3 lines

however, I wonder if
as per 66f47ed0e86d ("ARM: shmobile: r8a7790: tidyup SDHI register size on DTSI") the register size should be 0x328.

I just don't know...

Quoted 4 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7792.dtsi +4 -0
+                       interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+                       dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+                              <&dmac1 0xcd>, <&dmac1 0xce>;
+                       dma-names = "tx", "rx", "tx", "rx";
Quoted 8 lines

arch/arm/boot/dts/r8a7792.dtsi line 452

Quoted 8 lines
arch/arm/boot/dts/r8a7792.dtsi +5 -0
+                       clocks = <&mstp3_clks R8A7792_CLK_SDHI0>;
+                       power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+                       status = "disabled";
+               };
+
                jpu: jpeg-codec at fe980000 {
                        compatible = "renesas,jpu-r8a7792",
                                     "renesas,rcar-gen2-jpu";
Quoted 3 lines

I also wonder whether whether a single per-SoC SDHI "compatible" is
valid. The registers and their offsets seem to differ b/w SDHI0 and the other SDHI cores...

Quoted 5 lines

There's version register.

BTW, given SDHI on V2H doesn't support SDR50/SDR104, unlike the instances on other R-Car Gen2 SoCs, can you please tell us the version value, as read from CTL_VERSION in sh_mobile_sdhi_sdbuf_width()?

    It's 0xCB0D, the same as on other SoCs.
Quoted 1 line

Thanks!

    Not at all. :-)
Quoted 3 lines

Gr{oetje,eeting}s,

Geert

MBR, Sergei

#9 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

Hi Sergei,

Quoted 6 lines · Sergei Shtylyov
Quoted 4 lines

BTW, given SDHI on V2H doesn't support SDR50/SDR104, unlike the instances on other R-Car Gen2 SoCs, can you please tell us the version value, as read
from CTL_VERSION in sh_mobile_sdhi_sdbuf_width()?

It's 0xCB0D, the same as on other SoCs.

Thanks!

#define SDHI_VER_GEN2_SDR104 0xcb0d

Not good, as it doesn't support SDR50/SDR104....

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#10 lore raw

PATCH 2/2 ARM: dts: r8a7792: add SDHI support

Quoted 10 lines · Geert Uytterhoeven
Quoted 6 lines
Quoted 4 lines

BTW, given SDHI on V2H doesn't support SDR50/SDR104, unlike the instances on other R-Car Gen2 SoCs, can you please tell us the version value, as read
from CTL_VERSION in sh_mobile_sdhi_sdbuf_width()?

It's 0xCB0D, the same as on other SoCs.

Thanks!

#define SDHI_VER_GEN2_SDR104 0xcb0d

Not seeing this #define, where is it?

Quoted 1 line

Not good, as it doesn't support SDR50/SDR104....

    Does it have the register at 0x324 tho?
Quoted 3 lines

Gr{oetje,eeting}s,

Geert

MBR, Sergei