Skip to contentSkip to conversation

Freescale Enhanced Local Bus Controller (eLBC) binding YAML conversion

PATCH Superseded J. Neuschäfer 2 participants 6 messages Apr 12, 2025

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v5 cover Freescale Enhanced Local Bus Controller (eLBC) binding YAML conversion

This series converts the fsl,elbc binding to YAML and adds new bindings for related devices (particular kinds of chip on the eLBC).

For readability, the existing unit address syntax of <cs>,<offset> (e.g. nand@1,0) is kept. This results in a few dtc validation warnings, when combined with other choices in this patchset:

- For compatibility with existing kernels which don't explicitly probe under an eLBC controller, the "simple-bus" compatible string is kept on eLBC controller nodes. The validation logic requires a linear unit address, though (e.g. @100000000 instead of @1,0)

The patches in this series were previously part of the following series, which turned out to be too large and unwieldy:
[PATCH v2 00/12] YAML conversion of several Freescale/PowerPC DT bindings
https://lore.kernel.org/lkml/[email protected]/

Changelogs are present in the individual patches.

---
Changes in v5:
- Rebase on v6.15-rc1
- Add Rob Herring's reviewed-by tags to patches 1,3
- Fix documentation reference in Documentation/devicetree/bindings/display/ssd1289fb.txt
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Reintroduce patch "dt-bindings: mtd: raw-nand-chip: Relax node name pattern"
- Link to v3: https://lore.kernel.org/r/[email protected]

---
J. Neuschäfer (4):
dt-bindings: mtd: raw-nand-chip: Relax node name pattern
dt-bindings: memory-controllers: Add fsl,elbc-gpcm-uio
dt-bindings: nand: Add fsl,elbc-fcm-nand
dt-bindings: memory-controllers: Convert fsl,elbc to YAML

 .../devicetree/bindings/display/ssd1289fb.txt      |   2 +-
 .../memory-controllers/fsl,elbc-gpcm-uio.yaml      |  59 ++++++++
 .../bindings/memory-controllers/fsl,elbc.yaml      | 158 +++++++++++++++++++++
 .../devicetree/bindings/mtd/fsl,elbc-fcm-nand.yaml |  68 +++++++++
 .../devicetree/bindings/mtd/raw-nand-chip.yaml     |   2 +-
 .../devicetree/bindings/powerpc/fsl/lbc.txt        |  43 ------
 6 files changed, 287 insertions(+), 45 deletions(-)

---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250220-ppcyaml-elbc-bb85941fb250

Best regards,

Signature · 1 line
J. Neuschäfer <[email protected]>
#1 lore raw

PATCH v5 1/4 dt-bindings: mtd: raw-nand-chip: Relax node name pattern

In some scenarios, such as under the Freescale eLBC bus, there are raw NAND chips with a unit address that has a comma in it (cs,offset). For reasons of compatibility with historical device trees and readability of the unit addresses, this format is kept.

Relax the $nodename pattern in raw-nand-chip.yaml to allow such unit addresses. Unfortunately $nonenames defined in bindings that reference raw-nand

---

V5:
- Add Rob's review tag

V4:
- reintroduce patch to silence dtc validation error, after discussion with Rob Herring and Miquèl Raynal
- add some more detail to the commit message
- remove unit address format rather than extending it
(old pattern: "^nand@[a-f0-9](,[0-9a-f]*)?$")

V3:
- remove patch after discussion with Miquèl Raynal

V2:
- new patch

---
 Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml +1 -1
index 092448d7bfc5ccd246ca4b2341464e18722a2d51..d655f6673fc31b1d9ee7cd734cbe1d310f88090b 100644
@@ -25,7 +25,7 @@ description: |
 
 properties:
   $nodename:
-    pattern: "^nand@[a-f0-9]$"
+    pattern: "^nand@"
 
   reg:
     description:
Signature · 1 line
2.48.0.rc1.219.gb6b6757d772
#2 lore raw

