Add Tegra268 pinmux support
Subsystems (4)
v3 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 v3:
- Rebased on next-20261111.
- soc/tegra: Drop "depends on !CPU_BIG_ENDIAN", which has been removed from the other Tegra SoC symbols now that arm64 no longer supports big-endian kernels.
- dt-bindings: Drop the explanatory comment from the common binding (Rob).
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.
v2: https://lore.kernel.org/all/[email protected]/
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 | 64 + .../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 | 8 + 8 files changed, 2115 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: aaa2f954c21b205a0bcd0961e5b2be4e82e58455
Signature · 1 line
2.43.0
PATCH v3 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 | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/soc/tegra/Kconfig +8 -0
@@ -153,6 +153,14 @@ 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 + select MAILBOX + select SOC_TEGRA_PMC + help + Enable support for the NVIDIA Tegra268 SoC. + endif endif
Signature · 1 line
2.43.0
PATCH v3 2/3 dt-bindings: pinctrl: Document Tegra268 pin controllers
In reply to Prateek AgarwalFrom: 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 | 64 +++++++++ .../pinctrl/nvidia,tegra268-pinmux-main.yaml | 136 ++++++++++++++++++ .../pinctrl/nvidia,tegra268-pinmux-uphy.yaml | 75 ++++++++++ 4 files changed, 353 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
@@ -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 +64 -0
64 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.43.0
PATCH v3 3/3 pinctrl: tegra: Add support for Tegra268
In reply to Prateek AgarwalFrom: 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
@@ -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
@@ -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.43.0
[email protected]
AI reviewRe: [PATCH v3 3/3] pinctrl: tegra: Add support for Tegra268
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] pinctrl: tegra: PIN_PINGROUP_ENTRY_Y hardcodes rcv_sel_bit to -1 on Tegra268 --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] pinctrl: tegra: PIN_PINGROUP_ENTRY_Y hardcodes rcv_sel_bit to -1 on Tegra268
--
commit 504e6b9e2c6aa5bbd3e59fd78e4ff51426a7e008
Author: Prathamesh Shete <[email protected]>
pinctrl: tegra: Add support for Tegra268
This commit adds the pinctrl driver for NVIDIA Tegra268 supporting the MAIN, AON, and UPHY pin controllers.
Quoted 5 lines
drivers/pinctrl/tegra/pinctrl-tegra268.c new file +0
-0
[ ... ]
drivers/pinctrl/tegra/pinctrl-tegra268.c line 1322
Quoted 10 lines
drivers/pinctrl/tegra/pinctrl-tegra268.c new file +10
-0+#define PIN_PINGROUP_ENTRY_Y (r, bank, pupd, e_io_hv, e_lpbk, e_input, \ + e_lpdr, e_pbias_buf, gpio_sfio_sel, \ + schmitt_b) \ + .mux_reg = PINGROUP_REG_Y(r), \ + .lpmd_bit = -1, \ + .lock_bit = -1, \ + .hsm_bit = -1, \ + .odrain_bit = -1, \ + .ioreset_bit = -1, \ + .rcv_sel_bit = -1, \
[Severity: Medium]
Should PIN_PINGROUP_ENTRY_Y set .rcv_sel_bit = e_io_hv instead of -1?
Every PINGROUP entry passes bit 5 for e_io_hv, and cfg_params[] in drivers/pinctrl/tegra/pinctrl-tegra.c maps "nvidia,io-hv" to TEGRA_PINCONF_PARAM_RCV_SEL, which tegra_pinconf_reg() resolves via g->rcv_sel_bit. Leaving .rcv_sel_bit hardcoded to -1 causes tegra_pinconf_reg() to return -ENOTSUPP whenever a Device Tree uses nvidia,io-hv.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3