Skip to contentSkip to conversation

mtd: rawnand: omap_elm: convert DT binding to yaml

PATCH Superseded Roger Quadros 3 participants 8 messages Mar 25, 2022

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover mtd: rawnand: omap_elm: convert DT binding to yaml

Hi,

This series converts omap_elm DT bindings to yaml and adds support for ELM on AM64 SoC.

Changelog:
v2
- explain hwmod usage deprecated in commit log
- fix example node name to 'ecc'
- remove 'items' for single compatible specifier

cheers,
-roger

Roger Quadros (3):
dt-bindings: mtd: ti,elm: Convert to yaml
dt-bindings: mtd: ti,elm: Add support for AM64 ELM
mtd: rawnand: omap_elm: Add compatible for AM64 ELM

 Documentation/devicetree/bindings/mtd/elm.txt | 16 ----
 .../devicetree/bindings/mtd/ti,elm.yaml       | 73 +++++++++++++++++++
 drivers/mtd/nand/raw/omap_elm.c               |  1 +
 3 files changed, 74 insertions(+), 16 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mtd/elm.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/ti,elm.yaml
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 dt-bindings: mtd: ti,elm: Convert to yaml

Convert elm.txt to ti,elm.yaml.

hwmod framework use is deprecated for new platforms so mark it so.

---
 Documentation/devicetree/bindings/mtd/elm.txt | 16 -------
 .../devicetree/bindings/mtd/ti,elm.yaml       | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 16 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mtd/elm.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/ti,elm.yaml
Documentation/devicetree/bindings/mtd/elm.txt deleted +0 -16
deleted file mode 100644
index 59ddc61c1076..000000000000
@@ -1,16 +0,0 @@
-Error location module
-
-Required properties:
-- compatible: Must be "ti,am3352-elm"
-- reg: physical base address and size of the registers map.
-- interrupts: Interrupt number for the elm.
-
-Optional properties:
-- ti,hwmods: Name of the hwmod associated to the elm
-
-Example:
-elm: elm@0 {
-	compatible = "ti,am3352-elm";
-	reg = <0x48080000 0x2000>;
-	interrupts = <4>;
-};
Documentation/devicetree/bindings/mtd/ti,elm.yaml new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: mtd: ti,elm: Convert to yaml

Quoted 5 lines · Roger Quadros

Convert elm.txt to ti,elm.yaml.

hwmod framework use is deprecated for new platforms so mark it so.

Quoted 8 lines
---
 Documentation/devicetree/bindings/mtd/elm.txt | 16 -------
 .../devicetree/bindings/mtd/ti,elm.yaml       | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 16 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mtd/elm.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/ti,elm.yaml

Running 'make dtbs_check' with the schema in this patch gives the following warnings. Consider if they are expected or the schema is incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check. This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/1609419

elm@0: 'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+'

	arch/arm/boot/dts/am437x-cm-t43.dt.yaml
	arch/arm/boot/dts/am437x-gp-evm.dt.yaml
	arch/arm/boot/dts/am437x-idk-evm.dt.yaml
	arch/arm/boot/dts/am437x-sbc-t43.dt.yaml
	arch/arm/boot/dts/am437x-sk-evm.dt.yaml
	arch/arm/boot/dts/am43x-epos-evm.dt.yaml
Reviewed-by on v2 1/3
#3 lore raw

Re: [PATCH v2 1/3] dt-bindings: mtd: ti,elm: Convert to yaml

In reply to Roger Quadros
Quoted 57 lines · Roger Quadros

Convert elm.txt to ti,elm.yaml.

hwmod framework use is deprecated for new platforms so mark it so.

---
 Documentation/devicetree/bindings/mtd/elm.txt | 16 -------
 .../devicetree/bindings/mtd/ti,elm.yaml       | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 16 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mtd/elm.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/ti,elm.yaml
Documentation/devicetree/bindings/mtd/elm.txt deleted +0 -16
deleted file mode 100644
index 59ddc61c1076..000000000000
@@ -1,16 +0,0 @@
-Error location module
-
-Required properties:
-- compatible: Must be "ti,am3352-elm"
-- reg: physical base address and size of the registers map.
-- interrupts: Interrupt number for the elm.
-
-Optional properties:
-- ti,hwmods: Name of the hwmod associated to the elm
-
-Example:
-elm: elm@0 {
-	compatible = "ti,am3352-elm";
-	reg = <0x48080000 0x2000>;
-	interrupts = <4>;
-};
Documentation/devicetree/bindings/mtd/ti,elm.yaml new file +16 -0
new file mode 100644
index 000000000000..e36452b742c0
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/ti,elm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments Error Location Module (ELM).
+
+maintainers:
+  - Roger Quadros <[email protected]>
+
+description:
+  ELM module is used together with GPMC and NAND Flash to detect
+  errors and the location of the error based on BCH algorithms
+  so they can be corrected if possible.
+

