Skip to contentSkip to conversation

dt-bindings: pinctrl: Add fsl,ls1012a-pinctrl yaml file

PATCH In review David Leonard 3 participants 8 messages Aug 27, 2024 – Aug 28, 2024

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

PATCH 3/6 dt-bindings: pinctrl: Add fsl,ls1012a-pinctrl yaml file

Add a binding schema and examples for the LS1012A's pinctrl function.

---
 .../bindings/pinctrl/fsl,ls1012a-pinctrl.yaml | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +83 -0
new file mode 100644
index 000000000000..599df49b44d4
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/fsl,ls1012a-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP QorIQ LS1012A pin multiplexing
+
+maintainers:
+  - [email protected]
+
+description: >
+  Bindings for LS1012A pinmux control.
+
+properties:
+  compatible:
+    const: fsl,ls1012a-pinctrl
+
+  reg:
+    description: Specifies the base address of the PMUXCR0 register.
+    maxItems: 2
+
+  big-endian:
+    description: If present, the PMUXCR0 register is implemented in big-endian.
+    type: boolean
+
+  dcfg-regmap:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      The phandle of the syscon node for the DCFG registers.
+
+patternProperties:
+  '^pinctrl-':
+    type: object
+    $ref: pinmux-node.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      function:
+        enum: [ i2c, spi, gpio, gpio_reset ]
+
+      groups:
+        items:
+          enum: [ qspi_1_grp, qspi_2_grp, qspi_3_grp ]
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    pinctrl: pinctrl@1570430 {
+        compatible = "fsl,ls1012a-pinctrl";
+        reg = <0x0 0x1570430 0x0 0x4>;
+        big-endian;
+        dcfg-regmap = <&dcfg>;
+        pinctrl_qspi_1: pinctrl-qspi-1 {
+            groups = "qspi_1_grp";
+            function = "spi";
+        };
+        pinctrl_qspi_2: pinctrl-qspi-2 {
+            groups = "qspi_1_grp", "qspi_2_grp";
+            function = "spi";
+        };
+        pinctrl_qspi_4: pinctrl-qspi-4 {
+            groups = "qspi_1_grp", "qspi_2_grp", "qspi_3_grp";
+            function = "spi";
+        };
+    };
+  - |
+    qspi: quadspi@1550000 {
+        compatible = "fsl,ls1021a-qspi";
+        reg = <0 0x1550000 0 0x10000>;
+        /* QSPI pins for buswidth 2 */
+        pinctrl-names = "default";
+        pinctrl-0 = <&pinctrl_qspi_2>;
+        status = "okay";
+    };
Signature · 1 line
2.43.0
#1 lore raw
Quoted 9 lines · David Leonard

Add a binding schema and examples for the LS1012A's pinctrl function.

---
  .../bindings/pinctrl/fsl,ls1012a-pinctrl.yaml | 83 +++++++++++++++++++
  1 file changed, 83 insertions(+)

create mode 100644 Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.example.dtb: quadspi@1550000: $nodename:0: 'quadspi@1550000' does not match '^spi(@.*|-([0-9]|[1-9][0-9]+))?$'
from schema $id: http://devicetree.org/schemas/spi/fsl,spi-fsl-qspi.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.example.dtb: quadspi@1550000: 'reg-names' is a required property
from schema $id: http://devicetree.org/schemas/spi/fsl,spi-fsl-qspi.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.example.dtb: quadspi@1550000: 'clocks' is a required property
from schema $id: http://devicetree.org/schemas/spi/fsl,spi-fsl-qspi.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.example.dtb: quadspi@1550000: 'clock-names' is a required property
from schema $id: http://devicetree.org/schemas/spi/fsl,spi-fsl-qspi.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.example.dtb: quadspi@1550000: 'oneOf' conditional failed, one must be fixed:
'interrupts' is a required property
'interrupts-extended' is a required property
from schema $id: http://devicetree.org/schemas/spi/fsl,spi-fsl-qspi.yaml#

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.

#2 lore raw
In reply to David Leonard
Quoted 5 lines · David Leonard

