Skip to contentSkip to conversation

ESWIN EIC7700 pinctrl driver

PATCH Superseded Yulin Lu 3 participants 6 messages May 15, 2025 – May 22, 2025

Subsystems (3)

v4 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Yulin Lu

author
#0 lore raw

v4 cover ESWIN EIC7700 pinctrl driver

Implements support for the Eswin eic7700 SoC pinctrl controller. Provides API to manage pinctrl for the eic7700 SoC. Integration with the Linux pinctrl subsystem for consistency and scalability.

Supported chips:

    Eswin eic7700 SoC.

Test:
Tested this patch on the Sifive HiFive Premier P550 (which uses the EIC7700 SoC), including system boot, networking, EMMC, display, and other peripherals. The drivers for these modules all use the pinctrl module, so this verifies that this pinctrl driver patch is working properly.

---
Changes since V3:
- Added "Reviewed-by" tag of "Krzysztof Kozlowski"
- Corrected some incorrect spaces and blank lines in the YAML file.
- Link: https://lore.kernel.org/all/[email protected]/

Changes since V2:
- Added "Reviewed-by" tag of "Krzysztof Kozlowski"
- Address the comments from Krzysztof Kozlowski, some commit information are modified.
- Fixed some errors and warnings reported by the kernel test robot.
- Modified the usage of some labels and syntax in the YAML file, as well as the usage of the dev_err_probe function, to make their application scenarios more accurate.
- Link: https://lore.kernel.org/all/[email protected]/

Changes since V1:
- Made overall modifications to the driver structure and the DTS writing style.
- Link: https://lore.kernel.org/all/[email protected]/

Yulin Lu (2):
dt-bindings: pinctrl: eswin: Document for EIC7700 SoC
pinctrl: eswin: Add EIC7700 pinctrl driver

 .../pinctrl/eswin,eic7700-pinctrl.yaml        | 156 ++++
 drivers/pinctrl/Kconfig                       |  11 +
 drivers/pinctrl/Makefile                      |   1 +
 drivers/pinctrl/pinctrl-eic7700.c             | 702 ++++++++++++++++++
 4 files changed, 870 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/eswin,eic7700-pinctrl.yaml
 create mode 100644 drivers/pinctrl/pinctrl-eic7700.c
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v4 1/2 dt-bindings: pinctrl: eswin: Document for EIC7700 SoC

Add EIC7700 pinctrl device for all configurable pins. For the EIC7700 pinctrl registers, each register (32 bits) controls the characteristics of a single pin.
It supports setting function multiplexing, Schmitt trigger, drive strength, pull-up/pull-down, and input enable.

---
 .../pinctrl/eswin,eic7700-pinctrl.yaml        | 156 ++++++++++++++++++
 1 file changed, 156 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/eswin,eic7700-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/eswin,eic7700-pinctrl.yaml new file +156 -0
