Skip to contentSkip to conversation

Add pinctrl support for S32 SoC family

PATCH Superseded Chester Lin 6 participants 18 messages Nov 28, 2022 – Dec 14, 2022

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add pinctrl support for S32 SoC family

Hello,

Here I want to introduce a new patch series, which aims to support IOMUX functions provided by SIUL2 [System Integration Unit Lite2] on S32 SoCs, such as S32G2. This series is originally from NXP's implementation on CodeAurora[1] and it will be required by upstream kernel for supporting a variety of devices on S32 SoCs which need to config PINMUXs, such as PHYs and MAC controllers.

Currently, the whole architecture relies on FDTs offered by ATF[3] on CodeAurora to keep the flexibility of handling multiple S32 platforms since now S32 clks can be triggered via the ARM SCMI clock protocol and clk IDs/ settings can vary according to different board designs. To ensure that the driver can work properly, the dt-binding schemas in this patchset are still required as references.

Thanks,
Chester

Changes in v2:
- Move the "nxp,pins" ID range information from DT to the driver.
- dt-bindings:
- Fix schema issues.
- Add descriptions for reg entries.
- Revise the example.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix the copyright format suggested by NXP.

[1] https://source.codeaurora.org/external/autobsps32/linux/tree/drivers/pinctrl/freescale?h=bsp34.0-5.10.120-rt
[2] https://source.codeaurora.org/external/autobsps32/arm-trusted-firmware/tag/?h=bsp34.0-2.5

Chester Lin (2):
dt-bindings: pinctrl: add schema for NXP S32 SoCs
pinctrl: add NXP S32 SoC family support

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      |  125 ++
 drivers/pinctrl/freescale/Kconfig             |   16 +
 drivers/pinctrl/freescale/Makefile            |    2 +
 drivers/pinctrl/freescale/pinctrl-s32.h       |   77 ++
 drivers/pinctrl/freescale/pinctrl-s32cc.c     | 1003 +++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-s32g.c      |  773 +++++++++++++
 6 files changed, 1996 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
 create mode 100644 drivers/pinctrl/freescale/pinctrl-s32.h
 create mode 100644 drivers/pinctrl/freescale/pinctrl-s32cc.c
 create mode 100644 drivers/pinctrl/freescale/pinctrl-s32g.c
Signature · 1 line
2.37.3
#1 lore raw

PATCH v2 1/2 dt-bindings: pinctrl: add schema for NXP S32 SoCs

Add DT schema for the pinctrl driver of NXP S32 SoC family.

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +125 -0
new file mode 100644
index 000000000000..2fc25a9362af
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2022 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nxp,s32cc-siul2-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP S32 Common Chassis SIUL2 iomux controller
+
+maintainers:
+  - Ghennadi Procopciuc <[email protected]>
+  - Chester Lin <[email protected]>
+
+description: |
+  Core driver for the pin controller found on S32 Common Chassis SoC.
+
+properties:
+  compatible:
+    enum:
+      - nxp,s32g2-siul2-pinctrl
+
+  reg:
+    description:
+      A list of MSCR/IMCR register regions to be reserved.
+      - MSCR (Multiplexed Signal Configuration Register)
+        An MSCR register can configure the associated pin as either a GPIO pin
+        or a function output pin depends on the selected signal source.
+      - IMCR (Input Multiplexed Signal Configuration Register)
+        An IMCR register can configure the associated pin as function input
+        pin depends on the selected signal source.
+    minItems: 5
+    items:
+      - description: MSCR registers group 0 managed by the SIUL2 controller 0
+      - description: MSCR registers group 1 managed by the SIUL2 controller 1
+      - description: MSCR registers group 2 managed by the SIUL2 controller 1
+      - description: IMCR registers group 0 managed by the SIUL2 controller 0
+      - description: IMCR registers group 1 managed by the SIUL2 controller 1
+      - description: IMCR registers group 2 managed by the SIUL2 controller 1
+
+required:
+  - compatible
+  - reg
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.
+
+additionalProperties: false
+
+examples:
+  - |
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5
+    #define FUNC6  6
+    #define FUNC7  7
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+
+              /* MSCR0-MSCR101 registers on siul2_0 */
+        reg = <0x4009c240 0x198>,
+              /* MSCR112-MSCR122 registers on siul2_1 */
+              <0x44010400 0x2c>,
+              /* MSCR144-MSCR190 registers on siul2_1 */
+              <0x44010480 0xbc>,
+              /* IMCR0-IMCR83 registers on siul2_0 */
+              <0x4009ca40 0x150>,
+              /* IMCR119-IMCR397 registers on siul2_1 */
+              <0x44010c1c 0x45c>,
+              /* IMCR430-IMCR495 registers on siul2_1 */
+              <0x440110f8 0x108>;
+
+        llce-can0-pins {
+            llce-can0-grp0 {
+                pinmux = <S32CC_PINMUX(43, FUNC0)>;
+                input-enable;
+                slew-rate = <S32CC_SLEW_208MHZ>;
+            };
+
+            llce-can0-grp1 {
+                pinmux = <S32CC_PINMUX(44, FUNC2)>;
+                output-enable;
+                slew-rate = <S32CC_SLEW_208MHZ>;
+            };
+        };
+    };
+...
Signature · 1 line
2.37.3
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

Hi Chester,

Am 28.11.22 um 06:48 schrieb Chester Lin:

Quoted 6 lines

Add DT schema for the pinctrl driver of NXP S32 SoC family.

Quoted 6 lines

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".

Thanks.

Quoted 13 lines

- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

  .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
  1 file changed, 125 insertions(+)

create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..2fc25a9362af

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 1

