Skip to contentSkip to conversation

Add pinctrl support for S32 SoC family

PATCH In review Chester Lin 5 participants 14 messages Oct 31, 2022 – Nov 10, 2022

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

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

[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      |   91 ++
 drivers/pinctrl/freescale/Kconfig             |   16 +
 drivers/pinctrl/freescale/Makefile            |    2 +
 drivers/pinctrl/freescale/pinctrl-s32.h       |   65 ++
 drivers/pinctrl/freescale/pinctrl-s32cc.c     | 1023 +++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-s32g.c      |  759 ++++++++++++
 6 files changed, 1956 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 1/2 dt-bindings: pinctrl: add schema for NXP S32 SoCs

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

---
 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 91 +++++++++++++++++++
 1 file changed, 91 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +91 -0
new file mode 100644
index 000000000000..eafb9091cbf7
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 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,s32g-siul2-pinctrl
+
+  reg:
+    minItems: 5
+    maxItems: 6
+    description: A list of register regions to be reserved.
+
+  nxp,pins:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      A list of [start, end] pin ID boundaries that correspond to each of
+      the register regions reserved.
+
+required:
+  - compatible
+  - reg
+  - nxp,pins
+
+patternProperties:
+  '_pins$':
+    type: object
+    patternProperties:
+      '_grp[0-9]$':
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties below.
+
+additionalProperties: false
+
+examples:
+  - |
+
+    pinctrl: siul2-pinctrl@4009c240 {
+        compatible = "nxp,s32g-siul2-pinctrl";
+
+              /* MSCR range */
+        reg = <0x4009c240 0x198>,
+              <0x44010400 0x2c>,
+              <0x44010480 0xbc>,
+              /* MSCR range */
+              <0x4009ca40 0x150>,
+              <0x44010c1c 0x45c>,
+              <0x440110f8 0x108>;
+
+                   /* MSCR range */
+        nxp,pins = <0   101>,
+                   <112 122>,
+                   <144 190>,
+                   /* IMCR range */
+                   <512 595>,
+                   <631 909>,
+                   <942 1007>;
+
+        llce_can0_pins {
+            llce_can0_grp0 {
+                pinmux = <0x2b0>;
+                input-enable;
+                slew-rate = <0x00>;
+            };
+
+            llce_can0_grp1 {
+                pinmux = <0x2c2>;
+                output-enable;
+                slew-rate = <0x00>;
+            };
+        };
+    };
+...
Signature · 1 line
2.37.3
maintainer
#2 lore raw

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

Quoted 31 lines · Chester Lin

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

---
 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 91 +++++++++++++++++++
 1 file changed, 91 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +15 -0
new file mode 100644
index 000000000000..eafb9091cbf7
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 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.

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

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+
+properties:
+  compatible:
+    enum:
+      - nxp,s32g-siul2-pinctrl
+
+  reg:
+    minItems: 5
+    maxItems: 6
+    description: A list of register regions to be reserved.

Need to be explicit about what each entry is.

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

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+
+  nxp,pins:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      A list of [start, end] pin ID boundaries that correspond to each of
+      the register regions reserved.

Looks like a matrix rather than an array.

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

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +8 -0
+
+required:
+  - compatible
+  - reg
+  - nxp,pins
+
+patternProperties:
+  '_pins$':

s/_/-/

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

Quoted 1 line
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +1 -0
+    type: object

additionalProperties: false

(and a blank line after)

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

Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +2 -0
+    patternProperties:
+      '_grp[0-9]$':

s/_/-/

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

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +4 -0
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#

unevaluatedProperties: false

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

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties below.
+
+additionalProperties: false
+
+examples:
+  - |
+
+    pinctrl: siul2-pinctrl@4009c240 {

pinctrl@...

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

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+        compatible = "nxp,s32g-siul2-pinctrl";
+
+              /* MSCR range */
+        reg = <0x4009c240 0x198>,
+              <0x44010400 0x2c>,
+              <0x44010480 0xbc>,
+              /* MSCR range */
+              <0x4009ca40 0x150>,
+              <0x44010c1c 0x45c>,
+              <0x440110f8 0x108>;

What is in these holes in the memory map? Is this part of some larger block? If so, that block needs to be described.

Quoted 29 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +25 -0
+
+                   /* MSCR range */
+        nxp,pins = <0   101>,
+                   <112 122>,
+                   <144 190>,
+                   /* IMCR range */
+                   <512 595>,
+                   <631 909>,
+                   <942 1007>;
+
+        llce_can0_pins {
+            llce_can0_grp0 {
+                pinmux = <0x2b0>;
+                input-enable;
+                slew-rate = <0x00>;
+            };
+
+            llce_can0_grp1 {
+                pinmux = <0x2c2>;
+                output-enable;
+                slew-rate = <0x00>;
+            };
+        };
+    };
+...
Signature · 1 line
2.37.3
#3 lore raw

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

Hi Rob,

Thank you for reviewing this patch.

Quoted 36 lines · Rob Herring
Quoted 35 lines · Chester Lin

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

---
 .../pinctrl/nxp,s32cc-siul2-pinctrl.yaml      | 91 +++++++++++++++++++
 1 file changed, 91 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +19 -0
new file mode 100644
index 000000000000..eafb9091cbf7
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) 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:
Quoted 9 lines

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

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+      - nxp,s32g-siul2-pinctrl
+
+  reg:
+    minItems: 5
+    maxItems: 6
+    description: A list of register regions to be reserved.

