[v2,08/12] ARM: dts: imx6dl-pico: fix board compatibles
diff mbox series

Message ID 20200930190143.27032-9-krzk@kernel.org
State New, archived
Headers show
Series
  • ARM: dts: imx: Board compatibles cleanup
Related show

Commit Message

Krzysztof Kozlowski Sept. 30, 2020, 7:01 p.m. UTC
There are four flavors of TechNexion PICO-IMX6 boards.  They have their
own DTSes, even though in Dwarf, Nymph and Pi are exactly the same.
They also have their own bindings so adjust the compatibles to match the
bindings.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

Changes since v1:
1. None
---
 arch/arm/boot/dts/imx6dl-pico-dwarf.dts  | 2 +-
 arch/arm/boot/dts/imx6dl-pico-hobbit.dts | 2 +-
 arch/arm/boot/dts/imx6dl-pico-nymph.dts  | 2 +-
 arch/arm/boot/dts/imx6dl-pico-pi.dts     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ahmad Fatoum Oct. 1, 2020, 7:22 a.m. UTC | #1
Hello Krzysztof,

On 9/30/20 9:01 PM, Krzysztof Kozlowski wrote:
> There are four flavors of TechNexion PICO-IMX6 boards.  They have their
> own DTSes, even though in Dwarf, Nymph and Pi are exactly the same.
> They also have their own bindings so adjust the compatibles to match the
> bindings.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> ---
> 
> Changes since v1:
> 1. None
> ---
>  arch/arm/boot/dts/imx6dl-pico-dwarf.dts  | 2 +-
>  arch/arm/boot/dts/imx6dl-pico-hobbit.dts | 2 +-
>  arch/arm/boot/dts/imx6dl-pico-nymph.dts  | 2 +-
>  arch/arm/boot/dts/imx6dl-pico-pi.dts     | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6dl-pico-dwarf.dts b/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
> index 659a8e8714ea..d85b15a8c127 100644
> --- a/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
> +++ b/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
> @@ -13,5 +13,5 @@
>  
>  / {
>  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Dwarf baseboard";
> -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> +	compatible = "technexion,imx6dl-pico-dwarf", "fsl,imx6dl";

Could you change this to have all three compatibles ("technexion,imx6dl-pico-dwarf", "technexion,imx6dl-pico",
"fsl,imx6dl") and likewise for the other files? 
That way other firmware that reuses the Linux device tree files and match against the SoM compatible
continues to work after update.

>  };
> diff --git a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> index d7403c5c4337..08fedcbcc91b 100644
> --- a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> +++ b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> @@ -13,5 +13,5 @@
>  
>  / {
>  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Hobbit baseboard";
> -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> +	compatible = "technexion,imx6dl-pico-hobbit", "fsl,imx6dl";
>  };
> diff --git a/arch/arm/boot/dts/imx6dl-pico-nymph.dts b/arch/arm/boot/dts/imx6dl-pico-nymph.dts
> index b282dbf953aa..32ccfc5d41ce 100644
> --- a/arch/arm/boot/dts/imx6dl-pico-nymph.dts
> +++ b/arch/arm/boot/dts/imx6dl-pico-nymph.dts
> @@ -13,5 +13,5 @@
>  
>  / {
>  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Nymph baseboard";
> -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> +	compatible = "technexion,imx6dl-pico-nymph", "fsl,imx6dl";
>  };
> diff --git a/arch/arm/boot/dts/imx6dl-pico-pi.dts b/arch/arm/boot/dts/imx6dl-pico-pi.dts
> index b7b1c07f96f3..4590e8ad9a91 100644
> --- a/arch/arm/boot/dts/imx6dl-pico-pi.dts
> +++ b/arch/arm/boot/dts/imx6dl-pico-pi.dts
> @@ -13,5 +13,5 @@
>  
>  / {
>  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and PI baseboard";
> -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> +	compatible = "technexion,imx6dl-pico-pi", "fsl,imx6dl";
>  };
>
Krzysztof Kozlowski Oct. 1, 2020, 7:32 a.m. UTC | #2
On Thu, Oct 01, 2020 at 09:22:03AM +0200, Ahmad Fatoum wrote:
> Hello Krzysztof,
> 
> On 9/30/20 9:01 PM, Krzysztof Kozlowski wrote:
> > There are four flavors of TechNexion PICO-IMX6 boards.  They have their
> > own DTSes, even though in Dwarf, Nymph and Pi are exactly the same.
> > They also have their own bindings so adjust the compatibles to match the
> > bindings.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > 
> > ---
> > 
> > Changes since v1:
> > 1. None
> > ---
> >  arch/arm/boot/dts/imx6dl-pico-dwarf.dts  | 2 +-
> >  arch/arm/boot/dts/imx6dl-pico-hobbit.dts | 2 +-
> >  arch/arm/boot/dts/imx6dl-pico-nymph.dts  | 2 +-
> >  arch/arm/boot/dts/imx6dl-pico-pi.dts     | 2 +-
> >  4 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/imx6dl-pico-dwarf.dts b/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
> > index 659a8e8714ea..d85b15a8c127 100644
> > --- a/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
> > +++ b/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
> > @@ -13,5 +13,5 @@
> >  
> >  / {
> >  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Dwarf baseboard";
> > -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> > +	compatible = "technexion,imx6dl-pico-dwarf", "fsl,imx6dl";
> 
> Could you change this to have all three compatibles ("technexion,imx6dl-pico-dwarf", "technexion,imx6dl-pico",
> "fsl,imx6dl") and likewise for the other files? 
> That way other firmware that reuses the Linux device tree files and match against the SoM compatible
> continues to work after update.
> 
> >  };
> > diff --git a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> > index d7403c5c4337..08fedcbcc91b 100644
> > --- a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> > +++ b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> > @@ -13,5 +13,5 @@
> >  
> >  / {
> >  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Hobbit baseboard";
> > -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> > +	compatible = "technexion,imx6dl-pico-hobbit", "fsl,imx6dl";
> >  };
> > diff --git a/arch/arm/boot/dts/imx6dl-pico-nymph.dts b/arch/arm/boot/dts/imx6dl-pico-nymph.dts
> > index b282dbf953aa..32ccfc5d41ce 100644
> > --- a/arch/arm/boot/dts/imx6dl-pico-nymph.dts
> > +++ b/arch/arm/boot/dts/imx6dl-pico-nymph.dts
> > @@ -13,5 +13,5 @@
> >  
> >  / {
> >  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Nymph baseboard";
> > -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> > +	compatible = "technexion,imx6dl-pico-nymph", "fsl,imx6dl";
> >  };
> > diff --git a/arch/arm/boot/dts/imx6dl-pico-pi.dts b/arch/arm/boot/dts/imx6dl-pico-pi.dts
> > index b7b1c07f96f3..4590e8ad9a91 100644
> > --- a/arch/arm/boot/dts/imx6dl-pico-pi.dts
> > +++ b/arch/arm/boot/dts/imx6dl-pico-pi.dts

