Skip to contentSkip to conversation

pinctrl: tegra: Add Tegra186 pinmux driver

PATCH Superseded Aaron Kling 4 participants 15 messages Jun 9, 2025 – Aug 1, 2025

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover pinctrl: tegra: Add Tegra186 pinmux driver

This series adds support for Tegra186 pin control, based on a downstream driver, updated to match the existing Tegra194 driver.

---
Changes in v2:
- Don't allow underscores in node names in patch 1
- Rebase on v6.16-rc1
- Patch 2 was picked up and thus not in the rebase
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Aaron Kling (3):
dt-bindings: pinctrl: Document Tegra186 pin controllers
pinctrl: tegra: Add Tegra186 pinmux driver
arm64: tegra: Add Tegra186 pin controllers

 .../bindings/pinctrl/nvidia,tegra186-pinmux.yaml   |  285 ++++
 arch/arm64/boot/dts/nvidia/tegra186.dtsi           |   12 +
 drivers/pinctrl/tegra/Kconfig                      |    4 +
 drivers/pinctrl/tegra/Makefile                     |    1 +
 drivers/pinctrl/tegra/pinctrl-tegra186.c           | 1784 ++++++++++++++++++++
 drivers/soc/tegra/Kconfig                          |    1 +
 6 files changed, 2087 insertions(+)

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250308-tegra186-pinctrl-651ffbbbe816

Best regards,

Signature · 1 line
Aaron Kling <[email protected]>
#1 lore raw

PATCH v2 1/3 dt-bindings: pinctrl: Document Tegra186 pin controllers

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

---
 .../bindings/pinctrl/nvidia,tegra186-pinmux.yaml   | 285 +++++++++++++++++++++
 1 file changed, 285 insertions(+)
