linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings
@ 2017-10-16  7:58 Simon Horman
  2017-10-16  7:58 ` [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Simon Horman @ 2017-10-16  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Add fallback compatibility strings for R-Car Gen 1, 2 and 3 to the SDHI
bindings and driver.

In the case of Renesas R-Car hardware we know that there are generations of
SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
between IP blocks might be. For example, I believe that r8a7790 is older
than r8a7791 but that doesn't imply that the latter is a descendant of the
former or vice versa.

We can, however, by examining the documentation and behaviour of the
hardware at run-time observe that the current driver implementation appears
to be compatible with the IP blocks on SoCs within a given generation.

For the above reasons and convenience when enabling new SoCs a
per-generation fallback compatibility string scheme being adopted for
drivers for Renesas SoCs.

Based on mmc/next

Changes since v1:
* Describe example in patch one as being for the r8a7790 (R-Car H2) rather
  than the r8a7779 (R-Car H1)
* Accumulate review tags from Geert Uytterhoeven

Simon Horman (3):
  dt-bindings: mmc: renesas_sdhi: provide example in bindings
    documentation
  dt-bindings: mmc: renesas_sdhi: add R-Car Gen[123] fallback
    compatibility strings
  mmc: renesas_sdhi: implement R-Car Gen[123] fallback compatibility
    strings

 Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 66 +++++++++++++++++++++-
 drivers/mmc/host/renesas_sdhi_internal_dmac.c      |  1 +
 drivers/mmc/host/renesas_sdhi_sys_dmac.c           |  5 +-
 3 files changed, 70 insertions(+), 2 deletions(-)

-- 
2.11.0

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

* [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation
  2017-10-16  7:58 [PATCH v2 0/3] mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
@ 2017-10-16  7:58 ` Simon Horman
  2017-10-16  9:13   ` Geert Uytterhoeven
  2017-10-16  7:58 ` [PATCH v2 2/3] dt-bindings: mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
  2017-10-16  7:58 ` [PATCH v2 3/3] mmc: renesas_sdhi: implement " Simon Horman
  2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2017-10-16  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Provide an example of the usage of the DT bindings for TMIO
in their documentation. The example given is for the r8a7790 (R-Car H2).

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v2
* Correct description of example, it is for the r8a7790 (R-Car H2)
  rather than the r8a7779 (R-Car H1)
---
 Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index 54ef642f23a0..53f8b5280ecd 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -43,3 +43,57 @@ Optional properties:
 - pinctrl-names: should be "default", "state_uhs"
 - pinctrl-0: should contain default/high speed pin ctrl
 - pinctrl-1: should contain uhs mode pin ctrl
+
+Example: R8A7790 (R-Car H2) SDHI controller nodes
+
+	sdhi0: sd at ee100000 {
+		compatible = "renesas,sdhi-r8a7790";
+		reg = <0 0xee100000 0 0x328>;
+		interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
+		dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
+		       <&dmac1 0xcd>, <&dmac1 0xce>;
+		dma-names = "tx", "rx", "tx", "rx";
+		max-frequency = <195000000>;
+		power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+		status = "disabled";
+	};
+
+	sdhi1: sd at ee120000 {
+		compatible = "renesas,sdhi-r8a7790";
+		reg = <0 0xee120000 0 0x328>;
+		interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
+		dmas = <&dmac0 0xc9>, <&dmac0 0xca>,
+		       <&dmac1 0xc9>, <&dmac1 0xca>;
+		dma-names = "tx", "rx", "tx", "rx";
+		max-frequency = <195000000>;
+		power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+		status = "disabled";
+	};
+
+	sdhi2: sd at ee140000 {
+		compatible = "renesas,sdhi-r8a7790";
+		reg = <0 0xee140000 0 0x100>;
+		interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
+		dmas = <&dmac0 0xc1>, <&dmac0 0xc2>,
+		       <&dmac1 0xc1>, <&dmac1 0xc2>;
+		dma-names = "tx", "rx", "tx", "rx";
+		max-frequency = <97500000>;
+		power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+		status = "disabled";
+	};
+
+	sdhi3: sd at ee160000 {
+		compatible = "renesas,sdhi-r8a7790";
+		reg = <0 0xee160000 0 0x100>;
+		interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
+		dmas = <&dmac0 0xd3>, <&dmac0 0xd4>,
+		       <&dmac1 0xd3>, <&dmac1 0xd4>;
+		dma-names = "tx", "rx", "tx", "rx";
+		max-frequency = <97500000>;
+		power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+		status = "disabled";
+	};
-- 
2.11.0

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

* [PATCH v2 2/3] dt-bindings: mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings
  2017-10-16  7:58 [PATCH v2 0/3] mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
  2017-10-16  7:58 ` [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation Simon Horman
@ 2017-10-16  7:58 ` Simon Horman
  2017-10-16  7:58 ` [PATCH v2 3/3] mmc: renesas_sdhi: implement " Simon Horman
  2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2017-10-16  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Add fallback compatibility strings for R-Car Gen 1, 2 and 3.

In the case of Renesas R-Car hardware we know that there are generations of
SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
between IP blocks might be. For example, I believe that r8a7790 is older
than r8a7791 but that doesn't imply that the latter is a descendant of the
former or vice versa.

We can, however, by examining the documentation and behaviour of the
hardware at run-time observe that the current driver implementation appears
to be compatible with the IP blocks on SoCs within a given generation.

For the above reasons and convenience when enabling new SoCs a
per-generation fallback compatibility string scheme being adopted for
drivers for Renesas SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index 53f8b5280ecd..8320ee5b7811 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -10,7 +10,7 @@ described in mmc.txt, can be used. Additionally the following tmio_mmc-specific
 optional bindings can be used.
 
 Required properties:
-- compatible:	"renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
+- compatible: should contain one or more of the following:
 		"renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
 		"renesas,sdhi-r7s72100" - SDHI IP on R7S72100 SoC
 		"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
@@ -26,6 +26,16 @@ Required properties:
 		"renesas,sdhi-r8a7794" - SDHI IP on R8A7794 SoC
 		"renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
 		"renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
+		"renesas,sdhi-shmobile" - a generic sh-mobile SDHI controller
+		"renesas,rcar-gen1-sdhi" - a generic R-Car Gen1 SDHI controller
+		"renesas,rcar-gen2-sdhi" - a generic R-Car Gen2 or RZ/G1
+					   SDHI controller
+		"renesas,rcar-gen3-sdhi" - a generic R-Car Gen3 SDHI controller
+
+
+		When compatible with the generic version nodes must list
+		the SoC-specific version corresponding to the platform
+		first followed by the generic version.
 
 - clocks: Most controllers only have 1 clock source per channel. However, on
 	  some variations of this controller, the internal card detection
@@ -47,7 +57,7 @@ Optional properties:
 Example: R8A7790 (R-Car H2) SDHI controller nodes
 
 	sdhi0: sd at ee100000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,rcar-gen2-sdhi";
 		reg = <0 0xee100000 0 0x328>;
 		interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -60,7 +70,7 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
 	};
 
 	sdhi1: sd at ee120000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,rcar-gen2-sdhi";
 		reg = <0 0xee120000 0 0x328>;
 		interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -73,7 +83,7 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
 	};
 
 	sdhi2: sd at ee140000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,rcar-gen2-sdhi";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -86,7 +96,7 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
 	};
 
 	sdhi3: sd at ee160000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,rcar-gen2-sdhi";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
