Skip to contentSkip to conversation

Add Tegra268 pinmux support

PATCH Superseded Prateek Agarwal 2 participants 5 messages Oct 14 – Oct 28

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Tegra268 pinmux support

This series adds pinctrl support for the three pin controllers (MAIN, UPHY and AON) found on Tegra268. The pin, function and pin group data is self-contained in the new driver.

Patch 1 adds the ARCH_TEGRA_268_SOC Kconfig symbol. This symbol gates the Tegra268 specific support code, and PINCTRL_TEGRA268 in patch 3 uses it as its default. It is kept as a separate patch because drivers/soc/tegra is merged through the Tegra tree rather than the pinctrl tree.

Patch 2 documents the three compatible strings and describes the pins and functions they provide. Patch 3 adds the driver and the PINCTRL_TEGRA268 Kconfig symbol.

Patches 2 and 3 build without patch 1. PINCTRL_TEGRA268 only references ARCH_TEGRA_268_SOC in a "default m if" expression, and Kconfig treats an unknown symbol in that position as false, so the driver simply defaults to off if patch 1 is not present. Patches 2 and 3 can therefore be applied to the pinctrl tree independently of patch 1, and no temporary build break occurs if the trees are merged in either order.

There is no Tegra268 device tree in the tree yet. The device tree nodes for these controllers will be posted together with the Tegra268 device tree once that work is ready. If it is preferred that the bindings land alongside their first consumer instead, patch 2 can be held back and reposted with the device tree.

Changes in v2:
- pinctrl: Mark open-drain, io-reset and rcv-sel as unsupported (-1) in every pin group. They previously defaulted to 0, so setting one of these parameters wrote bit 0 of the mux register and changed the selected function instead of being rejected.
- pinctrl: Remove pin, drive group and function definitions for pads that do not exist on Tegra268.
- pinctrl: Return -ENODEV from probe if no match data is found.
- dt-bindings: Drop the functions that no Tegra268 pin group provides, and rename the example node to match the pin it configures.

v1: https://lore.kernel.org/all/[email protected]/

Prathamesh Shete (3):
soc/tegra: Add Tegra268 Kconfig symbol
dt-bindings: pinctrl: Document Tegra268 pin controllers
pinctrl: tegra: Add support for Tegra268

 .../pinctrl/nvidia,tegra268-pinmux-aon.yaml   |   78 +
 .../nvidia,tegra268-pinmux-common.yaml        |   72 +
 .../pinctrl/nvidia,tegra268-pinmux-main.yaml  |  136 ++
 .../pinctrl/nvidia,tegra268-pinmux-uphy.yaml  |   75 +
 drivers/pinctrl/tegra/Kconfig                 |   11 +
 drivers/pinctrl/tegra/Makefile                |    1 +
 drivers/pinctrl/tegra/pinctrl-tegra268.c      | 1742 +++++++++++++++++
 drivers/soc/tegra/Kconfig                     |    9 +
 8 files changed, 2124 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-aon.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-main.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-uphy.yaml
 create mode 100644 drivers/pinctrl/tegra/pinctrl-tegra268.c

base-commit: 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e

Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/3 soc/tegra: Add Tegra268 Kconfig symbol

From: Prathamesh Shete <[email protected]>

The NVIDIA Tegra268 SoC is an upcoming new chip. Add a Kconfig symbol to allow fine-grained selection of support code for this chip.

---
 drivers/soc/tegra/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/soc/tegra/Kconfig +9 -0
index 8b6fdb9ad1ea..d856f9efea71 100644
@@ -158,6 +158,15 @@ config ARCH_TEGRA_264_SOC
 	help
 	  Enable support for the NVIDIA Tegra264 SoC.
 
+config ARCH_TEGRA_268_SOC
+	bool "NVIDIA Tegra268 SoC"
+	default ARCH_TEGRA
+	depends on !CPU_BIG_ENDIAN
+	select MAILBOX
+	select SOC_TEGRA_PMC
+	help
+	  Enable support for the NVIDIA Tegra268 SoC.
+
 endif
 endif
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/3 dt-bindings: pinctrl: Document Tegra268 pin controllers