Documentation/devicetree/bindings/pinctrl/nvidia,tegra186-pinmux.yaml new file +285 -0
new file mode 100644
index 0000000000000000000000000000000000000000..ac764d0ac4b638b9c15175316e5186204076f281
@@ -0,0 +1,285 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/nvidia,tegra186-pinmux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra186 Pinmux Controller
+
+maintainers:
+  - Thierry Reding <[email protected]>
+  - Jon Hunter <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - nvidia,tegra186-pinmux
+      - nvidia,tegra186-pinmux-aon
+
+  reg:
+    items:
+      - description: pinmux registers
+
+patternProperties:
+  "^pinmux(-[a-z0-9-]+)?$":
+    type: object
+
+    # pin groups
+    additionalProperties:
+      $ref: nvidia,tegra-pinmux-common.yaml
+      unevaluatedProperties: false
+      properties:
+        nvidia,function:
+          enum: [ aud, can0, can1, ccla, dca, dcb, dcc, directdc, directdc1,
+                  displaya, displayb, dmic1, dmic2, dmic3, dmic4, dmic5, dp,
+                  dspk0, dspk1, dtv, eqos, extperiph1, extperiph2, extperiph3,
+                  extperiph4, gp, gpio, hdmi, i2c1, i2c2, i2c3, i2c5, i2c7,
+                  i2c8, i2c9, i2s1, i2s2, i2s3, i2s4, i2s5, i2s6, iqc0, iqc1,
+                  nv, pe, pe0, pe1, pe2, qspi, rsvd0, rsvd1, rsvd2, rsvd3,
+                  sata, sce, sdmmc1, sdmmc2, sdmmc3, sdmmc4, soc, spdif, spi1,
+                  spi2, spi3, spi4, touch, uarta, uartb, uartc, uartd, uarte,
+                  uartf, uartg, ufs0, usb, vgp1, vgp2, vgp3, vgp4, vgp5, vgp6,
+                  wdt ]
+
+        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:
+        - nvidia,pins
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          const: nvidia,tegra186-pinmux
+    then:
+      patternProperties:
+        "^pinmux(-[a-z0-9-]+)?$":
+          type: object
+          additionalProperties:
+            properties:
+              nvidia,pins:
+                description: An array of strings. Each string contains the name
+                  of a pin or group. Valid values for these names are listed
+                  below.
+                items:
+                  enum: [ pex_l0_rst_n_pa0, pex_l0_clkreq_n_pa1,
+                          pex_wake_n_pa2, pex_l1_rst_n_pa3,
+                          pex_l1_clkreq_n_pa4, pex_l2_rst_n_pa5,
+                          pex_l2_clkreq_n_pa6, uart4_tx_pb0, uart4_rx_pb1,
+                          uart4_rts_pb2, uart4_cts_pb3, gpio_wan1_pb4,
+                          gpio_wan2_pb5, gpio_wan3_pb6, gpio_wan4_pc0,
+                          dap2_sclk_pc1, dap2_dout_pc2, dap2_din_pc3,
+                          dap2_fs_pc4, gen1_i2c_scl_pc5, gen1_i2c_sda_pc6,
+                          sdmmc1_clk_pd0, sdmmc1_cmd_pd1, sdmmc1_dat0_pd2,
+                          sdmmc1_dat1_pd3, sdmmc1_dat2_pd4, sdmmc1_dat3_pd5,
+                          eqos_txc_pe0, eqos_td0_pe1, eqos_td1_pe2,
+                          eqos_td2_pe3, eqos_td3_pe4, eqos_tx_ctl_pe5,
+                          eqos_rd0_pe6, eqos_rd1_pe7, eqos_rd2_pf0,
+                          eqos_rd3_pf1, eqos_rx_ctl_pf2, eqos_rxc_pf3,
+                          eqos_mdio_pf4, eqos_mdc_pf5, sdmmc3_clk_pg0,
+                          sdmmc3_cmd_pg1, sdmmc3_dat0_pg2, sdmmc3_dat1_pg3,
+                          sdmmc3_dat2_pg4, sdmmc3_dat3_pg5, gpio_wan5_ph0,
+                          gpio_wan6_ph1, gpio_wan7_ph2, gpio_wan8_ph3,
+                          bcpu_pwr_req_ph4, mcpu_pwr_req_ph5, gpu_pwr_req_ph6,
+                          gpio_pq0_pi0, gpio_pq1_pi1, gpio_pq2_pi2,
+                          gpio_pq3_pi3, gpio_pq4_pi4, gpio_pq5_pi5,
+                          gpio_pq6_pi6, gpio_pq7_pi7, dap1_sclk_pj0,
+                          dap1_dout_pj1, dap1_din_pj2, dap1_fs_pj3,
+                          aud_mclk_pj4, gpio_aud0_pj5, gpio_aud1_pj6,
+                          gpio_aud2_pj7, gpio_aud3_pk0, gen7_i2c_scl_pl0,
+                          gen7_i2c_sda_pl1, gen9_i2c_scl_pl2, gen9_i2c_sda_pl3,
+                          usb_vbus_en0_pl4, usb_vbus_en1_pl5, gp_pwm6_pl6,
+                          gp_pwm7_pl7, dmic1_dat_pm0, dmic1_clk_pm1,
+                          dmic2_dat_pm2, dmic2_clk_pm3, dmic4_dat_pm4,
+                          dmic4_clk_pm5, gpio_cam1_pn0, gpio_cam2_pn1,
+                          gpio_cam3_pn2, gpio_cam4_pn3, gpio_cam6_pn5,
+                          gpio_cam7_pn6, extperiph1_clk_po0,
+                          extperiph2_clk_po1, cam_i2c_scl_po2, cam_i2c_sda_po3,
+                          dp_aux_ch0_hpd_pp0, dp_aux_ch1_hpd_pp1, hdmi_cec_pp2,
+                          gpio_edp0_pp3, gpio_edp1_pp4, gpio_edp2_pp5,
+                          gpio_edp3_pp6, directdc1_clk_pq0, directdc1_in_pq1,
+                          directdc1_out0_pq2, directdc1_out1_pq3,
+                          directdc1_out2_pq4, directdc1_out3_pq5,
+                          qspi_sck_pr0, qspi_io0_pr1, qspi_io1_pr2,
+                          qspi_io2_pr3, qspi_io3_pr4, qspi_cs_n_pr5,
+                          uart1_tx_pt0, uart1_rx_pt1, uart1_rts_pt2,
+                          uart1_cts_pt3, uart2_tx_px0, uart2_rx_px1,
+                          uart2_rts_px2, uart2_cts_px3, uart5_tx_px4,
+                          uart5_rx_px5, uart5_rts_px6, uart5_cts_px7,
+                          gpio_mdm1_py0, gpio_mdm2_py1, gpio_mdm3_py2,
+                          gpio_mdm4_py3, gpio_mdm5_py4, gpio_mdm6_py5,
+                          gpio_mdm7_py6, ufs0_ref_clk_pbb0, ufs0_rst_pbb1,
+                          dap4_sclk_pcc0, dap4_dout_pcc1, dap4_din_pcc2,
+                          dap4_fs_pcc3, directdc_comp, sdmmc1_comp, eqos_comp,
+                          sdmmc3_comp, qspi_comp,
+                          # drive groups
+                          drive_gpio_aud3_pk0, drive_gpio_aud2_pj7,
+                          drive_gpio_aud1_pj6, drive_gpio_aud0_pj5,
+                          drive_aud_mclk_pj4, drive_dap1_fs_pj3,
+                          drive_dap1_din_pj2, drive_dap1_dout_pj1,
+                          drive_dap1_sclk_pj0, drive_dmic1_clk_pm1,
+                          drive_dmic1_dat_pm0, drive_dmic2_dat_pm2,
+                          drive_dmic2_clk_pm3, drive_dmic4_dat_pm4,
+                          drive_dmic4_clk_pm5, drive_dap4_fs_pcc3,
+                          drive_dap4_din_pcc2, drive_dap4_dout_pcc1,
+                          drive_dap4_sclk_pcc0, drive_extperiph2_clk_po1,
+                          drive_extperiph1_clk_po0, drive_cam_i2c_sda_po3,
+                          drive_cam_i2c_scl_po2, drive_gpio_cam1_pn0,
+                          drive_gpio_cam2_pn1, drive_gpio_cam3_pn2,
+                          drive_gpio_cam4_pn3, drive_gpio_cam5_pn4,
+                          drive_gpio_cam6_pn5, drive_gpio_cam7_pn6,
+                          drive_dap2_din_pc3, drive_dap2_dout_pc2,
+                          drive_dap2_fs_pc4, drive_dap2_sclk_pc1,
+                          drive_uart4_cts_pb3, drive_uart4_rts_pb2,
+                          drive_uart4_rx_pb1, drive_uart4_tx_pb0,
+                          drive_gpio_wan4_pc0, drive_gpio_wan3_pb6,
+                          drive_gpio_wan2_pb5, drive_gpio_wan1_pb4,
+                          drive_gen1_i2c_scl_pc5, drive_gen1_i2c_sda_pc6,
+                          drive_uart1_cts_pt3, drive_uart1_rts_pt2,
+                          drive_uart1_rx_pt1, drive_uart1_tx_pt0,
+                          drive_directdc1_out3_pq5, drive_directdc1_out2_pq4,
+                          drive_directdc1_out1_pq3, drive_directdc1_out0_pq2,
+                          drive_directdc1_in_pq1, drive_directdc1_clk_pq0,
+                          drive_gpio_pq0_pi0, drive_gpio_pq1_pi1,
+                          drive_gpio_pq2_pi2, drive_gpio_pq3_pi3,
+                          drive_gpio_pq4_pi4, drive_gpio_pq5_pi5,
+                          drive_gpio_pq6_pi6, drive_gpio_pq7_pi7,
+                          drive_gpio_edp2_pp5, drive_gpio_edp3_pp6,
+                          drive_gpio_edp0_pp3, drive_gpio_edp1_pp4,
+                          drive_dp_aux_ch0_hpd_pp0, drive_dp_aux_ch1_hpd_pp1,
+                          drive_hdmi_cec_pp2, drive_pex_l2_clkreq_n_pa6,
+                          drive_pex_wake_n_pa2, drive_pex_l1_clkreq_n_pa4,
+                          drive_pex_l1_rst_n_pa3, drive_pex_l0_clkreq_n_pa1,
+                          drive_pex_l0_rst_n_pa0, drive_pex_l2_rst_n_pa5,
+                          drive_sdmmc1_clk_pd0, drive_sdmmc1_cmd_pd1,
+                          drive_sdmmc1_dat3_pd5, drive_sdmmc1_dat2_pd4,
+                          drive_sdmmc1_dat1_pd3, drive_sdmmc1_dat0_pd2,
+                          drive_eqos_td3_pe4, drive_eqos_td2_pe3,
+                          drive_eqos_td1_pe2, drive_eqos_td0_pe1,
+                          drive_eqos_rd3_pf1, drive_eqos_rd2_pf0,
+                          drive_eqos_rd1_pe7, drive_eqos_mdio_pf4,
+                          drive_eqos_rd0_pe6, drive_eqos_mdc_pf5,
+                          drive_eqos_txc_pe0, drive_eqos_rxc_pf3,
+                          drive_eqos_tx_ctl_pe5, drive_eqos_rx_ctl_pf2,
+                          drive_sdmmc3_dat3_pg5, drive_sdmmc3_dat2_pg4,
+                          drive_sdmmc3_dat1_pg3, drive_sdmmc3_dat0_pg2,
+                          drive_sdmmc3_cmd_pg1, drive_sdmmc3_clk_pg0,
+                          drive_qspi_io3_pr4, drive_qspi_io2_pr3,
+                          drive_qspi_io1_pr2, drive_qspi_io0_pr1,
+                          drive_qspi_sck_pr0, drive_qspi_cs_n_pr5,
+                          drive_gpio_wan8_ph3, drive_gpio_wan7_ph2,
+                          drive_gpio_wan6_ph1, drive_gpio_wan5_ph0,
+                          drive_uart2_tx_px0, drive_uart2_rx_px1,
+                          drive_uart2_rts_px2, drive_uart2_cts_px3,
+                          drive_uart5_rx_px5, drive_uart5_tx_px4,
+                          drive_uart5_rts_px6, drive_uart5_cts_px7,
+                          drive_gpio_mdm1_py0, drive_gpio_mdm2_py1,
+                          drive_gpio_mdm3_py2, drive_gpio_mdm4_py3,
+                          drive_gpio_mdm5_py4, drive_gpio_mdm6_py5,
+                          drive_gpio_mdm7_py6, drive_bcpu_pwr_req_ph4,
+                          drive_mcpu_pwr_req_ph5, drive_gpu_pwr_req_ph6,
+                          drive_gen7_i2c_scl_pl0, drive_gen7_i2c_sda_pl1,
+                          drive_gen9_i2c_sda_pl3, drive_gen9_i2c_scl_pl2,
+                          drive_usb_vbus_en0_pl4, drive_usb_vbus_en1_pl5,
+                          drive_gp_pwm7_pl7, drive_gp_pwm6_pl6,
+                          drive_ufs0_rst_pbb1, drive_ufs0_ref_clk_pbb0,
+                          drive_directdc_comp, drive_sdmmc1_comp,
+                          drive_eqos_comp, drive_sdmmc3_comp, drive_sdmmc4_clk,
+                          drive_sdmmc4_cmd, drive_sdmmc4_dqs,
+                          drive_sdmmc4_dat7, drive_sdmmc4_dat6,
+                          drive_sdmmc4_dat5, drive_sdmmc4_dat4,
+                          drive_sdmmc4_dat3, drive_sdmmc4_dat2,
+                          drive_sdmmc4_dat1, drive_sdmmc4_dat0,
+                          drive_qspi_comp ]
+
+  - if:
+      properties:
+        compatible:
+          const: nvidia,tegra186-pinmux-aon
+    then:
+      patternProperties:
+        "^pinmux(-[a-z0-9-]+)?$":
+          type: object
+          additionalProperties:
+            properties:
+              nvidia,pins:
+                items:
+                  enum: [ pwr_i2c_scl_ps0, pwr_i2c_sda_ps1, batt_oc_ps2,
+                          safe_state_ps3, vcomp_alert_ps4, gpio_dis0_pu0,
+                          gpio_dis1_pu1, gpio_dis2_pu2, gpio_dis3_pu3,
+                          gpio_dis4_pu4, gpio_dis5_pu5, gpio_sen0_pv0,
+                          gpio_sen1_pv1, gpio_sen2_pv2, gpio_sen3_pv3,
+                          gpio_sen4_pv4, gpio_sen5_pv5, gpio_sen6_pv6,
+                          gpio_sen7_pv7, gen8_i2c_scl_pw0, gen8_i2c_sda_pw1,
+                          uart3_tx_pw2, uart3_rx_pw3, uart3_rts_pw4,
+                          uart3_cts_pw5, uart7_tx_pw6, uart7_rx_pw7,
+                          can1_dout_pz0, can1_din_pz1, can0_dout_pz2,
+                          can0_din_pz3, can_gpio0_paa0, can_gpio1_paa1,
+                          can_gpio2_paa2, can_gpio3_paa3, can_gpio4_paa4,
+                          can_gpio5_paa5, can_gpio6_paa6, can_gpio7_paa7,
+                          gpio_sen8_pee0, gpio_sen9_pee1, touch_clk_pee2,
+                          power_on_pff0, gpio_sw1_pff1, gpio_sw2_pff2,
+                          gpio_sw3_pff3, gpio_sw4_pff4, shutdown, pmu_int,
+                          soc_pwr_req, clk_32k_in,
+                          # drive groups
+                          drive_touch_clk_pee2, drive_uart3_cts_pw5,
+                          drive_uart3_rts_pw4, drive_uart3_rx_pw3,
+                          drive_uart3_tx_pw2, drive_gen8_i2c_sda_pw1,
+                          drive_gen8_i2c_scl_pw0, drive_uart7_rx_pw7,
+                          drive_uart7_tx_pw6, drive_gpio_sen0_pv0,
+                          drive_gpio_sen1_pv1, drive_gpio_sen2_pv2,
+                          drive_gpio_sen3_pv3, drive_gpio_sen4_pv4,
+                          drive_gpio_sen5_pv5, drive_gpio_sen6_pv6,
+                          drive_gpio_sen7_pv7, drive_gpio_sen8_pee0,
+                          drive_gpio_sen9_pee1, drive_can_gpio7_paa7,
+                          drive_can1_dout_pz0, drive_can1_din_pz1,
+                          drive_can0_dout_pz2, drive_can0_din_pz3,
+                          drive_can_gpio0_paa0, drive_can_gpio1_paa1,
+                          drive_can_gpio2_paa2, drive_can_gpio3_paa3,
+                          drive_can_gpio4_paa4, drive_can_gpio5_paa5,
+                          drive_can_gpio6_paa6, drive_gpio_sw1_pff1,
+                          drive_gpio_sw2_pff2, drive_gpio_sw3_pff3,
+                          drive_gpio_sw4_pff4, drive_shutdown, drive_pmu_int,
+                          drive_safe_state_ps3, drive_vcomp_alert_ps4,
+                          drive_soc_pwr_req, drive_batt_oc_ps2,
+                          drive_clk_32k_in, drive_power_on_pff0,
+                          drive_pwr_i2c_scl_ps0, drive_pwr_i2c_sda_ps1,
+                          drive_gpio_dis0_pu0, drive_gpio_dis1_pu1,
+                          drive_gpio_dis2_pu2, drive_gpio_dis3_pu3,
+                          drive_gpio_dis4_pu4, drive_gpio_dis5_pu5 ]
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/pinctrl/pinctrl-tegra.h>
+
+    pinmux@2430000 {
+        compatible = "nvidia,tegra186-pinmux";
+        reg = <0x2430000 0x15000>;
+
+        pinctrl-names = "jetson_io";
+        pinctrl-0 = <&jetson_io_pinmux>;
+
+        jetson_io_pinmux: pinmux {
+            hdr40-pin7 {
+                nvidia,pins = "aud_mclk_pj4";
+                nvidia,function = "aud";
+                nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
+                nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+            };
+        };
+    };
+...
Signature · 1 line
2.49.0
maintainer Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: pinctrl: Document Tegra186 pin controllers