PATCH v5 2/4 dt-bindings: memory-controllers: Add fsl,elbc-gpcm-uio

In reply to J. Neuschäfer

Formalize the binding already supported by the uio_fsl_elbc_gpcm.c driver.

---

V4,V5:
- no changes

V3:
- add review tags

V2:
- split out from fsl,elbc patch
- add description
- remove "device_type" property
- move to bindings/memory-controllers

---
 .../memory-controllers/fsl,elbc-gpcm-uio.yaml      | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
Documentation/devicetree/bindings/memory-controllers/fsl,elbc-gpcm-uio.yaml new file +59 -0
new file mode 100644
index 0000000000000000000000000000000000000000..381584b400a0ad98c6d9e0b38f2877d44603ed84
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/memory-controllers/fsl,elbc-gpcm-uio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Userspace I/O interface for Freescale eLBC devices
+
+description:
+  The Freescale Enhanced Local Bus controller (eLBC) supports flexible access
+  to memory devices, through the General-Purpose Chip-select Machine (GPCM).
+  The purpose of this binding is to designate devices attached to eLBC/GPMC for
+  use by userspace.
+
+maintainers:
+  - J. Neuschäfer <[email protected]>
+
+properties:
+  compatible:
+    const: fsl,elbc-gpcm-uio
+
+  reg:
+    maxItems: 1
+
+  elbc-gpcm-br:
+    description: Base Register (BR) value to set
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  elbc-gpcm-or:
+    description: Option Register (OR) value to set
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  interrupts:
+    maxItems: 1
+
+  uio_name:
+    $ref: /schemas/types.yaml#/definitions/string
+
+required:
+  - compatible
+  - reg
+  - elbc-gpcm-br
+  - elbc-gpcm-or
+
+additionalProperties: false
+
+examples:
+  - |
+    localbus {
+        #address-cells = <2>;
+        #size-cells = <1>;
+
+        simple-periph@2,0 {
+            compatible = "fsl,elbc-gpcm-uio";
+            reg = <0x2 0x0 0x10000>;
+            elbc-gpcm-br = <0xfd810800>;
+            elbc-gpcm-or = <0xffff09f7>;
+        };
+    };
Signature · 1 line
2.48.0.rc1.219.gb6b6757d772
#3 lore raw

PATCH v5 3/4 dt-bindings: nand: Add fsl,elbc-fcm-nand

In reply to J. Neuschäfer

Formalize the binding already supported by the fsl_elbc_nand.c driver and used in several device trees in arch/powerpc/boot/dts/.

raw-nand-chip.yaml is referenced in order to accommodate situations in which the ECC parameters settings are set in the device tree. One such example is in arch/powerpc/boot/dts/turris1x.dts:

	/* MT29F2G08ABAEAWP:E NAND */
	nand@1,0 {
		compatible = "fsl,p2020-fcm-nand", "fsl,elbc-fcm-nand";
		reg = <0x1 0x0 0x00040000>;
		nand-ecc-mode = "soft";
		nand-ecc-algo = "bch";

		partitions { ... };
	};

---

V5:
- add Rob's review tag

V4:
- no changes

V3:
- remove unnecessary #address/size-cells from nand node in example
- add Frank Li's review tag
- add missing end of document marker (...)
- explain choice to reference raw-nand-chip.yaml

V2:
- split out from fsl,elbc binding patch
- constrain #address-cells and #size-cells
- add a general description
- use unevaluatedProperties=false instead of additionalProperties=false
- fix property order to comply with dts coding style
- include raw-nand-chip.yaml instead of nand-chip.yaml

---
 .../devicetree/bindings/mtd/fsl,elbc-fcm-nand.yaml | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)