In reply to Prateek Agarwal

From: Prathamesh Shete <[email protected]>

Tegra268 contains three pin controllers. Document their compatible strings and describe the list of pins and functions that they provide.

---
 .../pinctrl/nvidia,tegra268-pinmux-aon.yaml   |  78 ++++++++++
 .../nvidia,tegra268-pinmux-common.yaml        |  72 ++++++++++
 .../pinctrl/nvidia,tegra268-pinmux-main.yaml  | 136 ++++++++++++++++++
 .../pinctrl/nvidia,tegra268-pinmux-uphy.yaml  |  75 ++++++++++
 4 files changed, 361 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-aon.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-main.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-uphy.yaml
Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-aon.yaml new file +78 -0
new file mode 100644
index 000000000000..0757e15c1327
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nvidia,tegra268-pinmux-aon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra268 AON Pinmux Controller
+
+maintainers:
+  - Thierry Reding <[email protected]>
+  - Jon Hunter <[email protected]>
+
+properties:
+  compatible:
+    const: nvidia,tegra268-pinmux-aon
+
+  reg:
+    maxItems: 1
+
+patternProperties:
+  "^pinmux(-[a-z0-9-]+)?$":
+    type: object
+
+    # pin groups
+    additionalProperties:
+      $ref: nvidia,tegra268-pinmux-common.yaml
+
+      properties:
+        nvidia,pins:
+          items:
+            enum: [ soc_gpio00_paa0, vcomp_alert_paa1, ao_retention_n_paa2,
+                    batt_oc_paa3, bootv_ctl_n_paa4, power_on_paa5,
+                    hdmi_cec_paa6, soc_gpio07_paa7, soc_gpio08_pbb0,
+                    soc_gpio09_pbb1, gen2_i2c_scl_pcc0, gen2_i2c_sda_pcc1,
+                    gen3_i2c_scl_pcc2, gen3_i2c_sda_pcc3, gp_pwm4_pcc4,
+                    uart0_tx_pcc5, uart0_rx_pcc6, spi2_sck_pcc7,
+                    spi2_miso_pdd0, spi2_mosi_pdd1, spi2_cs0_n_pdd2,
+                    soc_gpio21_pdd3, soc_gpio23_pdd5, soc_gpio24_pdd6,
+                    soc_gpio25_pdd7, soc_gpio26_pee0, soc_gpio27_pee1,
+                    drive_ao_retention_n_paa2, drive_batt_oc_paa3,
+                    drive_power_on_paa5, drive_vcomp_alert_paa1,
+                    drive_bootv_ctl_n_paa4, drive_soc_gpio00_paa0,
+                    drive_soc_gpio07_paa7, drive_soc_gpio08_pbb0,
+                    drive_soc_gpio09_pbb1, drive_hdmi_cec_paa6,
+                    drive_gen2_i2c_scl_pcc0, drive_gen2_i2c_sda_pcc1,
+                    drive_gen3_i2c_scl_pcc2, drive_gen3_i2c_sda_pcc3,
+                    drive_gp_pwm4_pcc4, drive_uart0_tx_pcc5,
+                    drive_uart0_rx_pcc6, drive_spi2_sck_pcc7,
+                    drive_spi2_miso_pdd0, drive_spi2_mosi_pdd1,
+                    drive_spi2_cs0_n_pdd2, drive_soc_gpio21_pdd3,
+                    drive_soc_gpio23_pdd5, drive_soc_gpio24_pdd6,
+                    drive_soc_gpio25_pdd7, drive_soc_gpio26_pee0,
+                    drive_soc_gpio27_pee1 ]
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/pinctrl/pinctrl-tegra.h>
+
+    pinmux@c7a2000 {
+        compatible = "nvidia,tegra268-pinmux-aon";
+        reg = <0xc7a2000 0x2000>;
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&state_default>;
+
+        state_default: pinmux-default {
+            uart0 {
+                nvidia,pins = "uart0_tx_pcc5";
+                nvidia,function = "uarta_txd";
+            };
+        };
+    };
Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml new file +72 -0

