Re: [PATCH v2] dt-bindings: renesas: Document preferred compatible naming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

Thanks for your feedback.

On 2024-02-12 20:36:12 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Sat, Jan 27, 2024 at 1:20 PM Niklas Söderlund
> <niklas.soderlund+renesas@xxxxxxxxxxxx> wrote:
> > Compatibles can come in two formats. Either "vendor,ip-soc" or
> > "vendor,soc-ip". Add a DT schema file documenting Renesas preferred
> > policy and enforcing it for all new compatibles, except few existing
> > patterns.
> >
> > Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
> > ---
> > * Changes since v1
> > - Split the "SoC agnostic compatibles" section into two to make it's
> >   intent clearer.
> > - Improved the documentation for each group of compatibles.
> > - Reduced the number of regexp to create a larger target area. As
> >   suggested by Krzysztof the goal is not to validate each SoC name but
> >   check for the correct order of SoC-IP.
> 
> Thanks for the update!
> 
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/soc/renesas/renesas-soc.yaml
> > @@ -0,0 +1,135 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/soc/renesas/renesas-soc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas SoC compatibles naming convention
> > +
> > +maintainers:
> > +  - Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> > +  - Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx>
> > +
> > +description: |
> > +  Guidelines for new compatibles for SoC blocks/components.
> > +  When adding new compatibles in new bindings, use the format::
> > +    renesas,SoC-IP
> 
> or renesas,Family-IP?
> 
> > +
> > +  For example::
> > +   renesas,r8a77965-csi2
> > +
> > +  When adding new compatibles to existing bindings, use the format in the
> > +  existing binding, even if it contradicts the above.
> > +
> > +select:
> > +  properties:
> > +    compatible:
> > +      pattern: "^renesas,.*-.*$"
> > +  required:
> > +    - compatible
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      # Preferred naming style for compatibles of SoC components
> > +      - pattern: "^renesas,emev2-[a-z0-9-]+$"
> > +      - pattern: "^renesas,r(7s|8a|9a)[a-z0-9]+-[a-z0-9-]+$"
> > +      - pattern: "^renesas,rcar-[a-z0-9-]+$"
> > +      - pattern: "^renesas,rz[a-z0-9]*-[a-z0-9-]+$"
> > +      - pattern: "^renesas,sh-[a-z0-9-]+$"
> > +      - pattern: "^renesas,sh7[a-z0-9]+-[a-z0-9-]+$"
> 
> I guess it's not worth adding rmobile and shmobile prefixes?

Maybe we start with this and see how it goes?

> 
> > +      # Fixed legacy compatibles
> > +      #
> > +      # List cannot grow with new bindings.
> > +      - enum:
> > +          - renesas,bsc-r8a73a4
> > +          - renesas,bsc-sh73a0
> > +          - renesas,dbsc-r8a73a4
> > +          - renesas,dbsc3-r8a7740
> > +          - renesas,em-gio
> > +          - renesas,em-sti
> > +          - renesas,em-uart
> 
> Perhaps combine these three: "renesas,em-(gpio|sti|usrt)"?

Will do.

> 
> > +          - renesas,fsi2-r8a7740
> > +          - renesas,fsi2-sh73a0
> 
> Likewise

Will do.

> 
> > +          - renesas,hspi-r8a7778
> > +          - renesas,hspi-r8a7779
> 
> Etc. ;-)

Will do :-)

> 
> Now, how do I trigger violations?
> 
> I added the following to a binding file:
> 
>           - enum:
>               - renesas,bogus-r8a7778
>               - renesas,bogus-r8a7779
>           - const: renesas,bogus
> 
> but nothing happened with "make dt_binding_check".
> 
> I added the following to a DTS file:
> 
>         compatible = "renesas,bogus-r8a7778", "renesas,bogus";
> 
> again, nothing happened with "make dtbs_check".
> 
> What am I missing?

Hum, this is odd. I have confirmed your finding that

    compatible = "renesas,bogus-r8a7778", "renesas,bogus";

or

    compatible = "renesas,bogus-r8a7778", "renesas,bogus-bar";

Do not trigger an issue, but a single compatible,

    compatible = "renesas,bogus-r8a7778";

Do trigger.

I tested this before I reduced the regexp and IIRC it worked as expected 
for the RFC. Not sure if I have updated dt-schema since, but I know I 
rebased the branch for v2. I will try to figure out what have gone 
wrong, if anyone know if something changed in this area pleas let me 
know.

> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
> 
> 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

-- 
Kind Regards,
Niklas Söderlund




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux