* [PATCH v3 01/17] dt-bindings: mtd: Accept nand related node names
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:16 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties Miquel Raynal
` (15 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Rob Herring, Krzysztof Kozlowski
There is no addition there, but the mtd.yaml file is so generic, it can
be referenced by a wide variety of devices, including nand ones which
already define the node name to "nand@<cs>". Right now it does not lead
to any failure but when we will constrain more the schema, this will
become a problem because we want the mtd-wide properties like label or
partitions to be available for the callers.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/mtd/mtd.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mtd/mtd.yaml b/Documentation/devicetree/bindings/mtd/mtd.yaml
index da3d488c335f..b82ca03e969c 100644
--- a/Documentation/devicetree/bindings/mtd/mtd.yaml
+++ b/Documentation/devicetree/bindings/mtd/mtd.yaml
@@ -12,7 +12,7 @@ maintainers:
properties:
$nodename:
- pattern: "^(flash|.*sram)(@.*)?$"
+ pattern: "^(flash|.*sram|nand)(@.*)?$"
label:
description:
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 01/17] dt-bindings: mtd: Accept nand related node names
2023-06-19 9:29 ` [PATCH v3 01/17] dt-bindings: mtd: Accept nand related node names Miquel Raynal
@ 2023-06-22 21:16 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:16 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Rob Herring, Krzysztof Kozlowski
On Mon, 2023-06-19 at 09:29:00 UTC, Miquel Raynal wrote:
> There is no addition there, but the mtd.yaml file is so generic, it can
> be referenced by a wide variety of devices, including nand ones which
> already define the node name to "nand@<cs>". Right now it does not lead
> to any failure but when we will constrain more the schema, this will
> become a problem because we want the mtd-wide properties like label or
> partitions to be available for the callers.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 01/17] dt-bindings: mtd: Accept nand related node names Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-19 22:50 ` Rob Herring
2023-06-22 21:16 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 03/17] dt-bindings: mtd: Mark nand-ecc-placement deprecated Miquel Raynal
` (14 subsequent siblings)
16 siblings, 2 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Rob Herring
In an effort to constrain as much as we can the existing binding, we
want to add "unevaluatedProperties: false" in all the NAND chip
descriptions part of NAND controller bindings. But in order to do that
properly, we also need to reference a file which contains all the
"allowed" properties. Right now this file is nand-chip.yaml but in
practice raw NAND controllers may use additional properties in their
NAND chip children node. These properties are listed under
nand-controller.yaml, which makes the "unevaluatedProperties" checks
fail while the description are valid. We need to move these NAND chip
related properties into another file, because we do not want to pollute
nand-chip.yaml which is also referenced by eg. SPI-NAND devices.
Let's create a raw-nand-chip.yaml file to reference all the properties a
raw NAND chip description can contain. The chain of inheritance becomes:
nand-controller.yaml <- raw-nand-chip.yaml
raw-nand-chip.yaml <- nand-chip.yaml
spi-nand.yaml <- nand-chip.yaml
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
.../bindings/mtd/nand-controller.yaml | 85 +--------------
.../bindings/mtd/raw-nand-chip.yaml | 102 ++++++++++++++++++
2 files changed, 104 insertions(+), 83 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
diff --git a/Documentation/devicetree/bindings/mtd/nand-controller.yaml b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
index f70a32d2d9d4..83a4fe4cc29d 100644
--- a/Documentation/devicetree/bindings/mtd/nand-controller.yaml
+++ b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
@@ -16,16 +16,6 @@ description: |
children nodes of the NAND controller. This representation should be
enforced even for simple controllers supporting only one chip.
- The ECC strength and ECC step size properties define the user
- desires in terms of correction capability of a controller. Together,
- they request the ECC engine to correct {strength} bit errors per
- {size} bytes.
-
- The interpretation of these parameters is implementation-defined, so
- not all implementations must support all possible
- combinations. However, implementations are encouraged to further
- specify the value(s) they support.
-
properties:
$nodename:
pattern: "^nand-controller(@.*)?"
@@ -51,79 +41,8 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
- $ref: nand-chip.yaml#
-
- properties:
- reg:
- description:
- Contains the chip-select IDs.
-
- nand-ecc-placement:
- description:
- Location of the ECC bytes. This location is unknown by default
- but can be explicitly set to "oob", if all ECC bytes are
- known to be stored in the OOB area, or "interleaved" if ECC
- bytes will be interleaved with regular data in the main area.
- $ref: /schemas/types.yaml#/definitions/string
- enum: [ oob, interleaved ]
-
- nand-bus-width:
- description:
- Bus width to the NAND chip
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [8, 16]
- default: 8
-
- nand-on-flash-bbt:
- description:
- With this property, the OS will search the device for a Bad
- Block Table (BBT). If not found, it will create one, reserve
- a few blocks at the end of the device to store it and update
- it as the device ages. Otherwise, the out-of-band area of a
- few pages of all the blocks will be scanned at boot time to
- find Bad Block Markers (BBM). These markers will help to
- build a volatile BBT in RAM.
- $ref: /schemas/types.yaml#/definitions/flag
-
- nand-ecc-maximize:
- description:
- Whether or not the ECC strength should be maximized. The
- maximum ECC strength is both controller and chip
- dependent. The ECC engine has to select the ECC config
- providing the best strength and taking the OOB area size
- constraint into account. This is particularly useful when
- only the in-band area is used by the upper layers, and you
- want to make your NAND as reliable as possible.
- $ref: /schemas/types.yaml#/definitions/flag
-
- nand-is-boot-medium:
- description:
- Whether or not the NAND chip is a boot medium. Drivers might
- use this information to select ECC algorithms supported by
- the boot ROM or similar restrictions.
- $ref: /schemas/types.yaml#/definitions/flag
-
- nand-rb:
- description:
- Contains the native Ready/Busy IDs.
- $ref: /schemas/types.yaml#/definitions/uint32-array
-
- rb-gpios:
- description:
- Contains one or more GPIO descriptor (the numper of descriptor
- depends on the number of R/B pins exposed by the flash) for the
- Ready/Busy pins. Active state refers to the NAND ready state and
- should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
-
- wp-gpios:
- description:
- Contains one GPIO descriptor for the Write Protect pin.
- Active state refers to the NAND Write Protect state and should be
- set to GPIOD_ACTIVE_LOW unless the signal is inverted.
- maxItems: 1
-
- required:
- - reg
+ type: object
+ $ref: raw-nand-chip.yaml#
required:
- "#address-cells"
diff --git a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
new file mode 100644
index 000000000000..2caa6a9a73d3
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/raw-nand-chip.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Raw NAND Chip Common Properties
+
+maintainers:
+ - Miquel Raynal <miquel.raynal@bootlin.com>
+
+allOf:
+ - $ref: nand-chip.yaml#
+
+description: |
+ The ECC strength and ECC step size properties define the user
+ desires in terms of correction capability of a controller. Together,
+ they request the ECC engine to correct {strength} bit errors per
+ {size} bytes for a particular raw NAND chip.
+
+ The interpretation of these parameters is implementation-defined, so
+ not all implementations must support all possible
+ combinations. However, implementations are encouraged to further
+ specify the value(s) they support.
+
+properties:
+ $nodename:
+ pattern: "^nand@[a-f0-9]$"
+
+ reg:
+ description:
+ Contains the chip-select IDs.
+
+ nand-ecc-placement:
+ description:
+ Location of the ECC bytes. This location is unknown by default
+ but can be explicitly set to "oob", if all ECC bytes are
+ known to be stored in the OOB area, or "interleaved" if ECC
+ bytes will be interleaved with regular data in the main area.
+ $ref: /schemas/types.yaml#/definitions/string
+ enum: [ oob, interleaved ]
+
+ nand-bus-width:
+ description:
+ Bus width to the NAND chip
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [8, 16]
+ default: 8
+
+ nand-on-flash-bbt:
+ description:
+ With this property, the OS will search the device for a Bad
+ Block Table (BBT). If not found, it will create one, reserve
+ a few blocks at the end of the device to store it and update
+ it as the device ages. Otherwise, the out-of-band area of a
+ few pages of all the blocks will be scanned at boot time to
+ find Bad Block Markers (BBM). These markers will help to
+ build a volatile BBT in RAM.
+ $ref: /schemas/types.yaml#/definitions/flag
+
+ nand-ecc-maximize:
+ description:
+ Whether or not the ECC strength should be maximized. The
+ maximum ECC strength is both controller and chip
+ dependent. The ECC engine has to select the ECC config
+ providing the best strength and taking the OOB area size
+ constraint into account. This is particularly useful when
+ only the in-band area is used by the upper layers, and you
+ want to make your NAND as reliable as possible.
+ $ref: /schemas/types.yaml#/definitions/flag
+
+ nand-is-boot-medium:
+ description:
+ Whether or not the NAND chip is a boot medium. Drivers might
+ use this information to select ECC algorithms supported by
+ the boot ROM or similar restrictions.
+ $ref: /schemas/types.yaml#/definitions/flag
+
+ nand-rb:
+ description:
+ Contains the native Ready/Busy IDs.
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+
+ rb-gpios:
+ description:
+ Contains one or more GPIO descriptor (the numper of descriptor
+ depends on the number of R/B pins exposed by the flash) for the
+ Ready/Busy pins. Active state refers to the NAND ready state and
+ should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
+
+ wp-gpios:
+ description:
+ Contains one GPIO descriptor for the Write Protect pin.
+ Active state refers to the NAND Write Protect state and should be
+ set to GPIOD_ACTIVE_LOW unless the signal is inverted.
+ maxItems: 1
+
+required:
+ - reg
+
+# This is a generic file other binding inherit from and extend
+additionalProperties: true
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties
2023-06-19 9:29 ` [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties Miquel Raynal
@ 2023-06-19 22:50 ` Rob Herring
2023-06-20 6:18 ` Miquel Raynal
2023-06-22 21:05 ` Miquel Raynal
2023-06-22 21:16 ` Miquel Raynal
1 sibling, 2 replies; 37+ messages in thread
From: Rob Herring @ 2023-06-19 22:50 UTC (permalink / raw)
To: Miquel Raynal
Cc: Krzysztof Kozlowski, devicetree, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, Chris Packham, Thomas Petazzoni
On Mon, Jun 19, 2023 at 11:29:01AM +0200, Miquel Raynal wrote:
> In an effort to constrain as much as we can the existing binding, we
> want to add "unevaluatedProperties: false" in all the NAND chip
> descriptions part of NAND controller bindings. But in order to do that
> properly, we also need to reference a file which contains all the
> "allowed" properties. Right now this file is nand-chip.yaml but in
> practice raw NAND controllers may use additional properties in their
> NAND chip children node. These properties are listed under
> nand-controller.yaml, which makes the "unevaluatedProperties" checks
> fail while the description are valid. We need to move these NAND chip
> related properties into another file, because we do not want to pollute
> nand-chip.yaml which is also referenced by eg. SPI-NAND devices.
>
> Let's create a raw-nand-chip.yaml file to reference all the properties a
> raw NAND chip description can contain. The chain of inheritance becomes:
> nand-controller.yaml <- raw-nand-chip.yaml
> raw-nand-chip.yaml <- nand-chip.yaml
> spi-nand.yaml <- nand-chip.yaml
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---
> .../bindings/mtd/nand-controller.yaml | 85 +--------------
> .../bindings/mtd/raw-nand-chip.yaml | 102 ++++++++++++++++++
> 2 files changed, 104 insertions(+), 83 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
>
> diff --git a/Documentation/devicetree/bindings/mtd/nand-controller.yaml b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> index f70a32d2d9d4..83a4fe4cc29d 100644
> --- a/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> +++ b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> @@ -16,16 +16,6 @@ description: |
> children nodes of the NAND controller. This representation should be
> enforced even for simple controllers supporting only one chip.
>
> - The ECC strength and ECC step size properties define the user
> - desires in terms of correction capability of a controller. Together,
> - they request the ECC engine to correct {strength} bit errors per
> - {size} bytes.
> -
> - The interpretation of these parameters is implementation-defined, so
> - not all implementations must support all possible
> - combinations. However, implementations are encouraged to further
> - specify the value(s) they support.
> -
> properties:
> $nodename:
> pattern: "^nand-controller(@.*)?"
> @@ -51,79 +41,8 @@ properties:
>
> patternProperties:
> "^nand@[a-f0-9]$":
> - $ref: nand-chip.yaml#
> -
> - properties:
> - reg:
> - description:
> - Contains the chip-select IDs.
> -
> - nand-ecc-placement:
> - description:
> - Location of the ECC bytes. This location is unknown by default
> - but can be explicitly set to "oob", if all ECC bytes are
> - known to be stored in the OOB area, or "interleaved" if ECC
> - bytes will be interleaved with regular data in the main area.
> - $ref: /schemas/types.yaml#/definitions/string
> - enum: [ oob, interleaved ]
> -
> - nand-bus-width:
> - description:
> - Bus width to the NAND chip
> - $ref: /schemas/types.yaml#/definitions/uint32
> - enum: [8, 16]
> - default: 8
> -
> - nand-on-flash-bbt:
> - description:
> - With this property, the OS will search the device for a Bad
> - Block Table (BBT). If not found, it will create one, reserve
> - a few blocks at the end of the device to store it and update
> - it as the device ages. Otherwise, the out-of-band area of a
> - few pages of all the blocks will be scanned at boot time to
> - find Bad Block Markers (BBM). These markers will help to
> - build a volatile BBT in RAM.
> - $ref: /schemas/types.yaml#/definitions/flag
> -
> - nand-ecc-maximize:
> - description:
> - Whether or not the ECC strength should be maximized. The
> - maximum ECC strength is both controller and chip
> - dependent. The ECC engine has to select the ECC config
> - providing the best strength and taking the OOB area size
> - constraint into account. This is particularly useful when
> - only the in-band area is used by the upper layers, and you
> - want to make your NAND as reliable as possible.
> - $ref: /schemas/types.yaml#/definitions/flag
> -
> - nand-is-boot-medium:
> - description:
> - Whether or not the NAND chip is a boot medium. Drivers might
> - use this information to select ECC algorithms supported by
> - the boot ROM or similar restrictions.
> - $ref: /schemas/types.yaml#/definitions/flag
> -
> - nand-rb:
> - description:
> - Contains the native Ready/Busy IDs.
> - $ref: /schemas/types.yaml#/definitions/uint32-array
> -
> - rb-gpios:
> - description:
> - Contains one or more GPIO descriptor (the numper of descriptor
> - depends on the number of R/B pins exposed by the flash) for the
> - Ready/Busy pins. Active state refers to the NAND ready state and
> - should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
> -
> - wp-gpios:
> - description:
> - Contains one GPIO descriptor for the Write Protect pin.
> - Active state refers to the NAND Write Protect state and should be
> - set to GPIOD_ACTIVE_LOW unless the signal is inverted.
> - maxItems: 1
> -
> - required:
> - - reg
> + type: object
> + $ref: raw-nand-chip.yaml#
>
> required:
> - "#address-cells"
> diff --git a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> new file mode 100644
> index 000000000000..2caa6a9a73d3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> @@ -0,0 +1,102 @@
> +# SPDX-License-Identifier: GPL-2.0
Should be dual licensed like the original.
Rob
^ permalink raw reply [flat|nested] 37+ messages in thread* Re: [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties
2023-06-19 22:50 ` Rob Herring
@ 2023-06-20 6:18 ` Miquel Raynal
2023-06-22 21:05 ` Miquel Raynal
1 sibling, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-20 6:18 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, devicetree, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, Chris Packham, Thomas Petazzoni
Hi Rob,
robh@kernel.org wrote on Mon, 19 Jun 2023 16:50:38 -0600:
> On Mon, Jun 19, 2023 at 11:29:01AM +0200, Miquel Raynal wrote:
> > In an effort to constrain as much as we can the existing binding, we
> > want to add "unevaluatedProperties: false" in all the NAND chip
> > descriptions part of NAND controller bindings. But in order to do that
> > properly, we also need to reference a file which contains all the
> > "allowed" properties. Right now this file is nand-chip.yaml but in
> > practice raw NAND controllers may use additional properties in their
> > NAND chip children node. These properties are listed under
> > nand-controller.yaml, which makes the "unevaluatedProperties" checks
> > fail while the description are valid. We need to move these NAND chip
> > related properties into another file, because we do not want to pollute
> > nand-chip.yaml which is also referenced by eg. SPI-NAND devices.
> >
> > Let's create a raw-nand-chip.yaml file to reference all the properties a
> > raw NAND chip description can contain. The chain of inheritance becomes:
> > nand-controller.yaml <- raw-nand-chip.yaml
> > raw-nand-chip.yaml <- nand-chip.yaml
> > spi-nand.yaml <- nand-chip.yaml
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > ---
> > .../bindings/mtd/nand-controller.yaml | 85 +--------------
> > .../bindings/mtd/raw-nand-chip.yaml | 102 ++++++++++++++++++
> > 2 files changed, 104 insertions(+), 83 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mtd/nand-controller.yaml b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> > index f70a32d2d9d4..83a4fe4cc29d 100644
> > --- a/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> > +++ b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> > @@ -16,16 +16,6 @@ description: |
> > children nodes of the NAND controller. This representation should be
> > enforced even for simple controllers supporting only one chip.
> >
> > - The ECC strength and ECC step size properties define the user
> > - desires in terms of correction capability of a controller. Together,
> > - they request the ECC engine to correct {strength} bit errors per
> > - {size} bytes.
> > -
> > - The interpretation of these parameters is implementation-defined, so
> > - not all implementations must support all possible
> > - combinations. However, implementations are encouraged to further
> > - specify the value(s) they support.
> > -
> > properties:
> > $nodename:
> > pattern: "^nand-controller(@.*)?"
> > @@ -51,79 +41,8 @@ properties:
> >
> > patternProperties:
> > "^nand@[a-f0-9]$":
> > - $ref: nand-chip.yaml#
> > -
> > - properties:
> > - reg:
> > - description:
> > - Contains the chip-select IDs.
> > -
> > - nand-ecc-placement:
> > - description:
> > - Location of the ECC bytes. This location is unknown by default
> > - but can be explicitly set to "oob", if all ECC bytes are
> > - known to be stored in the OOB area, or "interleaved" if ECC
> > - bytes will be interleaved with regular data in the main area.
> > - $ref: /schemas/types.yaml#/definitions/string
> > - enum: [ oob, interleaved ]
> > -
> > - nand-bus-width:
> > - description:
> > - Bus width to the NAND chip
> > - $ref: /schemas/types.yaml#/definitions/uint32
> > - enum: [8, 16]
> > - default: 8
> > -
> > - nand-on-flash-bbt:
> > - description:
> > - With this property, the OS will search the device for a Bad
> > - Block Table (BBT). If not found, it will create one, reserve
> > - a few blocks at the end of the device to store it and update
> > - it as the device ages. Otherwise, the out-of-band area of a
> > - few pages of all the blocks will be scanned at boot time to
> > - find Bad Block Markers (BBM). These markers will help to
> > - build a volatile BBT in RAM.
> > - $ref: /schemas/types.yaml#/definitions/flag
> > -
> > - nand-ecc-maximize:
> > - description:
> > - Whether or not the ECC strength should be maximized. The
> > - maximum ECC strength is both controller and chip
> > - dependent. The ECC engine has to select the ECC config
> > - providing the best strength and taking the OOB area size
> > - constraint into account. This is particularly useful when
> > - only the in-band area is used by the upper layers, and you
> > - want to make your NAND as reliable as possible.
> > - $ref: /schemas/types.yaml#/definitions/flag
> > -
> > - nand-is-boot-medium:
> > - description:
> > - Whether or not the NAND chip is a boot medium. Drivers might
> > - use this information to select ECC algorithms supported by
> > - the boot ROM or similar restrictions.
> > - $ref: /schemas/types.yaml#/definitions/flag
> > -
> > - nand-rb:
> > - description:
> > - Contains the native Ready/Busy IDs.
> > - $ref: /schemas/types.yaml#/definitions/uint32-array
> > -
> > - rb-gpios:
> > - description:
> > - Contains one or more GPIO descriptor (the numper of descriptor
> > - depends on the number of R/B pins exposed by the flash) for the
> > - Ready/Busy pins. Active state refers to the NAND ready state and
> > - should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
> > -
> > - wp-gpios:
> > - description:
> > - Contains one GPIO descriptor for the Write Protect pin.
> > - Active state refers to the NAND Write Protect state and should be
> > - set to GPIOD_ACTIVE_LOW unless the signal is inverted.
> > - maxItems: 1
> > -
> > - required:
> > - - reg
> > + type: object
> > + $ref: raw-nand-chip.yaml#
> >
> > required:
> > - "#address-cells"
> > diff --git a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> > new file mode 100644
> > index 000000000000..2caa6a9a73d3
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> > @@ -0,0 +1,102 @@
> > +# SPDX-License-Identifier: GPL-2.0
>
> Should be dual licensed like the original.
Good catch. I'll wait a few more days, in case there is no other
comment I'll correct when applying. Otherwise I'll address this in v4.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 37+ messages in thread* Re: [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties
2023-06-19 22:50 ` Rob Herring
2023-06-20 6:18 ` Miquel Raynal
@ 2023-06-22 21:05 ` Miquel Raynal
1 sibling, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:05 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, devicetree, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, Chris Packham, Thomas Petazzoni
Hi Rob,
robh@kernel.org wrote on Mon, 19 Jun 2023 16:50:38 -0600:
> On Mon, Jun 19, 2023 at 11:29:01AM +0200, Miquel Raynal wrote:
> > In an effort to constrain as much as we can the existing binding, we
> > want to add "unevaluatedProperties: false" in all the NAND chip
> > descriptions part of NAND controller bindings. But in order to do that
> > properly, we also need to reference a file which contains all the
> > "allowed" properties. Right now this file is nand-chip.yaml but in
> > practice raw NAND controllers may use additional properties in their
> > NAND chip children node. These properties are listed under
> > nand-controller.yaml, which makes the "unevaluatedProperties" checks
> > fail while the description are valid. We need to move these NAND chip
> > related properties into another file, because we do not want to pollute
> > nand-chip.yaml which is also referenced by eg. SPI-NAND devices.
> >
> > Let's create a raw-nand-chip.yaml file to reference all the properties a
> > raw NAND chip description can contain. The chain of inheritance becomes:
> > nand-controller.yaml <- raw-nand-chip.yaml
> > raw-nand-chip.yaml <- nand-chip.yaml
> > spi-nand.yaml <- nand-chip.yaml
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > ---
> > .../bindings/mtd/nand-controller.yaml | 85 +--------------
> > .../bindings/mtd/raw-nand-chip.yaml | 102 ++++++++++++++++++
> > 2 files changed, 104 insertions(+), 83 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mtd/nand-controller.yaml b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> > index f70a32d2d9d4..83a4fe4cc29d 100644
> > --- a/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> > +++ b/Documentation/devicetree/bindings/mtd/nand-controller.yaml
> > @@ -16,16 +16,6 @@ description: |
> > children nodes of the NAND controller. This representation should be
> > enforced even for simple controllers supporting only one chip.
> >
> > - The ECC strength and ECC step size properties define the user
> > - desires in terms of correction capability of a controller. Together,
> > - they request the ECC engine to correct {strength} bit errors per
> > - {size} bytes.
> > -
> > - The interpretation of these parameters is implementation-defined, so
> > - not all implementations must support all possible
> > - combinations. However, implementations are encouraged to further
> > - specify the value(s) they support.
> > -
> > properties:
> > $nodename:
> > pattern: "^nand-controller(@.*)?"
> > @@ -51,79 +41,8 @@ properties:
> >
> > patternProperties:
> > "^nand@[a-f0-9]$":
> > - $ref: nand-chip.yaml#
> > -
> > - properties:
> > - reg:
> > - description:
> > - Contains the chip-select IDs.
> > -
> > - nand-ecc-placement:
> > - description:
> > - Location of the ECC bytes. This location is unknown by default
> > - but can be explicitly set to "oob", if all ECC bytes are
> > - known to be stored in the OOB area, or "interleaved" if ECC
> > - bytes will be interleaved with regular data in the main area.
> > - $ref: /schemas/types.yaml#/definitions/string
> > - enum: [ oob, interleaved ]
> > -
> > - nand-bus-width:
> > - description:
> > - Bus width to the NAND chip
> > - $ref: /schemas/types.yaml#/definitions/uint32
> > - enum: [8, 16]
> > - default: 8
> > -
> > - nand-on-flash-bbt:
> > - description:
> > - With this property, the OS will search the device for a Bad
> > - Block Table (BBT). If not found, it will create one, reserve
> > - a few blocks at the end of the device to store it and update
> > - it as the device ages. Otherwise, the out-of-band area of a
> > - few pages of all the blocks will be scanned at boot time to
> > - find Bad Block Markers (BBM). These markers will help to
> > - build a volatile BBT in RAM.
> > - $ref: /schemas/types.yaml#/definitions/flag
> > -
> > - nand-ecc-maximize:
> > - description:
> > - Whether or not the ECC strength should be maximized. The
> > - maximum ECC strength is both controller and chip
> > - dependent. The ECC engine has to select the ECC config
> > - providing the best strength and taking the OOB area size
> > - constraint into account. This is particularly useful when
> > - only the in-band area is used by the upper layers, and you
> > - want to make your NAND as reliable as possible.
> > - $ref: /schemas/types.yaml#/definitions/flag
> > -
> > - nand-is-boot-medium:
> > - description:
> > - Whether or not the NAND chip is a boot medium. Drivers might
> > - use this information to select ECC algorithms supported by
> > - the boot ROM or similar restrictions.
> > - $ref: /schemas/types.yaml#/definitions/flag
> > -
> > - nand-rb:
> > - description:
> > - Contains the native Ready/Busy IDs.
> > - $ref: /schemas/types.yaml#/definitions/uint32-array
> > -
> > - rb-gpios:
> > - description:
> > - Contains one or more GPIO descriptor (the numper of descriptor
> > - depends on the number of R/B pins exposed by the flash) for the
> > - Ready/Busy pins. Active state refers to the NAND ready state and
> > - should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
> > -
> > - wp-gpios:
> > - description:
> > - Contains one GPIO descriptor for the Write Protect pin.
> > - Active state refers to the NAND Write Protect state and should be
> > - set to GPIOD_ACTIVE_LOW unless the signal is inverted.
> > - maxItems: 1
> > -
> > - required:
> > - - reg
> > + type: object
> > + $ref: raw-nand-chip.yaml#
> >
> > required:
> > - "#address-cells"
> > diff --git a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> > new file mode 100644
> > index 000000000000..2caa6a9a73d3
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
> > @@ -0,0 +1,102 @@
> > +# SPDX-License-Identifier: GPL-2.0
>
> Should be dual licensed like the original.
The original is not dual licensed, so I'll send a fix.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties
2023-06-19 9:29 ` [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties Miquel Raynal
2023-06-19 22:50 ` Rob Herring
@ 2023-06-22 21:16 ` Miquel Raynal
1 sibling, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:16 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Rob Herring
On Mon, 2023-06-19 at 09:29:01 UTC, Miquel Raynal wrote:
> In an effort to constrain as much as we can the existing binding, we
> want to add "unevaluatedProperties: false" in all the NAND chip
> descriptions part of NAND controller bindings. But in order to do that
> properly, we also need to reference a file which contains all the
> "allowed" properties. Right now this file is nand-chip.yaml but in
> practice raw NAND controllers may use additional properties in their
> NAND chip children node. These properties are listed under
> nand-controller.yaml, which makes the "unevaluatedProperties" checks
> fail while the description are valid. We need to move these NAND chip
> related properties into another file, because we do not want to pollute
> nand-chip.yaml which is also referenced by eg. SPI-NAND devices.
>
> Let's create a raw-nand-chip.yaml file to reference all the properties a
> raw NAND chip description can contain. The chain of inheritance becomes:
> nand-controller.yaml <- raw-nand-chip.yaml
> raw-nand-chip.yaml <- nand-chip.yaml
> spi-nand.yaml <- nand-chip.yaml
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 03/17] dt-bindings: mtd: Mark nand-ecc-placement deprecated
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 01/17] dt-bindings: mtd: Accept nand related node names Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 02/17] dt-bindings: mtd: Create a file for raw NAND chip properties Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:16 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 04/17] dt-bindings: mtd: Describe nand-ecc-mode Miquel Raynal
` (13 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Rob Herring, Krzysztof Kozlowski
The nand-ecc-placement property has been deprecated for a long time
already, it does not really mean something useful for the ECC engines
and is anyway in the vast majority of cases totally useless. Just mark
it deprecated to avoid appealing people to use it.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
index 2caa6a9a73d3..a0488bf60971 100644
--- a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
+++ b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
@@ -39,6 +39,7 @@ properties:
bytes will be interleaved with regular data in the main area.
$ref: /schemas/types.yaml#/definitions/string
enum: [ oob, interleaved ]
+ deprecated: true
nand-bus-width:
description:
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 03/17] dt-bindings: mtd: Mark nand-ecc-placement deprecated
2023-06-19 9:29 ` [PATCH v3 03/17] dt-bindings: mtd: Mark nand-ecc-placement deprecated Miquel Raynal
@ 2023-06-22 21:16 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:16 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Rob Herring, Krzysztof Kozlowski
On Mon, 2023-06-19 at 09:29:02 UTC, Miquel Raynal wrote:
> The nand-ecc-placement property has been deprecated for a long time
> already, it does not really mean something useful for the ECC engines
> and is anyway in the vast majority of cases totally useless. Just mark
> it deprecated to avoid appealing people to use it.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 04/17] dt-bindings: mtd: Describe nand-ecc-mode
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (2 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 03/17] dt-bindings: mtd: Mark nand-ecc-placement deprecated Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:16 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 05/17] dt-bindings: mtd: qcom: Fix a property position Miquel Raynal
` (12 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Rob Herring, Krzysztof Kozlowski
This property has been extensively used for almost two decades already,
a lot of device trees use it, this is not the preferred way to configure
the ECC engines but we cannot just ignore it. Describe the property,
list the exact strings which have once been supported and mark it
deprecated.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
index a0488bf60971..cd9ac60b048b 100644
--- a/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
+++ b/Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml
@@ -41,6 +41,14 @@ properties:
enum: [ oob, interleaved ]
deprecated: true
+ nand-ecc-mode:
+ description:
+ Legacy ECC configuration mixing the ECC engine choice and
+ configuration.
+ $ref: /schemas/types.yaml#/definitions/string
+ enum: [none, soft, soft_bch, hw, hw_syndrome, on-die]
+ deprecated: true
+
nand-bus-width:
description:
Bus width to the NAND chip
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 04/17] dt-bindings: mtd: Describe nand-ecc-mode
2023-06-19 9:29 ` [PATCH v3 04/17] dt-bindings: mtd: Describe nand-ecc-mode Miquel Raynal
@ 2023-06-22 21:16 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:16 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Rob Herring, Krzysztof Kozlowski
On Mon, 2023-06-19 at 09:29:03 UTC, Miquel Raynal wrote:
> This property has been extensively used for almost two decades already,
> a lot of device trees use it, this is not the preferred way to configure
> the ECC engines but we cannot just ignore it. Describe the property,
> list the exact strings which have once been supported and mark it
> deprecated.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 05/17] dt-bindings: mtd: qcom: Fix a property position
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (3 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 04/17] dt-bindings: mtd: Describe nand-ecc-mode Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:16 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 06/17] dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties Miquel Raynal
` (11 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Manivannan Sadhasivam,
Rob Herring, Krzysztof Kozlowski
qcom,boot-partitions is a NAND chip property, not a NAND controller
property. Move the description of the property into the NAND chip
section and just enable the property in the if/else block.
Fixes: 5278cc93a97f ("dt-bindings: mtd: qcom_nandc: document qcom,boot-partitions binding")
Cc: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../devicetree/bindings/mtd/qcom,nandc.yaml | 41 +++++++++++--------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
index 00c991ffa6c4..3d77922dfaef 100644
--- a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
+++ b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
@@ -45,6 +45,22 @@ patternProperties:
enum:
- 512
+ qcom,boot-partitions:
+ $ref: /schemas/types.yaml#/definitions/uint32-matrix
+ items:
+ items:
+ - description: offset
+ - description: size
+ description:
+ Boot partition use a different layout where the 4 bytes of spare
+ data are not protected by ECC. Use this to declare these special
+ partitions by defining first the offset and then the size.
+
+ It's in the form of <offset1 size1 offset2 size2 offset3 ...>
+ and should be declared in ascending order.
+
+ Refer to the ipq8064 example on how to use this special binding.
+
allOf:
- $ref: nand-controller.yaml#
@@ -107,22 +123,15 @@ allOf:
- qcom,ipq806x-nand
then:
- properties:
- qcom,boot-partitions:
- $ref: /schemas/types.yaml#/definitions/uint32-matrix
- items:
- items:
- - description: offset
- - description: size
- description:
- Boot partition use a different layout where the 4 bytes of spare
- data are not protected by ECC. Use this to declare these special
- partitions by defining first the offset and then the size.
-
- It's in the form of <offset1 size1 offset2 size2 offset3 ...>
- and should be declared in ascending order.
-
- Refer to the ipq8064 example on how to use this special binding.
+ patternProperties:
+ "^nand@[a-f0-9]$":
+ properties:
+ qcom,boot-partitions: true
+ else:
+ patternProperties:
+ "^nand@[a-f0-9]$":
+ properties:
+ qcom,boot-partitions: false
required:
- compatible
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 05/17] dt-bindings: mtd: qcom: Fix a property position
2023-06-19 9:29 ` [PATCH v3 05/17] dt-bindings: mtd: qcom: Fix a property position Miquel Raynal
@ 2023-06-22 21:16 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:16 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Manivannan Sadhasivam, Rob Herring,
Krzysztof Kozlowski
On Mon, 2023-06-19 at 09:29:04 UTC, Miquel Raynal wrote:
> qcom,boot-partitions is a NAND chip property, not a NAND controller
> property. Move the description of the property into the NAND chip
> section and just enable the property in the if/else block.
>
> Fixes: 5278cc93a97f ("dt-bindings: mtd: qcom_nandc: document qcom,boot-partitions binding")
> Cc: Manivannan Sadhasivam <mani@kernel.org>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 06/17] dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (4 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 05/17] dt-bindings: mtd: qcom: Fix a property position Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 07/17] dt-bindings: mtd: ingenic: " Miquel Raynal
` (10 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Manivannan Sadhasivam,
Rob Herring
List all the possible properties in the NAND chip as per the example and
set unevaluatedProperties to false in the NAND chip section.
Cc: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/qcom,nandc.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
index 3d77922dfaef..4ada60fbf81d 100644
--- a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
+++ b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
@@ -34,7 +34,9 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
+
nand-bus-width:
const: 8
@@ -61,6 +63,8 @@ patternProperties:
Refer to the ipq8064 example on how to use this special binding.
+ unevaluatedProperties: false
+
allOf:
- $ref: nand-controller.yaml#
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 06/17] dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 06/17] dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Manivannan Sadhasivam, Rob Herring
On Mon, 2023-06-19 at 09:29:05 UTC, Miquel Raynal wrote:
> List all the possible properties in the NAND chip as per the example and
> set unevaluatedProperties to false in the NAND chip section.
>
> Cc: Manivannan Sadhasivam <mani@kernel.org>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 07/17] dt-bindings: mtd: ingenic: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (5 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 06/17] dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 08/17] dt-bindings: mtd: sunxi: " Miquel Raynal
` (9 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Paul Cercueil, Rob Herring
List all the possible properties in the NAND chip as per the example and
set unevaluatedProperties to false in the NAND chip section.
Cc: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/ingenic,nand.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml b/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml
index a7bdb5d3675c..b9312ebefeb9 100644
--- a/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/ingenic,nand.yaml
@@ -39,7 +39,9 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
+
rb-gpios:
description: GPIO specifier for the busy pin.
maxItems: 1
@@ -48,6 +50,8 @@ patternProperties:
description: GPIO specifier for the write-protect pin.
maxItems: 1
+ unevaluatedProperties: false
+
required:
- compatible
- reg
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 07/17] dt-bindings: mtd: ingenic: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 07/17] dt-bindings: mtd: ingenic: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Paul Cercueil, Rob Herring
On Mon, 2023-06-19 at 09:29:06 UTC, Miquel Raynal wrote:
> List all the possible properties in the NAND chip as per the example and
> set unevaluatedProperties to false in the NAND chip section.
>
> Cc: Paul Cercueil <paul@crapouillou.net>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 08/17] dt-bindings: mtd: sunxi: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (6 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 07/17] dt-bindings: mtd: ingenic: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 09/17] dt-bindings: mtd: meson: " Miquel Raynal
` (8 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Maxime Ripard, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Rob Herring
nand-ecc-mode is a generic property which may apply to any raw NAND
chip, it does not need to be listed in each controller
description. Instead, let's reference the raw NAND chip description file
which contains the property. The description contained
"additionalProperties: false" which is wrong as other properties such as
partitions might very well be added in the final .dts, and anyway needs
to be converted into "unexpectedProperties: false" to fit the property
change new requirements.
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Samuel Holland <samuel@sholland.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
.../devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml b/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml
index 9a88870cd865..054b6b8bf9b9 100644
--- a/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml
@@ -49,13 +49,12 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
reg:
minimum: 0
maximum: 7
- nand-ecc-mode: true
-
nand-ecc-algo:
const: bch
@@ -75,7 +74,7 @@ patternProperties:
minimum: 0
maximum: 1
- additionalProperties: false
+ unevaluatedProperties: false
required:
- compatible
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 08/17] dt-bindings: mtd: sunxi: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 08/17] dt-bindings: mtd: sunxi: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Rob Herring
On Mon, 2023-06-19 at 09:29:07 UTC, Miquel Raynal wrote:
> nand-ecc-mode is a generic property which may apply to any raw NAND
> chip, it does not need to be listed in each controller
> description. Instead, let's reference the raw NAND chip description file
> which contains the property. The description contained
> "additionalProperties: false" which is wrong as other properties such as
> partitions might very well be added in the final .dts, and anyway needs
> to be converted into "unexpectedProperties: false" to fit the property
> change new requirements.
>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Samuel Holland <samuel@sholland.org>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 09/17] dt-bindings: mtd: meson: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (7 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 08/17] dt-bindings: mtd: sunxi: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 10/17] dt-bindings: mtd: brcmnand: " Miquel Raynal
` (7 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Liang Yang, Rob Herring
Ensure all raw NAND chip properties are valid by referencing the
relevant schema and set unevaluatedProperties to false in the NAND chip
section to avoid spurious additions of random properties.
Cc: Liang Yang <liang.yang@amlogic.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
index 28fb9a7dd70f..00810b04dcde 100644
--- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
@@ -40,6 +40,7 @@ properties:
patternProperties:
"^nand@[0-7]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
reg:
minimum: 0
@@ -58,6 +59,8 @@ patternProperties:
meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
meson-axg-nfc 8
+ unevaluatedProperties: false
+
required:
- compatible
- reg
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* [PATCH v3 10/17] dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (8 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 09/17] dt-bindings: mtd: meson: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 11/17] dt-bindings: mtd: denali: " Miquel Raynal
` (6 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Brian Norris, Kamal Dasu,
Rob Herring
Ensure all raw NAND chip properties are valid by referencing the
relevant schema and set unevaluatedProperties to false in the NAND chip
section to avoid spurious additions of random properties.
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
index 1571024aa119..f57e96374e67 100644
--- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
+++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
@@ -114,6 +114,7 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
compatible:
const: brcm,nandcs
@@ -136,6 +137,8 @@ patternProperties:
layout.
$ref: /schemas/types.yaml#/definitions/uint32
+ unevaluatedProperties: false
+
allOf:
- $ref: nand-controller.yaml#
- if:
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 10/17] dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 10/17] dt-bindings: mtd: brcmnand: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Brian Norris, Kamal Dasu, Rob Herring
On Mon, 2023-06-19 at 09:29:09 UTC, Miquel Raynal wrote:
> Ensure all raw NAND chip properties are valid by referencing the
> relevant schema and set unevaluatedProperties to false in the NAND chip
> section to avoid spurious additions of random properties.
>
> Cc: Brian Norris <computersforpeace@gmail.com>
> Cc: Kamal Dasu <kdasu.kdev@gmail.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 11/17] dt-bindings: mtd: denali: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (9 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 10/17] dt-bindings: mtd: brcmnand: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 12/17] dt-bindings: mtd: intel: " Miquel Raynal
` (5 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Masahiro Yamada, Rob Herring
Ensure all raw NAND chip properties are valid by referencing the
relevant schema and set unevaluatedProperties to false in the NAND chip
section to avoid spurious additions of random properties.
Doing this in one location also saves us from dupplicating the
description of the NAND chip object.
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/denali,nand.yaml | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/denali,nand.yaml b/Documentation/devicetree/bindings/mtd/denali,nand.yaml
index 0be83ad42970..81f95538d415 100644
--- a/Documentation/devicetree/bindings/mtd/denali,nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/denali,nand.yaml
@@ -63,6 +63,12 @@ properties:
minItems: 1
maxItems: 2
+patternProperties:
+ "^nand@[a-f0-9]$":
+ type: object
+ $ref: raw-nand-chip.yaml
+ unevaluatedProperties: false
+
allOf:
- $ref: nand-controller.yaml
@@ -74,7 +80,6 @@ allOf:
then:
patternProperties:
"^nand@[a-f0-9]$":
- type: object
properties:
nand-ecc-strength:
enum:
@@ -92,7 +97,6 @@ allOf:
then:
patternProperties:
"^nand@[a-f0-9]$":
- type: object
properties:
nand-ecc-strength:
enum:
@@ -111,7 +115,6 @@ allOf:
then:
patternProperties:
"^nand@[a-f0-9]$":
- type: object
properties:
nand-ecc-strength:
enum:
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 11/17] dt-bindings: mtd: denali: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 11/17] dt-bindings: mtd: denali: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Masahiro Yamada, Rob Herring
On Mon, 2023-06-19 at 09:29:10 UTC, Miquel Raynal wrote:
> Ensure all raw NAND chip properties are valid by referencing the
> relevant schema and set unevaluatedProperties to false in the NAND chip
> section to avoid spurious additions of random properties.
>
> Doing this in one location also saves us from dupplicating the
> description of the NAND chip object.
>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 12/17] dt-bindings: mtd: intel: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (10 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 11/17] dt-bindings: mtd: denali: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 13/17] dt-bindings: mtd: rockchip: " Miquel Raynal
` (4 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Vadivel Murugan, Rob Herring
nand-ecc-mode is a generic property which may apply to any raw NAND
chip, it does not need to be listed in each controller
description. Instead, let's reference the raw NAND chip description file
which contains the property. The description contained
"additionalProperties: false" which is wrong as other properties such as
partitions might very well be added in the final .dts, and anyway needs
to be converted into "unexpectedProperties: false" to fit the property
change new requirements.
Cc: Vadivel Murugan <vadivel.muruganx.ramuthevar@linux.intel.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/intel,lgm-ebunand.yaml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/intel,lgm-ebunand.yaml b/Documentation/devicetree/bindings/mtd/intel,lgm-ebunand.yaml
index cc3def758e00..07bc7e3efd3a 100644
--- a/Documentation/devicetree/bindings/mtd/intel,lgm-ebunand.yaml
+++ b/Documentation/devicetree/bindings/mtd/intel,lgm-ebunand.yaml
@@ -42,17 +42,16 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
reg:
minimum: 0
maximum: 1
- nand-ecc-mode: true
-
nand-ecc-algo:
const: hw
- additionalProperties: false
+ unevaluatedProperties: false
required:
- compatible
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 12/17] dt-bindings: mtd: intel: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 12/17] dt-bindings: mtd: intel: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Vadivel Murugan, Rob Herring
On Mon, 2023-06-19 at 09:29:11 UTC, Miquel Raynal wrote:
> nand-ecc-mode is a generic property which may apply to any raw NAND
> chip, it does not need to be listed in each controller
> description. Instead, let's reference the raw NAND chip description file
> which contains the property. The description contained
> "additionalProperties: false" which is wrong as other properties such as
> partitions might very well be added in the final .dts, and anyway needs
> to be converted into "unexpectedProperties: false" to fit the property
> change new requirements.
>
> Cc: Vadivel Murugan <vadivel.muruganx.ramuthevar@linux.intel.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 13/17] dt-bindings: mtd: rockchip: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (11 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 12/17] dt-bindings: mtd: intel: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 14/17] dt-bindings: mtd: stm32: " Miquel Raynal
` (3 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Heiko Stuebner, Rob Herring
List all the possible properties in the NAND chip as per the example and
set unevaluatedProperties to false in the NAND chip section.
Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
.../devicetree/bindings/mtd/rockchip,nand-controller.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/rockchip,nand-controller.yaml b/Documentation/devicetree/bindings/mtd/rockchip,nand-controller.yaml
index 7eb1d0a38565..ee53715ffdca 100644
--- a/Documentation/devicetree/bindings/mtd/rockchip,nand-controller.yaml
+++ b/Documentation/devicetree/bindings/mtd/rockchip,nand-controller.yaml
@@ -57,6 +57,7 @@ properties:
patternProperties:
"^nand@[0-7]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
reg:
minimum: 0
@@ -116,6 +117,8 @@ patternProperties:
Only used in combination with 'nand-is-boot-medium'.
+ unevaluatedProperties: false
+
required:
- compatible
- reg
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 13/17] dt-bindings: mtd: rockchip: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 13/17] dt-bindings: mtd: rockchip: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Heiko Stuebner, Rob Herring
On Mon, 2023-06-19 at 09:29:12 UTC, Miquel Raynal wrote:
> List all the possible properties in the NAND chip as per the example and
> set unevaluatedProperties to false in the NAND chip section.
>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 14/17] dt-bindings: mtd: stm32: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (12 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 13/17] dt-bindings: mtd: rockchip: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 15/17] dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml Miquel Raynal
` (2 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Maxime Coquelin,
Alexandre Torgue, Christophe Kerello, Rob Herring
List all the possible properties in the NAND chip as per the example and
set unevaluatedProperties to false in the NAND chip section.
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Christophe Kerello <christophe.kerello@foss.st.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/st,stm32-fmc2-nand.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/st,stm32-fmc2-nand.yaml b/Documentation/devicetree/bindings/mtd/st,stm32-fmc2-nand.yaml
index 986e85ccebc7..e72cb5bacaf0 100644
--- a/Documentation/devicetree/bindings/mtd/st,stm32-fmc2-nand.yaml
+++ b/Documentation/devicetree/bindings/mtd/st,stm32-fmc2-nand.yaml
@@ -37,6 +37,7 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
type: object
+ $ref: raw-nand-chip.yaml
properties:
nand-ecc-step-size:
const: 512
@@ -44,6 +45,8 @@ patternProperties:
nand-ecc-strength:
enum: [1, 4, 8]
+ unevaluatedProperties: false
+
allOf:
- $ref: nand-controller.yaml#
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 14/17] dt-bindings: mtd: stm32: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 14/17] dt-bindings: mtd: stm32: " Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Maxime Coquelin, Alexandre Torgue,
Christophe Kerello, Rob Herring
On Mon, 2023-06-19 at 09:29:13 UTC, Miquel Raynal wrote:
> List all the possible properties in the NAND chip as per the example and
> set unevaluatedProperties to false in the NAND chip section.
>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Christophe Kerello <christophe.kerello@foss.st.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 15/17] dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (13 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 14/17] dt-bindings: mtd: stm32: " Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:15 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 16/17] dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 17/17] dt-bindings: mtd: ti,am654: Prevent " Miquel Raynal
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Matthias Brugger,
AngeloGioacchino Del Regno, Xiangsheng Hou, Rob Herring
The mediatek NAND controller should reference the new raw-nand-chip.yaml
binding instead of the original nand-chip.yaml which does not contain
*all* the properties that may be used to fully describe the NAND
devices, certain properties being actually described under
nand-controller.yaml.
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml b/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
index a6e7f123eda7..ab10b90077b6 100644
--- a/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
+++ b/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
@@ -40,7 +40,7 @@ properties:
patternProperties:
"^nand@[a-f0-9]$":
- $ref: nand-chip.yaml#
+ $ref: raw-nand-chip.yaml#
unevaluatedProperties: false
properties:
reg:
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 15/17] dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml
2023-06-19 9:29 ` [PATCH v3 15/17] dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml Miquel Raynal
@ 2023-06-22 21:15 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:15 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Matthias Brugger, AngeloGioacchino Del Regno,
Xiangsheng Hou, Rob Herring
On Mon, 2023-06-19 at 09:29:14 UTC, Miquel Raynal wrote:
> The mediatek NAND controller should reference the new raw-nand-chip.yaml
> binding instead of the original nand-chip.yaml which does not contain
> *all* the properties that may be used to fully describe the NAND
> devices, certain properties being actually described under
> nand-controller.yaml.
>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Cc: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 16/17] dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (14 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 15/17] dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:14 ` Miquel Raynal
2023-06-19 9:29 ` [PATCH v3 17/17] dt-bindings: mtd: ti,am654: Prevent " Miquel Raynal
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Matthias Brugger,
AngeloGioacchino Del Regno, Xiangsheng Hou, Rob Herring
nand-on-flash-bbt is a generic property which may apply to any raw NAND
chip, it does not need to be listed in each controller
description. The raw NAND chip description file which contains the
property is already referenced, so no need to mention the property here
again.
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml b/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
index ab10b90077b6..ab503a33a269 100644
--- a/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
+++ b/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
@@ -45,7 +45,6 @@ patternProperties:
properties:
reg:
maximum: 1
- nand-on-flash-bbt: true
nand-ecc-mode:
const: hw
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 16/17] dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties
2023-06-19 9:29 ` [PATCH v3 16/17] dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties Miquel Raynal
@ 2023-06-22 21:14 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:14 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Matthias Brugger, AngeloGioacchino Del Regno,
Xiangsheng Hou, Rob Herring
On Mon, 2023-06-19 at 09:29:15 UTC, Miquel Raynal wrote:
> nand-on-flash-bbt is a generic property which may apply to any raw NAND
> chip, it does not need to be listed in each controller
> description. The raw NAND chip description file which contains the
> property is already referenced, so no need to mention the property here
> again.
>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Cc: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH v3 17/17] dt-bindings: mtd: ti,am654: Prevent unevaluated properties
2023-06-19 9:28 [PATCH v3 00/17] Prevent NAND chip unevaluated properties Miquel Raynal
` (15 preceding siblings ...)
2023-06-19 9:29 ` [PATCH v3 16/17] dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties Miquel Raynal
@ 2023-06-19 9:29 ` Miquel Raynal
2023-06-22 21:14 ` Miquel Raynal
16 siblings, 1 reply; 37+ messages in thread
From: Miquel Raynal @ 2023-06-19 9:29 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Miquel Raynal, Rob Herring
Reference mtd-physmap.yaml which contains all the relevant properties
for this device. Add "unevaluatedProperties: false" to avoid any
spurious addition of random properties.
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml b/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml
index 4774c92e7fc4..df4fdc02456d 100644
--- a/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml
+++ b/Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml
@@ -30,6 +30,8 @@ properties:
patternProperties:
"^flash@[0-1],[0-9a-f]+$":
type: object
+ $ref: mtd-physmap.yaml
+ unevaluatedProperties: false
required:
- compatible
--
2.34.1
^ permalink raw reply related [flat|nested] 37+ messages in thread* Re: [PATCH v3 17/17] dt-bindings: mtd: ti,am654: Prevent unevaluated properties
2023-06-19 9:29 ` [PATCH v3 17/17] dt-bindings: mtd: ti,am654: Prevent " Miquel Raynal
@ 2023-06-22 21:14 ` Miquel Raynal
0 siblings, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2023-06-22 21:14 UTC (permalink / raw)
To: Miquel Raynal, Rob Herring, Krzysztof Kozlowski, devicetree
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Chris Packham,
Thomas Petazzoni, Rob Herring
On Mon, 2023-06-19 at 09:29:16 UTC, Miquel Raynal wrote:
> Reference mtd-physmap.yaml which contains all the relevant properties
> for this device. Add "unevaluatedProperties: false" to avoid any
> spurious addition of random properties.
>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
^ permalink raw reply [flat|nested] 37+ messages in thread