All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: renesas: add sdhi/mmc aliases
@ 2021-02-08  2:47 Yoshihiro Shimoda
  2021-02-08  9:46 ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Yoshihiro Shimoda @ 2021-02-08  2:47 UTC (permalink / raw)
  To: geert+renesas, magnus.damm; +Cc: linux-renesas-soc, Yoshihiro Shimoda

After the commit 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS
for drivers that existed in v4.14"), the order of /dev/mmcblkN
was not fixed in some SoCs which have multiple sdhi controllers.
So, we were hard to use an sdhi device as rootfs by using
the kernel parameter like "root=/dev/mmcblkNpM".

According to the discussion on a mainling list [1], we can add
mmc aliases to fix the issue. So, add such aliases into R-Car Gen3
and RZ/G2 dtsi files. Note that, if an SoC like r8a77980 has one
sdhi controller only, the alias is not defined.

[1]
https://lore.kernel.org/linux-arm-kernel/CAPDyKFptyEQNJu8cqzMt2WRFZcwEdjDiytMBp96nkoZyprTgmA@mail.gmail.com/

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 Changes from v1:
 - Revise the commit description.
 - Remove some alias which SoC has one sdhi controller only.
https://patchwork.kernel.org/project/linux-renesas-soc/patch/1604654877-30010-1-git-send-email-yoshihiro.shimoda.uh@renesas.com/

 arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 4 ++++
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 7 +++++++
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 6 ++++++
 arch/arm64/boot/dts/renesas/r8a774e1.dtsi | 7 +++++++
 arch/arm64/boot/dts/renesas/r8a77951.dtsi | 4 ++++
 arch/arm64/boot/dts/renesas/r8a77960.dtsi | 4 ++++
 arch/arm64/boot/dts/renesas/r8a77961.dtsi | 7 +++++++
 arch/arm64/boot/dts/renesas/r8a77965.dtsi | 4 ++++
 arch/arm64/boot/dts/renesas/r8a77990.dtsi | 3 +++
 9 files changed, 46 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