Quoted 8 lines · Aaron Kling

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

---
 .../bindings/pinctrl/nvidia,tegra186-pinmux.yaml   | 285 +++++++++++++++++++++
 1 file changed, 285 insertions(+)
#3 lore raw

PATCH v2 2/3 pinctrl: tegra: Add Tegra186 pinmux driver

In reply to Aaron Kling

This is based on Nvidia's downstream 5.10 driver, rewritten to match the mainline Tegra194 pinmux driver.

---
 drivers/pinctrl/tegra/Kconfig            |    4 +
 drivers/pinctrl/tegra/Makefile           |    1 +
 drivers/pinctrl/tegra/pinctrl-tegra186.c | 1784 ++++++++++++++++++++++++++++++
 drivers/soc/tegra/Kconfig                |    1 +
 4 files changed, 1790 insertions(+)
drivers/pinctrl/tegra/Kconfig +4 -0
index 4e87d19323ba88980e0cd1b1571c5e9414330172..660d101ea3679aac3370000e138c25a741252032 100644
@@ -24,6 +24,10 @@ config PINCTRL_TEGRA210
 	bool
 	select PINCTRL_TEGRA
 
+config PINCTRL_TEGRA186
+	bool
+	select PINCTRL_TEGRA
+
 config PINCTRL_TEGRA194
 	bool
 	select PINCTRL_TEGRA