Need to be explicit about what each entry is.

They are
- MSCR registers group 0 managed by the SIUL2 controller #0
- MSCR registers group 1 managed by the SIUL2 controller #1
- MSCR registers group 2 managed by the SIUL2 controller #1
- IMCR registers group 0 managed by the SIUL2 controller #0
- IMCR registers group 1 managed by the SIUL2 controller #1
- IMCR registers group 2 managed by the SIUL2 controller #1

- 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.

I will add descriptions for each entry in v2, thanks.

Quoted 38 lines

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

Quoted 6 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +6 -0
+
+  nxp,pins:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      A list of [start, end] pin ID boundaries that correspond to each of
+      the register regions reserved.

Looks like a matrix rather than an array.

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

Quoted 8 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +8 -0
+
+required:
+  - compatible
+  - reg
+  - nxp,pins
+
+patternProperties:
+  '_pins$':

s/_/-/

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

Quoted 1 line
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +1 -0
+    type: object

additionalProperties: false

(and a blank line after)

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

Quoted 2 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +2 -0
+    patternProperties:
+      '_grp[0-9]$':

s/_/-/

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

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +4 -0
+        type: object
+        allOf:
+          - $ref: pinmux-node.yaml#
+          - $ref: pincfg-node.yaml#

unevaluatedProperties: false

Quoted 20 lines

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

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +10 -0
+        description:
+          Pinctrl node's client devices specify pin muxes using subnodes,
+          which in turn use the standard properties below.
+
+additionalProperties: false
+
+examples:
+  - |
+
+    pinctrl: siul2-pinctrl@4009c240 {

pinctrl@...

Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +7 -0
+        compatible = "nxp,s32g-siul2-pinctrl";
+
+              /* MSCR range */
+        reg = <0x4009c240 0x198>,
+              <0x44010400 0x2c>,
+              <0x44010480 0xbc>,
+              /* MSCR range */

It's IMCR range but not the 2nd MSCR range, will fix it in v2.

Quoted 7 lines

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

Quoted 3 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +3 -0
+              <0x4009ca40 0x150>,
+              <0x44010c1c 0x45c>,
+              <0x440110f8 0x108>;

What is in these holes in the memory map? Is this part of some larger block? If so, that block needs to be described.

In this case S32G contains two SIUL2 controllers, which are located in two different memory regions, siul2_0@4009C000 and siul2_1@44010000. The siul2_0 contains the MSCR0-MSCR101 [starts at 0x4009c240] and IMCR0-IMCR83 [starts at 0x4009ca40] registers, and there are some other reserved regions and registers which are not related to pin muxing in siul2 memory ranges. Not sure what the original reason it could be, but the expanded MSCR112-MSCR122, MSCR144 -MSCR190 and IMCR119-IMCR397, IMCR430-IMCR495 registers are present in siul2_1's memory space. Besides, in the S32G pin map, some indexes are hidden since they're not used as pinouts, such as MSCR indexes 102-111, 123-143, and IMCR indexes 84-118, 398-429.

Anyway, that's why they look so fragmented. I will add more descriptions for each entry in v2.

Thanks,
Chester

Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +25 -0
+
+                   /* MSCR range */
+        nxp,pins = <0   101>,
+                   <112 122>,
+                   <144 190>,
+                   /* IMCR range */
+                   <512 595>,
+                   <631 909>,
+                   <942 1007>;
+
+        llce_can0_pins {
+            llce_can0_grp0 {
+                pinmux = <0x2b0>;
+                input-enable;
+                slew-rate = <0x00>;
+            };
+
+            llce_can0_grp1 {
+                pinmux = <0x2c2>;
+                output-enable;
+                slew-rate = <0x00>;
+            };
+        };
+    };
+...
Signature · 1 line
2.37.3
#4 lore raw

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