Documentation/devicetree/bindings/mtd/ti,elm.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/mtd/ti,elm.yaml new file +10 -0
+properties:
+  compatible:
+    const: ti,am3352-elm
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+

make dtbs complains, but it will be fixed in patch #2, so looks good:

Best regards,
Krzysztof

maintainer Acked-by on v2 1/3
#4 lore raw

Re: [PATCH v2 1/3] dt-bindings: mtd: ti,elm: Convert to yaml

In reply to Roger Quadros
Quoted 5 lines · Roger Quadros

Convert elm.txt to ti,elm.yaml.

hwmod framework use is deprecated for new platforms so mark it so.

Quoted 8 lines
---
 Documentation/devicetree/bindings/mtd/elm.txt | 16 -------
 .../devicetree/bindings/mtd/ti,elm.yaml       | 47 +++++++++++++++++++
 2 files changed, 47 insertions(+), 16 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/mtd/elm.txt
 create mode 100644 Documentation/devicetree/bindings/mtd/ti,elm.yaml

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#5 lore raw

PATCH v2 2/3 dt-bindings: mtd: ti,elm: Add support for AM64 ELM

In reply to Roger Quadros

TI's AM64 SoC has the Error Locator Module. Add compatible and related properties to support ELM on AM64 SoC.

---
 .../devicetree/bindings/mtd/ti,elm.yaml       | 28 ++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mtd/ti,elm.yaml +27 -1
index e36452b742c0..967c87f32c71 100644
@@ -16,7 +16,10 @@ description:
 
 properties:
   compatible:
-    const: ti,am3352-elm
+    items:
+      - enum:
+          - ti,am3352-elm
+          - ti,am64-elm
 
   reg:
     maxItems: 1
@@ -24,6 +27,17 @@ properties:
   interrupts:
     maxItems: 1
 
+  clocks:
+    maxItems: 1
+    description: Functional clock.
+
+  clock-names:
+    items:
+      - const: fck
+
+  power-domains:
+    maxItems: 1
+
   ti,hwmods:
     description:
       Name of the HWMOD associated with ELM. This is for legacy
@@ -36,6 +50,18 @@ required:
   - reg
   - interrupts
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: ti,am64-elm
+    then:
+      required:
+        - clocks
+        - clock-names
+        - power-domains
+
 additionalProperties: false
 
 examples:
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH v2 2/3] dt-bindings: mtd: ti,elm: Add support for AM64 ELM

Quoted 13 lines · Roger Quadros

TI's AM64 SoC has the Error Locator Module. Add compatible and related properties to support ELM on AM64 SoC.

---
 .../devicetree/bindings/mtd/ti,elm.yaml       | 28 ++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mtd/ti,elm.yaml +0 -0
index e36452b742c0..967c87f32c71 100644

Documentation/devicetree/bindings/mtd/ti,elm.yaml description: · line 19

Quoted 5 lines
Documentation/devicetree/bindings/mtd/ti,elm.yaml +1 -1
@@ -16,7 +16,10 @@ description:
 
 properties:
   compatible:
-    const: ti,am3352-elm
+    items:

Why do the items appeared again?

Make it an enum in first patch, without items, with one entry. Now in patch #2 you add one more compatible.

Best regards,
Krzysztof

#7 lore raw

PATCH v2 3/3 mtd: rawnand: omap_elm: Add compatible for AM64 ELM

In reply to Roger Quadros

The AM64 SoC has the Error Locator Module. Add compatible id for it.

---
 drivers/mtd/nand/raw/omap_elm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/omap_elm.c +1 -0
index db105d9b560c..aa7f49c3f372 100644
@@ -550,6 +550,7 @@ static SIMPLE_DEV_PM_OPS(elm_pm_ops, elm_suspend, elm_resume);
 #ifdef CONFIG_OF
 static const struct of_device_id elm_of_match[] = {
 	{ .compatible = "ti,am3352-elm" },
+	{ .compatible = "ti,am64-elm" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, elm_of_match);
Signature · 1 line
2.17.1