[PATCH v3 01/10] dt-bindings: mtd: partitions: add OpenWrt defined U-Boot Image

Rafał Miłecki zajec5 at gmail.com
Wed Jan 20 16:17:46 EST 2021


On 20.01.2021 16:44, Bjørn Mork wrote:
> Rafał Miłecki <zajec5 at gmail.com> writes:
> 
>> Did you check that binding with the dt_binding_check?
>>
>> Something like:
>> make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml
>> (you may need arch too, e.g. ARCH=arm64)
> 
> Yes, I actually did since I'm not exactly used to writing these files
> (or any docs, really :-)
> 
> So I used
> https://www.kernel.org/doc/html/latest/devicetree/writing-schema.html
> and tried my best to follow all the instructions.
> 
> Retested it now, just to be sure.  Need to add the "^openwrt,.*" vendor
> opbviously if this should go upstream:
> 
> bjorn at miraculix:/usr/local/src/git/linux$ git diff Documentation/devicetree/bindings/vendor-prefixes.yaml
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> index 041ae90b0d8f..bb70d31ec380 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> @@ -812,6 +812,8 @@ patternProperties:
>       description: OpenCores.org
>     "^openrisc,.*":
>       description: OpenRISC.io
> +  "^openwrt,.*":
> +    description: OpenWrt
>     "^option,.*":
>       description: Option NV
>     "^oranth,.*":
> 
> 
> And I get some warnings I really don't understand:
> 
> bjorn at miraculix:/usr/local/src/git/linux$ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml
>    CHKDT   Documentation/devicetree/bindings/processed-schema-examples.json
>    SCHEMA  Documentation/devicetree/bindings/processed-schema-examples.json
>    DTC     Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.example.dt.yaml
>    CHECK   Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.example.dt.yaml
> /usr/local/src/git/linux/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.example.dt.yaml: partition at 300000: 'label', 'reg' do not match any of the regexes: 'pinctrl-[0-9]+'
>          From schema: /usr/local/src/git/linux/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml
> /usr/local/src/git/linux/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.example.dt.yaml: partition at 70000: 'label', 'reg' do not match any of the regexes: 'pinctrl-[0-9]+'
>          From schema: /usr/local/src/git/linux/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml
> /usr/local/src/git/linux/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.example.dt.yaml: partition at 6c0000: 'label', 'reg' do not match any of the regexes: 'pinctrl-[0-9]+'
>          From schema: /usr/local/src/git/linux/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml

This means you used unexpected (unmentioned in .yaml) properties (label and reg).

It's an interesting timing as I just backported one slightly related patch:
[PATCH] dt-bindings: mtd: convert "fixed-partitions" to the json-schema
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=7495acb555730b56ca85e259c1565d141220674a

I'm also working on reusing partitions .yaml for other parsers, see:
[PATCH 1/3] dt-bindings: mtd: move partition binding to its own file
https://patchwork.ozlabs.org/project/linux-mtd/patch/20210115153901.31052-1-zajec5@gmail.com/
[PATCH 2/3] dt-bindings: mtd: add binding from BCM4908 partitions
https://patchwork.ozlabs.org/project/linux-mtd/patch/20210115153901.31052-2-zajec5@gmail.com/


>> I think preferred license for yaml (that dt_binding_check checks for) is
>> # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> 
> Wondered about that, but didn't find any specific recommendation.  And
> there are all plenty of both:
> 
> bjorn at miraculix:/usr/local/src/git/linux$ git grep -h SPDX-License-Identifier Documentation/devicetree/bindings/|sort|uniq -c
>        6 # SPDX-License-Identifier: (GPL-2.0)
>      378 # SPDX-License-Identifier: GPL-2.0
>       10 # SPDX-License-Identifier: GPL-2.0+
>        4 .. SPDX-License-Identifier: GPL-2.0
>        1 # SPDX-License-Identifier: (GPL-2.0-only)
>       71 # SPDX-License-Identifier: GPL-2.0-only
>       15 # SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
>        3 # SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
>      539 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>       79 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>      307 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>        7 # SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
>        9 # SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
>        1 # SPDX-License-Identifier: (GPL-2.0-or-later)
>        4 # SPDX-License-Identifier: GPL-2.0-or-later
>        5 # SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
>        3 # SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
>        3 # SPDX-License-Identifier: (GPL-2.0 OR MIT)
>        3 # SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>        3 # SPDX-License-Identifier: (GPL-2.0+ OR X11)
> 
> 
> But I won't object to changing it if you think that is better somehow.
> It's not like I see the real differnece here..  Why would anyone want to
> distibute a modified version of this schema in any other form than yaml
> source?

I personally don't have any strong preferences, I'm just trying to follow
upstream rules. If you use license preferred by upstream developers, it'll
make it easier for someone (maybe me) to upstream your work later.

If you check Documentation/devicetree/bindings/submitting-patches.txt , it
says you should use GPL-2.0-only OR BSD-2-Clause. That rule was added by Rob
in the commit 70145d16b3c1 ("dt: submitting-patches: Document requirements
for DT schema"). No extra explanation on "why". I would prefer not having
to argue with Rob though ;)



More information about the openwrt-devel mailing list