devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: dts: renesas: genmai: enable SDHI and MMCIF
@ 2024-09-26 10:20 Wolfram Sang
  2024-09-26 10:20 ` [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0 Wolfram Sang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wolfram Sang @ 2024-09-26 10:20 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Conor Dooley, devicetree, Geert Uytterhoeven,
	Krzysztof Kozlowski, Magnus Damm, Rob Herring

Finally, here are the patches to enable SDHI and MMCIF for the Genmai board.
It can now serve as a regression test platform for these devices. Good!

A branch with all my Genmai-related patches can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/genmai-upstreaming

Thanks and happy hacking!


Wolfram Sang (3):
  ARM: dts: renesas: genmai: enable SDHI0
  ARM: dts: renesas: r7s72100: 'bus-width' is a board property
  ARM: dts: renesas: genmai: enable MMCIF

 arch/arm/boot/dts/renesas/r7s72100-genmai.dts | 55 ++++++++++++++++++-
 arch/arm/boot/dts/renesas/r7s72100.dtsi       |  1 -
 2 files changed, 54 insertions(+), 2 deletions(-)

-- 
2.45.2


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

* [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0
  2024-09-26 10:20 [PATCH 0/3] ARM: dts: renesas: genmai: enable SDHI and MMCIF Wolfram Sang
@ 2024-09-26 10:20 ` Wolfram Sang
  2024-10-04 13:23   ` Geert Uytterhoeven
  2024-09-26 10:20 ` [PATCH 2/3] ARM: dts: renesas: r7s72100: 'bus-width' is a board property Wolfram Sang
  2024-09-26 10:20 ` [PATCH 3/3] ARM: dts: renesas: genmai: enable MMCIF Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2024-09-26 10:20 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, devicetree

For this to work, User LEDs must be disabled because they share their
pins with SD data lines.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm/boot/dts/renesas/r7s72100-genmai.dts | 23 ++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/renesas/r7s72100-genmai.dts b/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
index 2d72daa4fac2..e93f444b2442 100644
--- a/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
+++ b/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
@@ -76,7 +76,8 @@ key-1 {
 	};
 
 	leds {
-		status = "okay";
+		/* Needs SDHI0 to be disabled */
+		status = "disabled";
 		compatible = "gpio-leds";
 
 		led1 {
@@ -227,6 +228,18 @@ scif2_pins: serial2 {
 		/* P3_0 as TxD2; P3_2 as RxD2 */
 		pinmux = <RZA1_PINMUX(3, 0, 6)>, <RZA1_PINMUX(3, 2, 4)>;
 	};
+
+	sdhi0_pins: sdhi0 {
+		/* SDHI0: P4_8 up to P4_15 */
+		pinmux = <RZA1_PINMUX(4, 8, 3)>,	/* SD_CD_0 */
+			 <RZA1_PINMUX(4, 9, 3)>,	/* SD_WP_0 */
+			 <RZA1_PINMUX(4, 10, 3)>,	/* SD_D1_0 */
+			 <RZA1_PINMUX(4, 11, 3)>,	/* SD_D0_0 */
+			 <RZA1_PINMUX(4, 12, 3)>,	/* SD_CLK_0 */
+			 <RZA1_PINMUX(4, 13, 3)>,	/* SD_CMD_0 */
+			 <RZA1_PINMUX(4, 14, 3)>,	/* SD_D3_0 */
+			 <RZA1_PINMUX(4, 15, 3)>;	/* SD_D2_0 */
+	};
 };
 
 &rtc_x1_clk {
@@ -244,6 +257,14 @@ &scif2 {
 	status = "okay";
 };
 
+&sdhi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdhi0_pins>;
+
+	bus-width = <4>;
+	status = "okay";
+};
+
 &spi4 {
 	status = "okay";
 
-- 
2.45.2


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

* [PATCH 2/3] ARM: dts: renesas: r7s72100: 'bus-width' is a board property
  2024-09-26 10:20 [PATCH 0/3] ARM: dts: renesas: genmai: enable SDHI and MMCIF Wolfram Sang
  2024-09-26 10:20 ` [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0 Wolfram Sang
@ 2024-09-26 10:20 ` Wolfram Sang
  2024-10-04 13:31   ` Geert Uytterhoeven
  2024-09-26 10:20 ` [PATCH 3/3] ARM: dts: renesas: genmai: enable MMCIF Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2024-09-26 10:20 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, devicetree

Do not set 'bus-width' in the SoC-include DTSI. It must be set in the
board DTS file. No regressions because MMCIF was not enabled yet for
this SoC.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm/boot/dts/renesas/r7s72100.dtsi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/boot/dts/renesas/r7s72100.dtsi b/arch/arm/boot/dts/renesas/r7s72100.dtsi
index a460a9092c43..27a4121517a7 100644
--- a/arch/arm/boot/dts/renesas/r7s72100.dtsi
+++ b/arch/arm/boot/dts/renesas/r7s72100.dtsi
@@ -333,7 +333,6 @@ mmcif: mmc@e804c800 {
 				     <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&mstp8_clks R7S72100_CLK_MMCIF>;
 			power-domains = <&cpg_clocks>;
-			bus-width = <8>;
 			status = "disabled";
 		};
 
-- 
2.45.2


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

* [PATCH 3/3] ARM: dts: renesas: genmai: enable MMCIF
  2024-09-26 10:20 [PATCH 0/3] ARM: dts: renesas: genmai: enable SDHI and MMCIF Wolfram Sang
  2024-09-26 10:20 ` [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0 Wolfram Sang
  2024-09-26 10:20 ` [PATCH 2/3] ARM: dts: renesas: r7s72100: 'bus-width' is a board property Wolfram Sang
@ 2024-09-26 10:20 ` Wolfram Sang
  2 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2024-09-26 10:20 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, devicetree

Luckily, I still had an MMC card lying around. Works fine.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm/boot/dts/renesas/r7s72100-genmai.dts | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/renesas/r7s72100-genmai.dts b/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
index e93f444b2442..d0b2b4ea1734 100644
--- a/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
+++ b/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
@@ -88,6 +88,14 @@ led2 {
 			gpios = <&port4 11 GPIO_ACTIVE_LOW>;
 		};
 	};
+
+	vcc_mmc: regulator-mmc {
+		compatible = "regulator-fixed";
+		regulator-name = "MMC Vcc";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
 };
 
 &bsc {
@@ -179,6 +187,16 @@ eeprom@50 {
 	};
 };
 
+&mmcif {
+	pinctrl-0 = <&mmcif_pins>;
+	pinctrl-names = "default";
+	cd-gpios = <&port3 8 GPIO_ACTIVE_LOW>;
+
+	vmmc-supply = <&vcc_mmc>;
+	bus-width = <8>;
+	status = "okay";
+};
+
 &mtu2 {
 	status = "okay";
 };
@@ -224,6 +242,20 @@ keyboard_pins: keyboard {
 		pinmux = <RZA1_PINMUX(3, 1, 3)>;
 	};
 
+	mmcif_pins: mmcif {
+		/* MMCIF: P3_8 is CD_GPIO, P3_10 up to P3_15, P4_0 up to P4_3 */
+		pinmux = <RZA1_PINMUX(3, 10, 8)>,	/* MMC_D1 */
+			 <RZA1_PINMUX(3, 11, 8)>,	/* MMC_D0 */
+			 <RZA1_PINMUX(3, 12, 8)>,	/* MMC_CLK */
+			 <RZA1_PINMUX(3, 13, 8)>,	/* MMC_CMD */
+			 <RZA1_PINMUX(3, 14, 8)>,	/* MMC_D3 */
+			 <RZA1_PINMUX(3, 15, 8)>,	/* MMC_D2 */
+			 <RZA1_PINMUX(4, 0, 8)>,	/* MMC_D4 */
+			 <RZA1_PINMUX(4, 1, 8)>,	/* MMC_D5 */
+			 <RZA1_PINMUX(4, 2, 8)>,	/* MMC_D6 */
+			 <RZA1_PINMUX(4, 3, 8)>;	/* MMC_D7 */
+	};
+
 	scif2_pins: serial2 {
 		/* P3_0 as TxD2; P3_2 as RxD2 */
 		pinmux = <RZA1_PINMUX(3, 0, 6)>, <RZA1_PINMUX(3, 2, 4)>;
-- 
2.45.2


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

* Re: [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0
  2024-09-26 10:20 ` [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0 Wolfram Sang
@ 2024-10-04 13:23   ` Geert Uytterhoeven
  2024-10-04 13:40     ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-10-04 13:23 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree

Hi Wolfram,

On Thu, Sep 26, 2024 at 12:20 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> For this to work, User LEDs must be disabled because they share their
> pins with SD data lines.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks for your patch!

> --- a/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
> +++ b/arch/arm/boot/dts/renesas/r7s72100-genmai.dts
> @@ -76,7 +76,8 @@ key-1 {
>         };
>
>         leds {
> -               status = "okay";
> +               /* Needs SDHI0 to be disabled */
> +               status = "disabled";
>                 compatible = "gpio-leds";

Pity...

>
>                 led1 {

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v6.13.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 7+ messages in thread

* Re: [PATCH 2/3] ARM: dts: renesas: r7s72100: 'bus-width' is a board property
  2024-09-26 10:20 ` [PATCH 2/3] ARM: dts: renesas: r7s72100: 'bus-width' is a board property Wolfram Sang
@ 2024-10-04 13:31   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-10-04 13:31 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree

On Thu, Sep 26, 2024 at 12:20 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> Do not set 'bus-width' in the SoC-include DTSI. It must be set in the
> board DTS file. No regressions because MMCIF was not enabled yet for
> this SoC.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v6.13.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 7+ messages in thread

* Re: [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0
  2024-10-04 13:23   ` Geert Uytterhoeven
@ 2024-10-04 13:40     ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-10-04 13:40 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree

On Fri, Oct 4, 2024 at 3:23 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Thu, Sep 26, 2024 at 12:20 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > For this to work, User LEDs must be disabled because they share their
> > pins with SD data lines.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. will queue in renesas-devel for v6.13.

Oops, obsolete version. Please ignore.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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] 7+ messages in thread

end of thread, other threads:[~2024-10-04 13:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 10:20 [PATCH 0/3] ARM: dts: renesas: genmai: enable SDHI and MMCIF Wolfram Sang
2024-09-26 10:20 ` [PATCH 1/3] ARM: dts: renesas: genmai: enable SDHI0 Wolfram Sang
2024-10-04 13:23   ` Geert Uytterhoeven
2024-10-04 13:40     ` Geert Uytterhoeven
2024-09-26 10:20 ` [PATCH 2/3] ARM: dts: renesas: r7s72100: 'bus-width' is a board property Wolfram Sang
2024-10-04 13:31   ` Geert Uytterhoeven
2024-09-26 10:20 ` [PATCH 3/3] ARM: dts: renesas: genmai: enable MMCIF Wolfram Sang

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