arm64: dts: ti: k3-pinctrl: Add virtual GPIO select mux macros
Subsystems (2)
PATCH v2 1/1 arm64: dts: ti: k3-pinctrl: Add virtual GPIO select mux macros
Add virtual GPIO select mux macros for configuring the vgpio_sel field in pad configuration registers. This field selects GPIO controller routing. The meaning of each value is SoC-specific - refer to the Technical Reference Manual for the specific SoC.
For example, on AM62L, values 0 and 1 select GPIO banks 0 and 2 respectively, while on J784S4, values 0-3 select different GPIO controller pairs based on the pin. Pad configuration register field details can be found in each SoC's Technical Reference Manual (example: section 14.2.1.2.1 of [1]).
[1] AM62L TRM: https://www.ti.com/lit/ug/sprujb4a/sprujb4a.pdf
---
Changes in v2:
- Add all four PIN_VGPIO_SEL[0-3] macros instead of just two
- Use generic value-based naming to support all K3 SoCs
- Update commit message to clarify SoC-specific behavior
- Link to v1: https://lore.kernel.org/all/[email protected]/
--- arch/arm64/boot/dts/ti/k3-pinctrl.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-pinctrl.h +7 -1
@@ -3,11 +3,12 @@* This header provides constants for pinctrl bindings for TI's K3 SoC * family. * -* Copyright (C) 2018-2025 Texas Instruments Incorporated - https://www.ti.com/ +* Copyright (C) 2018-2026 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef DTS_ARM64_TI_K3_PINCTRL_H #define DTS_ARM64_TI_K3_PINCTRL_H +#define VGPIO_SEL_SHIFT (4)#define WKUP_LVL_EN_SHIFT (7)#define WKUP_LVL_POL_SHIFT (8)#define DEBOUNCE_SHIFT (11)
@@ -111,6 +112,11 @@#define PIN_WKUP_EN_LEVEL_HIGH (WKUP_ENABLE | WKUP_ON_LEVEL | WKUP_LEVEL_HIGH)#define PIN_WKUP_EN (WKUP_ENABLE | WKUP_ON_EDGE) +#define PIN_VGPIO_SEL0 (0 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL1 (1 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL2 (2 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL3 (3 << VGPIO_SEL_SHIFT) +/* Default mux configuration for gpio-ranges to use with pinctrl */ #define PIN_GPIO_RANGE_IOPAD (PIN_INPUT | 7)
Signature · 1 line
2.34.1
Nishanth Menon
maintainerQuoted 31 lines · Akashdeep Kaur
Add virtual GPIO select mux macros for configuring the
vgpio_selfield in pad configuration registers. This field selects GPIO controller routing. The meaning of each value is SoC-specific - refer to the Technical Reference Manual for the specific SoC.For example, on AM62L, values 0 and 1 select GPIO banks 0 and 2 respectively, while on J784S4, values 0-3 select different GPIO controller pairs based on the pin. Pad configuration register field details can be found in each SoC's Technical Reference Manual (example: section 14.2.1.2.1 of [1]).
[1] AM62L TRM: https://www.ti.com/lit/ug/sprujb4a/sprujb4a.pdf
Signed-off-by Akashdeep Kaur <[email protected]>---
Changes in v2:
- Add all four PIN_VGPIO_SEL[0-3] macros instead of just two
- Use generic value-based naming to support all K3 SoCs
- Update commit message to clarify SoC-specific behavior
- Link to v1: https://lore.kernel.org/all/[email protected]/--- arch/arm64/boot/dts/ti/k3-pinctrl.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)arch/arm64/boot/dts/ti/k3-pinctrl.h +0
-0
arch/arm64/boot/dts/ti/k3-pinctrl.h line 6
Quoted 5 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +1
-1@@ -3,11 +3,12 @@* This header provides constants for pinctrl bindings for TI's K3 SoC * family. * -* Copyright (C) 2018-2025 Texas Instruments Incorporated - https://www.ti.com/ +* Copyright (C) 2018-2026 Texas Instruments Incorporated - https://www.ti.com/
Drop this for trivial changes.
arch/arm64/boot/dts/ti/k3-pinctrl.h line 11
Quoted 5 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +1
-0*/ #ifndef DTS_ARM64_TI_K3_PINCTRL_H #define DTS_ARM64_TI_K3_PINCTRL_H +#define VGPIO_SEL_SHIFT (4)
Tabs like the rest of the macros? I assume checkpatch --strict didn't catch this?
Did you check *all* k3 devices to ensure the offset is the same for all K3? in the next revision, please add that audit in the diffstat section.
arch/arm64/boot/dts/ti/k3-pinctrl.h line 118
Quoted 11 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +4
-0#define WKUP_LVL_EN_SHIFT (7)#define WKUP_LVL_POL_SHIFT (8)#define DEBOUNCE_SHIFT (11)@@ -111,6 +112,11 @@#define PIN_WKUP_EN_LEVEL_HIGH (WKUP_ENABLE | WKUP_ON_LEVEL | WKUP_LEVEL_HIGH)#define PIN_WKUP_EN (WKUP_ENABLE | WKUP_ON_EDGE) +#define PIN_VGPIO_SEL0 (0 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL1 (1 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL2 (2 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL3 (3 << VGPIO_SEL_SHIFT)
Same - use tabs (consistent with rest of the file) - also add a comment above these to indicate the user should read the trm corresponding to the SoC for the meaning of the values - people are not going to do git log to know these values should be selected carefully based on SoC (same value means different things on different SoCs).
Quoted 7 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +1
-0+/* Default mux configuration for gpio-ranges to use with pinctrl */ #define PIN_GPIO_RANGE_IOPAD (PIN_INPUT | 7)Signature · 1 line
2.34.1
Signature · 4 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D https://ti.com/opensource
Hi Nishanth,
Quoted 2 lines · Nishanth Menon
Quoted 1 line · Akashdeep Kaur
Add virtual GPIO select mux macros for configuring the
vgpio_sel
...
Quoted 8 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h line 6
Quoted 6 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +1
-1@@ -3,11 +3,12 @@* This header provides constants for pinctrl bindings for TI's K3 SoC * family. * -* Copyright (C) 2018-2025 Texas Instruments Incorporated - https://www.ti.com/ +* Copyright (C) 2018-2026 Texas Instruments Incorporated - https://www.ti.com/ Drop this for trivial changes.
Done
Quoted 11 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h line 11
Quoted 6 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +1
-0*/ #ifndef DTS_ARM64_TI_K3_PINCTRL_H #define DTS_ARM64_TI_K3_PINCTRL_H +#define VGPIO_SEL_SHIFT (4)Tabs like the rest of the macros? I assume checkpatch --strict didn't catch this?
Did you check *all* k3 devices to ensure the offset is the same for all K3? in the next revision, please add that audit in the diffstat section.
Published the audit findings in the diffstat section of v3. No, --strict did not catch this. Thanks for the catch! Fixed
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +0
-0#define WKUP_LVL_EN_SHIFT (7)#define WKUP_LVL_POL_SHIFT (8)#define DEBOUNCE_SHIFT (11)@@ -111,6 +112,11 @@#define PIN_WKUP_EN_LEVEL_HIGH (WKUP_ENABLE | WKUP_ON_LEVEL | WKUP_LEVEL_HIGH)#define PIN_WKUP_EN (WKUP_ENABLE | WKUP_ON_EDGE)
Quoted 11 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h line 118
Quoted 4 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +4
-0+#define PIN_VGPIO_SEL0 (0 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL1 (1 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL2 (2 << VGPIO_SEL_SHIFT) +#define PIN_VGPIO_SEL3 (3 << VGPIO_SEL_SHIFT)Same - use tabs (consistent with rest of the file) - also add a comment above these to indicate the user should read the trm corresponding to the SoC for the meaning of the values - people are not going to do git log to know these values should be selected carefully based on SoC (same value means different things on different SoCs).
Added a comment above as recommended. Fixed to use tabs.
Quoted 9 lines
Quoted 8 lines
arch/arm64/boot/dts/ti/k3-pinctrl.h +1
-0+/* Default mux configuration for gpio-ranges to use with pinctrl */ #define PIN_GPIO_RANGE_IOPAD (PIN_INPUT | 7)Signature · 1 line
2.34.1
Thanks and Regards,
Akashdeep Kaur