Quoted 1 line
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +1 -0
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Any reason the code is GPL-2.0-or-later but the schema is GPL-2.0-only?

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +4 -0
+# Copyright 2022 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nxp,s32cc-siul2-pinctrl.yaml#

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP S32 Common Chassis SIUL2 iomux controller
+
+maintainers:
+  - Ghennadi Procopciuc <[email protected]>
+  - Chester Lin <[email protected]>
+
+description: |
+  Core driver for the pin controller found on S32 Common Chassis SoC.

SoC family

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +5 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,s32g2-siul2-pinctrl

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 30

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+
+  reg:
+    description:
+      A list of MSCR/IMCR register regions to be reserved.
+      - MSCR (Multiplexed Signal Configuration Register)
+        An MSCR register can configure the associated pin as either a GPIO pin
+        or a function output pin depends on the selected signal source.
+      - IMCR (Input Multiplexed Signal Configuration Register)
+        An IMCR register can configure the associated pin as function input
+        pin depends on the selected signal source.

Does this multi-paragraph text not need "description: |" like above?

Quoted 41 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +41 -0
+    minItems: 5
+    items:
+      - description: MSCR registers group 0 managed by the SIUL2 controller 0
+      - description: MSCR registers group 1 managed by the SIUL2 controller 1
+      - description: MSCR registers group 2 managed by the SIUL2 controller 1
+      - description: IMCR registers group 0 managed by the SIUL2 controller 0
+      - description: IMCR registers group 1 managed by the SIUL2 controller 1
+      - description: IMCR registers group 2 managed by the SIUL2 controller 1
+
+required:
+  - compatible
+  - reg
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.
+
+additionalProperties: false
+
+examples:
+  - |
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 81

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+    #define FUNC6  6
+    #define FUNC7  7
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7

I notice that neither this patch nor the following one introduces a dt-bindings header for these macros? Is the plan to only have them in TF-A sources? Thinking of DT overlays for SoMs, for example.

Regards,
Andreas

Quoted 44 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +44 -0
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+
+              /* MSCR0-MSCR101 registers on siul2_0 */
+        reg = <0x4009c240 0x198>,
+              /* MSCR112-MSCR122 registers on siul2_1 */
+              <0x44010400 0x2c>,
+              /* MSCR144-MSCR190 registers on siul2_1 */
+              <0x44010480 0xbc>,
+              /* IMCR0-IMCR83 registers on siul2_0 */
+              <0x4009ca40 0x150>,
+              /* IMCR119-IMCR397 registers on siul2_1 */
+              <0x44010c1c 0x45c>,
+              /* IMCR430-IMCR495 registers on siul2_1 */
+              <0x440110f8 0x108>;
+
+        llce-can0-pins {
+            llce-can0-grp0 {
+                pinmux = <S32CC_PINMUX(43, FUNC0)>;
+                input-enable;
+                slew-rate = <S32CC_SLEW_208MHZ>;
+            };
+
+            llce-can0-grp1 {
+                pinmux = <S32CC_PINMUX(44, FUNC2)>;
+                output-enable;
+                slew-rate = <S32CC_SLEW_208MHZ>;
+            };
+        };
+    };
+...
Signature · 4 lines
SUSE Software Solutions Germany GmbH
Frankenstraße 146, 90461 Nürnberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nürnberg)
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

Hi Andreas,

Quoted 25 lines · Andreas Färber

Hi Chester,

Am 28.11.22 um 06:48 schrieb Chester Lin:

Quoted 6 lines

Add DT schema for the pinctrl driver of NXP S32 SoC family.

Quoted 6 lines

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".

Thanks.

Quoted 7 lines

- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

  .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
  1 file changed, 125 insertions(+)

create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Quoted 10 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 1

Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +1 -0
new file mode 100644
index 000000000000..2fc25a9362af
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Any reason the code is GPL-2.0-or-later but the schema is GPL-2.0-only?

Actually this patch is modified from an original downstream schema, which has "GPL-2.0-only". See:

https://source.codeaurora.org/external/autobsps32/linux/tree/Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2.yaml?h=bsp34.0-5.10.120-rt#n1

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +8 -0
+# Copyright 2022 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nxp,s32cc-siul2-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP S32 Common Chassis SIUL2 iomux controller
+
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 15

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+maintainers:
+  - Ghennadi Procopciuc <[email protected]>
+  - Chester Lin <[email protected]>
+
+description: |
+  Core driver for the pin controller found on S32 Common Chassis SoC.

SoC family

Will fix in v3.

Quoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +9 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,s32g2-siul2-pinctrl
+
+  reg:
+    description:
+      A list of MSCR/IMCR register regions to be reserved.
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 30

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+      - MSCR (Multiplexed Signal Configuration Register)
+        An MSCR register can configure the associated pin as either a GPIO pin
+        or a function output pin depends on the selected signal source.
+      - IMCR (Input Multiplexed Signal Configuration Register)
+        An IMCR register can configure the associated pin as function input
+        pin depends on the selected signal source.

Does this multi-paragraph text not need "description: |" like above?

Will fix in v3, thanks for the reminder.

Quoted 47 lines
Quoted 47 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +47 -0
+    minItems: 5
+    items:
+      - description: MSCR registers group 0 managed by the SIUL2 controller 0
+      - description: MSCR registers group 1 managed by the SIUL2 controller 1
+      - description: MSCR registers group 2 managed by the SIUL2 controller 1
+      - description: IMCR registers group 0 managed by the SIUL2 controller 0
+      - description: IMCR registers group 1 managed by the SIUL2 controller 1
+      - description: IMCR registers group 2 managed by the SIUL2 controller 1
+
+required:
+  - compatible
+  - reg
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.
+
+additionalProperties: false
+
+examples:
+  - |
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5
+    #define FUNC6  6
+    #define FUNC7  7
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 81

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +4 -0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7

