[PATCH v2 10/10] dt-bindings: mtd: partitions: Combine simple partition bindings

Rob Herring robh at kernel.org
Tue Jan 20 10:20:17 PST 2026


On Tue, Jan 20, 2026 at 3:04 AM Krzysztof Kozlowski <krzk at kernel.org> wrote:
>
> On Mon, Jan 19, 2026 at 07:48:31PM -0600, Rob Herring (Arm) wrote:
> > Several partition node bindings are just a compatible plus properties
> > defined in partition.yaml. Move all of these bindings to a single schema
> > file.
> >
> > Signed-off-by: Rob Herring (Arm) <robh at kernel.org>
> > -        partition at 200000 {
> > -            compatible = "tfa-bl31";
> > -            reg = <0x200000 0x100000>;
> > -            align = <0x4000>;
> > -        };
> > -    };
> > diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
> > index 159b32d12803..a6edf145df57 100644
> > --- a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
> > +++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
> > @@ -29,11 +29,7 @@ properties:
> >
> >  patternProperties:
> >    "^partition@[0-9a-f]+$":
> > -    $ref: partition.yaml#
> > -    properties:
> > -      compatible:
> > -        const: brcm,bcm4908-firmware
> > -    unevaluatedProperties: false
> > +    type: object
>
> I think this is not specific enough now and you should have here $ref
> (e.g. to simple-partition.yaml) with unevaluatedProperties. Otherwise
> schema does not report:
> 1. bogus properties in partition@ nodes without compatibles (like the
>    first one in the example),

Yes, it should be "$ref: partition.yaml#/$defs/partition-node" rather
than simple-partition.yaml IMO.

> 2. partition@ nodes with some other compatibles (non-partition like,
>    e.g. whatever I2C device stuffed there for which there is a schema of
>    course)

We don't really enforce something like that anywhere else except when
the child nodes are fixed and there's only 1 possible option. I don't
think the schemas need to check for obviously nonsensical DTs. We can
put I2C device on simple-bus or vendorA device in vendorB SoC. Trying
to combine all possibilities is what was tried in partitions.yaml, but
that doesn't really work well when there are multiple combinations and
nesting is possible. Maybe "brcm,bcm4908-firmware" is the only one
used, but there's not really any reason others can't be used. The
other way around already happened. "brcm,bcm4908-firmware" is used
under a "fixed-partitions" node (in bcm4906-netgear-r8000p.dts) which
wasn't allowed before this series.

Rob



More information about the linux-mtd mailing list