Add a binding schema and examples for the LS1012A's pinctrl function.

---

It does not look like you tested the bindings, at least after quick look. Please run (see Documentation/devicetree/bindings/writing-schema.rst for instructions). Maybe you need to update your dtschema and yamllint.

Quoted 12 lines
 .../bindings/pinctrl/fsl,ls1012a-pinctrl.yaml | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +2 -0
new file mode 100644
index 000000000000..599df49b44d4
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +10 -0
+---
+$id: http://devicetree.org/schemas/pinctrl/fsl,ls1012a-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP QorIQ LS1012A pin multiplexing
+
+maintainers:
+  - [email protected]
+
+description: >

Drop >

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 13

Quoted 1 line
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +1 -0
+  Bindings for LS1012A pinmux control.

Drop "Bindings for" and explain the hardware.

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 21

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +8 -0
+
+properties:
+  compatible:
+    const: fsl,ls1012a-pinctrl
+
+  reg:
+    description: Specifies the base address of the PMUXCR0 register.
+    maxItems: 2

Instead list and describe the items.

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 24

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+
+  big-endian:
+    description: If present, the PMUXCR0 register is implemented in big-endian.

Why is this here? Either it is or it is not?

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 27

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+    type: boolean
+
+  dcfg-regmap:

Missing vendor prefix.

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 30

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      The phandle of the syscon node for the DCFG registers.

Instead explain what it is needed it for, how is it used.

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 33

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+
+patternProperties:
+  '^pinctrl-':

Rather -pins$ or ^pins-

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +4 -0
+    type: object
+    $ref: pinmux-node.yaml#
+    unevaluatedProperties: false
+

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 47

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +10 -0
+    properties:
+      function:
+        enum: [ i2c, spi, gpio, gpio_reset ]
+
+      groups:
+        items:
+          enum: [ qspi_1_grp, qspi_2_grp, qspi_3_grp ]
+
+allOf:
+  - $ref: pinctrl.yaml#

Thies goes after required.