drivers/pinctrl/tegra/Makefile +1 -0
index a93973701d4cced61cc806d70510218372959fed..82176526549e7d21ec1b86ad6403447332528696 100644
@@ -5,6 +5,7 @@ obj-$(CONFIG_PINCTRL_TEGRA30)		+= pinctrl-tegra30.o
 obj-$(CONFIG_PINCTRL_TEGRA114)		+= pinctrl-tegra114.o
 obj-$(CONFIG_PINCTRL_TEGRA124)		+= pinctrl-tegra124.o
 obj-$(CONFIG_PINCTRL_TEGRA210)		+= pinctrl-tegra210.o
+obj-$(CONFIG_PINCTRL_TEGRA186)		+= pinctrl-tegra186.o
 obj-$(CONFIG_PINCTRL_TEGRA194)		+= pinctrl-tegra194.o
 obj-$(CONFIG_PINCTRL_TEGRA234)		+= pinctrl-tegra234.o
 obj-$(CONFIG_PINCTRL_TEGRA_XUSB)	+= pinctrl-tegra-xusb.o
drivers/pinctrl/tegra/pinctrl-tegra186.c new file +1784 -0

1,784 lines not on this page · raw message

drivers/soc/tegra/Kconfig +1 -0
index 33512558af9f7f017a2aa286a3eacb142472f7e5..b5f674869fdb1126473f6b5efe04b344d24ff0ef 100644
@@ -96,6 +96,7 @@ config ARCH_TEGRA_210_SOC
 config ARCH_TEGRA_186_SOC
 	bool "NVIDIA Tegra186 SoC"
 	depends on !CPU_BIG_ENDIAN
