2023-05-06 15:40:56

by Linus Walleij

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: mtd: Add SEAMA partition bindings

This types of NAND partitions appear in OpenWrt and
U-Boot.

Signed-off-by: Linus Walleij <[email protected]>
---
.../devicetree/bindings/mtd/partitions/seama.yaml | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)

diff --git a/Documentation/devicetree/bindings/mtd/partitions/seama.yaml b/Documentation/devicetree/bindings/mtd/partitions/seama.yaml
new file mode 100644
index 000000000000..352f008ffdb1
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/partitions/seama.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/partitions/seama.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Seattle Image Partitions
+
+description: The SEAttle iMAge (SEAMA) partition is a type of partition
+ used for NAND flash devices. This type of flash image is found in some
+ D-Link routers such as DIR-645, DIR-842, DIR-859, DIR-860L, DIR-885L,
+ DIR890L and DCH-M225, as well as in WD and NEC routers on the ath79
+ (MIPS), Broadcom BCM53xx, and RAMIPS platforms.
+
+maintainers:
+ - Linus Walleij <[email protected]>
+
+select: false
+
+properties:
+ compatible:
+ const: seama
+
+ '#address-cells': false
+
+ '#size-cells': false
+
+patternProperties:
+ "@[0-9a-f]+$":
+ $ref: partition.yaml#
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ flash {
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ firmware@0 {
+ compatible = "seama";
+ label = "firmware";
+ reg = <0x00000000 0x08000000>;
+ };
+ };
+ };

--
2.34.1


2023-05-10 15:07:18

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: mtd: Add SEAMA partition bindings

On 06/05/2023 17:29, Linus Walleij wrote:
> This types of NAND partitions appear in OpenWrt and
> U-Boot.
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> .../devicetree/bindings/mtd/partitions/seama.yaml | 50 ++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/seama.yaml b/Documentation/devicetree/bindings/mtd/partitions/seama.yaml
> new file mode 100644
> index 000000000000..352f008ffdb1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mtd/partitions/seama.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mtd/partitions/seama.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Seattle Image Partitions
> +
> +description: The SEAttle iMAge (SEAMA) partition is a type of partition
> + used for NAND flash devices. This type of flash image is found in some
> + D-Link routers such as DIR-645, DIR-842, DIR-859, DIR-860L, DIR-885L,
> + DIR890L and DCH-M225, as well as in WD and NEC routers on the ath79
> + (MIPS), Broadcom BCM53xx, and RAMIPS platforms.
> +
> +maintainers:
> + - Linus Walleij <[email protected]>
> +
> +select: false

You miss update to partitions.yaml. Anyway, for your testing,
temporarily change it to true, to see errors.

> +
> +properties:
> + compatible:
> + const: seama
> +
> + '#address-cells': false
> +
> + '#size-cells': false

You have children, so these must be true.

> +
> +patternProperties:
> + "@[0-9a-f]+$":
> + $ref: partition.yaml#
> +
> +required:
> + - compatible

address/size-cells as well

> +
> +additionalProperties: false
> +
> +examples:

Best regards,
Krzysztof


2023-07-05 10:37:27

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: mtd: Add SEAMA partition bindings

On Wed, May 10, 2023 at 4:57 PM Krzysztof Kozlowski
<[email protected]> wrote:

> > +select: false
>
> You miss update to partitions.yaml. Anyway, for your testing,
> temporarily change it to true, to see errors.

This "select" just confuses me. I can set it to true and then I get
a flood of irrelevant errors, and the same if I change it to true for
any of the other childless partitions such as arm,arm-firmware-suite.yaml

So I do a best effort here...

> > +properties:
> > + compatible:
> > + const: seama
> > +
> > + '#address-cells': false
> > +
> > + '#size-cells': false
>
> You have children, so these must be true.

Not really, seama is childless.

I guess the example with fixed-partitions
was confusion, seama can be a subpartition in a set
of fixed-partions.

I'll try to write up something so it's clear.

Yours,
Linus Walleij