I notice that neither this patch nor the following one introduces a dt-bindings header for these macros? Is the plan to only have them in TF-A sources? Thinking of DT overlays for SoMs, for example.

Yes, it is. Since the current arch relies on the FDT offered by NXP's downstream TF-A, only TF-A sources include the dt-bindings header in order to refer to these macros. However, introduce these macros in this example can still help developers to understand how a pinmux constructs.

Regards,
Chester

Quoted 53 lines

Regards,
Andreas

Quoted 44 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +44 -0
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+
+              /* MSCR0-MSCR101 registers on siul2_0 */
+        reg = <0x4009c240 0x198>,
+              /* MSCR112-MSCR122 registers on siul2_1 */
+              <0x44010400 0x2c>,
+              /* MSCR144-MSCR190 registers on siul2_1 */
+              <0x44010480 0xbc>,
+              /* IMCR0-IMCR83 registers on siul2_0 */
+              <0x4009ca40 0x150>,
+              /* IMCR119-IMCR397 registers on siul2_1 */
+              <0x44010c1c 0x45c>,
+              /* IMCR430-IMCR495 registers on siul2_1 */
+              <0x440110f8 0x108>;
+
+        llce-can0-pins {
+            llce-can0-grp0 {
+                pinmux = <S32CC_PINMUX(43, FUNC0)>;
+                input-enable;
+                slew-rate = <S32CC_SLEW_208MHZ>;
+            };
+
+            llce-can0-grp1 {
+                pinmux = <S32CC_PINMUX(44, FUNC2)>;
+                output-enable;
+                slew-rate = <S32CC_SLEW_208MHZ>;
+            };
+        };
+    };
+...
Signature · 4 lines
SUSE Software Solutions Germany GmbH
Frankenstraße 146, 90461 Nürnberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nürnberg)
#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

In reply to Chester Lin

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Quoted 24 lines · Chester Lin

Add DT schema for the pinctrl driver of NXP S32 SoC family.

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..2fc25a9362af

Usually filename matches the compatible (or family name), so any reason why compatible is "nxp,s32g2" but filename is "nxp,s32cc"?

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +5 -0
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2022 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nxp,s32cc-siul2-pinctrl.yaml#

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP S32 Common Chassis SIUL2 iomux controller
+
+maintainers:
+  - Ghennadi Procopciuc <[email protected]>
+  - Chester Lin <[email protected]>
+
+description: |
+  Core driver for the pin controller found on S32 Common Chassis SoC.

If "Core driver for the" refers to Linux driver, then drop it. If refers to something else, please elaborate.

Quoted 17 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +17 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,s32g2-siul2-pinctrl
+
+  reg:
+    description:
+      A list of MSCR/IMCR register regions to be reserved.
+      - MSCR (Multiplexed Signal Configuration Register)
+        An MSCR register can configure the associated pin as either a GPIO pin
+        or a function output pin depends on the selected signal source.
+      - IMCR (Input Multiplexed Signal Configuration Register)
+        An IMCR register can configure the associated pin as function input
+        pin depends on the selected signal source.
+    minItems: 5
+    items:

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+      - description: MSCR registers group 0 managed by the SIUL2 controller 0
+      - description: MSCR registers group 1 managed by the SIUL2 controller 1
+      - description: MSCR registers group 2 managed by the SIUL2 controller 1
+      - description: IMCR registers group 0 managed by the SIUL2 controller 0
+      - description: IMCR registers group 1 managed by the SIUL2 controller 1
+      - description: IMCR registers group 2 managed by the SIUL2 controller 1
+
+required:
+  - compatible
+  - reg

required goes after all properties, so below patternProperties.

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 58

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.

All properties are accepted? What about values, e.g. for drive strength?

Quoted 29 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +29 -0
+
+additionalProperties: false
+
+examples:
+  - |
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5
+    #define FUNC6  6
+    #define FUNC7  7
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 97

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+

Either this should be part of description or should be dropped. It blows example and probably duplicates DTS.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

Hi Krzysztof,

Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Chester Lin

Add DT schema for the pinctrl driver of NXP S32 SoC family.

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..2fc25a9362af

Usually filename matches the compatible (or family name), so any reason why compatible is "nxp,s32g2" but filename is "nxp,s32cc"?

According to NXP, the S32CC is a microarch which is adapted by different S32 SoCs, such as S32G2/G3 and S32R45. Some common IPs are implemented in S32CC, such as serial, pinctrl, mmc, gmac and some other peripheral interfaces. S32R45 has different pinouts compared to S32G2, which means that there would not be just "s32g2-siul2-pinctrl" but also "s32r45-siul2-pinctrl" in the compatible enum if S32R45 has to be upstreamed in the future. For this case, it seems to be inappropriate that adding a compatible name without any "s32g" keyword in the filename "nxp,s32g2-.." unless creating a new yaml for each platform, such as nxp,s32r45-siul2-pinctl.yaml.

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2022 NXP
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nxp,s32cc-siul2-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP S32 Common Chassis SIUL2 iomux controller
+
+maintainers:
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 15

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +5 -0
+  - Ghennadi Procopciuc <[email protected]>
+  - Chester Lin <[email protected]>
+
+description: |
+  Core driver for the pin controller found on S32 Common Chassis SoC.

If "Core driver for the" refers to Linux driver, then drop it. If refers to something else, please elaborate.

Will fix it in v3.