-- 
2.11.0

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

* [PATCH v2 3/3] mmc: renesas_sdhi: implement R-Car Gen[123] fallback compatibility strings
  2017-10-16  7:58 [PATCH v2 0/3] mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
  2017-10-16  7:58 ` [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation Simon Horman
  2017-10-16  7:58 ` [PATCH v2 2/3] dt-bindings: mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
@ 2017-10-16  7:58 ` Simon Horman
  2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2017-10-16  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Implement fallback compatibility strings for R-Car Gen 1, 2 and 3.

In the case of Renesas R-Car hardware we know that there are generations of
SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
between IP blocks might be. For example, I believe that r8a7790 is older
than r8a7791 but that doesn't imply that the latter is a descendant of the
former or vice versa.

We can, however, by examining the documentation and behaviour of the
hardware at run-time observe that the current driver implementation appears
to be compatible with the IP blocks on SoCs within a given generation.

For the above reasons and convenience when enabling new SoCs a
per-generation fallback compatibility string scheme being adopted for
drivers for Renesas SoCs.

Also, improve readability by listing the shmobile fallback compatibility
string after the more-specific compatibility strings they provide a
fallback for.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 +
 drivers/mmc/host/renesas_sdhi_sys_dmac.c      | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index f905f2361d12..637c27057ac2 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -88,6 +88,7 @@ static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = {
 static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
 	{ .compatible = "renesas,sdhi-r8a7795", .data = &of_rcar_gen3_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7796", .data = &of_rcar_gen3_compatible, },
+	{ .compatible = "renesas,rcar-gen3-sdhi", .data = &of_rcar_gen3_compatible, },
 	{},
 };
 MODULE_DEVICE_TABLE(of, renesas_sdhi_internal_dmac_of_match);
diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
index df4465439e13..9ab10436e4b8 100644
--- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
@@ -91,7 +91,6 @@ static const struct renesas_sdhi_of_data of_rcar_gen3_compatible = {
 };
 
 static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
-	{ .compatible = "renesas,sdhi-shmobile" },
 	{ .compatible = "renesas,sdhi-sh73a0", .data = &of_default_cfg, },
 	{ .compatible = "renesas,sdhi-r8a73a4", .data = &of_default_cfg, },
 	{ .compatible = "renesas,sdhi-r8a7740", .data = &of_default_cfg, },
@@ -107,6 +106,10 @@ static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
 	{ .compatible = "renesas,sdhi-r8a7794", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7795", .data = &of_rcar_gen3_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7796", .data = &of_rcar_gen3_compatible, },
+	{ .compatible = "renesas,rcar-gen1-sdhi", .data = &of_rcar_gen1_compatible, },
+	{ .compatible = "renesas,rcar-gen2-sdhi", .data = &of_rcar_gen2_compatible, },
+	{ .compatible = "renesas,rcar-gen3-sdhi", .data = &of_rcar_gen3_compatible, },
+	{ .compatible = "renesas,sdhi-shmobile" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, renesas_sdhi_sys_dmac_of_match);
-- 
2.11.0

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

* [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation
  2017-10-16  7:58 ` [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation Simon Horman
@ 2017-10-16  9:13   ` Geert Uytterhoeven
  2017-10-17  8:04     ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2017-10-16  9:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Mon, Oct 16, 2017 at 9:58 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> Provide an example of the usage of the DT bindings for TMIO
> in their documentation. The example given is for the r8a7790 (R-Car H2).
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> v2
> * Correct description of example, it is for the r8a7790 (R-Car H2)
>   rather than the r8a7779 (R-Car H1)

Thanks for the update!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> @@ -43,3 +43,57 @@ Optional properties:
>  - pinctrl-names: should be "default", "state_uhs"
>  - pinctrl-0: should contain default/high speed pin ctrl
>  - pinctrl-1: should contain uhs mode pin ctrl
> +
> +Example: R8A7790 (R-Car H2) SDHI controller nodes
> +
> +       sdhi0: sd at ee100000 {
> +               compatible = "renesas,sdhi-r8a7790";
> +               reg = <0 0xee100000 0 0x328>;
> +               interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
> +               clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;

You may want to copy the example from the current r8a7790.dtsi, which
uses the newer CPG/MSSR bindings.

> +               dmas = <&dmac0 0xcd>, <&dmac0 0xce>,
> +                      <&dmac1 0xcd>, <&dmac1 0xce>;
> +               dma-names = "tx", "rx", "tx", "rx";
> +               max-frequency = <195000000>;
> +               power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
> +               status = "disabled";
> +       };

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

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

* [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation
  2017-10-16  9:13   ` Geert Uytterhoeven
@ 2017-10-17  8:04     ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2017-10-17  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 16, 2017 at 11:13:32AM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Mon, Oct 16, 2017 at 9:58 AM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > Provide an example of the usage of the DT bindings for TMIO
> > in their documentation. The example given is for the r8a7790 (R-Car H2).
> >
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> > v2
> > * Correct description of example, it is for the r8a7790 (R-Car H2)
> >   rather than the r8a7779 (R-Car H1)
> 
> Thanks for the update!
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> > +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> > @@ -43,3 +43,57 @@ Optional properties:
> >  - pinctrl-names: should be "default", "state_uhs"
> >  - pinctrl-0: should contain default/high speed pin ctrl
> >  - pinctrl-1: should contain uhs mode pin ctrl
> > +
> > +Example: R8A7790 (R-Car H2) SDHI controller nodes
> > +
> > +       sdhi0: sd at ee100000 {
> > +               compatible = "renesas,sdhi-r8a7790";
> > +               reg = <0 0xee100000 0 0x328>;
> > +               interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
> > +               clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
> 
> You may want to copy the example from the current r8a7790.dtsi, which
> uses the newer CPG/MSSR bindings.

Thanks, v3 sent.

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

end of thread, other threads:[~2017-10-17  8:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16  7:58 [PATCH v2 0/3] mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
2017-10-16  7:58 ` [PATCH v2 1/3] dt-bindings: mmc: renesas_sdhi: provide example in bindings documentation Simon Horman
2017-10-16  9:13   ` Geert Uytterhoeven
2017-10-17  8:04     ` Simon Horman
2017-10-16  7:58 ` [PATCH v2 2/3] dt-bindings: mmc: renesas_sdhi: add R-Car Gen[123] fallback compatibility strings Simon Horman
2017-10-16  7:58 ` [PATCH v2 3/3] mmc: renesas_sdhi: implement " Simon Horman

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