+	select PINCTRL_TEGRA186
 	select MAILBOX
 	select TEGRA_BPMP
 	select TEGRA_HSP_MBOX
Signature · 1 line
2.49.0
#4 lore raw
Quoted 4 lines · On Sun, Jun 08, 2025 at 09:13:14PM -0500, Aaron Kling via B4 Relay wrote:

From: Aaron Kling <[email protected]>

This is based on Nvidia's downstream 5.10 driver, rewritten to match the mainline Tegra194 pinmux driver.

A few words upfront, to justify why I'm being pedantic. Originally the pinmux drivers were generated using the tegra-pinmux-scripts[0]. This project was later archived because Tegra210 was deemed to be the last chip to need a pin controller. It then turned out that Tegra194 needed pinmuxing for certain pins, and then more, so we ended up with a full pinmux driver for it. However, we also deemed Tegra194 to be an exception, so that's why that pinctrl driver was a one-off job.

I now regret these decisions because the same formatting mistakes are now proliferating, which is exactly what the scripts were meant to avoid.

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

If we really need this pinctrl driver it may be worth resurrecting the tegra-pinmux-scripts so that we can add these drivers based on the generated files as originally intended.

As announced, there's a few pedantic nitpicks down below.

[0]: https://github.com/NVIDIA/tegra-pinmux-scripts

[...]

Quoted 1 line
drivers/pinctrl/tegra/pinctrl-tegra186.c +0 -0

[...]

drivers/pinctrl/tegra/pinctrl-tegra186.c line 382

Quoted 6 lines
drivers/pinctrl/tegra/pinctrl-tegra186.c +6 -0
+static const unsigned int pex_l0_rst_n_pa0_pins[] = {
+	TEGRA_PIN_PEX_L0_RST_N_PA0,
+};
+static const unsigned int pex_l0_clkreq_n_pa1_pins[] = {
+	TEGRA_PIN_PEX_L0_CLKREQ_N_PA1,
+};

Typically there'd be a blank line to separate each of these structures. Or maybe we can come up with some notation to make these single lines?

Quoted 11 lines
drivers/pinctrl/tegra/pinctrl-tegra186.c +11 -0
+static const unsigned int sdmmc4_clk_pins[] = {};
+
+static const unsigned int sdmmc4_cmd_pins[] = {};
+
+static const unsigned int sdmmc4_dqs_pins[] = {};
+
+static const unsigned int sdmmc4_dat7_pins[] = {};
+
+static const unsigned int sdmmc4_dat6_pins[] = {};
+
+static const unsigned int sdmmc4_dat5_pins[] = {};

drivers/pinctrl/tegra/pinctrl-tegra186.c line 986

Quoted 10 lines
drivers/pinctrl/tegra/pinctrl-tegra186.c +10 -0
+
+static const unsigned int sdmmc4_dat4_pins[] = {};
+
+static const unsigned int sdmmc4_dat3_pins[] = {};
+
+static const unsigned int sdmmc4_dat2_pins[] = {};
+
+static const unsigned int sdmmc4_dat1_pins[] = {};
+
+static const unsigned int sdmmc4_dat0_pins[] = {};

These look out of place. Ideally these would simply be NULL and 0 in the respective PINGROUP definitions, but not sure if that's something that can be done with the preprocessor. Are these guaranteed not to take up any space in the generated binary?

[...]

drivers/pinctrl/tegra/pinctrl-tegra186.c line 1213

Quoted 4 lines
drivers/pinctrl/tegra/pinctrl-tegra186.c +4 -0
+#define PIN_PINGROUP_ENTRY_Y(r, bank, pupd, e_io_hv, e_lpbk, e_input,	\
+			     e_lpdr, e_pbias_buf, gpio_sfio_sel, \
+			     e_od, schmitt_b, drvtype, epreemp,	\
+			     io_reset, rfu_in)			\

It looks like there's an alignment issue in this macro.