Quoted 21 lines
Quoted 21 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +21 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,s32g2-siul2-pinctrl
+
+  reg:
+    description:
+      A list of MSCR/IMCR register regions to be reserved.
+      - MSCR (Multiplexed Signal Configuration Register)
+        An MSCR register can configure the associated pin as either a GPIO pin
+        or a function output pin depends on the selected signal source.
+      - IMCR (Input Multiplexed Signal Configuration Register)
+        An IMCR register can configure the associated pin as function input
+        pin depends on the selected signal source.
+    minItems: 5
+    items:
+      - description: MSCR registers group 0 managed by the SIUL2 controller 0
+      - description: MSCR registers group 1 managed by the SIUL2 controller 1
+      - description: MSCR registers group 2 managed by the SIUL2 controller 1
+      - description: IMCR registers group 0 managed by the SIUL2 controller 0
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 42

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+      - description: IMCR registers group 1 managed by the SIUL2 controller 1
+      - description: IMCR registers group 2 managed by the SIUL2 controller 1
+
+required:
+  - compatible
+  - reg

required goes after all properties, so below patternProperties.

Will fix in v3.

Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 58

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.

All properties are accepted? What about values, e.g. for drive strength?

For those unsupported properties such as drive-strength, the s32g2 pinctrl driver returns -EOPNOTSUPP.

Quoted 48 lines
Quoted 30 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +29 -0
+
+additionalProperties: false
+
+examples:
+  - |
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5
+    #define FUNC6  6
+    #define FUNC7  7
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 97

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+

Either this should be part of description or should be dropped. It blows example and probably duplicates DTS.

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

Quoted 33 lines · Chester Lin

Hi Krzysztof,

Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Chester Lin

Add DT schema for the pinctrl driver of NXP S32 SoC family.

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..2fc25a9362af

Usually filename matches the compatible (or family name), so any reason why compatible is "nxp,s32g2" but filename is "nxp,s32cc"?

Quoted 9 lines

According to NXP, the S32CC is a microarch which is adapted by different S32 SoCs, such as S32G2/G3 and S32R45. Some common IPs are implemented in S32CC, such as serial, pinctrl, mmc, gmac and some other peripheral interfaces. S32R45 has different pinouts compared to S32G2, which means that there would not be just "s32g2-siul2-pinctrl" but also "s32r45-siul2-pinctrl" in the compatible enum if S32R45 has to be upstreamed in the future. For this case, it seems to be inappropriate that adding a compatible name without any "s32g" keyword in the filename "nxp,s32g2-.." unless creating a new yaml for each platform, such as nxp,s32r45-siul2-pinctl.yaml.

First, you can always rename a file if such need arises. Maybe new SoCs will come, maybe not.

Second, when you actually upstream new SoC it might anyway require new bindings file, because pinctrls are quite specific and it is usually difficult to support multiple devices in a nice, readable way in one file. Therefore anyway another file is quite likely.

(...)

Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 58

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.

All properties are accepted? What about values, e.g. for drive strength?

Quoted 2 lines

For those unsupported properties such as drive-strength, the s32g2 pinctrl driver returns -EOPNOTSUPP.

I don't care what the driver is doing, we do not discuss the driver. You need to describe properly the hardware and I doubt that hardware accepts all drive-strengths, all forms of pull resistors (so any Ohm value).

Add constrains.

Quoted 16 lines
Quoted 16 lines
Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +5 -0
+
+additionalProperties: false
+
+examples:
+  - |

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 73

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5
+    #define FUNC6  6
+    #define FUNC7  7

This is another surprise - functions are texts, not numbers.

Quoted 8 lines
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 81

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +8 -0
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7

Don't store register values in the bindings examples. Instead you need to be explain the slew-rate property.

Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 97

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+

Either this should be part of description or should be dropped. It blows example and probably duplicates DTS.

Quoted 3 lines
Quoted 3 lines

Best regards,
Krzysztof

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

Quoted 44 lines · Krzysztof Kozlowski
Quoted 33 lines · Chester Lin

Hi Krzysztof,

Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Chester Lin

Add DT schema for the pinctrl driver of NXP S32 SoC family.

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..2fc25a9362af

Usually filename matches the compatible (or family name), so any reason why compatible is "nxp,s32g2" but filename is "nxp,s32cc"?

Quoted 9 lines

According to NXP, the S32CC is a microarch which is adapted by different S32 SoCs, such as S32G2/G3 and S32R45. Some common IPs are implemented in S32CC, such as serial, pinctrl, mmc, gmac and some other peripheral interfaces. S32R45 has different pinouts compared to S32G2, which means that there would not be just "s32g2-siul2-pinctrl" but also "s32r45-siul2-pinctrl" in the compatible enum if S32R45 has to be upstreamed in the future. For this case, it seems to be inappropriate that adding a compatible name without any "s32g" keyword in the filename "nxp,s32g2-.." unless creating a new yaml for each platform, such as nxp,s32r45-siul2-pinctl.yaml.

Quoted 8 lines

First, you can always rename a file if such need arises. Maybe new SoCs will come, maybe not.

Second, when you actually upstream new SoC it might anyway require new bindings file, because pinctrls are quite specific and it is usually difficult to support multiple devices in a nice, readable way in one file. Therefore anyway another file is quite likely.

Thanks for your guidance. Will fix it.

Quoted 21 lines

(...)

Quoted 19 lines
Quoted 18 lines
Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 58

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.

All properties are accepted? What about values, e.g. for drive strength?

Quoted 9 lines
Quoted 2 lines

For those unsupported properties such as drive-strength, the s32g2 pinctrl driver returns -EOPNOTSUPP.

I don't care what the driver is doing, we do not discuss the driver. You need to describe properly the hardware and I doubt that hardware accepts all drive-strengths, all forms of pull resistors (so any Ohm value).

Add constrains.

Thanks for the suggestion. IIUC, I should specifically described the supported pinmux and pincfg properties in this schema and then add an "additionalProperties: false" in the end in order to constrain unsupported properties listed in the pattern pin groups.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +9 -0
+
+additionalProperties: false
+
+examples:
+  - |
+
+    /* Pins functions (SSS field) */
+    #define FUNC0  0
+    #define FUNC1  1
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 73

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+    #define FUNC2  2
+    #define FUNC3  3
+    #define FUNC4  4
+    #define FUNC5  5
+    #define FUNC6  6
+    #define FUNC7  7

