diff mbox series

[6/9] spi: fsl_dspi: add new compatible fsl,ls1021a-v1.0-dspi

Message ID 20210831154028.1649864-7-michael@walle.cc
State Superseded
Delegated to: Priyanka Jain
Headers show
Series arm: dts: ls1028a: sync device tree with linux | expand

Commit Message

Michael Walle Aug. 31, 2021, 3:40 p.m. UTC
The offical ls1028a binding of the driver uses the following as
compatibles:
  compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";

Add the missing compatible to the driver and update the device tree.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm/dts/fsl-ls1028a.dtsi | 6 +++---
 drivers/spi/fsl_dspi.c        | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Vladimir Oltean Aug. 31, 2021, 6:32 p.m. UTC | #1
On Tue, Aug 31, 2021 at 05:40:25PM +0200, Michael Walle wrote:
> The offical ls1028a binding of the driver uses the following as

Same typo as before.

> compatibles:
>   compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
> 
> Add the missing compatible to the driver and update the device tree.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
> diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
> index 8fe3508c64..23d812f476 100644
> --- a/drivers/spi/fsl_dspi.c
> +++ b/drivers/spi/fsl_dspi.c
> @@ -654,6 +654,7 @@ static const struct dm_spi_ops fsl_dspi_ops = {
>  
>  static const struct udevice_id fsl_dspi_ids[] = {
>  	{ .compatible = "fsl,vf610-dspi" },
> +	{ .compatible = "fsl,ls1021a-v1.0-dspi" },

Okay, so you say it is pointless to add the "fsl,ls1028a-dspi"
compatible string as well, since the U-Boot driver will match on the
fallback compatible, and that is absolutely sufficient, since U-Boot
will never implement any of the LS1028A specifics (DMA) anyway.
I'm fine with that.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

>  	{ }
>  };
>  
> -- 
> 2.30.2
>
Michael Walle Aug. 31, 2021, 9:35 p.m. UTC | #2
Am 2021-08-31 20:32, schrieb Vladimir Oltean:
> On Tue, Aug 31, 2021 at 05:40:25PM +0200, Michael Walle wrote:
>> The offical ls1028a binding of the driver uses the following as
> 
> Same typo as before.
> 
>> compatibles:
>>   compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
>> 
>> Add the missing compatible to the driver and update the device tree.
>> 
>> Signed-off-by: Michael Walle <michael@walle.cc>
>> ---
>> diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
>> index 8fe3508c64..23d812f476 100644
>> --- a/drivers/spi/fsl_dspi.c
>> +++ b/drivers/spi/fsl_dspi.c
>> @@ -654,6 +654,7 @@ static const struct dm_spi_ops fsl_dspi_ops = {
>> 
>>  static const struct udevice_id fsl_dspi_ids[] = {
>>  	{ .compatible = "fsl,vf610-dspi" },
>> +	{ .compatible = "fsl,ls1021a-v1.0-dspi" },
> 
> Okay, so you say it is pointless to add the "fsl,ls1028a-dspi"
> compatible string as well, since the U-Boot driver will match on the
> fallback compatible, and that is absolutely sufficient, since U-Boot
> will never implement any of the LS1028A specifics (DMA) anyway.
> I'm fine with that.

I'll add that to the commit message in the next version.

> 
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

-michael
Vladimir Oltean Aug. 31, 2021, 9:39 p.m. UTC | #3
On Tue, Aug 31, 2021 at 11:35:25PM +0200, Michael Walle wrote:
> Am 2021-08-31 20:32, schrieb Vladimir Oltean:
> > On Tue, Aug 31, 2021 at 05:40:25PM +0200, Michael Walle wrote:
> > > The offical ls1028a binding of the driver uses the following as
> > 
> > Same typo as before.
> > 
> > > compatibles:
> > >   compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
> > > 
> > > Add the missing compatible to the driver and update the device tree.
> > > 
> > > Signed-off-by: Michael Walle <michael@walle.cc>
> > > ---
> > > diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
> > > index 8fe3508c64..23d812f476 100644
> > > --- a/drivers/spi/fsl_dspi.c
> > > +++ b/drivers/spi/fsl_dspi.c
> > > @@ -654,6 +654,7 @@ static const struct dm_spi_ops fsl_dspi_ops = {
> > > 
> > >  static const struct udevice_id fsl_dspi_ids[] = {
> > >  	{ .compatible = "fsl,vf610-dspi" },
> > > +	{ .compatible = "fsl,ls1021a-v1.0-dspi" },
> > 
> > Okay, so you say it is pointless to add the "fsl,ls1028a-dspi"
> > compatible string as well, since the U-Boot driver will match on the
> > fallback compatible, and that is absolutely sufficient, since U-Boot
> > will never implement any of the LS1028A specifics (DMA) anyway.
> > I'm fine with that.
> 
> I'll add that to the commit message in the next version.

There is a subtler point to be made.
While in the case of lpuart, there is that difference between Linux and
U-Boot, in that:
- Linux sets endianness based on compatible string
- U-Boot sets endianness based on "little-endian" property
For the dspi, it is different. Both Linux and U-Boot set endianness
based on the "big-endian" property. So that's why both the LS1021A and
LS1028A DSPI modules work with the same compatible string. Quite
inconsistent, but it is what it is.
Michael Walle Aug. 31, 2021, 9:53 p.m. UTC | #4
Am 2021-08-31 23:39, schrieb Vladimir Oltean:
> On Tue, Aug 31, 2021 at 11:35:25PM +0200, Michael Walle wrote:
>> Am 2021-08-31 20:32, schrieb Vladimir Oltean:
>> > On Tue, Aug 31, 2021 at 05:40:25PM +0200, Michael Walle wrote:
>> > > The offical ls1028a binding of the driver uses the following as
>> >
>> > Same typo as before.
>> >
>> > > compatibles:
>> > >   compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
>> > >
>> > > Add the missing compatible to the driver and update the device tree.
>> > >
>> > > Signed-off-by: Michael Walle <michael@walle.cc>
>> > > ---
>> > > diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
>> > > index 8fe3508c64..23d812f476 100644
>> > > --- a/drivers/spi/fsl_dspi.c
>> > > +++ b/drivers/spi/fsl_dspi.c
>> > > @@ -654,6 +654,7 @@ static const struct dm_spi_ops fsl_dspi_ops = {
>> > >
>> > >  static const struct udevice_id fsl_dspi_ids[] = {
>> > >  	{ .compatible = "fsl,vf610-dspi" },
>> > > +	{ .compatible = "fsl,ls1021a-v1.0-dspi" },
>> >
>> > Okay, so you say it is pointless to add the "fsl,ls1028a-dspi"
>> > compatible string as well, since the U-Boot driver will match on the
>> > fallback compatible, and that is absolutely sufficient, since U-Boot
>> > will never implement any of the LS1028A specifics (DMA) anyway.
>> > I'm fine with that.
>> 
>> I'll add that to the commit message in the next version.
> 
> There is a subtler point to be made.
> While in the case of lpuart, there is that difference between Linux and
> U-Boot, in that:
> - Linux sets endianness based on compatible string
> - U-Boot sets endianness based on "little-endian" property

You mean before this clean-up series?

> For the dspi, it is different. Both Linux and U-Boot set endianness
> based on the "big-endian" property. So that's why both the LS1021A and
> LS1028A DSPI modules work with the same compatible string. Quite
> inconsistent, but it is what it is.

Consistently inconsistent :p

-michael
Vladimir Oltean Aug. 31, 2021, 9:58 p.m. UTC | #5
On Tue, Aug 31, 2021 at 11:53:22PM +0200, Michael Walle wrote:
> Am 2021-08-31 23:39, schrieb Vladimir Oltean:
> > On Tue, Aug 31, 2021 at 11:35:25PM +0200, Michael Walle wrote:
> > > Am 2021-08-31 20:32, schrieb Vladimir Oltean:
> > > > On Tue, Aug 31, 2021 at 05:40:25PM +0200, Michael Walle wrote:
> > > > > The offical ls1028a binding of the driver uses the following as
> > > >
> > > > Same typo as before.
> > > >
> > > > > compatibles:
> > > > >   compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
> > > > >
> > > > > Add the missing compatible to the driver and update the device tree.
> > > > >
> > > > > Signed-off-by: Michael Walle <michael@walle.cc>
> > > > > ---
> > > > > diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
> > > > > index 8fe3508c64..23d812f476 100644
> > > > > --- a/drivers/spi/fsl_dspi.c
> > > > > +++ b/drivers/spi/fsl_dspi.c
> > > > > @@ -654,6 +654,7 @@ static const struct dm_spi_ops fsl_dspi_ops = {
> > > > >
> > > > >  static const struct udevice_id fsl_dspi_ids[] = {
> > > > >  	{ .compatible = "fsl,vf610-dspi" },
> > > > > +	{ .compatible = "fsl,ls1021a-v1.0-dspi" },
> > > >
> > > > Okay, so you say it is pointless to add the "fsl,ls1028a-dspi"
> > > > compatible string as well, since the U-Boot driver will match on the
> > > > fallback compatible, and that is absolutely sufficient, since U-Boot
> > > > will never implement any of the LS1028A specifics (DMA) anyway.
> > > > I'm fine with that.
> > > 
> > > I'll add that to the commit message in the next version.
> > 
> > There is a subtler point to be made.
> > While in the case of lpuart, there is that difference between Linux and
> > U-Boot, in that:
> > - Linux sets endianness based on compatible string
> > - U-Boot sets endianness based on "little-endian" property
> 
> You mean before this clean-up series?

Yes, I mean in the current git trees.
diff mbox series

Patch

diff --git a/arch/arm/dts/fsl-ls1028a.dtsi b/arch/arm/dts/fsl-ls1028a.dtsi
index 09d748c4d0..4186df17e1 100644
--- a/arch/arm/dts/fsl-ls1028a.dtsi
+++ b/arch/arm/dts/fsl-ls1028a.dtsi
@@ -381,7 +381,7 @@ 
 		};
 
 		dspi0: dspi@2100000 {
-			compatible = "fsl,vf610-dspi";
+			compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0x0 0x2100000 0x0 0x10000>;
@@ -394,7 +394,7 @@ 
 		};
 
 		dspi1: dspi@2110000 {
-			compatible = "fsl,vf610-dspi";
+			compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0x0 0x2110000 0x0 0x10000>;
@@ -407,7 +407,7 @@ 
 		};
 
 		dspi2: dspi@2120000 {
-			compatible = "fsl,vf610-dspi";
+			compatible = "fsl,ls1028a-dspi", "fsl,ls1021a-v1.0-dspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0x0 0x2120000 0x0 0x10000>;
diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
index 8fe3508c64..23d812f476 100644
--- a/drivers/spi/fsl_dspi.c
+++ b/drivers/spi/fsl_dspi.c
@@ -654,6 +654,7 @@  static const struct dm_spi_ops fsl_dspi_ops = {
 
 static const struct udevice_id fsl_dspi_ids[] = {
 	{ .compatible = "fsl,vf610-dspi" },
+	{ .compatible = "fsl,ls1021a-v1.0-dspi" },
 	{ }
 };