new file mode 100644
index 000000000000..d46e7ee6372d
@@ -0,0 +1,156 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/eswin,eic7700-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Eswin Eic7700 Pinctrl
+
+maintainers:
+  - Yulin Lu <[email protected]>
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+description: |
+  eic7700 pin configuration nodes act as a container for an arbitrary number of
+  subnodes. Each of these subnodes represents some desired configuration for one or
+  more pins. This configuration can include the mux function to select on those pin(s),
+  and various pin configuration parameters, such as input-enable, pull-up, etc.
+
+properties:
+  compatible:
+    const: eswin,eic7700-pinctrl
+
+  reg:
+    maxItems: 1
+
+  vrgmii-supply:
+    description:
+      Regulator supply for the RGMII interface IO power domain.
+      This property should reference a regulator that provides either 1.8V or 3.3V,
+      depending on the board-level voltage configuration required by the RGMII interface.
+
+patternProperties:
+  '-grp$':
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      '-pins$':
+        type: object
+
+        properties:
+          pins:
+            description:
+              For eic7700, specifies the name(s) of one or more pins to be configured by
+              this node.
+            items:
+              enum: [ chip_mode, mode_set0, mode_set1, mode_set2, mode_set3, xin,
+                      rst_out_n, key_reset_n, gpio0, por_sel, jtag0_tck, jtag0_tms,
+                      jtag0_tdi, jtag0_tdo, gpio5, spi2_cs0_n, jtag1_tck, jtag1_tms,
+                      jtag1_tdi, jtag1_tdo, gpio11, spi2_cs1_n, pcie_clkreq_n,
+                      pcie_wake_n, pcie_perst_n, hdmi_scl, hdmi_sda, hdmi_cec,
+                      jtag2_trst, rgmii0_clk_125, rgmii0_txen, rgmii0_txclk,
+                      rgmii0_txd0, rgmii0_txd1, rgmii0_txd2, rgmii0_txd3, i2s0_bclk,
+                      i2s0_wclk, i2s0_sdi, i2s0_sdo, i2s_mclk, rgmii0_rxclk,
+                      rgmii0_rxdv, rgmii0_rxd0, rgmii0_rxd1, rgmii0_rxd2, rgmii0_rxd3,
+                      i2s2_bclk, i2s2_wclk, i2s2_sdi, i2s2_sdo, gpio27, gpio28, gpio29,
+                      rgmii0_mdc, rgmii0_mdio, rgmii0_intb, rgmii1_clk_125, rgmii1_txen,
+                      rgmii1_txclk, rgmii1_txd0, rgmii1_txd1, rgmii1_txd2, rgmii1_txd3,
+                      i2s1_bclk, i2s1_wclk, i2s1_sdi, i2s1_sdo, gpio34, rgmii1_rxclk,
+                      rgmii1_rxdv, rgmii1_rxd0, rgmii1_rxd1, rgmii1_rxd2, rgmii1_rxd3,
+                      spi1_cs0_n, spi1_clk, spi1_d0, spi1_d1, spi1_d2, spi1_d3, spi1_cs1_n,
+                      rgmii1_mdc, rgmii1_mdio, rgmii1_intb, usb0_pwren, usb1_pwren,
+                      i2c0_scl, i2c0_sda, i2c1_scl, i2c1_sda, i2c2_scl, i2c2_sda,
+                      i2c3_scl, i2c3_sda, i2c4_scl, i2c4_sda, i2c5_scl, i2c5_sda,
+                      uart0_tx, uart0_rx, uart1_tx, uart1_rx, uart1_cts, uart1_rts,
+                      uart2_tx, uart2_rx, jtag2_tck, jtag2_tms, jtag2_tdi, jtag2_tdo,
+                      fan_pwm, fan_tach, mipi_csi0_xvs, mipi_csi0_xhs, mipi_csi0_mclk,
+                      mipi_csi1_xvs, mipi_csi1_xhs, mipi_csi1_mclk, mipi_csi2_xvs,
+                      mipi_csi2_xhs, mipi_csi2_mclk, mipi_csi3_xvs, mipi_csi3_xhs,
+                      mipi_csi3_mclk, mipi_csi4_xvs, mipi_csi4_xhs, mipi_csi4_mclk,
+                      mipi_csi5_xvs, mipi_csi5_xhs, mipi_csi5_mclk, spi3_cs_n, spi3_clk,
+                      spi3_di, spi3_do, gpio92, gpio93, s_mode, gpio95, spi0_cs_n,
+                      spi0_clk, spi0_d0, spi0_d1, spi0_d2, spi0_d3, i2c10_scl,
+                      i2c10_sda, i2c11_scl, i2c11_sda, gpio106, boot_sel0, boot_sel1,
+                      boot_sel2, boot_sel3, gpio111, lpddr_ref_clk ]
+
+          function:
+            description:
+              Specify the alternative function to be configured for the
+              given pins.
+            enum: [ disabled, boot_sel, chip_mode, emmc, fan_tach,
+                    gpio, hdmi, i2c, i2s, jtag, ddr_ref_clk_sel,
+                    lpddr_ref_clk, mipi_csi, osc, pcie, pwm,
+                    rgmii, reset, sata, sdio, spi, s_mode, uart, usb ]
+
+          input-schmitt-enable: true
+
+          input-schmitt-disable: true
+
+          bias-disable: true
+
+          bias-pull-down: true
+
+          bias-pull-up: true
+
+          input-enable: true
+
+          input-disable: true
+
+          drive-strength-microamp: true
+
+        required:
+          - pins
+
+        additionalProperties: false
+
+        allOf:
+          - $ref: pincfg-node.yaml#
+          - $ref: pinmux-node.yaml#
+
+          - if:
+              properties:
+                pins:
+                  anyOf:
+                    - pattern: '^rgmii'
+                    - const: lpddr_ref_clk
+            then:
+              properties:
+                drive-strength-microamp:
+                  enum: [3000, 6000, 9000, 12000, 15000, 18000, 21000, 24000]
+            else:
+              properties:
+                drive-strength-microamp:
+                  enum: [6000, 9000, 12000, 15000, 18000, 21000, 24000, 27000]
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pinctrl@51600080 {
+      compatible = "eswin,eic7700-pinctrl";
+      reg = <0x51600080 0x1fff80>;
+      vrgmii-supply = <&vcc_1v8>;
+
+      dev-active-grp {
+        /* group node defining 1 standard pin */
+        gpio10-pins {
+          pins = "jtag1_tdo";
+          function = "gpio";
+          input-enable;
+          bias-pull-up;
+        };
+
+        /* group node defining 2 I2C pins */
+        i2c6-pins {
+          pins = "uart1_cts", "uart1_rts";
+          function = "i2c";
+        };
+      };
+    };
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH v4 2/2 pinctrl: eswin: Add EIC7700 pinctrl driver