This is another surprise - functions are texts, not numbers.

Maybe the FUNC[0|9] are not accurate to describe Source Signal Select [SSS]. I will drop these definitions from the example and try elaborating 'pinmux' in its property description.

Quoted 12 lines
Quoted 8 lines
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 81

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +8 -0
+
+    #define S32CC_PINMUX(PIN, FUNC) (((PIN) << 4) | (FUNC))
+
+    #define S32CC_SLEW_208MHZ  0
+    #define S32CC_SLEW_166MHZ  4
+    #define S32CC_SLEW_150MHZ  5
+    #define S32CC_SLEW_133MHZ  6
+    #define S32CC_SLEW_83MHZ   7

Don't store register values in the bindings examples. Instead you need to be explain the slew-rate property.

Will do.

Quoted 28 lines
Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+
+    pinctrl@4009c240 {
+        compatible = "nxp,s32g2-siul2-pinctrl";
+
+        /*
+         * There are two SIUL2 controllers in S32G2:

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 97

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+         *
+         *   siul2_0 @ 0x4009c000
+         *   siul2_1 @ 0x44010000
+         *
+         * Every SIUL2 controller has multiple register types, and here
+         * only MSCR and IMCR registers need to be revealed for kernel
+         * to configure pinmux. Please note that some indexes are reserved,
+         * such as MSCR102-MSCR111 in the following reg property.
+         */
+

Either this should be part of description or should be dropped. It blows example and probably duplicates DTS.

Quoted 3 lines
Quoted 3 lines

Best regards,
Krzysztof

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH v2 1/2] dt-bindings: pinctrl: add schema for NXP S32 SoCs

Quoted 84 lines · Chester Lin
Quoted 44 lines · Krzysztof Kozlowski
Quoted 33 lines · Chester Lin

Hi Krzysztof,

Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Chester Lin

Add DT schema for the pinctrl driver of NXP S32 SoC family.

---

Changes in v2:
- Remove the "nxp,pins" property since it has been moved into the driver.
- Add descriptions for reg entries.
- Refine the compatible name from "nxp,s32g-..." to "nxp,s32g2-...".
- Fix schema issues and revise the example.
- Fix the copyright format suggested by NXP.

 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Quoted 9 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +0 -0
new file mode 100644
index 000000000000..2fc25a9362af

Usually filename matches the compatible (or family name), so any reason why compatible is "nxp,s32g2" but filename is "nxp,s32cc"?

Quoted 9 lines

According to NXP, the S32CC is a microarch which is adapted by different S32 SoCs, such as S32G2/G3 and S32R45. Some common IPs are implemented in S32CC, such as serial, pinctrl, mmc, gmac and some other peripheral interfaces. S32R45 has different pinouts compared to S32G2, which means that there would not be just "s32g2-siul2-pinctrl" but also "s32r45-siul2-pinctrl" in the compatible enum if S32R45 has to be upstreamed in the future. For this case, it seems to be inappropriate that adding a compatible name without any "s32g" keyword in the filename "nxp,s32g2-.." unless creating a new yaml for each platform, such as nxp,s32r45-siul2-pinctl.yaml.

Quoted 8 lines

First, you can always rename a file if such need arises. Maybe new SoCs will come, maybe not.

Second, when you actually upstream new SoC it might anyway require new bindings file, because pinctrls are quite specific and it is usually difficult to support multiple devices in a nice, readable way in one file. Therefore anyway another file is quite likely.

Thanks for your guidance. Will fix it.

Quoted 28 lines

(...)

Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+
+patternProperties:
+  '-pins$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-grp[0-9]$':
+        type: object
+        allOf:
Quoted 8 lines

Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml line 58

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        unevaluatedProperties: false
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties.

All properties are accepted? What about values, e.g. for drive strength?

Quoted 2 lines

For those unsupported properties such as drive-strength, the s32g2 pinctrl driver returns -EOPNOTSUPP.

I don't care what the driver is doing, we do not discuss the driver. You need to describe properly the hardware and I doubt that hardware accepts all drive-strengths, all forms of pull resistors (so any Ohm value).

Quoted 5 lines
Quoted 2 lines

Add constrains.

Thanks for the suggestion. IIUC, I should specifically described the supported pinmux and pincfg properties in this schema and then add an "additionalProperties: false"

Yes.

Quoted 2 lines

in the end in order to constrain unsupported properties listed in the pattern pin groups.

You mean functions? or node names? The node names can be anything, can't they?

If your drive strengths or slew rates have some limits, then I expect them here.

Best regards,
Krzysztof

#9 lore raw

PATCH v2 2/2 pinctrl: add NXP S32 SoC family support

In reply to Chester Lin

Add the pinctrl driver for NXP S32 SoC family. This driver is mainly based on NXP's downstream implementation on CodeAurora[1].

[1] https://source.codeaurora.org/external/autobsps32/linux/tree/drivers/pinctrl/freescale?h=bsp34.0-5.10.120-rt

---

Changes in v2:
- Create a s32_pin_range matrix in the driver for replacing the "nxp,pins" property in DT.
- Refine the compatible name to "nxp,s32g2-siul2-pinctrl".
- Fix the copyright requested by NXP.
- Remove a few recipients from the Cc list since these email addresses are no longer available.

 drivers/pinctrl/freescale/Kconfig         |   16 +
 drivers/pinctrl/freescale/Makefile        |    2 +
 drivers/pinctrl/freescale/pinctrl-s32.h   |   77 ++
 drivers/pinctrl/freescale/pinctrl-s32cc.c | 1003 +++++++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-s32g.c  |  773 ++++++++++++++++
 5 files changed, 1871 insertions(+)
 create mode 100644 drivers/pinctrl/freescale/pinctrl-s32.h
 create mode 100644 drivers/pinctrl/freescale/pinctrl-s32cc.c
 create mode 100644 drivers/pinctrl/freescale/pinctrl-s32g.c