72 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-main.yaml new file +136 -0

136 lines not on this page · raw message

Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-uphy.yaml new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer
#3 lore raw

Re: [PATCH v2 2/3] dt-bindings: pinctrl: Document Tegra268 pin controllers

Quoted 169 lines · Prateek Agarwal

From: Prathamesh Shete <[email protected]>

Tegra268 contains three pin controllers. Document their compatible strings and describe the list of pins and functions that they provide.

---
 .../pinctrl/nvidia,tegra268-pinmux-aon.yaml   |  78 ++++++++++
 .../nvidia,tegra268-pinmux-common.yaml        |  72 ++++++++++
 .../pinctrl/nvidia,tegra268-pinmux-main.yaml  | 136 ++++++++++++++++++
 .../pinctrl/nvidia,tegra268-pinmux-uphy.yaml  |  75 ++++++++++
 4 files changed, 361 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-aon.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-main.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-uphy.yaml
Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-aon.yaml new file +78 -0
new file mode 100644
index 000000000000..0757e15c1327
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nvidia,tegra268-pinmux-aon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra268 AON Pinmux Controller
+
+maintainers:
+  - Thierry Reding <[email protected]>
+  - Jon Hunter <[email protected]>
+
+properties:
+  compatible:
+    const: nvidia,tegra268-pinmux-aon
+
+  reg:
+    maxItems: 1
+
+patternProperties:
+  "^pinmux(-[a-z0-9-]+)?$":
+    type: object
+
+    # pin groups
+    additionalProperties:
+      $ref: nvidia,tegra268-pinmux-common.yaml
+
+      properties:
+        nvidia,pins:
+          items:
+            enum: [ soc_gpio00_paa0, vcomp_alert_paa1, ao_retention_n_paa2,
+                    batt_oc_paa3, bootv_ctl_n_paa4, power_on_paa5,
+                    hdmi_cec_paa6, soc_gpio07_paa7, soc_gpio08_pbb0,
+                    soc_gpio09_pbb1, gen2_i2c_scl_pcc0, gen2_i2c_sda_pcc1,
+                    gen3_i2c_scl_pcc2, gen3_i2c_sda_pcc3, gp_pwm4_pcc4,
+                    uart0_tx_pcc5, uart0_rx_pcc6, spi2_sck_pcc7,
+                    spi2_miso_pdd0, spi2_mosi_pdd1, spi2_cs0_n_pdd2,
+                    soc_gpio21_pdd3, soc_gpio23_pdd5, soc_gpio24_pdd6,
+                    soc_gpio25_pdd7, soc_gpio26_pee0, soc_gpio27_pee1,
+                    drive_ao_retention_n_paa2, drive_batt_oc_paa3,
+                    drive_power_on_paa5, drive_vcomp_alert_paa1,
+                    drive_bootv_ctl_n_paa4, drive_soc_gpio00_paa0,
+                    drive_soc_gpio07_paa7, drive_soc_gpio08_pbb0,
+                    drive_soc_gpio09_pbb1, drive_hdmi_cec_paa6,
+                    drive_gen2_i2c_scl_pcc0, drive_gen2_i2c_sda_pcc1,
+                    drive_gen3_i2c_scl_pcc2, drive_gen3_i2c_sda_pcc3,
+                    drive_gp_pwm4_pcc4, drive_uart0_tx_pcc5,
+                    drive_uart0_rx_pcc6, drive_spi2_sck_pcc7,
+                    drive_spi2_miso_pdd0, drive_spi2_mosi_pdd1,
+                    drive_spi2_cs0_n_pdd2, drive_soc_gpio21_pdd3,
+                    drive_soc_gpio23_pdd5, drive_soc_gpio24_pdd6,
+                    drive_soc_gpio25_pdd7, drive_soc_gpio26_pee0,
+                    drive_soc_gpio27_pee1 ]
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/pinctrl/pinctrl-tegra.h>
+
+    pinmux@c7a2000 {
+        compatible = "nvidia,tegra268-pinmux-aon";
+        reg = <0xc7a2000 0x2000>;
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&state_default>;
+
+        state_default: pinmux-default {
+            uart0 {
+                nvidia,pins = "uart0_tx_pcc5";
+                nvidia,function = "uarta_txd";
+            };
+        };
+    };
Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml new file +61 -0
new file mode 100644
index 000000000000..1b276a211b02
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nvidia,tegra268-pinmux-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra268 Pinmux Common Properties
+
+maintainers:
+  - Thierry Reding <[email protected]>
+  - Jon Hunter <[email protected]>
+
+$ref: nvidia,tegra-pinmux-common.yaml
+
+properties:
+  nvidia,function:
+    enum: [ dca_vsync, dca_hsync, rsvd0, dp_aux_ch0_hpd, dp_aux_ch1_hpd,
+            gp_pwm2, gp_pwm3, i2c7_clk, i2c7_dat, i2c9_clk, i2c9_dat, spi3_cs0,
+            spi3_cs3, spi3_din, spi3_dout, spi3_sck, uartf_cts, uartf_rts,
+            uartf_rxd, uartf_txd, spi1_cs0, spi1_cs1, spi1_din, spi1_dout,
+            spi1_sck, extperiph2_clk, extperiph1_clk, i2c12_clk, i2c12_dat,
+            nv_therm_fan_tach0, gp_pwm9, i2c0_clk, i2c0_dat, i2c1_clk, i2c1_dat,
+            i2s2_lrck, i2s2_sclk, i2s2_sdata_out, i2s2_sdata_in, uarte_cts,
+            uarte_rts, uarte_rxd, uarte_txd, i2c5_dat, i2c5_clk, i2s4_sdata_out,
+            i2s4_sclk, i2s4_sdata_in, i2s4_lrck, aud_mclk, i2s1_sclk,
+            i2s1_sdata_in, i2s1_sdata_out, i2s1_lrck, i2c11_clk, i2c11_dat,
+            xhalt_trig, gp_pwm1, gp_pwm6, gp_pwm7, gp_pwm8, ufs0, pe1_clkreq_l,
+            pe1_rst_l, pe2_rst_l, pe2_clkreq_l, pe3_clkreq_l, pe3_rst_l,
+            sgmii0_sma_mdio, sgmii0_sma_mdc, usb_vbus_en0, usb_vbus_en1,
+            pe4_clkreq_l, pe4_rst_l, eth0_mdio, eth0_mdc, eth2_mdio, eth2_mdc,
+            qspi0_cs_n, qspi0_io0, qspi0_io1, qspi0_io2, qspi0_io3, qspi0_sck,
+            dcb_vsync, dcb_hsync, dsa_lspii, dce_vsync, dce_hsync, bl_en,
+            bl_pwm_dim0, rsvd1, soc_therm_oc3, i2s5_sclk, i2s5_sdata_in,
+            extperiph3_clk, extperiph4_clk, i2s5_sdata_out, i2s5_lrck,
+            i2c14_dat, i2s8_sclk, i2s8_sdata_out, i2s8_lrck, i2c16_clk,
+            i2c16_dat, i2s3_sclk, i2s3_sdata_out, i2s3_sdata_in, i2s3_lrck,
+            pm_trig1, pm_trig0, dcc_vsync, dcc_hsync, rsvd2, dcf_vsync,
+            dcf_hsync, soundwire1_clk, soundwire1_dat0, soundwire1_dat1,
+            soundwire1_dat2, dmic2_clk, dmic2_dat, nv_therm_fan_tach1,
+            i2c15_clk, i2c15_dat, i2s7_sdata_out, dmic1_clk, dcd_vsync,
+            dcd_hsync, rsvd3, dcg_vsync, dcg_hsync, dspk1_clk, dspk1_dat,
+            soc_therm_oc2, istctrl_ist_done_n, soc_therm_oc1, tsc_edge_out0c,
+            tsc_edge_out0d, tsc_edge_out0a, tsc_edge_out0b, touch_clk, hdmi_cec,
+            i2c2_clk, i2c2_dat, i2c3_clk, i2c3_dat, gp_pwm4, uarta_txd,
+            uarta_rxd, spi2_sck, spi2_din, spi2_dout, spi2_cs0, tsc_sync1,
+            tsc_edge_out3, tsc_edge_out0, tsc_edge_out1, tsc_sync0,
+            soundwire0_clk, soundwire0_dat0, uartl_txd, uartl_rxd, i2s9_sclk,
+            i2s9_sdata_out, i2s9_sdata_in, i2s9_lrck, dmic5_dat, tsc_edge_out2 ]
+
+  # out of the common properties, only these are allowed for Tegra268
+  nvidia,pins: true
+  nvidia,pull: true
+  nvidia,tristate: true
+  nvidia,schmitt: true
+  nvidia,enable-input: true
+  nvidia,open-drain: true
+  nvidia,lock: true
+  nvidia,drive-type: true
+  nvidia,io-hv: true
+
+required:

Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml line 71

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/nvidia,tegra268-pinmux-common.yaml new file +10 -0
+  - nvidia,pins
+
+# We would typically use unevaluatedProperties here but that has the
+# downside that all the properties in the common bindings become valid
+# for all chip generations. In this case, however, we want the per-SoC
+# bindings to be able to override which of the common properties are
+# allowed, since not all pinmux generations support the same sets of
+# properties. This way, the common bindings define the format of the
+# properties but the per-SoC bindings define which of them apply to a
+# given chip.

