* [PATCH 0/3] Resolve BCMBCA DT validation errors
@ 2024-10-09 21:50 Sam Edwards
2024-10-09 21:50 ` [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema Sam Edwards
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sam Edwards @ 2024-10-09 21:50 UTC (permalink / raw)
To: Florian Fainelli, Rafał Miłecki, William Zhang,
Anand Gore, Kursad Oney
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Broadcom internal kernel review list, devicetree,
linux-arm-kernel, linux-kernel, Sam Edwards
Greetings DT schema folks,
This is a small changeset to resolve DT validation errors in some files located
within arm64/*/broadcom/bcmbca/. It consists of a relaxation of the BCM4908
partitioning schema, followed by two fixes to board-level DTs in order to pass
validation fully.
The motivation for this changeset was to resolve validation errors flagged by
Rob's bot when I tried to introduce a new DT to this directory [1].
Happy spooky month,
Sam
[1]: https://lore.kernel.org/linux-devicetree/172808887840.121596.11205114990341820307.robh@kernel.org/
COMMITTER NOTE: Email being what it is, the capitalization of my email address
is apparently getting discarded. If it is important that the author email
address have identical capitalization to the Signed-off-by, please explain why
so I can investigate why this is happening and/or get these patches to you in a
desired format.
Sam Edwards (3):
dt-bindings: mtd: Relax BCM4908 partition schema
arm64: dts: broadcom: bcmbca: bcm4908: Fix Asus GT-AC5300's cferom
partition
arm64: dts: broadcom: bcmbca: bcm4908: Fix Netgear R8000P partitioning
.../mtd/partitions/brcm,bcm4908-partitions.yaml | 17 +++++++++++------
.../broadcom/bcmbca/bcm4906-netgear-r8000p.dts | 4 +---
.../broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 12 +++++-------
3 files changed, 17 insertions(+), 16 deletions(-)
--
2.44.2
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema 2024-10-09 21:50 [PATCH 0/3] Resolve BCMBCA DT validation errors Sam Edwards @ 2024-10-09 21:50 ` Sam Edwards 2024-10-10 2:06 ` Rob Herring (Arm) 2024-10-10 2:38 ` Rob Herring 2024-10-09 21:50 ` [PATCH 2/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Asus GT-AC5300's cferom partition Sam Edwards 2024-10-09 21:50 ` [PATCH 3/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Netgear R8000P partitioning Sam Edwards 2 siblings, 2 replies; 7+ messages in thread From: Sam Edwards @ 2024-10-09 21:50 UTC (permalink / raw) To: Florian Fainelli, Rafał Miłecki, William Zhang, Anand Gore, Kursad Oney Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Broadcom internal kernel review list, devicetree, linux-arm-kernel, linux-kernel, Sam Edwards The BCM4908 partition "parser" is really just a fixed partitions table, with a special partition compatible (`brcm,bcm4908-firmware`) that automatically labels the partition as "firmware" or "backup" depending on what CFE is communicating as the selected active partition. The bcm4908-partitions schema is currently too restrictive, requiring that all child nodes use this special compatible or none at all. This not only contracits what is allowed by the "parser" but also causes warnings for an existing file ("bcm4908-asus-gt-ac5300.dts"). Modify the schema to be strict only for child partitions that use the -firmware compatible. Also update the child name regex to agree with fixed-partitions, so that these differences apply consistently. Signed-off-by: Sam Edwards <CFSworks@gmail.com> --- .../mtd/partitions/brcm,bcm4908-partitions.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml index 94f0742b375c..aed37922a5fc 100644 --- a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml +++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml @@ -30,12 +30,17 @@ properties: enum: [ 1, 2 ] patternProperties: - "^partition@[0-9a-f]+$": - $ref: partition.yaml# - properties: - compatible: - const: brcm,bcm4908-firmware - unevaluatedProperties: false + "^partition(-.+|@[0-9a-f]+)$": + type: object + if: + properties: + compatible: + const: brcm,bcm4908-firmware + then: + $ref: partition.yaml# + properties: + compatible: true + unevaluatedProperties: false required: - "#address-cells" -- 2.44.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema 2024-10-09 21:50 ` [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema Sam Edwards @ 2024-10-10 2:06 ` Rob Herring (Arm) 2024-10-10 2:38 ` Rob Herring 1 sibling, 0 replies; 7+ messages in thread From: Rob Herring (Arm) @ 2024-10-10 2:06 UTC (permalink / raw) To: Sam Edwards Cc: Rafał Miłecki, Broadcom internal kernel review list, Kursad Oney, William Zhang, Florian Fainelli, linux-kernel, Conor Dooley, Krzysztof Kozlowski, devicetree, linux-arm-kernel, Anand Gore, Sam Edwards On Wed, 09 Oct 2024 14:50:44 -0700, Sam Edwards wrote: > The BCM4908 partition "parser" is really just a fixed partitions table, > with a special partition compatible (`brcm,bcm4908-firmware`) that > automatically labels the partition as "firmware" or "backup" depending > on what CFE is communicating as the selected active partition. > > The bcm4908-partitions schema is currently too restrictive, requiring > that all child nodes use this special compatible or none at all. This > not only contracits what is allowed by the "parser" but also causes > warnings for an existing file ("bcm4908-asus-gt-ac5300.dts"). > > Modify the schema to be strict only for child partitions that use the > -firmware compatible. Also update the child name regex to agree with > fixed-partitions, so that these differences apply consistently. > > Signed-off-by: Sam Edwards <CFSworks@gmail.com> > --- > .../mtd/partitions/brcm,bcm4908-partitions.yaml | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml: patternProperties:^partition(-.+|@[0-9a-f]+)$: 'if' is not one of ['type', 'description', 'dependencies', 'dependentRequired', 'dependentSchemas', 'properties', 'patternProperties', 'additionalProperties', 'unevaluatedProperties', 'deprecated', 'required', 'not', 'allOf', 'anyOf', 'oneOf', '$ref'] from schema $id: http://devicetree.org/meta-schemas/nodes.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml: patternProperties:^partition(-.+|@[0-9a-f]+)$: 'then' is not one of ['type', 'description', 'dependencies', 'dependentRequired', 'dependentSchemas', 'properties', 'patternProperties', 'additionalProperties', 'unevaluatedProperties', 'deprecated', 'required', 'not', 'allOf', 'anyOf', 'oneOf', '$ref'] from schema $id: http://devicetree.org/meta-schemas/nodes.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241009215046.1449389-2-CFSworks@gmail.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema 2024-10-09 21:50 ` [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema Sam Edwards 2024-10-10 2:06 ` Rob Herring (Arm) @ 2024-10-10 2:38 ` Rob Herring 2024-10-10 3:37 ` Sam Edwards 1 sibling, 1 reply; 7+ messages in thread From: Rob Herring @ 2024-10-10 2:38 UTC (permalink / raw) To: Sam Edwards Cc: Florian Fainelli, Rafał Miłecki, William Zhang, Anand Gore, Kursad Oney, Krzysztof Kozlowski, Conor Dooley, Broadcom internal kernel review list, devicetree, linux-arm-kernel, linux-kernel On Wed, Oct 09, 2024 at 02:50:44PM -0700, Sam Edwards wrote: > The BCM4908 partition "parser" is really just a fixed partitions table, > with a special partition compatible (`brcm,bcm4908-firmware`) that > automatically labels the partition as "firmware" or "backup" depending > on what CFE is communicating as the selected active partition. > > The bcm4908-partitions schema is currently too restrictive, requiring > that all child nodes use this special compatible or none at all. This > not only contracits what is allowed by the "parser" but also causes > warnings for an existing file ("bcm4908-asus-gt-ac5300.dts"). > > Modify the schema to be strict only for child partitions that use the > -firmware compatible. Also update the child name regex to agree with > fixed-partitions, so that these differences apply consistently. > > Signed-off-by: Sam Edwards <CFSworks@gmail.com> > --- > .../mtd/partitions/brcm,bcm4908-partitions.yaml | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml > index 94f0742b375c..aed37922a5fc 100644 > --- a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml > +++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml > @@ -30,12 +30,17 @@ properties: > enum: [ 1, 2 ] > > patternProperties: > - "^partition@[0-9a-f]+$": > - $ref: partition.yaml# > - properties: > - compatible: > - const: brcm,bcm4908-firmware > - unevaluatedProperties: false > + "^partition(-.+|@[0-9a-f]+)$": > + type: object > + if: > + properties: > + compatible: > + const: brcm,bcm4908-firmware What schema applies to the node if this is not true? That needs to be addressed. You should be able to use oneOf here rather than if/then schema. > + then: > + $ref: partition.yaml# > + properties: > + compatible: true > + unevaluatedProperties: false > > required: > - "#address-cells" > -- > 2.44.2 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema 2024-10-10 2:38 ` Rob Herring @ 2024-10-10 3:37 ` Sam Edwards 0 siblings, 0 replies; 7+ messages in thread From: Sam Edwards @ 2024-10-10 3:37 UTC (permalink / raw) To: Rob Herring Cc: Florian Fainelli, Rafał Miłecki, William Zhang, Anand Gore, Kursad Oney, Krzysztof Kozlowski, Conor Dooley, Broadcom internal kernel review list, devicetree, linux-arm-kernel, linux-kernel On Wed, Oct 9, 2024 at 7:38 PM Rob Herring <robh@kernel.org> wrote: > > On Wed, Oct 09, 2024 at 02:50:44PM -0700, Sam Edwards wrote: > > The BCM4908 partition "parser" is really just a fixed partitions table, > > with a special partition compatible (`brcm,bcm4908-firmware`) that > > automatically labels the partition as "firmware" or "backup" depending > > on what CFE is communicating as the selected active partition. > > > > The bcm4908-partitions schema is currently too restrictive, requiring > > that all child nodes use this special compatible or none at all. This > > not only contracits what is allowed by the "parser" but also causes > > warnings for an existing file ("bcm4908-asus-gt-ac5300.dts"). > > > > Modify the schema to be strict only for child partitions that use the > > -firmware compatible. Also update the child name regex to agree with > > fixed-partitions, so that these differences apply consistently. > > > > Signed-off-by: Sam Edwards <CFSworks@gmail.com> > > --- > > .../mtd/partitions/brcm,bcm4908-partitions.yaml | 17 +++++++++++------ > > 1 file changed, 11 insertions(+), 6 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml > > index 94f0742b375c..aed37922a5fc 100644 > > --- a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml > > +++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml > > @@ -30,12 +30,17 @@ properties: > > enum: [ 1, 2 ] > > > > patternProperties: > > - "^partition@[0-9a-f]+$": > > - $ref: partition.yaml# > > - properties: > > - compatible: > > - const: brcm,bcm4908-firmware > > - unevaluatedProperties: false > > + "^partition(-.+|@[0-9a-f]+)$": > > + type: object > > + if: > > + properties: > > + compatible: > > + const: brcm,bcm4908-firmware Hi Rob, Thanks for your attention on this one! This is an odd case where I'm not sure what else could be done, and I'm a newbie to modifying DT schemata, so I'm glad to be receiving your feedback. :) > What schema applies to the node if this is not true? That needs to be > addressed. You should be able to use oneOf here rather than if/then > schema. The schema that should apply "in general" is partition.yaml, though moving the '$ref:' outside of 'then:' made the 'unevaluatedProperties: false' disallow everything. The if block here is just trying to memorialize bcm4908-firmware as a valid compatible at this level, and (ideally) disallow unevaluated properties if so. Could that be done with a oneOf? I would think if one of the arms of the oneOf was "unmodified $partition.yaml, unevaluated allowed" it would always match, rendering the "unevaluated disallowed when compatible=bcm4908-firmware" arm unused. Best, Sam > > > + then: > > + $ref: partition.yaml# > > + properties: > > + compatible: true > > + unevaluatedProperties: false > > > > required: > > - "#address-cells" > > -- > > 2.44.2 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Asus GT-AC5300's cferom partition 2024-10-09 21:50 [PATCH 0/3] Resolve BCMBCA DT validation errors Sam Edwards 2024-10-09 21:50 ` [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema Sam Edwards @ 2024-10-09 21:50 ` Sam Edwards 2024-10-09 21:50 ` [PATCH 3/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Netgear R8000P partitioning Sam Edwards 2 siblings, 0 replies; 7+ messages in thread From: Sam Edwards @ 2024-10-09 21:50 UTC (permalink / raw) To: Florian Fainelli, Rafał Miłecki, William Zhang, Anand Gore, Kursad Oney Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Broadcom internal kernel review list, devicetree, linux-arm-kernel, linux-kernel, Sam Edwards Since the previous patch relaxed the BCM4908 partition DT rules, it is now possible to have `nvmem-cells` directly under a BCM4908-partitioned MTD. Make use of this in order to refer to the nvmem MAC address the "correct" way, and pass the DTB check, for Asus GT-AC5300. Signed-off-by: Sam Edwards <CFSworks@gmail.com> --- .../dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts index 2a0d4ee3bd79..e4687176cffb 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts @@ -185,17 +185,15 @@ partitions { #size-cells = <1>; partition@0 { + compatible = "nvmem-cells"; label = "cferom"; reg = <0x0 0x100000>; - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <1>; + #size-cells = <1>; - base_mac_addr: mac@106a0 { - reg = <0x106a0 0x6>; - }; + base_mac_addr: mac@106a0 { + reg = <0x106a0 0x6>; }; }; -- 2.44.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Netgear R8000P partitioning 2024-10-09 21:50 [PATCH 0/3] Resolve BCMBCA DT validation errors Sam Edwards 2024-10-09 21:50 ` [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema Sam Edwards 2024-10-09 21:50 ` [PATCH 2/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Asus GT-AC5300's cferom partition Sam Edwards @ 2024-10-09 21:50 ` Sam Edwards 2 siblings, 0 replies; 7+ messages in thread From: Sam Edwards @ 2024-10-09 21:50 UTC (permalink / raw) To: Florian Fainelli, Rafał Miłecki, William Zhang, Anand Gore, Kursad Oney Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Broadcom internal kernel review list, devicetree, linux-arm-kernel, linux-kernel, Sam Edwards As we have just modified the DT schema for BCM4908 partitioning in order to accommodate `nvmem-cells` partitions, the workaround of using `fixed-partitions` is no longer necessary to pass the DT check. Promote this partition table to full-blown BCM4908 active-partition detection and remove an inappropriate `ranges` property, thus fully complying with the schema. Signed-off-by: Sam Edwards <CFSworks@gmail.com> --- .../arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts index 999d93730240..23adcfd52843 100644 --- a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts +++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4906-netgear-r8000p.dts @@ -139,7 +139,7 @@ &nandcs { #size-cells = <0>; partitions { - compatible = "fixed-partitions"; + compatible = "brcm,bcm4908-partitions"; #address-cells = <1>; #size-cells = <1>; @@ -150,7 +150,6 @@ partition@0 { #address-cells = <1>; #size-cells = <1>; - ranges = <0 0x0 0x100000>; base_mac_addr: mac@106a0 { reg = <0x106a0 0x6>; @@ -159,7 +158,6 @@ base_mac_addr: mac@106a0 { partition@100000 { compatible = "brcm,bcm4908-firmware"; - label = "firmware"; reg = <0x100000 0x4400000>; }; }; -- 2.44.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-10 3:37 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-09 21:50 [PATCH 0/3] Resolve BCMBCA DT validation errors Sam Edwards 2024-10-09 21:50 ` [PATCH 1/3] dt-bindings: mtd: Relax BCM4908 partition schema Sam Edwards 2024-10-10 2:06 ` Rob Herring (Arm) 2024-10-10 2:38 ` Rob Herring 2024-10-10 3:37 ` Sam Edwards 2024-10-09 21:50 ` [PATCH 2/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Asus GT-AC5300's cferom partition Sam Edwards 2024-10-09 21:50 ` [PATCH 3/3] arm64: dts: broadcom: bcmbca: bcm4908: Fix Netgear R8000P partitioning Sam Edwards
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).