Quoted 19 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +19 -0
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    pinctrl: pinctrl@1570430 {
+        compatible = "fsl,ls1012a-pinctrl";
+        reg = <0x0 0x1570430 0x0 0x4>;
+        big-endian;
+        dcfg-regmap = <&dcfg>;
+        pinctrl_qspi_1: pinctrl-qspi-1 {
+            groups = "qspi_1_grp";
+            function = "spi";
+        };
+        pinctrl_qspi_2: pinctrl-qspi-2 {

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 76

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +10 -0
+            groups = "qspi_1_grp", "qspi_2_grp";
+            function = "spi";
+        };
+        pinctrl_qspi_4: pinctrl-qspi-4 {
+            groups = "qspi_1_grp", "qspi_2_grp", "qspi_3_grp";
+            function = "spi";
+        };
+    };
+  - |
+    qspi: quadspi@1550000 {

Drop, useless and not related.

Best regards,
Krzysztof

#3 lore raw
Quoted 11 lines · Krzysztof Kozlowski
Quoted 5 lines · David Leonard

Add a binding schema and examples for the LS1012A's pinctrl function.

---

It does not look like you tested the bindings, at least after quick look. Please run (see Documentation/devicetree/bindings/writing-schema.rst for instructions). Maybe you need to update your dtschema and yamllint.

I've since updated tools (dt-valdate 2024.5 and yamllint 1.33.0) and rebased onto v6.11-rc1.

Quoted 11 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +1 -0
@@ -0,0 +1,83 @@
 
+description: >

Drop >

Quoted 1 line

+ Bindings for LS1012A pinmux control.

Drop "Bindings for" and explain the hardware.

Changed to

description:
The LS1012A pinmux controller can override the RCW and alter some pin groups' functions in a limited way.

Quoted 10 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 21

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +8 -0
+
+properties:
+  compatible:
+    const: fsl,ls1012a-pinctrl
+
+  reg:
+    description: Specifies the base address of the PMUXCR0 register.
+    maxItems: 2

Instead list and describe the items.

Changed to

reg:
items:
- description: Physical base address of the PMUXCR0 register.
- description: Size of the PMUXCR0 register (4).

Is this what you meant?

Quoted 5 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 24

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+
+  big-endian:
+    description: If present, the PMUXCR0 register is implemented in big-endian.

Why is this here? Either it is or it is not?

You're right. Changed to

big-endian: true

(This also lead to some code simplification)

Quoted 5 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 27

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+    type: boolean
+
+  dcfg-regmap:

Missing vendor prefix.

Will use "fsl,"

Quoted 5 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 30

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      The phandle of the syscon node for the DCFG registers.

Instead explain what it is needed it for, how is it used.

Changed to

fsl,dcfg-regmap:
$ref: /schemas/types.yaml#/definitions/phandle description:
The phandle of the syscon node for the DCFG registers providing the RCW's pin configuration that is in effect when the pinmux controller is disabled.

Quoted 5 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 33

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+
+patternProperties:
+  '^pinctrl-':

Rather -pins$ or ^pins-

Changed to ^pins- See example at the end.

Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 47

Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +2 -0
+allOf:
+  - $ref: pinctrl.yaml#

Thies goes after required.

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 51

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +4 -0
+
+required:
+  - compatible
+  - reg

Relocated

Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +18 -0
+additionalProperties: false
+
+examples:
+  - |
+    pinctrl: pinctrl@1570430 {
+        compatible = "fsl,ls1012a-pinctrl";
+        reg = <0x0 0x1570430 0x0 0x4>;
+        big-endian;
+        dcfg-regmap = <&dcfg>;
+        pinctrl_qspi_1: pinctrl-qspi-1 {
+            groups = "qspi_1_grp";
+            function = "spi";
+        };
+        pinctrl_qspi_2: pinctrl-qspi-2 {
+            groups = "qspi_1_grp", "qspi_2_grp";
+            function = "spi";
+        };
+        pinctrl_qspi_4: pinctrl-qspi-4 {
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 76

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +6 -0
+            groups = "qspi_1_grp", "qspi_2_grp", "qspi_3_grp";
+            function = "spi";
+        };
+    };
+  - |
+    qspi: quadspi@1550000 {

Drop, useless and not related.

Dropped the qspi example. Examples are now

examples:

    - |
      pinctrl: pinctrl@1570430 {
	  compatible = "fsl,ls1012a-pinctrl";
	  reg = <0x0 0x1570430 0x0 0x4>;
	  big-endian;
	  fsl,dcfg-regmap = <&dcfg>;
	  pinctrl_qspi_1: pins-qspi-1 { /* buswidth 1 */
	      groups = "qspi_1_grp";
	      function = "spi";
	  };
	  pinctrl_qspi_2: pins-qspi-2 { /* buswidth 2 */
	      groups = "qspi_1_grp", "qspi_2_grp";
	      function = "spi";
	  };
	  pinctrl_qspi_4: pins-qspi-4 { /* buswidth 4 */
	      groups = "qspi_1_grp", "qspi_2_grp", "qspi_3_grp";
	      function = "spi";
	  };
      };

Thanks,

David

#4 lore raw
Quoted 10 lines · David Leonard
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 21

Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +7 -0
+properties:
+  compatible:
+    const: fsl,ls1012a-pinctrl
+
+  reg:
+    description: Specifies the base address of the PMUXCR0 register.
+    maxItems: 2

Instead list and describe the items.

Quoted 8 lines

Changed to

reg:
items:
- description: Physical base address of the PMUXCR0 register.
- description: Size of the PMUXCR0 register (4).

Is this what you meant?

Almost, second reg is not a size. You claim there are two IO address spaces. Each address space contains base address and size. Look at other bindings how they do it.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +3 -0
+
+  big-endian:
+    description: If present, the PMUXCR0 register is implemented in big-endian.
Quoted 7 lines
Quoted 1 line

Why is this here? Either it is or it is not?

You're right. Changed to

big-endian: true

(This also lead to some code simplification)

OK, but I still wonder why is it here. Without it the hardware will work in little-endian?

Quoted 1 line

Best regards,
Krzysztof

#5 lore raw
Quoted 18 lines · Krzysztof Kozlowski
Quoted 17 lines · David Leonard
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 21

Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +7 -0
+properties:
+  compatible:
+    const: fsl,ls1012a-pinctrl
+
+  reg:
+    description: Specifies the base address of the PMUXCR0 register.
+    maxItems: 2

Instead list and describe the items.

Changed to

reg:
items:
- description: Physical base address of the PMUXCR0 register.
- description: Size of the PMUXCR0 register (4).

Quoted 5 lines
Quoted 1 line

Is this what you meant?

Almost, second reg is not a size. You claim there are two IO address spaces. Each address space contains base address and size. Look at other bindings how they do it.

Previously, dt_binding_check was giving me a warning that 'maxItems' needed to be supplied. Which confused me because I thought of reg as an opaque subspace descriptor, but I was just trying to placate the checks. After tool upgrades, that warning doesn't appear any more.

So the neatest documentation would be:

reg:
description: Specifies the address of the PMUXCR0 register.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 24

Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +2 -0
+  big-endian:
+    description: If present, the PMUXCR0 register is implemented in big-endian.

Why is this here? Either it is or it is not?

Quoted 8 lines
Quoted 5 lines

You're right. Changed to

big-endian: true

(This also lead to some code simplification)

OK, but I still wonder why is it here. Without it the hardware will work in little-endian?

Well, it's here firstly because I was trying to follow a perceived convention in dts/freescale/fsl,ls1012a.dtsi. That DT uses big-endian in child nodes of /soc that match up with memory map tables from the datasheet. (Not only do different and adjacent parts of the register map have opposing endianess, some register layouts also seem to be reversed bitwise, others bytewise.)

The second reason is practical/dodgy. The pinctrl driver should logically be a child of the scfg node, but the syscon driver doesn't populate its child nodes. To get the pinctrl driver to work meant making it a sibling node with an unsatisfactory overlap with the scfg's address region 0x1570000+0x10000. (No driver binds to "fsl,ls1012a-scfg".)

        soc: soc {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <2>;
		...
                scfg: scfg@1570000 {
                        compatible = "fsl,ls1012a-scfg", "syscon";
                        reg = <0x0 0x1570000 0x0 0x10000>;
                        big-endian;
		};
		pinmux: pinmux@157040c {
                        compatible = "fsl,ls1046a-pinctrl";
                        reg = <0 0x157040c 0 4>;
                        big-endian;
			...
		};
	};

The better device tree would be:

        soc: soc {
                compatible = "simple-bus";
		...
                scfg: scfg@1570000 {
                        compatible = "fsl,ls1046a-scfg", "syscon";
                        big-endian;
                        #address-cells = <1>;
                        #size-cells = <1>;
			...
			pinmux: pinmux@40c {
				compatible = "fsl,ls1046a-pinctrl";
				reg = <0x40c 4>;
				...
			};
		};
	};

And this would resolve the big-endian property issue.

There was a discussion of syscon populating its child nodes at
https://lore.kernel.org/lkml/[email protected]/T/

Cheers,

David

#6 lore raw
Quoted 10 lines · David Leonard
Quoted 2 lines

OK, but I still wonder why is it here. Without it the hardware will work in little-endian?

Well, it's here firstly because I was trying to follow a perceived convention in dts/freescale/fsl,ls1012a.dtsi. That DT uses big-endian in child nodes of /soc that match up with memory map tables from the datasheet. (Not only do different and adjacent parts of the register map have opposing endianess, some register layouts also seem to be reversed bitwise, others bytewise.)

Quoted 5 lines

The second reason is practical/dodgy. The pinctrl driver should logically be a child of the scfg node, but the syscon driver doesn't populate its child nodes. To get the pinctrl driver to work meant making it a sibling node with an unsatisfactory overlap with the scfg's address region 0x1570000+0x10000. (No driver binds to "fsl,ls1012a-scfg".)

Sorry, my examples had mixed up some ls1046a with ls1012a, which must be confusing. Corrections follow, should the meaning have been lost:

        soc {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <2>;
                ...

                scfg: scfg@1570000 {
                        compatible = "fsl,ls1012a-scfg", "syscon";
                        reg = <0x0 0x1570000 0x0 0x10000>;
                        big-endian;
                };

                pinctrl: pinctrl@1570430 {
                        compatible = "fsl,ls1012a-pinctrl";
                        reg = <0x0 0x1570430 0x0 0x4>; /* SCFG PMUXCR0 */
                        big-endian;
                        fsl,dcfg-regmap = <&dcfg>;
                        ...
                };
        };
Quoted 1 line

The better device tree would be:

        soc {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <2>;
                ...

                scfg: scfg@1570000 {
                        compatible = "fsl,ls1012a-scfg", "syscon";
                        reg = <0x0 0x1570000 0x0 0x10000>;
                        big-endian;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ...

                        pinctrl: pinctrl@430 {
                                compatible = "fsl,ls1012a-pinctrl";
                                reg = <0x430 0x4>; /* SCFG PMUXCR0 */
                                fsl,dcfg-regmap = <&dcfg (416/8)>;
                                ...
                        };
                };
        };
Quoted 4 lines

And this would resolve the big-endian property issue.

There was a discussion of syscon populating its child nodes at
https://lore.kernel.org/lkml/[email protected]/T/

#7 lore raw
In reply to David Leonard
Quoted 20 lines · David Leonard
Quoted 18 lines · Krzysztof Kozlowski
Quoted 17 lines · David Leonard
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 21

Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +7 -0
+properties:
+  compatible:
+    const: fsl,ls1012a-pinctrl
+
+  reg:
+    description: Specifies the base address of the PMUXCR0 register.
+    maxItems: 2

Instead list and describe the items.

Changed to

reg:
items:
- description: Physical base address of the PMUXCR0 register.
- description: Size of the PMUXCR0 register (4).

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Is this what you meant?

Almost, second reg is not a size. You claim there are two IO address spaces. Each address space contains base address and size. Look at other bindings how they do it.

Previously, dt_binding_check was giving me a warning that 'maxItems' needed to be supplied. Which confused me because I thought of reg as an opaque subspace

No.

Quoted 7 lines

descriptor, but I was just trying to placate the checks. After tool upgrades, that warning doesn't appear any more.

So the neatest documentation would be:

reg:
description: Specifies the address of the PMUXCR0 register.

No. Please go through example-schema. Or any other binding... If you find any binding with above syntax, let me know.

Instead: maxItems: 1.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml line 24

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/fsl,ls1012a-pinctrl.yaml new file +2 -0
+  big-endian:
+    description: If present, the PMUXCR0 register is implemented in big-endian.

Why is this here? Either it is or it is not?

You're right. Changed to

big-endian: true

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

(This also lead to some code simplification)

OK, but I still wonder why is it here. Without it the hardware will work in little-endian?

Well, it's here firstly because I was trying to follow a perceived convention in dts/freescale/fsl,ls1012a.dtsi. That DT uses big-endian in child

I am confused. Are you adding new device or converting existing bindings?

Quoted 8 lines

nodes of /soc that match up with memory map tables from the datasheet. (Not only do different and adjacent parts of the register map have opposing endianess, some register layouts also seem to be reversed bitwise, others bytewise.)

The second reason is practical/dodgy. The pinctrl driver should logically be a child of the scfg node, but the syscon driver doesn't populate its child nodes. To get the pinctrl driver to work meant making it a sibling

So fix driver...

Quoted 3 lines

node with an unsatisfactory overlap with the scfg's address region 0x1570000+0x10000. (No driver binds to "fsl,ls1012a-scfg".)

Several big-endian properties were added unnecessarily and are now being removed. You cannot provide me answer whether this hardware is little/big endian, so it also feels unnecessary.

Best regards,
Krzysztof