No need for this explanation. If this is a result of sashiko, just ignore it or try putting this after the commit msg (i.e. below '---').

Rob

#4 lore raw

PATCH v2 3/3 pinctrl: tegra: Add support for Tegra268

In reply to Prateek Agarwal

From: Prathamesh Shete <[email protected]>

Add Tegra268 pinctrl driver supporting MAIN, AON and UPHY pin controllers.

---
 drivers/pinctrl/tegra/Kconfig            |   11 +
 drivers/pinctrl/tegra/Makefile           |    1 +
 drivers/pinctrl/tegra/pinctrl-tegra268.c | 1742 ++++++++++++++++++++++
 3 files changed, 1754 insertions(+)
 create mode 100644 drivers/pinctrl/tegra/pinctrl-tegra268.c
drivers/pinctrl/tegra/Kconfig +11 -0
index 39a93733efa2..21fe02f5e443 100644
@@ -59,6 +59,17 @@ config PINCTRL_TEGRA264
 	  and configuration for the MAIN, AON and UPHY pin controllers found
 	  on Tegra264.
 
+config PINCTRL_TEGRA268
+	tristate "NVIDIA Tegra268 pinctrl driver"
+	depends on ARCH_TEGRA || COMPILE_TEST
+	default m if ARCH_TEGRA_268_SOC
+	select PINCTRL_TEGRA
+	help
+	  Say Y or M here to enable support for the pinctrl driver for
+	  NVIDIA Tegra268 SoC. This driver controls the pin multiplexing
+	  and configuration for the MAIN, AON and UPHY pin controllers found
+	  on Tegra268.
+
 config PINCTRL_TEGRA_XUSB
 	bool "NVIDIA Tegra XUSB pin controller" if COMPILE_TEST && !ARCH_TEGRA
 	default y if ARCH_TEGRA
drivers/pinctrl/tegra/Makefile +1 -0
index 71ade768bf9c..2b84aca0e267 100644
@@ -10,4 +10,5 @@ obj-$(CONFIG_PINCTRL_TEGRA194)		+= pinctrl-tegra194.o
 obj-$(CONFIG_PINCTRL_TEGRA234)		+= pinctrl-tegra234.o
 obj-$(CONFIG_PINCTRL_TEGRA238)		+= pinctrl-tegra238.o
 obj-$(CONFIG_PINCTRL_TEGRA264)		+= pinctrl-tegra264.o
+obj-$(CONFIG_PINCTRL_TEGRA268)		+= pinctrl-tegra268.o
 obj-$(CONFIG_PINCTRL_TEGRA_XUSB)	+= pinctrl-tegra-xusb.o
drivers/pinctrl/tegra/pinctrl-tegra268.c new file +1742 -0

1,742 lines not on this page · raw message

Signature · 1 line
2.17.1