Documentation/devicetree/bindings/mtd/fsl,elbc-fcm-nand.yaml new file +68 -0
new file mode 100644
index 0000000000000000000000000000000000000000..91e8f2f9ff26da0f5a3f9bf276955ed32e9e7bc6
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/fsl,elbc-fcm-nand.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NAND flash attached to Freescale eLBC
+
+description:
+  The Freescale Enhanced Local Bus controller (eLBC) contains logic to
+  interface with NAND flash, called the NAND Flash Control Machine (FCM).
+  This binding describes flash attached to an eLBC using the FCM.
+
+maintainers:
+  - J. Neuschäfer <[email protected]>
+
+allOf:
+  - $ref: raw-nand-chip.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - fsl,mpc8313-fcm-nand
+              - fsl,mpc8315-fcm-nand
+              - fsl,mpc8377-fcm-nand
+              - fsl,mpc8378-fcm-nand
+              - fsl,mpc8379-fcm-nand
+              - fsl,mpc8536-fcm-nand
+              - fsl,mpc8569-fcm-nand
+              - fsl,mpc8572-fcm-nand
+              - fsl,p1020-fcm-nand
+              - fsl,p1021-fcm-nand
+              - fsl,p1025-fcm-nand
+              - fsl,p2020-fcm-nand
+          - const: fsl,elbc-fcm-nand
+      - const: fsl,elbc-fcm-nand
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    localbus {
+        #address-cells = <2>;
+        #size-cells = <1>;
+
+        nand@1,0 {
+            compatible = "fsl,mpc8315-fcm-nand",
+                         "fsl,elbc-fcm-nand";
+            reg = <0x1 0x0 0x2000>;
+        };
+    };
+
+...
Signature · 1 line
2.48.0.rc1.219.gb6b6757d772
#4 lore raw

PATCH v5 4/4 dt-bindings: memory-controllers: Convert fsl,elbc to YAML

In reply to J. Neuschäfer

Convert the Freescale localbus controller bindings from text form to YAML. Compared to the .txt version, the YAML binding contains a new usage example with FCM NAND flash, and a full list of compatible strings based on current usage in arch/powerpc/boot/dts/.

Note that the both the compatible strings and the unit address format are kept as-is, for compatibility with existing kernels and device trees, as well as unit address readability. This results in dts validation warnings:

Warning (simple_bus_reg): /example-0/localbus@f0010100/board-control@1,0:
simple-bus unit address format error, expected "100000000"

---

V5:
- fix reference to fsl/lbc.txt in Documentation/devicetree/bindings/display/ssd1289fb.txt

V4:
- no changes

V3:
- move this patch after the GPCM/FCM patches to dtschema/dtc warnings due to missing bindings for fsl,elbc-gpcm-uio and fsl,elbc-fcm-nand
- add "simple-bus" again, for compatibility with existing DTs/drivers based on discussion with Crystal Wood and Rob Herring
- fix fsl,pq2-localbus compatible properties based on mgcoge.dts / ep8248e.dts (was missing "simple-bus")
- add board-control (bcsr) example again, now using the compatible string listed in Documentation/devicetree/bindings/board/fsl,bcsr.yaml
- remove interrupt-parent property from example
- rework the commit message

V2:
- fix order of properties in examples, according to dts coding style
- move to Documentation/devicetree/bindings/memory-controllers
- clarify the commit message a tiny bit
- remove unnecessary multiline markers (|)
- define address format in patternProperties
- trim subject line (remove "binding")
- remove use of "simple-bus", because it's technically incorrect

---
 .../devicetree/bindings/display/ssd1289fb.txt      |   2 +-
 .../bindings/memory-controllers/fsl,elbc.yaml      | 158 +++++++++++++++++++++
 .../devicetree/bindings/powerpc/fsl/lbc.txt        |  43 ------
 3 files changed, 159 insertions(+), 44 deletions(-)
Documentation/devicetree/bindings/display/ssd1289fb.txt +1 -1
index 4fcd5e68cb6e005927f87c0c36d843de640de525..8cb59359352c6834aff73771ba2e12d0e4563ded 100644
@@ -4,7 +4,7 @@ Required properties:
   - compatible: Should be "solomon,ssd1289fb". The only supported bus for
     now is lbc.
   - reg: Should contain address of the controller on the LBC bus. The detail