The bindings, added in commit 53b61224ca40 ("dt-bindings: arm: fsl: Add
TechNexion boards"), describe that these are the only valid compatibles.
"technexion,imx6dl-pico" is not valid and would require changing the
bindings, thus breaking compatibility which you want to avoid.

The bindings, not what is present in DTS, is considered ABI.

Best regards,
Krzysztof
Ahmad Fatoum Oct. 1, 2020, 10:19 a.m. UTC | #3
Hi,

On 10/1/20 9:32 AM, Krzysztof Kozlowski wrote:
> On Thu, Oct 01, 2020 at 09:22:03AM +0200, Ahmad Fatoum wrote:
>>> diff --git a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
>>> index d7403c5c4337..08fedcbcc91b 100644
>>> --- a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
>>> +++ b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
>>> @@ -13,5 +13,5 @@
>>>  
>>>  / {
>>>  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Hobbit baseboard";
>>> -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
>>> +	compatible = "technexion,imx6dl-pico-hobbit", "fsl,imx6dl";
>>>  };
> 
> The bindings, added in commit 53b61224ca40 ("dt-bindings: arm: fsl: Add
> TechNexion boards"), describe that these are the only valid compatibles.
> "technexion,imx6dl-pico" is not valid and would require changing the
> bindings, thus breaking compatibility which you want to avoid.> 
> The bindings, not what is present in DTS, is considered ABI.

The existing binding doesn't cover these boards then and needs to be
extended, no? How about following patch?

[I guess we need to keep the two-compatible list they were originally
 in for compatibility even if it's unused among upstream device trees?]

Cheers,
Ahmad

-------------------------8<---------------------------

From d2e44951f900a1774ef289db22812969e72925d6 Mon Sep 17 00:00:00 2001
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
Date: Thu, 1 Oct 2020 12:03:36 +0200
Subject: [RFC PATCH] dt-bindings: arm: fsl: add technexion,imx6dl-pico compatible

The technexion,imx6dl-pico -dwarf, -hobbit, -nymph and -pi all use the
same SoM. Reflect this compatibility with the SoM in the binding.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/devicetree/bindings/arm/fsl.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/fsl.yaml b/Documentation/devicetree/bindings/arm/fsl.yaml
index 6da9d734cdb7..b7110305ce81 100644
--- a/Documentation/devicetree/bindings/arm/fsl.yaml
+++ b/Documentation/devicetree/bindings/arm/fsl.yaml
@@ -211,6 +211,16 @@ properties:
           - const: gw,ventana
           - const: fsl,imx6dl
 
+      - description: i.MX6DL TechNexion Pico Boards
+        items:
+          - enum:
+              - technexion,imx6dl-pico-dwarf   # TechNexion i.MX6DL Pico-Dwarf
+              - technexion,imx6dl-pico-hobbit  # TechNexion i.MX6DL Pico-Hobbit
+              - technexion,imx6dl-pico-nymph   # TechNexion i.MX6DL Pico-Nymph
+              - technexion,imx6dl-pico-pi      # TechNexion i.MX6DL Pico-Pi
+          - const: technexion,imx6dl-pico
+          - const: fsl,imx6dl
+
       - description: i.MX6SL based Boards
         items:
           - enum:
Krzysztof Kozlowski Oct. 1, 2020, 10:37 a.m. UTC | #4
On Thu, Oct 01, 2020 at 12:19:08PM +0200, Ahmad Fatoum wrote:
> Hi,
> 
> On 10/1/20 9:32 AM, Krzysztof Kozlowski wrote:
> > On Thu, Oct 01, 2020 at 09:22:03AM +0200, Ahmad Fatoum wrote:
> >>> diff --git a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> >>> index d7403c5c4337..08fedcbcc91b 100644
> >>> --- a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> >>> +++ b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
> >>> @@ -13,5 +13,5 @@
> >>>  
> >>>  / {
> >>>  	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Hobbit baseboard";
> >>> -	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
> >>> +	compatible = "technexion,imx6dl-pico-hobbit", "fsl,imx6dl";
> >>>  };
> > 
> > The bindings, added in commit 53b61224ca40 ("dt-bindings: arm: fsl: Add
> > TechNexion boards"), describe that these are the only valid compatibles.
> > "technexion,imx6dl-pico" is not valid and would require changing the
> > bindings, thus breaking compatibility which you want to avoid.> 
> > The bindings, not what is present in DTS, is considered ABI.
> 
> The existing binding doesn't cover these boards then and needs to be
> extended, no? How about following patch?

What do you mean it doesn't cover? It was added exactly to handle them:
+              - technexion,imx6q-pico-dwarf   # TechNexion i.MX6Q Pico-Dwarf
+              - technexion,imx6q-pico-hobbit  # TechNexion i.MX6Q Pico-Hobbit
+              - technexion,imx6q-pico-nymph   # TechNexion i.MX6Q Pico-Nymph
+              - technexion,imx6q-pico-pi      # TechNexion i.MX6Q Pico-Pi

> 
> [I guess we need to keep the two-compatible list they were originally
>  in for compatibility even if it's unused among upstream device trees?]

You want to change both the binding (thus breaking the ABI) and update
the DTS to reflect new ABI. Then why having a binding at all?

I would assume that either binding is correct or DTS. You propose that
both are wrong and both need changes... in such case this is clearly
broken.

Best regards,
Krzysztof
Ahmad Fatoum Oct. 2, 2020, 7:41 a.m. UTC | #5
Hello,

On 10/1/20 12:37 PM, Krzysztof Kozlowski wrote:
>> The existing binding doesn't cover these boards then and needs to be
>> extended, no? How about following patch?
> 
> What do you mean it doesn't cover? It was added exactly to handle them:
> +              - technexion,imx6q-pico-dwarf   # TechNexion i.MX6Q Pico-Dwarf
> +              - technexion,imx6q-pico-hobbit  # TechNexion i.MX6Q Pico-Hobbit
> +              - technexion,imx6q-pico-nymph   # TechNexion i.MX6Q Pico-Nymph
> +              - technexion,imx6q-pico-pi      # TechNexion i.MX6Q Pico-Pi
> 

Still they are unused. So I'd think these boards should be handled like boards
that predated bindings: a binding is written that doesn't break existing users.

>> [I guess we need to keep the two-compatible list they were originally
>>  in for compatibility even if it's unused among upstream device trees?]
> 
> You want to change both the binding (thus breaking the ABI) and update
> the DTS to reflect new ABI. Then why having a binding at all?

If we leave the old two-compatible enumeration intact, there is no ABI broken.

> I would assume that either binding is correct or DTS. You propose that
> both are wrong and both need changes... in such case this is clearly
> broken.

IMO the DTS is the correct one. If you want to honor the author's intention
that each base board has a different compatible, it should be an extra
compatible and not replace the existing one that may be already in use.

Cheers
Ahmad


> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Oct. 2, 2020, 8:20 a.m. UTC | #6
On Fri, Oct 02, 2020 at 09:41:28AM +0200, Ahmad Fatoum wrote:
> Hello,
> 
> On 10/1/20 12:37 PM, Krzysztof Kozlowski wrote:
> >> The existing binding doesn't cover these boards then and needs to be
> >> extended, no? How about following patch?
> > 
> > What do you mean it doesn't cover? It was added exactly to handle them:
> > +              - technexion,imx6q-pico-dwarf   # TechNexion i.MX6Q Pico-Dwarf
> > +              - technexion,imx6q-pico-hobbit  # TechNexion i.MX6Q Pico-Hobbit
> > +              - technexion,imx6q-pico-nymph   # TechNexion i.MX6Q Pico-Nymph
> > +              - technexion,imx6q-pico-pi      # TechNexion i.MX6Q Pico-Pi
> > 
> 
> Still they are unused. So I'd think these boards should be handled like boards
> that predated bindings: a binding is written that doesn't break existing users.

OK, let's assume the binding is not correct and DTSes are good.

> 
> >> [I guess we need to keep the two-compatible list they were originally
> >>  in for compatibility even if it's unused among upstream device trees?]
> > 
> > You want to change both the binding (thus breaking the ABI) and update
> > the DTS to reflect new ABI. Then why having a binding at all?
> 
> If we leave the old two-compatible enumeration intact, there is no ABI broken.

Just to clarify, because I don't get here the "no ABI broken" part:
ABI is the binding, not the DTS. We can change intree DTS as we like,
replace compatibles, add nodes, remove nodes. There is no stability
requirement for DTS contents.

If we leave two-compatible binding intact, it is a broken binding since
beginning. Removing non-working, fake ABI is not breaking it because it
could never work.

> 
> > I would assume that either binding is correct or DTS. You propose that
> > both are wrong and both need changes... in such case this is clearly
> > broken.
> 
> IMO the DTS is the correct one. If you want to honor the author's intention
> that each base board has a different compatible, it should be an extra
> compatible and not replace the existing one that may be already in use.

OK, we can go with DTS approach. I fixed few of such cases as well,
assuming that DTS was intended and binding was incorrect. In such case
all boards will be documented under one compatible technexion,imx6q-pico
and DTS will not be changed.

Best regards,
Krzysztof
Ahmad Fatoum Oct. 2, 2020, 8:34 a.m. UTC | #7
Hello,

On 10/2/20 10:20 AM, Krzysztof Kozlowski wrote:
> On Fri, Oct 02, 2020 at 09:41:28AM +0200, Ahmad Fatoum wrote:
>> Hello,
>>
>> On 10/1/20 12:37 PM, Krzysztof Kozlowski wrote:
>>>> The existing binding doesn't cover these boards then and needs to be
>>>> extended, no? How about following patch?
>>>
>>> What do you mean it doesn't cover? It was added exactly to handle them:
>>> +              - technexion,imx6q-pico-dwarf   # TechNexion i.MX6Q Pico-Dwarf
>>> +              - technexion,imx6q-pico-hobbit  # TechNexion i.MX6Q Pico-Hobbit
>>> +              - technexion,imx6q-pico-nymph   # TechNexion i.MX6Q Pico-Nymph
>>> +              - technexion,imx6q-pico-pi      # TechNexion i.MX6Q Pico-Pi
>>>
>>
>> Still they are unused. So I'd think these boards should be handled like boards
>> that predated bindings: a binding is written that doesn't break existing users.
> 
> OK, let's assume the binding is not correct and DTSes are good.
> 
>>
>>>> [I guess we need to keep the two-compatible list they were originally
>>>>  in for compatibility even if it's unused among upstream device trees?]
>>>
>>> You want to change both the binding (thus breaking the ABI) and update
>>> the DTS to reflect new ABI. Then why having a binding at all?
>>
>> If we leave the old two-compatible enumeration intact, there is no ABI broken.
> 
> Just to clarify, because I don't get here the "no ABI broken" part:
> ABI is the binding, not the DTS. We can change intree DTS as we like,
> replace compatibles, add nodes, remove nodes. There is no stability
> requirement for DTS contents.
> If we leave two-compatible binding intact, it is a broken binding since
> beginning. Removing non-working, fake ABI is not breaking it because it
> could never work.

Then I misunderstood you. I was thinking about possible out-of-tree users
that have boards based on this and are adhering to the binding. Dropping
the binding would break those (albeit it's a quite manageable form of
brokenness here).

>>> I would assume that either binding is correct or DTS. You propose that
>>> both are wrong and both need changes... in such case this is clearly
>>> broken.
>>
>> IMO the DTS is the correct one. If you want to honor the author's intention
>> that each base board has a different compatible, it should be an extra
>> compatible and not replace the existing one that may be already in use.
> 
> OK, we can go with DTS approach. I fixed few of such cases as well,
> assuming that DTS was intended and binding was incorrect. In such case
> all boards will be documented under one compatible technexion,imx6q-pico
> and DTS will not be changed.

Sounds good. If further differentiation proves to be needed, it can be a
new compatible added in a separate commit.

Thanks
Ahmad

> 
> Best regards,
> Krzysztof
>
Marco Felsch Oct. 2, 2020, 8:41 a.m. UTC | #8
Hi,

sorry for jumping in.

On 20-10-02 10:20, Krzysztof Kozlowski wrote:
> On Fri, Oct 02, 2020 at 09:41:28AM +0200, Ahmad Fatoum wrote:
> > Hello,
> > 
> > On 10/1/20 12:37 PM, Krzysztof Kozlowski wrote:
> > >> The existing binding doesn't cover these boards then and needs to be
> > >> extended, no? How about following patch?
> > > 
> > > What do you mean it doesn't cover? It was added exactly to handle them:
> > > +              - technexion,imx6q-pico-dwarf   # TechNexion i.MX6Q Pico-Dwarf
> > > +              - technexion,imx6q-pico-hobbit  # TechNexion i.MX6Q Pico-Hobbit
> > > +              - technexion,imx6q-pico-nymph   # TechNexion i.MX6Q Pico-Nymph
> > > +              - technexion,imx6q-pico-pi      # TechNexion i.MX6Q Pico-Pi
> > > 
> > 
> > Still they are unused. So I'd think these boards should be handled like boards
> > that predated bindings: a binding is written that doesn't break existing users.
> 
> OK, let's assume the binding is not correct and DTSes are good.
> 
> > 
> > >> [I guess we need to keep the two-compatible list they were originally
> > >>  in for compatibility even if it's unused among upstream device trees?]
> > > 
> > > You want to change both the binding (thus breaking the ABI) and update
> > > the DTS to reflect new ABI. Then why having a binding at all?
> > 
> > If we leave the old two-compatible enumeration intact, there is no ABI broken.
> 
> Just to clarify, because I don't get here the "no ABI broken" part:
> ABI is the binding, not the DTS. We can change intree DTS as we like,
> replace compatibles, add nodes, remove nodes. There is no stability
> requirement for DTS contents.
> 
> If we leave two-compatible binding intact, it is a broken binding since
> beginning. Removing non-working, fake ABI is not breaking it because it
> could never work.

The problem here is that it wasn't covered by the review and now we have
the mess. I see the DTB and the Bootloader as Firmware. Now imagine if
the bootloader for these boards had some dt-fixup logic which won't
apply anymore or if the bootloader board init won't get called anymore
since the bootloader folks used the compatible found in the DTS. This
can cause a regression if the old Bootloader tries to boot the new
Kernel+DTS.

> > > I would assume that either binding is correct or DTS. You propose that
> > > both are wrong and both need changes... in such case this is clearly
> > > broken.
> > 
> > IMO the DTS is the correct one. If you want to honor the author's intention
> > that each base board has a different compatible, it should be an extra
> > compatible and not replace the existing one that may be already in use.

Question is what was the author's intention? @Fabio do you have any
comments here?

> OK, we can go with DTS approach. I fixed few of such cases as well,
> assuming that DTS was intended and binding was incorrect. In such case
> all boards will be documented under one compatible technexion,imx6q-pico
> and DTS will not be changed.

Or keep the exisiting bindings and adding the new one. Therefore the
yaml needs to handle two cases for each imx6[qdl]:
  compatible = "technexion,imx6dl-pico-dwarf", "technexion,imx6dl-pico", "fsl,imx6dl";
and
  compatible = "technexion,imx6dl-pico", "fsl,imx6dl";

Regards,
  Marco
Krzysztof Kozlowski Oct. 2, 2020, 10:36 a.m. UTC | #9
On Fri, Oct 02, 2020 at 10:41:19AM +0200, Marco Felsch wrote:
> Hi,
> 
> sorry for jumping in.
> 
> On 20-10-02 10:20, Krzysztof Kozlowski wrote:
> > On Fri, Oct 02, 2020 at 09:41:28AM +0200, Ahmad Fatoum wrote:
> > > Hello,
> > > 
> > > On 10/1/20 12:37 PM, Krzysztof Kozlowski wrote:
> > > >> The existing binding doesn't cover these boards then and needs to be
> > > >> extended, no? How about following patch?
> > > > 
> > > > What do you mean it doesn't cover? It was added exactly to handle them:
> > > > +              - technexion,imx6q-pico-dwarf   # TechNexion i.MX6Q Pico-Dwarf
> > > > +              - technexion,imx6q-pico-hobbit  # TechNexion i.MX6Q Pico-Hobbit
> > > > +              - technexion,imx6q-pico-nymph   # TechNexion i.MX6Q Pico-Nymph
> > > > +              - technexion,imx6q-pico-pi      # TechNexion i.MX6Q Pico-Pi
> > > > 
> > > 
> > > Still they are unused. So I'd think these boards should be handled like boards
> > > that predated bindings: a binding is written that doesn't break existing users.
> > 
> > OK, let's assume the binding is not correct and DTSes are good.
> > 
> > > 
> > > >> [I guess we need to keep the two-compatible list they were originally
> > > >>  in for compatibility even if it's unused among upstream device trees?]
> > > > 
> > > > You want to change both the binding (thus breaking the ABI) and update
> > > > the DTS to reflect new ABI. Then why having a binding at all?
> > > 
> > > If we leave the old two-compatible enumeration intact, there is no ABI broken.
> > 
> > Just to clarify, because I don't get here the "no ABI broken" part:
> > ABI is the binding, not the DTS. We can change intree DTS as we like,
> > replace compatibles, add nodes, remove nodes. There is no stability
> > requirement for DTS contents.
> > 
> > If we leave two-compatible binding intact, it is a broken binding since
> > beginning. Removing non-working, fake ABI is not breaking it because it
> > could never work.
> 
> The problem here is that it wasn't covered by the review and now we have
> the mess. I see the DTB and the Bootloader as Firmware. Now imagine if
> the bootloader for these boards had some dt-fixup logic which won't
> apply anymore or if the bootloader board init won't get called anymore
> since the bootloader folks used the compatible found in the DTS. This
> can cause a regression if the old Bootloader tries to boot the new
> Kernel+DTS.

Good points. It's nice to have a binding documented but it is more
likely that bootloader guys were depending on actual contents of DTS.

> 
> > > > I would assume that either binding is correct or DTS. You propose that
> > > > both are wrong and both need changes... in such case this is clearly
> > > > broken.
> > > 
> > > IMO the DTS is the correct one. If you want to honor the author's intention
> > > that each base board has a different compatible, it should be an extra
> > > compatible and not replace the existing one that may be already in use.
> 
> Question is what was the author's intention? @Fabio do you have any
> comments here?
> 
> > OK, we can go with DTS approach. I fixed few of such cases as well,
> > assuming that DTS was intended and binding was incorrect. In such case
> > all boards will be documented under one compatible technexion,imx6q-pico
> > and DTS will not be changed.
> 
> Or keep the exisiting bindings and adding the new one. Therefore the
> yaml needs to handle two cases for each imx6[qdl]:
>   compatible = "technexion,imx6dl-pico-dwarf", "technexion,imx6dl-pico", "fsl,imx6dl";
> and
>   compatible = "technexion,imx6dl-pico", "fsl,imx6dl";

This is the combination I wanted to avoid because it kind of proofs that
both (binding and DTS) were incorrect or insufficient. If both are
incorrect, then there might be no point to keep it stable.

Few other i.MX boards use one compatible for multiple DTS. Usually it is
a module's compatible and boards just do not add their own.

Best regards,
Krzysztof
Fabio Estevam Oct. 5, 2020, 11:39 a.m. UTC | #10
Hi Marco,

On Fri, Oct 2, 2020 at 5:41 AM Marco Felsch <m.felsch@pengutronix.de> wrote:

> Question is what was the author's intention? @Fabio do you have any
> comments here?

Krzysztof's patch looks good:

Reviewed-by: Fabio Estevam <festevam@gmail.com>

Thanks

Patch
diff mbox series

diff --git a/arch/arm/boot/dts/imx6dl-pico-dwarf.dts b/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
index 659a8e8714ea..d85b15a8c127 100644
--- a/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
+++ b/arch/arm/boot/dts/imx6dl-pico-dwarf.dts
@@ -13,5 +13,5 @@ 
 
 / {
 	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Dwarf baseboard";
-	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
+	compatible = "technexion,imx6dl-pico-dwarf", "fsl,imx6dl";
 };
diff --git a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
index d7403c5c4337..08fedcbcc91b 100644
--- a/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
+++ b/arch/arm/boot/dts/imx6dl-pico-hobbit.dts
@@ -13,5 +13,5 @@ 
 
 / {
 	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Hobbit baseboard";
-	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
+	compatible = "technexion,imx6dl-pico-hobbit", "fsl,imx6dl";
 };
diff --git a/arch/arm/boot/dts/imx6dl-pico-nymph.dts b/arch/arm/boot/dts/imx6dl-pico-nymph.dts
index b282dbf953aa..32ccfc5d41ce 100644
--- a/arch/arm/boot/dts/imx6dl-pico-nymph.dts
+++ b/arch/arm/boot/dts/imx6dl-pico-nymph.dts
@@ -13,5 +13,5 @@ 
 
 / {
 	model = "TechNexion PICO-IMX6 DualLite/Solo Board and Nymph baseboard";
-	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
+	compatible = "technexion,imx6dl-pico-nymph", "fsl,imx6dl";
 };
diff --git a/arch/arm/boot/dts/imx6dl-pico-pi.dts b/arch/arm/boot/dts/imx6dl-pico-pi.dts
index b7b1c07f96f3..4590e8ad9a91 100644
--- a/arch/arm/boot/dts/imx6dl-pico-pi.dts
+++ b/arch/arm/boot/dts/imx6dl-pico-pi.dts
@@ -13,5 +13,5 @@ 
 
 / {
 	model = "TechNexion PICO-IMX6 DualLite/Solo Board and PI baseboard";
-	compatible = "technexion,imx6dl-pico", "fsl,imx6dl";
+	compatible = "technexion,imx6dl-pico-pi", "fsl,imx6dl";
 };