index d64fb8b..4f7b917 100644
--- a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
@@ -26,6 +26,10 @@
 		i2c5 = &i2c5;
 		i2c6 = &i2c6;
 		i2c7 = &i2c_dvfs;
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
 	};
 
 	/*
diff --git a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
index 5b05474..a828bca 100644
--- a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
@@ -17,6 +17,13 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
+	};
+
 	/*
 	 * The external audio clocks are configured as 0 Hz fixed frequency
 	 * clocks by default.
diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
index 20fa3ca..f37ed49 100644
--- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
@@ -14,6 +14,12 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc3 = &sdhi3;
+	};
+
 	/*
 	 * The external audio clocks are configured as 0 Hz fixed frequency
 	 * clocks by default.
diff --git a/arch/arm64/boot/dts/renesas/r8a774e1.dtsi b/arch/arm64/boot/dts/renesas/r8a774e1.dtsi
index 8eb006c..2c4b65c 100644
--- a/arch/arm64/boot/dts/renesas/r8a774e1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774e1.dtsi
@@ -17,6 +17,13 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
+	};
+
 	/*
 	 * The external audio clocks are configured as 0 Hz fixed frequency
 	 * clocks by default.
diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
index 5c39152..654f048 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
@@ -25,6 +25,10 @@
 		i2c5 = &i2c5;
 		i2c6 = &i2c6;
 		i2c7 = &i2c_dvfs;
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
 	};
 
 	/*
diff --git a/arch/arm64/boot/dts/renesas/r8a77960.dtsi b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
index 25d947a..d0b7236 100644
--- a/arch/arm64/boot/dts/renesas/r8a77960.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
@@ -25,6 +25,10 @@
 		i2c5 = &i2c5;
 		i2c6 = &i2c6;
 		i2c7 = &i2c_dvfs;
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
 	};
 
 	/*
diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
index e8c31eb..57a3d6c 100644
--- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
@@ -16,6 +16,13 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
+	};
+
 	/*
 	 * The external audio clocks are configured as 0 Hz fixed frequency
 	 * clocks by default.
diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index 657b20d..d111ef7 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -28,6 +28,10 @@
 		i2c5 = &i2c5;
 		i2c6 = &i2c6;
 		i2c7 = &i2c_dvfs;
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc2 = &sdhi2;
+		mmc3 = &sdhi3;
 	};
 
 	/*
diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 5010f23..f0e2d67 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -23,6 +23,9 @@
 		i2c5 = &i2c5;
 		i2c6 = &i2c6;
 		i2c7 = &i2c7;
+		mmc0 = &sdhi0;
+		mmc1 = &sdhi1;
+		mmc3 = &sdhi3;
 	};
 
 	/*
-- 
2.7.4


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

* Re: [PATCH v2] arm64: dts: renesas: add sdhi/mmc aliases
  2021-02-08  2:47 [PATCH v2] arm64: dts: renesas: add sdhi/mmc aliases Yoshihiro Shimoda
@ 2021-02-08  9:46 ` Geert Uytterhoeven
  2021-02-08 10:53   ` Yoshihiro Shimoda
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-02-08  9:46 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: Magnus Damm, Linux-Renesas, Ulf Hansson

Hi Shimoda-san,

CC Ulf

On Mon, Feb 8, 2021 at 3:48 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> After the commit 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS
> for drivers that existed in v4.14"), the order of /dev/mmcblkN
> was not fixed in some SoCs which have multiple sdhi controllers.
> So, we were hard to use an sdhi device as rootfs by using
> the kernel parameter like "root=/dev/mmcblkNpM".
>
> According to the discussion on a mainling list [1], we can add
> mmc aliases to fix the issue. So, add such aliases into R-Car Gen3
> and RZ/G2 dtsi files. Note that, if an SoC like r8a77980 has one
> sdhi controller only, the alias is not defined.
>
> [1]
> https://lore.kernel.org/linux-arm-kernel/CAPDyKFptyEQNJu8cqzMt2WRFZcwEdjDiytMBp96nkoZyprTgmA@mail.gmail.com/
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  Changes from v1:
>  - Revise the commit description.
>  - Remove some alias which SoC has one sdhi controller only.
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/1604654877-30010-1-git-send-email-yoshihiro.shimoda.uh@renesas.com/

Thanks for the update!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. I plan to queue this in renesas-devel for v5.13.
Unless you want to upstream this as a fix for v5.11, in which case we
have to hurry. Note that v5.10 already has the issue, too.

BTW, shouldn't we add the aliases on 32-bit arm, too?

> --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> @@ -14,6 +14,12 @@
>         #address-cells = <2>;
>         #size-cells = <2>;
>
> +       aliases {
> +               mmc0 = &sdhi0;
> +               mmc1 = &sdhi1;
> +               mmc3 = &sdhi3;
> +       };

BTW, this is one of the other issues with aliases: where is mmc2?
Yes, I know why it's done this way ;-)

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 v2] arm64: dts: renesas: add sdhi/mmc aliases
  2021-02-08  9:46 ` Geert Uytterhoeven
@ 2021-02-08 10:53   ` Yoshihiro Shimoda
  2021-02-08 11:44     ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Yoshihiro Shimoda @ 2021-02-08 10:53 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, Linux-Renesas, Ulf Hansson

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 6:46 PM
> 
> Hi Shimoda-san,
> 
> CC Ulf
> 
> On Mon, Feb 8, 2021 at 3:48 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > After the commit 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS
> > for drivers that existed in v4.14"), the order of /dev/mmcblkN
> > was not fixed in some SoCs which have multiple sdhi controllers.
> > So, we were hard to use an sdhi device as rootfs by using
> > the kernel parameter like "root=/dev/mmcblkNpM".
> >
> > According to the discussion on a mainling list [1], we can add
> > mmc aliases to fix the issue. So, add such aliases into R-Car Gen3
> > and RZ/G2 dtsi files. Note that, if an SoC like r8a77980 has one
> > sdhi controller only, the alias is not defined.
> >
> > [1]
<snip>
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  Changes from v1:
> >  - Revise the commit description.
> >  - Remove some alias which SoC has one sdhi controller only.
> >
<snip>
> 
> Thanks for the update!
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. I plan to queue this in renesas-devel for v5.13.
> Unless you want to upstream this as a fix for v5.11, in which case we
> have to hurry. Note that v5.10 already has the issue, too.

Thank you for this comment. For v5.13 is enough to me. However,
if possible, I'd like to apply this patch v5.10.xx too.
So, should/may I add the following Fixes tag for it?

Fixes: 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14")

> BTW, shouldn't we add the aliases on 32-bit arm, too?

I think so. I'll prepare such a patch too.

> > --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > @@ -14,6 +14,12 @@
> >         #address-cells = <2>;
> >         #size-cells = <2>;
> >
> > +       aliases {
> > +               mmc0 = &sdhi0;
> > +               mmc1 = &sdhi1;
> > +               mmc3 = &sdhi3;
> > +       };
> 
> BTW, this is one of the other issues with aliases: where is mmc2?
> Yes, I know why it's done this way ;-)

Ah, I intended to assign the aliases 1:1 between "mmcN" and "sdhiN".
But, should we use "mmc2 = &sdhi3;" instead on r8a774c0 and r8a77990?

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v2] arm64: dts: renesas: add sdhi/mmc aliases
  2021-02-08 10:53   ` Yoshihiro Shimoda
@ 2021-02-08 11:44     ` Geert Uytterhoeven
  2021-02-08 12:31       ` Yoshihiro Shimoda
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-02-08 11:44 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: Magnus Damm, Linux-Renesas, Ulf Hansson

Hi Shimoda-san,

On Mon, Feb 8, 2021 at 11:53 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> > From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 6:46 PM
> > On Mon, Feb 8, 2021 at 3:48 AM Yoshihiro Shimoda
> > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > After the commit 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS
> > > for drivers that existed in v4.14"), the order of /dev/mmcblkN
> > > was not fixed in some SoCs which have multiple sdhi controllers.
> > > So, we were hard to use an sdhi device as rootfs by using
> > > the kernel parameter like "root=/dev/mmcblkNpM".
> > >
> > > According to the discussion on a mainling list [1], we can add
> > > mmc aliases to fix the issue. So, add such aliases into R-Car Gen3
> > > and RZ/G2 dtsi files. Note that, if an SoC like r8a77980 has one
> > > sdhi controller only, the alias is not defined.
> > >
> > > [1]
> <snip>
> > >
> > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > > ---
> > >  Changes from v1:
> > >  - Revise the commit description.
> > >  - Remove some alias which SoC has one sdhi controller only.
> > >
> <snip>
> >
> > Thanks for the update!
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > i.e. I plan to queue this in renesas-devel for v5.13.
> > Unless you want to upstream this as a fix for v5.11, in which case we
> > have to hurry. Note that v5.10 already has the issue, too.
>
> Thank you for this comment. For v5.13 is enough to me. However,

OK.

> if possible, I'd like to apply this patch v5.10.xx too.
> So, should/may I add the following Fixes tag for it?
>
> Fixes: 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14")

I can add the tag while applying.

> > BTW, shouldn't we add the aliases on 32-bit arm, too?
>
> I think so. I'll prepare such a patch too.

TIA!

> > > --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > @@ -14,6 +14,12 @@
> > >         #address-cells = <2>;
> > >         #size-cells = <2>;
> > >
> > > +       aliases {
> > > +               mmc0 = &sdhi0;
> > > +               mmc1 = &sdhi1;
> > > +               mmc3 = &sdhi3;
> > > +       };
> >
> > BTW, this is one of the other issues with aliases: where is mmc2?
> > Yes, I know why it's done this way ;-)
>
> Ah, I intended to assign the aliases 1:1 between "mmcN" and "sdhiN".
> But, should we use "mmc2 = &sdhi3;" instead on r8a774c0 and r8a77990?

I'm fine with the numbering you used, as the aliases match the existing
labels.

However, on R-Car Gen2 we did use contiguous numbering of the labels,
as early revisions of the datasheet used contiguous numbering for the
interfaces, while later revisions changed this.
I think the sensible thing to do is to make the aliases match the existing
labels, too.

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 v2] arm64: dts: renesas: add sdhi/mmc aliases
  2021-02-08 11:44     ` Geert Uytterhoeven
@ 2021-02-08 12:31       ` Yoshihiro Shimoda
  2021-02-08 13:00         ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Yoshihiro Shimoda @ 2021-02-08 12:31 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, Linux-Renesas, Ulf Hansson

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 8:45 PM
> On Mon, Feb 8, 2021 at 11:53 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 6:46 PM
> > > On Mon, Feb 8, 2021 at 3:48 AM Yoshihiro Shimoda
> > > <yoshihiro.shimoda.uh@renesas.com> wrote:
<snip>
> > if possible, I'd like to apply this patch v5.10.xx too.
> > So, should/may I add the following Fixes tag for it?
> >
> > Fixes: 7320915c8861 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14")
> 
> I can add the tag while applying.

Thanks!

<snip>
> > > > --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > > +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > > @@ -14,6 +14,12 @@
> > > >         #address-cells = <2>;
> > > >         #size-cells = <2>;
> > > >
> > > > +       aliases {
> > > > +               mmc0 = &sdhi0;
> > > > +               mmc1 = &sdhi1;
> > > > +               mmc3 = &sdhi3;
> > > > +       };
> > >
> > > BTW, this is one of the other issues with aliases: where is mmc2?
> > > Yes, I know why it's done this way ;-)
> >
> > Ah, I intended to assign the aliases 1:1 between "mmcN" and "sdhiN".
> > But, should we use "mmc2 = &sdhi3;" instead on r8a774c0 and r8a77990?
> 
> I'm fine with the numbering you used, as the aliases match the existing
> labels.
> 
> However, on R-Car Gen2 we did use contiguous numbering of the labels,
> as early revisions of the datasheet used contiguous numbering for the
> interfaces, while later revisions changed this.
> I think the sensible thing to do is to make the aliases match the existing
> labels, too.

Thank you for the comment about R-Car Gen2. I didn't realized that.
On R-Car Gen2 SoCs, they also have mmcif controllers. So, I'm thinking
the mmc aliases should use contiguous numbering for Gen2 mmcif and sdhi
at least. And, perhaps, I feel using same this rule (contiguous numbering) on
Gen3 is better. But, what do you think?

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v2] arm64: dts: renesas: add sdhi/mmc aliases
  2021-02-08 12:31       ` Yoshihiro Shimoda
@ 2021-02-08 13:00         ` Geert Uytterhoeven
  2021-02-09  5:02           ` Yoshihiro Shimoda
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-02-08 13:00 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: Magnus Damm, Linux-Renesas, Ulf Hansson

Hi Shimoda-san,

On Mon, Feb 8, 2021 at 1:31 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> > From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 8:45 PM
> > On Mon, Feb 8, 2021 at 11:53 AM Yoshihiro Shimoda
> > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 6:46 PM
> > > > On Mon, Feb 8, 2021 at 3:48 AM Yoshihiro Shimoda
> > > > <yoshihiro.shimoda.uh@renesas.com> wrote:

> > > > > --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > > > +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > > > @@ -14,6 +14,12 @@
> > > > >         #address-cells = <2>;
> > > > >         #size-cells = <2>;
> > > > >
> > > > > +       aliases {
> > > > > +               mmc0 = &sdhi0;
> > > > > +               mmc1 = &sdhi1;
> > > > > +               mmc3 = &sdhi3;
> > > > > +       };
> > > >
> > > > BTW, this is one of the other issues with aliases: where is mmc2?
> > > > Yes, I know why it's done this way ;-)
> > >
> > > Ah, I intended to assign the aliases 1:1 between "mmcN" and "sdhiN".
> > > But, should we use "mmc2 = &sdhi3;" instead on r8a774c0 and r8a77990?
> >
> > I'm fine with the numbering you used, as the aliases match the existing
> > labels.
> >
> > However, on R-Car Gen2 we did use contiguous numbering of the labels,
> > as early revisions of the datasheet used contiguous numbering for the
> > interfaces, while later revisions changed this.
> > I think the sensible thing to do is to make the aliases match the existing
> > labels, too.
>
> Thank you for the comment about R-Car Gen2. I didn't realized that.
> On R-Car Gen2 SoCs, they also have mmcif controllers. So, I'm thinking
> the mmc aliases should use contiguous numbering for Gen2 mmcif and sdhi
> at least. And, perhaps, I feel using same this rule (contiguous numbering) on
> Gen3 is better. But, what do you think?

Thank you for the comment about MMCIF,  I had forgotten about that.
R-Car Gen2 is even more complicated, as you have 1, 3, or 4 SDHI
instances, and may have 1 or 2 MMC instances.  So is mmc0 the first
SDHI interface, or the first MMC interface?
Worse, they share pins. So the user can actually choose to use an SDHI or
MMCIF instance on some of the pin groups (for now ignoring that MMCIF
supports 1/4/8 bit, and SDHI only 1/4).

Hence I think on R-Car Gen2 you have to add the aliases to the board DTS
files, based on the connector labels on the physical boards, which
brings us back to the original idea behind the aliases...

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 v2] arm64: dts: renesas: add sdhi/mmc aliases
  2021-02-08 13:00         ` Geert Uytterhoeven
@ 2021-02-09  5:02           ` Yoshihiro Shimoda
  0 siblings, 0 replies; 7+ messages in thread
From: Yoshihiro Shimoda @ 2021-02-09  5:02 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, Linux-Renesas, Ulf Hansson

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 10:01 PM
> On Mon, Feb 8, 2021 at 1:31 PM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 8:45 PM
> > > On Mon, Feb 8, 2021 at 11:53 AM Yoshihiro Shimoda
> > > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > > From: Geert Uytterhoeven, Sent: Monday, February 8, 2021 6:46 PM
> > > > > On Mon, Feb 8, 2021 at 3:48 AM Yoshihiro Shimoda
> > > > > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > > > --- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > > > > +++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
> > > > > > @@ -14,6 +14,12 @@
> > > > > >         #address-cells = <2>;
> > > > > >         #size-cells = <2>;
> > > > > >
> > > > > > +       aliases {
> > > > > > +               mmc0 = &sdhi0;
> > > > > > +               mmc1 = &sdhi1;
> > > > > > +               mmc3 = &sdhi3;
> > > > > > +       };
> > > > >
> > > > > BTW, this is one of the other issues with aliases: where is mmc2?
> > > > > Yes, I know why it's done this way ;-)
> > > >
> > > > Ah, I intended to assign the aliases 1:1 between "mmcN" and "sdhiN".
> > > > But, should we use "mmc2 = &sdhi3;" instead on r8a774c0 and r8a77990?
> > >
> > > I'm fine with the numbering you used, as the aliases match the existing
> > > labels.
> > >
> > > However, on R-Car Gen2 we did use contiguous numbering of the labels,
> > > as early revisions of the datasheet used contiguous numbering for the
> > > interfaces, while later revisions changed this.
> > > I think the sensible thing to do is to make the aliases match the existing
> > > labels, too.
> >
> > Thank you for the comment about R-Car Gen2. I didn't realized that.
> > On R-Car Gen2 SoCs, they also have mmcif controllers. So, I'm thinking
> > the mmc aliases should use contiguous numbering for Gen2 mmcif and sdhi
> > at least. And, perhaps, I feel using same this rule (contiguous numbering) on
> > Gen3 is better. But, what do you think?
> 
> Thank you for the comment about MMCIF,  I had forgotten about that.
> R-Car Gen2 is even more complicated, as you have 1, 3, or 4 SDHI
> instances, and may have 1 or 2 MMC instances.  So is mmc0 the first
> SDHI interface, or the first MMC interface?

I intended that mmc0 is the first MMC interface as alphabet ordering
of the labels (mmcifN vs sdhiN).

> Worse, they share pins. So the user can actually choose to use an SDHI or
> MMCIF instance on some of the pin groups (for now ignoring that MMCIF
> supports 1/4/8 bit, and SDHI only 1/4).
> 
> Hence I think on R-Car Gen2 you have to add the aliases to the board DTS
> files, based on the connector labels on the physical boards, which
> brings us back to the original idea behind the aliases...

I got it. I'll add such aliases on R-Car Gen2.

Best regards,
Yoshihiro Shimoda


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

end of thread, other threads:[~2021-02-09  5:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08  2:47 [PATCH v2] arm64: dts: renesas: add sdhi/mmc aliases Yoshihiro Shimoda
2021-02-08  9:46 ` Geert Uytterhoeven
2021-02-08 10:53   ` Yoshihiro Shimoda
2021-02-08 11:44     ` Geert Uytterhoeven
2021-02-08 12:31       ` Yoshihiro Shimoda
2021-02-08 13:00         ` Geert Uytterhoeven
2021-02-09  5:02           ` Yoshihiro Shimoda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.