drivers/pinctrl/freescale/Kconfig +16 -0
index 7a32f77792d9..fdd8f5492830 100644
@@ -217,3 +217,19 @@ config PINCTRL_IMXRT1170
 	select PINCTRL_IMX
 	help
 	  Say Y here to enable the imxrt1170 pinctrl driver
+
+config PINCTRL_S32CC
+	bool "NXP S32 Common Chassis pinctrl driver core"
+	depends on ARCH_S32 && OF
+	select GENERIC_PINCTRL_GROUPS
+	select GENERIC_PINMUX_FUNCTIONS
+	select GENERIC_PINCONF
+	help
+	  Say Y here to enable the NXP S32CC pinctrl driver core
+
+config PINCTRL_S32G
+	depends on ARCH_S32 && OF
+	bool "NXP S32G pinctrl driver"
+	select PINCTRL_S32CC
+	help
+	  Say Y here to enable the pinctrl driver for NXP 32G family SoCs
drivers/pinctrl/freescale/Makefile +2 -0
index 647dff060477..ceb0f61c6215 100644
@@ -33,3 +33,5 @@ obj-$(CONFIG_PINCTRL_IMX25)	+= pinctrl-imx25.o
 obj-$(CONFIG_PINCTRL_IMX28)	+= pinctrl-imx28.o
 obj-$(CONFIG_PINCTRL_IMXRT1050)	+= pinctrl-imxrt1050.o
 obj-$(CONFIG_PINCTRL_IMXRT1170)	+= pinctrl-imxrt1170.o
+obj-$(CONFIG_PINCTRL_S32CC)	+= pinctrl-s32cc.o
+obj-$(CONFIG_PINCTRL_S32G)	+= pinctrl-s32g.o
drivers/pinctrl/freescale/pinctrl-s32.h new file +77 -0

77 lines not on this page · raw message

drivers/pinctrl/freescale/pinctrl-s32cc.c new file +1003 -0

1,003 lines not on this page · raw message

drivers/pinctrl/freescale/pinctrl-s32g.c new file +773 -0

773 lines not on this page · raw message

Signature · 1 line
2.37.3
#10 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

Hi Chester,

Am 28.11.22 um 06:48 schrieb Chester Lin:

Quoted 13 lines

Add the pinctrl driver for NXP S32 SoC family. This driver is mainly based on NXP's downstream implementation on CodeAurora[1].

[1] https://source.codeaurora.org/external/autobsps32/linux/tree/drivers/pinctrl/freescale?h=bsp34.0-5.10.120-rt

Quoted 6 lines

---

Changes in v2:
- Create a s32_pin_range matrix in the driver for replacing the "nxp,pins" property in DT.
- Refine the compatible name to "nxp,s32g2-siul2-pinctrl".

Thanks.

Quoted 21 lines

- Fix the copyright requested by NXP.
- Remove a few recipients from the Cc list since these email addresses are no longer available.

  drivers/pinctrl/freescale/Kconfig         |   16 +
  drivers/pinctrl/freescale/Makefile        |    2 +
  drivers/pinctrl/freescale/pinctrl-s32.h   |   77 ++
  drivers/pinctrl/freescale/pinctrl-s32cc.c | 1003 +++++++++++++++++++++
  drivers/pinctrl/freescale/pinctrl-s32g.c  |  773 ++++++++++++++++
  5 files changed, 1871 insertions(+)

create mode 100644 drivers/pinctrl/freescale/pinctrl-s32.h create mode 100644 drivers/pinctrl/freescale/pinctrl-s32cc.c create mode 100644 drivers/pinctrl/freescale/pinctrl-s32g.c

drivers/pinctrl/freescale/Kconfig +0 -0
index 7a32f77792d9..fdd8f5492830 100644
@@ -217,3 +217,19 @@ config PINCTRL_IMXRT1170
  	select PINCTRL_IMX
  	help

drivers/pinctrl/freescale/Kconfig config PINCTRL_IMXRT1170 · line 228

Quoted 10 lines
drivers/pinctrl/freescale/Kconfig +9 -0
  	  Say Y here to enable the imxrt1170 pinctrl driver
+
+config PINCTRL_S32CC
+	bool "NXP S32 Common Chassis pinctrl driver core"
+	depends on ARCH_S32 && OF
+	select GENERIC_PINCTRL_GROUPS
+	select GENERIC_PINMUX_FUNCTIONS
+	select GENERIC_PINCONF
+	help
+	  Say Y here to enable the NXP S32CC pinctrl driver core

Does this driver core make any sense without a specific driver?

I.e., could this just be a menu-invisible internal option if S32G is the one the user needs to select anyway?
The alternative would be to leave it and have S32G depend on it, creating a submenu structure, but that would then still allow to build the driver core without any users.

drivers/pinctrl/freescale/Kconfig config PINCTRL_IMXRT1170 · line 235

Quoted 7 lines
drivers/pinctrl/freescale/Kconfig +7 -0
+
+config PINCTRL_S32G
+	depends on ARCH_S32 && OF
+	bool "NXP S32G pinctrl driver"
+	select PINCTRL_S32CC
+	help
+	  Say Y here to enable the pinctrl driver for NXP 32G family SoCs

s/32G/S32G/

drivers/pinctrl/freescale/Makefile obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o · line 37