In reply to Chester Lin

Hi Chester,

thanks for your patch!

Quoted 5 lines · Chester Lin

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

(...)

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

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +5 -0
+  nxp,pins:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      A list of [start, end] pin ID boundaries that correspond to each of
+      the register regions reserved.

That's an interesting approach.

But what about just hardcoding this into the driver instead?

If you have the compatible, surely you know these indexes from that compatible string?

Yours,
Linus Walleij

#5 lore raw

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

Hi Linus,

Quoted 4 lines · Linus Walleij

Hi Chester,

thanks for your patch!

Thanks for reviewing this patch series as well!

Quoted 14 lines · Chester Lin
Quoted 6 lines

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

(...)

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

Quoted 5 lines
Documentation/devicetree/bindings/pinctrl/nxp,s32cc-siul2-pinctrl.yaml new file +5 -0
+  nxp,pins:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      A list of [start, end] pin ID boundaries that correspond to each of
+      the register regions reserved.
Quoted 7 lines

That's an interesting approach.

But what about just hardcoding this into the driver instead?

If you have the compatible, surely you know these indexes from that compatible string?

The nxp,pins property is more like a common language that both kernel and u-boot can share with. Of course hardcoding indexes can be achieved as well but that also means the index matrices in both kernel driver and u-boot driver must be revised and synchronized if new boards may have different reg and nxp,pins. IMHO, having these ID ranges in DT could be more intuitive, developers can easily compare every pair with the corresponding reg entry in the same dts file since reg maps are fragmented as I mentioned in Rob's code review[1]. Based on this approach, both kernel driver and u-boot driver can reuse the same parser to acquire pin ID ranges from different boards, which can also simplify codes and have less patches in the future.

Regards,
Chester

[1] https://lkml.org/lkml/2022/11/9/722

Quoted 2 lines

Yours,
Linus Walleij

#6 lore raw

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

Quoted 8 lines · Chester Lin
Quoted 2 lines

If you have the compatible, surely you know these indexes from that compatible string?

The nxp,pins property is more like a common language that both kernel and u-boot can share with. Of course hardcoding indexes can be achieved as well but that also means the index matrices in both kernel driver and u-boot driver must be revised and synchronized if new boards may have different reg and nxp,pins.

Is it new *BOARDS* that need a new table really or new *SOC:s*?

I was under the impression that this is per-soc and then it can be derived from the compatible string and should be in the driver.

If it is something that vary from board to board then it should be in the device tree because it can not be derived from the version of the hardware i.e the compatible string.

So which one is it?

Yours,
Linus Walleij

#7 lore raw

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

Hi Chester and Linus,

Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

If you have the compatible, surely you know these indexes from that compatible string?

The nxp,pins property is more like a common language that both kernel and u-boot can share with. Of course hardcoding indexes can be achieved as well but that also means the index matrices in both kernel driver and u-boot driver must be revised and synchronized if new boards may have different reg and nxp,pins.

Quoted 3 lines

Is it new *BOARDS* that need a new table really or new *SOC:s*?

I was under the impression that this is per-soc and then it can be derived from the compatible string and should be in the driver.

