2022-04-23 07:12:43

by Jonathan Bakker

[permalink] [raw]
Subject: [PATCH 1/5] dt-bindings: mtd: samsung-onenand: Add new binding

Add a yaml binding document for the Samsung OneNAND controller.
It is found in several older Samsung SoC, notably the S5PV210.

Signed-off-by: Jonathan Bakker <[email protected]>
---
.../bindings/mtd/samsung,onenand.yaml | 89 +++++++++++++++++++
1 file changed, 89 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mtd/samsung,onenand.yaml

diff --git a/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml b/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml
new file mode 100644
index 000000000000..25012248add6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/samsung,onenand.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung OneNAND controller
+
+maintainers:
+ - Jonathan Bakker <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - samsung,s3c6400-onenand
+ - samsung,s3c6410-onenand
+ - samsung,s5pv210-onenand
+
+ reg:
+ maxItems: 3
+
+ interrupts:
+ maxItems: 1
+
+ clock-names:
+ items:
+ - const: bus
+ - const: onenand
+
+ clocks:
+ minItems: 2
+ maxItems: 2
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+allOf:
+ - $ref: nand-controller.yaml
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - samsung,s5pv210-onenand
+ then:
+ required:
+ - interrupts
+ - clock-names
+ - clocks
+
+patternProperties:
+ "^nand@[a-f0-9]+$":
+ type: object
+ properties:
+ reg:
+ minimum: 0
+ maximum: 1
+
+ additionalProperties: false
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/s5pv210.h>
+ onenand: nand-controller@b0600000 {
+ compatible = "samsung,s5pv210-onenand";
+ reg = <0xb0600000 0x2000>,
+ <0xb0000000 0x20000>,
+ <0xb0040000 0x20000>;
+ interrupt-parent = <&vic1>;
+ interrupts = <31>;
+ clocks = <&clocks CLK_NANDXL>, <&clocks DOUT_FLASH>;
+ clock-names = "bus", "onenand";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ nand@0 {
+ reg = <0>;
+ };
+ };
--
2.30.2


2022-04-25 08:36:38

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/5] dt-bindings: mtd: samsung-onenand: Add new binding

On 23/04/2022 05:45, Jonathan Bakker wrote:
> Add a yaml binding document for the Samsung OneNAND controller.
> It is found in several older Samsung SoC, notably the S5PV210.
>
> Signed-off-by: Jonathan Bakker <[email protected]>
> ---
> .../bindings/mtd/samsung,onenand.yaml | 89 +++++++++++++++++++
> 1 file changed, 89 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mtd/samsung,onenand.yaml
>
> diff --git a/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml b/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml
> new file mode 100644
> index 000000000000..25012248add6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mtd/samsung,onenand.yaml
> @@ -0,0 +1,89 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mtd/samsung,onenand.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung OneNAND controller
> +
> +maintainers:
> + - Jonathan Bakker <[email protected]>
> +
> +properties:
> + compatible:
> + enum:
> + - samsung,s3c6400-onenand
> + - samsung,s3c6410-onenand
> + - samsung,s5pv210-onenand
> +
> + reg:
> + maxItems: 3

Please describe the items or add reg-names.

> +
> + interrupts:
> + maxItems: 1
> +
> + clock-names:
> + items:
> + - const: bus
> + - const: onenand
> +
> + clocks:
> + minItems: 2
> + maxItems: 2

Drop minItems.

> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0

Don't need these, they come from nand-controller.

> +
> +allOf:
> + - $ref: nand-controller.yaml
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - samsung,s5pv210-onenand
> + then:
> + required:
> + - interrupts
> + - clock-names
> + - clocks

Others require it as well, don't they?

> +
> +patternProperties:
> + "^nand@[a-f0-9]+$":
> + type: object
> + properties:
> + reg:
> + minimum: 0
> + maximum: 1
> +
> + additionalProperties: false

Also not needed.

> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false

With dropping all duplicated properties from nand-controller, this can
be unevaluatedProperties:false. Unless for some reason parts of
nand-controller schema are not valid here?

> +
> +examples:
> + - |
> + #include <dt-bindings/clock/s5pv210.h>
> + onenand: nand-controller@b0600000 {
> + compatible = "samsung,s5pv210-onenand";
> + reg = <0xb0600000 0x2000>,
> + <0xb0000000 0x20000>,
> + <0xb0040000 0x20000>;

Align the entries with first <> entry.

> + interrupt-parent = <&vic1>;
> + interrupts = <31>;
> + clocks = <&clocks CLK_NANDXL>, <&clocks DOUT_FLASH>;
> + clock-names = "bus", "onenand";
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + nand@0 {
> + reg = <0>;
> + };
> + };


Best regards,
Krzysztof