Quoted 10 lines
drivers/pinctrl/freescale/Makefile +2 -0
index 647dff060477..ceb0f61c6215 100644
@@ -33,3 +33,5 @@ obj-$(CONFIG_PINCTRL_IMX25)	+= pinctrl-imx25.o
  obj-$(CONFIG_PINCTRL_IMX28)	+= pinctrl-imx28.o
  obj-$(CONFIG_PINCTRL_IMXRT1050)	+= pinctrl-imxrt1050.o
  obj-$(CONFIG_PINCTRL_IMXRT1170)	+= pinctrl-imxrt1170.o
+obj-$(CONFIG_PINCTRL_S32CC)	+= pinctrl-s32cc.o
+obj-$(CONFIG_PINCTRL_S32G)	+= pinctrl-s32g.o

[snip]

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Frankenstraße 146, 90461 Nürnberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nürnberg)
#11 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

Hi Andreas,

Quoted 50 lines · Andreas Färber

Hi Chester,

Am 28.11.22 um 06:48 schrieb Chester Lin:

Quoted 13 lines

Add the pinctrl driver for NXP S32 SoC family. This driver is mainly based on NXP's downstream implementation on CodeAurora[1].

[1] https://source.codeaurora.org/external/autobsps32/linux/tree/drivers/pinctrl/freescale?h=bsp34.0-5.10.120-rt

Quoted 6 lines

---

Changes in v2:
- Create a s32_pin_range matrix in the driver for replacing the "nxp,pins" property in DT.
- Refine the compatible name to "nxp,s32g2-siul2-pinctrl".

Thanks.

Quoted 25 lines

- Fix the copyright requested by NXP.
- Remove a few recipients from the Cc list since these email addresses are no longer available.

  drivers/pinctrl/freescale/Kconfig         |   16 +
  drivers/pinctrl/freescale/Makefile        |    2 +
  drivers/pinctrl/freescale/pinctrl-s32.h   |   77 ++
  drivers/pinctrl/freescale/pinctrl-s32cc.c | 1003 +++++++++++++++++++++
  drivers/pinctrl/freescale/pinctrl-s32g.c  |  773 ++++++++++++++++
  5 files changed, 1871 insertions(+)

create mode 100644 drivers/pinctrl/freescale/pinctrl-s32.h create mode 100644 drivers/pinctrl/freescale/pinctrl-s32cc.c create mode 100644 drivers/pinctrl/freescale/pinctrl-s32g.c

drivers/pinctrl/freescale/Kconfig +3 -0
index 7a32f77792d9..fdd8f5492830 100644
@@ -217,3 +217,19 @@ config PINCTRL_IMXRT1170
  	select PINCTRL_IMX
  	help
  	  Say Y here to enable the imxrt1170 pinctrl driver
+
+config PINCTRL_S32CC
+	bool "NXP S32 Common Chassis pinctrl driver core"
Quoted 9 lines

drivers/pinctrl/freescale/Kconfig config PINCTRL_IMXRT1170 · line 228

Quoted 6 lines
drivers/pinctrl/freescale/Kconfig +6 -0
+	depends on ARCH_S32 && OF
+	select GENERIC_PINCTRL_GROUPS
+	select GENERIC_PINMUX_FUNCTIONS
+	select GENERIC_PINCONF
+	help
+	  Say Y here to enable the NXP S32CC pinctrl driver core

Does this driver core make any sense without a specific driver?

No, it does not. This driver core must be associated with a specific platform driver, such as PINCTL_S32G.

Quoted 2 lines

I.e., could this just be a menu-invisible internal option if S32G is the one the user needs to select anyway?

If you mean making the option invisible in menuconfig, it can be done by simply removing the prompt message "NXP S32 Common .." from the bool type line. Although it will disappear from menuconfig but it can be automatically selected once the config PINCTRL_S32G is set to "y" due to its "select" option.

Quoted 4 lines

The alternative would be to leave it and have S32G depend on it, creating a submenu structure, but that would then still allow to build the driver core without any users.

Quoted 10 lines

drivers/pinctrl/freescale/Kconfig config PINCTRL_IMXRT1170 · line 235

Quoted 7 lines
drivers/pinctrl/freescale/Kconfig +7 -0
+
+config PINCTRL_S32G
+	depends on ARCH_S32 && OF
+	bool "NXP S32G pinctrl driver"
+	select PINCTRL_S32CC
+	help
+	  Say Y here to enable the pinctrl driver for NXP 32G family SoCs

s/32G/S32G/

Will fix it in v3. Thanks!

Quoted 20 lines

drivers/pinctrl/freescale/Makefile obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o · line 37

Quoted 10 lines
drivers/pinctrl/freescale/Makefile +2 -0
index 647dff060477..ceb0f61c6215 100644
@@ -33,3 +33,5 @@ obj-$(CONFIG_PINCTRL_IMX25)	+= pinctrl-imx25.o
  obj-$(CONFIG_PINCTRL_IMX28)	+= pinctrl-imx28.o
  obj-$(CONFIG_PINCTRL_IMXRT1050)	+= pinctrl-imxrt1050.o
  obj-$(CONFIG_PINCTRL_IMXRT1170)	+= pinctrl-imxrt1170.o
+obj-$(CONFIG_PINCTRL_S32CC)	+= pinctrl-s32cc.o
+obj-$(CONFIG_PINCTRL_S32G)	+= pinctrl-s32g.o

[snip]

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Frankenstraße 146, 90461 Nürnberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nürnberg)
#12 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

In reply to Chester Lin
Quoted 15 lines · Chester Lin

Add the pinctrl driver for NXP S32 SoC family. This driver is mainly based on NXP's downstream implementation on CodeAurora[1].

[1] https://source.codeaurora.org/external/autobsps32/linux/tree/drivers/pinctrl/freescale?h=bsp34.0-5.10.120-rt

---

Quoted 7 lines