-    was described in Documentation/devicetree/bindings/powerpc/fsl/lbc.txt
+    was described in Documentation/devicetree/bindings/memory-controllers/fsl,elbc.yaml
 
 Examples:
 display@2,0 {
Documentation/devicetree/bindings/memory-controllers/fsl,elbc.yaml new file +158 -0

158 lines not on this page · raw message

Documentation/devicetree/bindings/powerpc/fsl/lbc.txt deleted +0 -43

43 lines not on this page · raw message

Signature · 1 line
2.48.0.rc1.219.gb6b6757d772
#5 lore raw

Re: [PATCH v5 4/4] dt-bindings: memory-controllers: Convert fsl,elbc to YAML

Quoted 43 lines · J. Neuschäfer

Convert the Freescale localbus controller bindings from text form to YAML. Compared to the .txt version, the YAML binding contains a new usage example with FCM NAND flash, and a full list of compatible strings based on current usage in arch/powerpc/boot/dts/.

Note that the both the compatible strings and the unit address format are kept as-is, for compatibility with existing kernels and device trees, as well as unit address readability. This results in dts validation warnings:

Warning (simple_bus_reg): /example-0/localbus@f0010100/board-control@1,0:
simple-bus unit address format error, expected "100000000"

---

V5:
- fix reference to fsl/lbc.txt in Documentation/devicetree/bindings/display/ssd1289fb.txt

V4:
- no changes

V3:
- move this patch after the GPCM/FCM patches to dtschema/dtc warnings due to missing bindings for fsl,elbc-gpcm-uio and fsl,elbc-fcm-nand
- add "simple-bus" again, for compatibility with existing DTs/drivers based on discussion with Crystal Wood and Rob Herring
- fix fsl,pq2-localbus compatible properties based on mgcoge.dts / ep8248e.dts (was missing "simple-bus")
- add board-control (bcsr) example again, now using the compatible string listed in Documentation/devicetree/bindings/board/fsl,bcsr.yaml
- remove interrupt-parent property from example
- rework the commit message

V2:
- fix order of properties in examples, according to dts coding style
- move to Documentation/devicetree/bindings/memory-controllers
- clarify the commit message a tiny bit
- remove unnecessary multiline markers (|)
- define address format in patternProperties
- trim subject line (remove "binding")
- remove use of "simple-bus", because it's technically incorrect

Quoted 6 lines
---
 .../devicetree/bindings/display/ssd1289fb.txt      |   2 +-
 .../bindings/memory-controllers/fsl,elbc.yaml      | 158 +++++++++++++++++++++
 .../devicetree/bindings/powerpc/fsl/lbc.txt        |  43 ------
 3 files changed, 159 insertions(+), 44 deletions(-)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/memory-controllers/fsl,elbc.example.dts:29.23-34.15: Warning (simple_bus_reg): /example-0/localbus@f0010100/flash@0,0: simple-bus unit address format error, expected "0" Documentation/devicetree/bindings/memory-controllers/fsl,elbc.example.dts:36.31-39.15: Warning (simple_bus_reg): /example-0/localbus@f0010100/board-control@1,0: simple-bus unit address format error, expected "100000000" Documentation/devicetree/bindings/memory-controllers/fsl,elbc.example.dts:41.31-46.15: Warning (simple_bus_reg): /example-0/localbus@f0010100/simple-periph@2,0: simple-bus unit address format error, expected "200000000" Documentation/devicetree/bindings/memory-controllers/fsl,elbc.example.dts:82.23-89.15: Warning (simple_bus_reg): /example-1/localbus@e0005000/flash@0,0: simple-bus unit address format error, expected "0" Documentation/devicetree/bindings/memory-controllers/fsl,elbc.example.dts:91.22-97.15: Warning (simple_bus_reg): /example-1/localbus@e0005000/nand@1,0: simple-bus unit address format error, expected "100000000"

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.