In reply to Yulin Lu

Add support for the pin controller in ESWIN's EIC7700 SoC, which supports pin multiplexing, pin configuration, and rgmii voltage control.

---
 drivers/pinctrl/Kconfig           |  11 +
 drivers/pinctrl/Makefile          |   1 +
 drivers/pinctrl/pinctrl-eic7700.c | 702 ++++++++++++++++++++++++++++++
 3 files changed, 714 insertions(+)
 create mode 100644 drivers/pinctrl/pinctrl-eic7700.c
drivers/pinctrl/Kconfig +11 -0
index 464cc9aca157..5e709a3f76bc 100644
@@ -208,6 +208,17 @@ config PINCTRL_DIGICOLOR
 	select PINMUX
 	select GENERIC_PINCONF
 
+config PINCTRL_EIC7700
+	tristate "EIC7700 PINCTRL driver"
+	depends on ARCH_ESWIN || COMPILE_TEST
+	select PINMUX
+	select GENERIC_PINCONF
+	help
+	  This driver support for the pin controller in ESWIN's EIC7700 SoC,
+	  which supports pin multiplexing, pin configuration,and rgmii voltage
+	  control.
+	  Say Y here to enable the eic7700 pinctrl driver
+
 config PINCTRL_EP93XX
 	bool
 	depends on ARCH_EP93XX || COMPILE_TEST
drivers/pinctrl/Makefile +1 -0
index ac27e88677d1..82e0d4cf5045 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_PINCTRL_CY8C95X0)	+= pinctrl-cy8c95x0.o
 obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o
 obj-$(CONFIG_PINCTRL_DA9062)	+= pinctrl-da9062.o
 obj-$(CONFIG_PINCTRL_DIGICOLOR)	+= pinctrl-digicolor.o
+obj-$(CONFIG_PINCTRL_EIC7700)	+= pinctrl-eic7700.o
 obj-$(CONFIG_PINCTRL_EQUILIBRIUM)   += pinctrl-equilibrium.o
 obj-$(CONFIG_PINCTRL_EP93XX)	+= pinctrl-ep93xx.o
 obj-$(CONFIG_PINCTRL_EYEQ5)	+= pinctrl-eyeq5.o
drivers/pinctrl/pinctrl-eic7700.c new file +702 -0

702 lines not on this page · raw message

Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH v4 2/2] pinctrl: eswin: Add EIC7700 pinctrl driver

Quoted 8 lines · Yulin Lu

Add support for the pin controller in ESWIN's EIC7700 SoC, which supports pin multiplexing, pin configuration, and rgmii voltage control.

Hm? This did not happen!

You cannot add fake tags! Read again the explanation I provided last time. Read the documentation.

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH v4 2/2] pinctrl: eswin: Add EIC7700 pinctrl driver

In reply to Yulin Lu
kernel test robot noticed the following build errors:

Hi Yulin,

kernel test robot noticed the following build errors:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next robh/for-next linus/master v6.15-rc7 next-20250521] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yulin-Lu/dt-bindings-pinctrl-eswin-Document-for-EIC7700-SoC/20250515-134847
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20250515054736.922-1-luyulin%40eswincomputing.com
patch subject: [PATCH v4 2/2] pinctrl: eswin: Add EIC7700 pinctrl driver
config: s390-randconfig-r132-20250522 (https://download.01.org/0day-ci/archive/20250522/[email protected]/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce: (https://download.01.org/0day-ci/archive/20250522/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>, old ones prefixed by <<):

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-mgr-test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-bridge-test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-region-test.o

>> ERROR: modpost: "pinconf_generic_dt_node_to_map" [drivers/pinctrl/pinctrl-eic7700.ko] undefined!
>> ERROR: modpost: "pinconf_generic_dt_free_map" [drivers/pinctrl/pinctrl-eic7700.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#5 lore raw
In reply to Yulin Lu
Quoted 15 lines · Yulin Lu

Implements support for the Eswin eic7700 SoC pinctrl controller. Provides API to manage pinctrl for the eic7700 SoC. Integration with the Linux pinctrl subsystem for consistency and scalability.

Supported chips:

    Eswin eic7700 SoC.

Test:
Tested this patch on the Sifive HiFive Premier P550 (which uses the EIC7700 SoC), including system boot, networking, EMMC, display, and other peripherals. The drivers for these modules all use the pinctrl module, so this verifies that this pinctrl driver patch is working properly.

Quoted 5 lines

---
Changes since V3:
- Added "Reviewed-by" tag of "Krzysztof Kozlowski"
- Corrected some incorrect spaces and blank lines in the YAML file.
- Link: https://lore.kernel.org/all/[email protected]/

Start using b4 so you will not introduce such errors like here.

Best regards,
Krzysztof