[PATCH 1/5] arm: mvebu: a7040/a8040/cn9130: Add spi0 dts reference

Pali Rohár pali at kernel.org
Thu Aug 4 17:07:43 CEST 2022


On Thursday 04 August 2022 16:51:47 Stefan Roese wrote:
> On 03.08.22 13:00, Pali Rohár wrote:
> > For future changes it is needed for have spi0 device tree reference in
> > every mvebu soc dts file even when it is unused.
> > 
> > Signed-off-by: Pali Rohár <pali at kernel.org>
> > ---
> >   arch/arm/dts/armada-7040.dtsi | 3 +++
> >   arch/arm/dts/armada-8040.dtsi | 3 +++
> >   arch/arm/dts/cn9130.dtsi      | 3 +++
> >   3 files changed, 9 insertions(+)
> 
> You're changing 64-bit Armada files here, but in the cover letter you
> mention that this patchset only addresses 32-bit mvebu DT files. So
> why are you making these changes here?

The main issue is that 64-bit Armada DTS files are compiled also during
32-bit Armada builds. And 32-bit Armada DTS files needs spi0 reference
because it is used in 32-bit Armada section in mvebu-u-boot.dtsi file.

I know it is broken build system if during compilation of 32-bit SoC are
compiled also unrelated 64-bit Armada DTS files in 32-bit mode. But I do
not see currently easier solution than just define "harmless" reference.

During 64-bit Armada builds is content of mvebu-u-boot.dtsi skipped as
there is a 32-bit guard.

Proper way, of course, would be to fix build system, so none 64-bit file
is compiled (and let unused) during 32-bit build.

> One more comment below...
> 
> > diff --git a/arch/arm/dts/armada-7040.dtsi b/arch/arm/dts/armada-7040.dtsi
> > index 039d30c72a8c..1fb21c6bfde0 100644
> > --- a/arch/arm/dts/armada-7040.dtsi
> > +++ b/arch/arm/dts/armada-7040.dtsi
> > @@ -63,3 +63,6 @@
> >   		marvell,function = <3>;
> >   	};
> >   };
> > +
> > +spi0: &cp0_spi1 {
> > +};
> 
> Why is spi0 aliased now to "cp0_spi1"?

Because cp0_spi1 is used in U-Boot 64-bit Armada DTS files as "spi0"
alias. Really.

> In the Kernel DT files I see
> this:
> 
> 		spi0 = &spi0;
> 		spi1 = &cp0_spi0;
> 		spi2 = &cp0_spi1;
> ...
> 			spi0: spi at 510600 {

And you bring another issue :-) U-Boot DTS files for 64-bit Armada SoCs
(expects 3720) differs from kernel DTS files. They are incompatible and
nobody fixed this issue yet. I fixed it only for 64-bit Armada 3720 as
we are using and maintaining Armada 3720 boards.

So I just do not know what to do with remaining 64-bit
A7040/A8040/CN9030 SoCs. I just added simple harmless change which do
not change behavior nor output of those boards.

Either somebody has to start working on fixing U-Boot support and DTS
files for those boards to be compatible with Linux kernel. Or those SoCs
stays incompatible with Linux and their technical debt in U-Boot code
just grow. Or you as maintainer can decide that they are unmaintained
(and ready for removal?).

I'm just not going to do this big cleanup for A7040/A8040/CN9030 SoCs too.

> Thanks,
> Stefan
> 
> > diff --git a/arch/arm/dts/armada-8040.dtsi b/arch/arm/dts/armada-8040.dtsi
> > index eec5fa277405..608ff0d97f95 100644
> > --- a/arch/arm/dts/armada-8040.dtsi
> > +++ b/arch/arm/dts/armada-8040.dtsi
> > @@ -87,3 +87,6 @@
> >   		marvell,function = <3>;
> >   	};
> >   };
> > +
> > +spi0: &cp1_spi1 {
> > +};
> > diff --git a/arch/arm/dts/cn9130.dtsi b/arch/arm/dts/cn9130.dtsi
> > index 68b767a70639..a200276f7a2e 100644
> > --- a/arch/arm/dts/cn9130.dtsi
> > +++ b/arch/arm/dts/cn9130.dtsi
> > @@ -71,3 +71,6 @@
> >   		marvell,function = <3>;
> >   	};
> >   };
> > +
> > +spi0: &cp0_spi1 {
> > +};
> 
> Viele Grüße,
> Stefan Roese
> 
> -- 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list