Changes in v2:
- Create a s32_pin_range matrix in the driver for replacing the "nxp,pins" property in DT.
- Refine the compatible name to "nxp,s32g2-siul2-pinctrl".
- Fix the copyright requested by NXP.
- Remove a few recipients from the Cc list since these email addresses are no longer available.

Overall this version looks very good. I will be happy to merge it once Andreas comments are addressed, and it is rebased on v6.2-rc1 once that is out in some two+ weeks.

Yours,
Linus Walleij

maintainer
#13 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

In reply to Chester Lin

Hi Chester,

drivers/pinctrl/freescale/pinctrl-s32g.c line 766

Quoted 9 lines · Chester Lin
drivers/pinctrl/freescale/pinctrl-s32g.c new file +9 -0
+static struct platform_driver s32g_pinctrl_driver = {
+       .driver = {
+               .name = "s32g-siul2-pinctrl",
+               .owner = THIS_MODULE,
+               .of_match_table = s32_pinctrl_of_match,
+               .pm = &s32g_pinctrl_pm_ops,
+       },
+       .probe = s32g_pinctrl_probe,
+       .remove = s32_pinctrl_remove,

Do you really want to allow this pinctrl driver to be removed?

In other imx8m pinctrl drivers we pass:

.suppress_bind_attrs = true,

Check drivers/pinctrl/freescale/pinctrl-imx8mm.c for example.

Quoted 1 line

+module_platform_driver(s32g_pinctrl_driver);

And we also register it in arch_initcall() level.

Maybe you want to align these points with imx8m?

#14 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

Quoted 1 line · Fabio Estevam

In other imx8m pinctrl drivers we pass:

(...)

Quoted 3 lines
Quoted 1 line

+module_platform_driver(s32g_pinctrl_driver);

And we also register it in arch_initcall() level.

Do you really need that though? This driver certainly does not.

I was under the impression that recent changes to the probe-order logic has made most explicit arch_ etc initcall orderings surplus.

Yours,
Linus Walleij

#15 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

Hi Linus and Fabio,

Thanks for your time to review this patch!

Quoted 4 lines · Linus Walleij
Quoted 1 line · Fabio Estevam

In other imx8m pinctrl drivers we pass:

(...)

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

+module_platform_driver(s32g_pinctrl_driver);

And we also register it in arch_initcall() level.

Do you really need that though? This driver certainly does not.

I was under the impression that recent changes to the probe-order logic has made most explicit arch_ etc initcall orderings surplus.

Could bool/tristate options in the Kconfig be the key point?

Based on current design I prefer to build the s32g2 pinctrl driver as built-in rather than a loadable module. IIUC, when the driver is not built as module then the initcall ordering should still matter.

Feel free to correct me if anything wrong.

Regards,
Chester

Quoted 2 lines

Yours,
Linus Walleij

#16 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

Quoted 20 lines · Chester Lin

Hi Linus and Fabio,

Thanks for your time to review this patch!

Quoted 4 lines · Linus Walleij
Quoted 1 line · Fabio Estevam

In other imx8m pinctrl drivers we pass:

(...)

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

+module_platform_driver(s32g_pinctrl_driver);

And we also register it in arch_initcall() level.

Do you really need that though? This driver certainly does not.

I was under the impression that recent changes to the probe-order logic has made most explicit arch_ etc initcall orderings surplus.

Quoted 5 lines

Could bool/tristate options in the Kconfig be the key point?

Based on current design I prefer to build the s32g2 pinctrl driver as built-in rather than a loadable module. IIUC, when the driver is not built as module then the initcall ordering should still matter.

It is true that if you compile something into a module then all initicalls are the same: they are called when the module is loaded.

But the remaining initcalls used to be assigned to core, arch, subsystem etc in order for resources (such as clocks, regulators or pins) to be available before the drivers that need them get probed.

However there was first deferred probe to partially solve the problem and recently a large and refined series that use the dependencies in the device tree to resolve probe order.

Saravana Kannan has been working tirelessly at this, issueing git log --oneline --author="Saravana Kannan"
you will see the scope of this work.

Yours,
Linus Walleij

#17 lore raw

Re: [PATCH v2 2/2] pinctrl: add NXP S32 SoC family support

Quoted 35 lines · Linus Walleij
Quoted 20 lines · Chester Lin

Hi Linus and Fabio,

Thanks for your time to review this patch!

Quoted 4 lines · Linus Walleij
Quoted 1 line · Fabio Estevam

In other imx8m pinctrl drivers we pass:

(...)

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

+module_platform_driver(s32g_pinctrl_driver);

And we also register it in arch_initcall() level.

Do you really need that though? This driver certainly does not.

I was under the impression that recent changes to the probe-order logic has made most explicit arch_ etc initcall orderings surplus.

Quoted 5 lines

Could bool/tristate options in the Kconfig be the key point?

Based on current design I prefer to build the s32g2 pinctrl driver as built-in rather than a loadable module. IIUC, when the driver is not built as module then the initcall ordering should still matter.

It is true that if you compile something into a module then all initicalls are the same: they are called when the module is loaded.

But the remaining initcalls used to be assigned to core, arch, subsystem etc in order for resources (such as clocks, regulators or pins) to be available before the drivers that need them get probed.

Quoted 8 lines

However there was first deferred probe to partially solve the problem and recently a large and refined series that use the dependencies in the device tree to resolve probe order.

Saravana Kannan has been working tirelessly at this, issueing git log --oneline --author="Saravana Kannan"
you will see the scope of this work.

Thanks Linus.

For a system using DT, fw_devlink's goal is to make module load ordering or driver registration ordering irrelevant to proper functioning of the kernel/drivers. It should automatically figure out the dependencies and have the devices probe in the right order. It's already true for at least 80% of the cases for a system using DT. There are some known issues I'm either working on or have on my To do list. So, if you see a case where fw_devlink is not handling it correctly, please let me know.

-Saravana