Yes, the "nxp,pins" property only depends on the SoC. It will not change from board to board(boards using the same SoC). It can be derived from the compatible string.

Best regards,
Andrei

#8 lore raw

PATCH 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

---
 drivers/pinctrl/freescale/Kconfig         |   16 +
 drivers/pinctrl/freescale/Makefile        |    2 +
 drivers/pinctrl/freescale/pinctrl-s32.h   |   65 ++
 drivers/pinctrl/freescale/pinctrl-s32cc.c | 1023 +++++++++++++++++++++
 drivers/pinctrl/freescale/pinctrl-s32g.c  |  759 +++++++++++++++
 5 files changed, 1865 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 +65 -0

65 lines not on this page · raw message

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

1,023 lines not on this page · raw message

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

759 lines not on this page · raw message

Signature · 1 line
2.37.3
#9 lore raw

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

Hi Chester,

thanks for your patch!

Quoted 5 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 8 lines

Overall this looks very good, special thanks for using as much generic code as possible.

Only main thing I want you to look into are those magic nxp,pins ranges encoded into the device tree.

Quoted 4 lines
drivers/pinctrl/freescale/pinctrl-s32g.c new file +4 -0
+static struct s32_pinctrl_soc_info s32_pinctrl_info = {
+       .pins = s32_pinctrl_pads_siul2,
+       .npins = ARRAY_SIZE(s32_pinctrl_pads_siul2),
+};

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

Quoted 10 lines
drivers/pinctrl/freescale/pinctrl-s32g.c new file +10 -0
+
+static const struct of_device_id s32_pinctrl_of_match[] = {
+       {
+
+               .compatible = "nxp,s32g-siul2-pinctrl",
+               .data = (void *) &s32_pinctrl_info,
+       },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, s32_pinctrl_of_match);

Since you are already using .data so nicely for the variants surely the nxp,pins info can go in there too?

Yours,
Linus Walleij

#10 lore raw

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

In reply to Chester Lin

Hi Chester,

Thank you for sending the patches.

drivers/pinctrl/freescale/pinctrl-s32.h line 5

Quoted 11 lines
drivers/pinctrl/freescale/pinctrl-s32.h new file +5 -0
new file mode 100644
index 000000000000..7b48fe3d73c9
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * S32 pinmux core definitions
+ *
+ * Copyright (C) 2016-2020,2022 NXP

Could we also add: " * Copyright 2015-2016 Freescale Semiconductor, Inc."?

Best regards,
Andrei

#11 lore raw

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

Hi Chester and Andrei,

Am 08.11.22 um 15:54 schrieb Andrei Stefanescu:

Quoted 5 lines
Quoted 5 lines
drivers/pinctrl/freescale/pinctrl-s32.h new file +0 -0
new file mode 100644
index 000000000000..7b48fe3d73c9
Quoted 8 lines

drivers/pinctrl/freescale/pinctrl-s32.h line 5

Quoted 6 lines
drivers/pinctrl/freescale/pinctrl-s32.h new file +5 -0
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * S32 pinmux core definitions
+ *
+ * Copyright (C) 2016-2020,2022 NXP

Could we also add: " * Copyright 2015-2016 Freescale Semiconductor, Inc."?

... and insert a space before 2022, while at it.

@Andrei: Intentionally no (C) or (c) for Freescale? (column alignment)

Cheers,
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 2/2] pinctrl: add NXP S32 SoC family support

Hi Chester and Andreas,

Quoted 1 line

@Andrei: Intentionally no (C) or (c) for Freescale? (column alignment)

I now see that all files in these patches have the (C) present. All NXP, Freescale Copyright statements should not have the (C) symbol present.

Thank you and best regards,
Andrei

#13 lore raw

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

Hi Andrei and Andreas,

Quoted 9 lines · Andrei Stefanescu

Hi Chester and Andreas,

Quoted 1 line

@Andrei: Intentionally no (C) or (c) for Freescale? (column alignment)

I now see that all files in these patches have the (C) present. All NXP, Freescale Copyright statements should not have the (C) symbol present.

Thank you and best regards,
Andrei

Will fix in v2.

Thanks,
Chester