drivers/pinctrl/tegra/pinctrl-tegra186.c line 1456

Quoted 12 lines
drivers/pinctrl/tegra/pinctrl-tegra186.c +12 -0
+#define PINGROUP(pg_name, f0, f1, f2, f3, r, bank, pupd, e_io_hv, e_lpbk, e_input, e_lpdr, e_pbias_buf, \
+			gpio_sfio_sel, e_od, schmitt_b, drvtype, epreemp, io_reset, rfu_in)		\
+	{							\
+		.name = #pg_name,				\
+		.pins = pg_name##_pins,				\
+		.npins = ARRAY_SIZE(pg_name##_pins),		\
+			.funcs = {				\
+				TEGRA_MUX_##f0,			\
+				TEGRA_MUX_##f1,			\
+				TEGRA_MUX_##f2,			\
+				TEGRA_MUX_##f3,			\
+			},					\

This .funcs substructure seems to be indented wrongly. I see that that's also the case for Tegra194, but it's correct on Tegra210, so it looks like you copied from the wrong source. =)

Thierry

#5 lore raw
Quoted 8 lines · Thierry Reding
Quoted 4 lines · On Sun, Jun 08, 2025 at 09:13:14PM -0500, Aaron Kling via B4 Relay wrote:

From: Aaron Kling <[email protected]>

This is based on Nvidia's downstream 5.10 driver, rewritten to match the mainline Tegra194 pinmux driver.

A few words upfront, to justify why I'm being pedantic. Originally the

I don't mind pedantic. Get it right the first time, save later pain.

Quoted 6 lines

pinmux drivers were generated using the tegra-pinmux-scripts[0]. This project was later archived because Tegra210 was deemed to be the last chip to need a pin controller. It then turned out that Tegra194 needed pinmuxing for certain pins, and then more, so we ended up with a full pinmux driver for it. However, we also deemed Tegra194 to be an exception, so that's why that pinctrl driver was a one-off job.

Tegra234 also has a pinctrl driver, which makes tegra186 the exception, when looking at the driver list without any other context.

Quoted 11 lines

I now regret these decisions because the same formatting mistakes are now proliferating, which is exactly what the scripts were meant to avoid.

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

I have a device that's based on p3509+p3636 with an audio codec, originally targeting l4t r32. The odm provided instructions to use the codec was to first run the jetson pinmux python script after boot... I made that less bad by putting the pinmux in the kernel dt. But I see similar recommendations all over the nvidia dev forums, even for t194 and t234. Solely for that reason, I'd think it reasonable to support the kernel pinmux driver on all tegra platforms: to allow easier porting of l4t devices. And a secondary argument could be made for the
devkits: they have expansion headers with mux-able pins, prototyping / experimenting with those at runtime via sysfs is a valid use case.

Taking a look through the public cboot sources for t186, I'm not seeing that it handles pinmux at all. With one or two exceptions like the t194 pcie stuff. How is it expected to configure pinmux at the bootloader level? Using the auto-generated mb1 flash config? I'm unaware of this being publicly documented anywhere, not just for t186 but for any tegra arch. And the format of those aren't particularly easy to read and hand modify.

Quoted 4 lines

If we really need this pinctrl driver it may be worth resurrecting the tegra-pinmux-scripts so that we can add these drivers based on the generated files as originally intended.

Imo, this would be ideal. That will require some updates to the scripts to handle the main/aon split. I don't think it's something that can be done externally either as it depends on the internal only pinmux spreadsheets as the starting point for a soc or device. But if that's done, all the format issues will be sidestepped and this series will be superseded.

Sincerely,
Aaron Kling

#6 lore raw
In reply to Thierry Reding
Quoted 6 lines · Thierry Reding

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

Actually, speaking as the maintainer of pin control I hear the following a lot:

- We don't need pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, static set-up should be enough

These are all enthusiastic estimates, but in practice, for any successful SoC we always need pin control. Either the BIOS firmware authors got things wrong or made errors (bugs) and there is no path to upgrade the firmware safely, or runtime usecases appear that no-one ever thought about.

Aarons case looks like that latter.

I think it'd be wise to send the message to any SoC system architects (or Linux base port overseer or whatever title this person may have) that a pin control driver is usually needed.

The SCMI people heard the message and have added pin control into the specification for that firmware interface.

Yours,
Linus Walleij

#7 lore raw
Quoted 19 lines · Linus Walleij
Quoted 6 lines · Thierry Reding

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

Actually, speaking as the maintainer of pin control I hear the following a lot:

- We don't need pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, static set-up should be enough

Quoted 7 lines

These are all enthusiastic estimates, but in practice, for any successful SoC we always need pin control. Either the BIOS firmware authors got things wrong or made errors (bugs) and there is no path to upgrade the firmware safely, or runtime usecases appear that no-one ever thought about.

Aarons case looks like that latter.

This was a long time ago now, but I have a vague recollection about hardware engineers telling software engineers that muxing pins dynamically at runtime wasn't safe for all pins and hence we had to do static configuration during early boot.

But then along came devkits with expansion headers and then people started using scripts to mux pins to the right functions and such.

Quoted 7 lines

I think it'd be wise to send the message to any SoC system architects (or Linux base port overseer or whatever title this person may have) that a pin control driver is usually needed.

The SCMI people heard the message and have added pin control into the specification for that firmware interface.

I'd agree with you that there's plenty of evidence that we need these drivers, so maybe I need to go back and look at what exactly the risks are that come with this and maybe there's something we need to do to avoid that (I'm thinking along the lines of certain pins being generally safe to mux at runtime, but not all).

