[PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc

Nícolas F. R. A. Prado posted 5 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc
Posted by Nícolas F. R. A. Prado 1 year, 11 months ago
Add aliases for the i2c and mmc nodes on the Asurada platform DT to
ensure that we get stable ids for those devices on userspace.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

---

Changes in v2:
- Added this commit

 arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
index dac2d4f5e670..758ca42a6156 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
@@ -11,6 +11,18 @@
 
 / {
 	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c4 = &i2c4;
+		i2c5 = &i2c5;
+		i2c6 = &i2c6;
+		i2c7 = &i2c7;
+		i2c8 = &i2c8;
+		i2c9 = &i2c9;
+		mmc0 = &mmc0;
+		mmc1 = &mmc1;
 		serial0 = &uart0;
 	};
 
-- 
2.37.3

Re: [PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc
Posted by AngeloGioacchino Del Regno 1 year, 11 months ago
Il 06/10/22 23:25, Nícolas F. R. A. Prado ha scritto:
> Add aliases for the i2c and mmc nodes on the Asurada platform DT to
> ensure that we get stable ids for those devices on userspace.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


Re: [PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc
Posted by Chen-Yu Tsai 1 year, 11 months ago
On Fri, Oct 7, 2022 at 5:25 AM Nícolas F. R. A. Prado
<nfraprado@collabora.com> wrote:
>
> Add aliases for the i2c and mmc nodes on the Asurada platform DT to
> ensure that we get stable ids for those devices on userspace.
>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>
> ---
>
> Changes in v2:
> - Added this commit
>
>  arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> index dac2d4f5e670..758ca42a6156 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> @@ -11,6 +11,18 @@
>
>  / {
>         aliases {
> +               i2c0 = &i2c0;
> +               i2c1 = &i2c1;
> +               i2c2 = &i2c2;
> +               i2c3 = &i2c3;
> +               i2c4 = &i2c4;
> +               i2c5 = &i2c5;
> +               i2c6 = &i2c6;
> +               i2c7 = &i2c7;
> +               i2c8 = &i2c8;
> +               i2c9 = &i2c9;

You should only add aliases for interfaces that are actually enabled.

Also, I think we can disable i2c6. None of the current products use it.

ChenYu

> +               mmc0 = &mmc0;
> +               mmc1 = &mmc1;
>                 serial0 = &uart0;
>         };
>
> --
> 2.37.3
>
Re: [PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc
Posted by Chen-Yu Tsai 1 year, 11 months ago
On Fri, Oct 7, 2022 at 11:51 AM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> On Fri, Oct 7, 2022 at 5:25 AM Nícolas F. R. A. Prado
> <nfraprado@collabora.com> wrote:
> >
> > Add aliases for the i2c and mmc nodes on the Asurada platform DT to
> > ensure that we get stable ids for those devices on userspace.
> >
> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> >
> > ---
> >
> > Changes in v2:
> > - Added this commit
> >
> >  arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > index dac2d4f5e670..758ca42a6156 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > @@ -11,6 +11,18 @@
> >
> >  / {
> >         aliases {
> > +               i2c0 = &i2c0;
> > +               i2c1 = &i2c1;
> > +               i2c2 = &i2c2;
> > +               i2c3 = &i2c3;
> > +               i2c4 = &i2c4;
> > +               i2c5 = &i2c5;
> > +               i2c6 = &i2c6;
> > +               i2c7 = &i2c7;
> > +               i2c8 = &i2c8;
> > +               i2c9 = &i2c9;
>
> You should only add aliases for interfaces that are actually enabled.
>
> Also, I think we can disable i2c6. None of the current products use it.
>
> ChenYu
>
> > +               mmc0 = &mmc0;
> > +               mmc1 = &mmc1;

Also, Spherion does not have an SD card slot. It might be better to move
the mmc aliases to the end .dts files.

ChenYu
Re: [PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc
Posted by Nícolas F. R. A. Prado 1 year, 11 months ago
On Fri, Oct 07, 2022 at 12:02:03PM +0800, Chen-Yu Tsai wrote:
> On Fri, Oct 7, 2022 at 11:51 AM Chen-Yu Tsai <wenst@chromium.org> wrote:
> >
> > On Fri, Oct 7, 2022 at 5:25 AM Nícolas F. R. A. Prado
> > <nfraprado@collabora.com> wrote:
> > >
> > > Add aliases for the i2c and mmc nodes on the Asurada platform DT to
> > > ensure that we get stable ids for those devices on userspace.
> > >
> > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > >
> > > ---
> > >
> > > Changes in v2:
> > > - Added this commit
> > >
> > >  arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > > index dac2d4f5e670..758ca42a6156 100644
> > > --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > > +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > > @@ -11,6 +11,18 @@
> > >
> > >  / {
> > >         aliases {
> > > +               i2c0 = &i2c0;
> > > +               i2c1 = &i2c1;
> > > +               i2c2 = &i2c2;
> > > +               i2c3 = &i2c3;
> > > +               i2c4 = &i2c4;
> > > +               i2c5 = &i2c5;
> > > +               i2c6 = &i2c6;
> > > +               i2c7 = &i2c7;
> > > +               i2c8 = &i2c8;
> > > +               i2c9 = &i2c9;
> >
> > You should only add aliases for interfaces that are actually enabled.

Ok, will drop the extra ones.

> >
> > Also, I think we can disable i2c6. None of the current products use it.

It's already disabled upstream.

> >
> > ChenYu
> >
> > > +               mmc0 = &mmc0;
> > > +               mmc1 = &mmc1;
> 
> Also, Spherion does not have an SD card slot. It might be better to move
> the mmc aliases to the end .dts files.

Based on the downstream dts, rev0 and rev1 do have SD card slot (or at least the
mmc1 controller isn't disabled on those). However upstream we have a single dts
(asurada-spherion-r0) shared by those two and rev2 and rev3 (which don't have
the SD card slot), given that this way we can have a single dts and there's no
disadvantage to keeping the mmc1 node enabled because the CD IRQ will never be
triggered. With this in mind, I think it makes more sense to keep the mmc
aliases in the asurada dtsi, as there's no harm in having them, and will ensure
fixed ids for the rev0 and rev1 spherion boards.

Thanks,
Nícolas
Re: [PATCH v2 5/5] arm64: dts: mediatek: asurada: Add aliases for i2c and mmc
Posted by Chen-Yu Tsai 1 year, 11 months ago
On Fri, Oct 14, 2022 at 4:24 AM Nícolas F. R. A. Prado
<nfraprado@collabora.com> wrote:
>
> On Fri, Oct 07, 2022 at 12:02:03PM +0800, Chen-Yu Tsai wrote:
> > On Fri, Oct 7, 2022 at 11:51 AM Chen-Yu Tsai <wenst@chromium.org> wrote:
> > >
> > > On Fri, Oct 7, 2022 at 5:25 AM Nícolas F. R. A. Prado
> > > <nfraprado@collabora.com> wrote:
> > > >
> > > > Add aliases for the i2c and mmc nodes on the Asurada platform DT to
> > > > ensure that we get stable ids for those devices on userspace.
> > > >
> > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > > >
> > > > ---
> > > >
> > > > Changes in v2:
> > > > - Added this commit
> > > >
> > > >  arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 12 ++++++++++++
> > > >  1 file changed, 12 insertions(+)
> > > >
> > > > diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > > > index dac2d4f5e670..758ca42a6156 100644
> > > > --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > > > +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
> > > > @@ -11,6 +11,18 @@
> > > >
> > > >  / {
> > > >         aliases {
> > > > +               i2c0 = &i2c0;
> > > > +               i2c1 = &i2c1;
> > > > +               i2c2 = &i2c2;
> > > > +               i2c3 = &i2c3;
> > > > +               i2c4 = &i2c4;
> > > > +               i2c5 = &i2c5;
> > > > +               i2c6 = &i2c6;
> > > > +               i2c7 = &i2c7;
> > > > +               i2c8 = &i2c8;
> > > > +               i2c9 = &i2c9;
> > >
> > > You should only add aliases for interfaces that are actually enabled.
>
> Ok, will drop the extra ones.
>
> > >
> > > Also, I think we can disable i2c6. None of the current products use it.
>
> It's already disabled upstream.
>
> > >
> > > ChenYu
> > >
> > > > +               mmc0 = &mmc0;
> > > > +               mmc1 = &mmc1;
> >
> > Also, Spherion does not have an SD card slot. It might be better to move
> > the mmc aliases to the end .dts files.
>
> Based on the downstream dts, rev0 and rev1 do have SD card slot (or at least the
> mmc1 controller isn't disabled on those). However upstream we have a single dts
> (asurada-spherion-r0) shared by those two and rev2 and rev3 (which don't have
> the SD card slot), given that this way we can have a single dts and there's no
> disadvantage to keeping the mmc1 node enabled because the CD IRQ will never be
> triggered. With this in mind, I think it makes more sense to keep the mmc
> aliases in the asurada dtsi, as there's no harm in having them, and will ensure
> fixed ids for the rev0 and rev1 spherion boards.

Sounds good to me.

ChenYu