Thierry

#8 lore raw
Quoted 45 lines · Thierry Reding
Quoted 19 lines · Linus Walleij
Quoted 6 lines · Thierry Reding

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

Actually, speaking as the maintainer of pin control I hear the following a lot:

- We don't need pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, static set-up should be enough

Quoted 7 lines

These are all enthusiastic estimates, but in practice, for any successful SoC we always need pin control. Either the BIOS firmware authors got things wrong or made errors (bugs) and there is no path to upgrade the firmware safely, or runtime usecases appear that no-one ever thought about.

Aarons case looks like that latter.

This was a long time ago now, but I have a vague recollection about hardware engineers telling software engineers that muxing pins dynamically at runtime wasn't safe for all pins and hence we had to do static configuration during early boot.

But then along came devkits with expansion headers and then people started using scripts to mux pins to the right functions and such.

Quoted 7 lines

I think it'd be wise to send the message to any SoC system architects (or Linux base port overseer or whatever title this person may have) that a pin control driver is usually needed.

The SCMI people heard the message and have added pin control into the specification for that firmware interface.

Quoted 7 lines

I'd agree with you that there's plenty of evidence that we need these drivers, so maybe I need to go back and look at what exactly the risks are that come with this and maybe there's something we need to do to avoid that (I'm thinking along the lines of certain pins being generally safe to mux at runtime, but not all).

Thierry

So what's the path forward on this? Will this series be used, or is Nvidia going to bring back the pinmux scripts and regenerate everything in a new series?

Aaron

#9 lore raw
Quoted 53 lines · Aaron Kling
Quoted 51 lines · Thierry Reding
Quoted 19 lines · Linus Walleij
Quoted 6 lines · Thierry Reding

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

Actually, speaking as the maintainer of pin control I hear the following a lot:

- We don't need pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, static set-up should be enough

Quoted 7 lines

These are all enthusiastic estimates, but in practice, for any successful SoC we always need pin control. Either the BIOS firmware authors got things wrong or made errors (bugs) and there is no path to upgrade the firmware safely, or runtime usecases appear that no-one ever thought about.

Aarons case looks like that latter.

This was a long time ago now, but I have a vague recollection about hardware engineers telling software engineers that muxing pins dynamically at runtime wasn't safe for all pins and hence we had to do static configuration during early boot.

But then along came devkits with expansion headers and then people started using scripts to mux pins to the right functions and such.

Quoted 7 lines

I think it'd be wise to send the message to any SoC system architects (or Linux base port overseer or whatever title this person may have) that a pin control driver is usually needed.

The SCMI people heard the message and have added pin control into the specification for that firmware interface.

I'd agree with you that there's plenty of evidence that we need these drivers, so maybe I need to go back and look at what exactly the risks are that come with this and maybe there's something we need to do to avoid that (I'm thinking along the lines of certain pins being generally safe to mux at runtime, but not all).

Quoted 5 lines
Quoted 1 line

Thierry

So what's the path forward on this? Will this series be used, or is Nvidia going to bring back the pinmux scripts and regenerate everything in a new series?

Let's bring back the pinmux scripts. I don't have much time to look into this right now. If you have some spare cycles to take a stab, that'd be great.

For most of these newer chips it should be far less work to get this going because we really only need the SoC bits, for which all of the information is available. For earlier chips where all of the default configuration had to be done by Linux there was a lot more generation needed, but newer chips do all of the default settings in early firmware, so we don't need a whole lot of pinmuxing in DT, only where it deviates from the defaults.

Thierry

#10 lore raw
Quoted 65 lines · Thierry Reding
Quoted 53 lines · Aaron Kling
Quoted 51 lines · Thierry Reding
Quoted 19 lines · Linus Walleij
Quoted 6 lines · Thierry Reding

One thing that's not clear from this patch set is whether we actually need the Tegra186 pinmux driver, or you're only adding it because it happens to be present in a 5.10 downstream driver. Do you actually have a requirement for setting pins dynamically at runtime? Do you need to be able to set a static configuration at boot that can't be set using some earlier bootloader/firmware mechanism?

Actually, speaking as the maintainer of pin control I hear the following a lot:

- We don't need pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, the BIOS/firmware deals with it
- We don't need runtime pin control, static set-up should be enough

Quoted 7 lines

These are all enthusiastic estimates, but in practice, for any successful SoC we always need pin control. Either the BIOS firmware authors got things wrong or made errors (bugs) and there is no path to upgrade the firmware safely, or runtime usecases appear that no-one ever thought about.

Aarons case looks like that latter.

This was a long time ago now, but I have a vague recollection about hardware engineers telling software engineers that muxing pins dynamically at runtime wasn't safe for all pins and hence we had to do static configuration during early boot.

But then along came devkits with expansion headers and then people started using scripts to mux pins to the right functions and such.

Quoted 7 lines

I think it'd be wise to send the message to any SoC system architects (or Linux base port overseer or whatever title this person may have) that a pin control driver is usually needed.

The SCMI people heard the message and have added pin control into the specification for that firmware interface.

I'd agree with you that there's plenty of evidence that we need these drivers, so maybe I need to go back and look at what exactly the risks are that come with this and maybe there's something we need to do to avoid that (I'm thinking along the lines of certain pins being generally safe to mux at runtime, but not all).

Quoted 5 lines
Quoted 1 line

Thierry

So what's the path forward on this? Will this series be used, or is Nvidia going to bring back the pinmux scripts and regenerate everything in a new series?

Let's bring back the pinmux scripts. I don't have much time to look into this right now. If you have some spare cycles to take a stab, that'd be great.

Quoted 7 lines

For most of these newer chips it should be far less work to get this going because we really only need the SoC bits, for which all of the information is available. For earlier chips where all of the default configuration had to be done by Linux there was a lot more generation needed, but newer chips do all of the default settings in early firmware, so we don't need a whole lot of pinmuxing in DT, only where it deviates from the defaults.

I started looking at the pinmux scripts a few days ago, but updating the pinmux driver import/export for the t194 style spiderwebbed out of control quickly. I expected it to be hairy, but that was an underestimation. Doesn't help that I'm not the most proficient at python either. I'll continue the effort later, but if someone with more familiarity wants to try, it might be quicker.

Aaron

#11 lore raw
Quoted 6 lines · Aaron Kling

I started looking at the pinmux scripts a few days ago, but updating the pinmux driver import/export for the t194 style spiderwebbed out of control quickly. I expected it to be hairy, but that was an underestimation. Doesn't help that I'm not the most proficient at python either. I'll continue the effort later, but if someone with more familiarity wants to try, it might be quicker.

If this means people with 186 dev boards cannot use mainline Linux and they would if this driver was applied, maybe we need to apply it anyways?

Yours,
Linus Walleij

#12 lore raw
Quoted 10 lines · Linus Walleij
Quoted 6 lines · Aaron Kling

I started looking at the pinmux scripts a few days ago, but updating the pinmux driver import/export for the t194 style spiderwebbed out of control quickly. I expected it to be hairy, but that was an underestimation. Doesn't help that I'm not the most proficient at python either. I'll continue the effort later, but if someone with more familiarity wants to try, it might be quicker.

Quoted 3 lines

If this means people with 186 dev boards cannot use mainline Linux and they would if this driver was applied, maybe we need to apply it anyways?

I wouldn't call t186 unusable without it. The devkits work fine without kernel pinmuxing as the bootloader configures everything to a reasonable default. It's only if something non-standard (for example, an audio codec) is plugged into one of the expansion headers that runtime configuration could be needed. However, I do agree that it would be worthwhile to move this forward for merging. Since it is unlikely I will get the generation script to a usable state soon. If Thierry or one of the other tegra maintainers agrees, I can start addressing the review comments and send a new revision.

Aaron

#13 lore raw
Quoted 15 lines · Aaron Kling
Quoted 10 lines · Linus Walleij
Quoted 6 lines · Aaron Kling

I started looking at the pinmux scripts a few days ago, but updating the pinmux driver import/export for the t194 style spiderwebbed out of control quickly. I expected it to be hairy, but that was an underestimation. Doesn't help that I'm not the most proficient at python either. I'll continue the effort later, but if someone with more familiarity wants to try, it might be quicker.

Quoted 3 lines

If this means people with 186 dev boards cannot use mainline Linux and they would if this driver was applied, maybe we need to apply it anyways?

Quoted 9 lines

I wouldn't call t186 unusable without it. The devkits work fine without kernel pinmuxing as the bootloader configures everything to a reasonable default. It's only if something non-standard (for example, an audio codec) is plugged into one of the expansion headers that runtime configuration could be needed. However, I do agree that it would be worthwhile to move this forward for merging. Since it is unlikely I will get the generation script to a usable state soon. If Thierry or one of the other tegra maintainers agrees, I can start addressing the review comments and send a new revision.

Alright then. Looks like we can't find anybody willing to work on those scripts and it sounds like I'm one of very few that thinks there's still some worth to them in this day.

Can you make a pass over the driver and make sure we have sufficient spacing (last time I looked the various tables in this driver were all very clustered together, so a few blank lines here and there would go a long way to make things more readable), consistent indentation and such?

Thanks,
Thierry

#14 lore raw

PATCH v2 3/3 arm64: tegra: Add Tegra186 pin controllers

In reply to Aaron Kling

Add the device tree nodes for the MAIN and AON pin controllers found on the Tegra186 family of SoCs.

---
 arch/arm64/boot/dts/nvidia/tegra186.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +12 -0
index 5778c93af3e6e72f5f14a9fcee1e7abf80d2d2c5..66fdcec17073a0954b3bf600588324e4c047d0bf 100644
@@ -36,6 +36,12 @@ gpio: gpio@2200000 {
 		interrupt-controller;
 		#gpio-cells = <2>;
 		gpio-controller;
+		gpio-ranges = <&pinmux 0 0 140>;
+	};
+
+	pinmux: pinmux@2430000 {
+		compatible = "nvidia,tegra186-pinmux";
+		reg = <0x0 0x2430000 0x0 0x15000>;
 	};
 
 	ethernet@2490000 {
@@ -1274,10 +1280,16 @@ gpio_aon: gpio@c2f0000 {
 		interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
 		gpio-controller;
 		#gpio-cells = <2>;
+		gpio-ranges = <&pinmux_aon 0 0 47>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
 	};
 
+	pinmux_aon: pinmux@c300000 {
+		compatible = "nvidia,tegra186-pinmux-aon";
+		reg = <0x0 0xc300000 0x0 0x4000>;
+	};
+
 	pwm4: pwm@c340000 {
 		compatible = "nvidia,tegra186-pwm";
 		reg = <0x0 0xc340000 0x0 0x10000>;
Signature · 1 line
2.49.0