* [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties
@ 2024-06-27 16:25 Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode Nishanth Menon
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Nishanth Menon @ 2024-06-27 16:25 UTC (permalink / raw)
To: Conor Dooley, Krzysztof Kozlowski, Rob Herring, Vignesh Raghavendra
Cc: linux-kernel, devicetree, linux-arm-kernel, Tero Kristo,
Vaishnav Achath, Jared McArthur, Bryan Brattlof, Dhruva Gole,
Nishanth Menon
Hi,
This series was tested on BeagleY-AI[1] using the script[2].
This allows gpiod to request for a gpio that is not in the default GPIO
mux mode and the framework controls the mux over to required GPIO mode.
The series is based off next-20240617.
NOTE: there is also a dtb_warning that is added, The fix for which is in
the binding[3].
Changes since V1:
- Mux definition PIN_GPIO_RANGE_IOPAD instead of PIN_GPIO_MUX_MODE
- Refactored on top of next-20240626
- Note: since the patches have changed, I have skipped Dhruva's
reviewed-by
V1: https://lore.kernel.org/linux-arm-kernel/20240618173123.2592074-1-nm@ti.com/
Jared McArthur (1):
arm64: dts: ti: k3-j722s: Add gpio-ranges properties
Nishanth Menon (2):
arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode
arm64: dts: ti: k3-am62p: Add gpio-ranges properties
.../boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi | 8 ++++++++
arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 17 +++++++++++++++++
arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 18 ++++++++++++++++++
arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
4 files changed, 46 insertions(+)
base-commit: df9574a57d02b265322e77fb8628d4d33641dda9
[1] https://www.beagleboard.org/boards/beagley-ai
[2] https://gist.github.com/nmenon/4973770cf0df3f02c2e4f7f3d048d80d
[3] https://lore.kernel.org/linux-arm-kernel/20240627150610.469645-1-nm@ti.com/
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2 1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode
2024-06-27 16:25 [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties Nishanth Menon
@ 2024-06-27 16:25 ` Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties Nishanth Menon
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2024-06-27 16:25 UTC (permalink / raw)
To: Conor Dooley, Krzysztof Kozlowski, Rob Herring, Vignesh Raghavendra
Cc: linux-kernel, devicetree, linux-arm-kernel, Tero Kristo,
Vaishnav Achath, Jared McArthur, Bryan Brattlof, Dhruva Gole,
Nishanth Menon
Introduce a GPIO mux mode macro for easier readability. All K3 devices
use mux mode 7 to switch to GPIO mux and this allows the gpio-ranges to
be defined for pinctrl-single clearly.
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V1:
- Mux definition PIN_GPIO_RANGE_IOPAD instead of PIN_GPIO_MUX_MODE
- Added documentation as well to clarify the usage.
V1: https://lore.kernel.org/linux-arm-kernel/20240618173123.2592074-2-nm@ti.com/
arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
index 4cd2df467d0b..22b8d73cfd32 100644
--- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
+++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
@@ -38,6 +38,9 @@
#define PIN_DEBOUNCE_CONF5 (5 << DEBOUNCE_SHIFT)
#define PIN_DEBOUNCE_CONF6 (6 << DEBOUNCE_SHIFT)
+/* Default mux configuration for gpio-ranges to use with pinctrl */
+#define PIN_GPIO_RANGE_IOPAD (PIN_INPUT | 7)
+
#define AM62AX_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode))
#define AM62AX_MCU_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode))
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2 2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties
2024-06-27 16:25 [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode Nishanth Menon
@ 2024-06-27 16:25 ` Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 3/3] arm64: dts: ti: k3-j722s: " Nishanth Menon
2024-07-03 4:35 ` [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: " Vignesh Raghavendra
3 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2024-06-27 16:25 UTC (permalink / raw)
To: Conor Dooley, Krzysztof Kozlowski, Rob Herring, Vignesh Raghavendra
Cc: linux-kernel, devicetree, linux-arm-kernel, Tero Kristo,
Vaishnav Achath, Jared McArthur, Bryan Brattlof, Dhruva Gole,
Nishanth Menon
On the AM62P platform we have no single 1:1 relation regarding index
of GPIO and pin controller. The GPIOs and pin controller registers
have mapping and holes in the map. These have been extracted from the
AM62P data sheet.
MCU pinctrl definition is shared as it is common between AM62P and
J722S, but that is not the case for main domain.
Ref: AM62P Data sheet https://www.ti.com/lit/gpn/am62p
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V1:
- Use PIN_GPIO_RANGE_IOPAD instead of PIN_GPIO_MUX_MODE
- Refactored on top of next-20240626 (new common files)
- Since the patch had to be refactored as well as new define used, I
have skipped picking up Dhruva's Reviewed-by.
V1: https://lore.kernel.org/linux-arm-kernel/20240618173123.2592074-3-nm@ti.com/
.../boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi | 8 ++++++++
arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 17 +++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi
index 1d4e5fc8b4e0..e65db6ce02bf 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi
@@ -12,7 +12,15 @@ mcu_pmx0: pinctrl@4084000 {
#pinctrl-cells = <1>;
pinctrl-single,register-width = <32>;
pinctrl-single,function-mask = <0xffffffff>;
+ pinctrl-single,gpio-range =
+ <&mcu_pmx_range 0 21 PIN_GPIO_RANGE_IOPAD>,
+ <&mcu_pmx_range 23 1 PIN_GPIO_RANGE_IOPAD>,
+ <&mcu_pmx_range 32 2 PIN_GPIO_RANGE_IOPAD>;
bootph-all;
+
+ mcu_pmx_range: gpio-range {
+ #pinctrl-single,gpio-range-cells = <3>;
+ };
};
mcu_esm: esm@4100000 {
diff --git a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
index f8a7f0cbd327..57383bd2eaeb 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
@@ -42,10 +42,27 @@ &inta_main_dmss {
ti,interrupt-ranges = <5 69 35>;
};
+&main_pmx0 {
+ pinctrl-single,gpio-range =
+ <&main_pmx0_range 0 32 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 33 92 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 137 5 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 143 3 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 149 2 PIN_GPIO_RANGE_IOPAD>;
+
+ main_pmx0_range: gpio-range {
+ #pinctrl-single,gpio-range-cells = <3>;
+ };
+};
+
&main_gpio0 {
+ gpio-ranges = <&main_pmx0 0 0 32>, <&main_pmx0 32 33 38>,
+ <&main_pmx0 70 72 22>;
ti,ngpio = <92>;
};
&main_gpio1 {
+ gpio-ranges = <&main_pmx0 0 94 32>, <&main_pmx0 42 137 5>,
+ <&main_pmx0 47 143 3>, <&main_pmx0 50 149 2>;
ti,ngpio = <52>;
};
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2 3/3] arm64: dts: ti: k3-j722s: Add gpio-ranges properties
2024-06-27 16:25 [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties Nishanth Menon
@ 2024-06-27 16:25 ` Nishanth Menon
2024-07-03 4:35 ` [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: " Vignesh Raghavendra
3 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2024-06-27 16:25 UTC (permalink / raw)
To: Conor Dooley, Krzysztof Kozlowski, Rob Herring, Vignesh Raghavendra
Cc: linux-kernel, devicetree, linux-arm-kernel, Tero Kristo,
Vaishnav Achath, Jared McArthur, Bryan Brattlof, Dhruva Gole,
Nishanth Menon
From: Jared McArthur <j-mcarthur@ti.com>
The AM67A/J722S/TDA4AEN platform is a derivative of AM62P platform
and we have no single 1:1 relation regarding index of GPIO and pin
controller. The GPIOs and pin controller registers have mapping and
holes in the map. These have been extracted from the J722S data
sheet. The MCU mapping is carried forward as is with J722S, however the
main GPIO block has differences that needs to be accounted for.
Mux mode input is selected as it is bi-directional. In case a specific
pull type or a specific pin level drive setting is desired, the board
device tree files will have to explicitly mux those pins for the GPIO
with the desired setting.
Ref: J722S Data sheet https://www.ti.com/lit/gpn/tda4aen-q1
Signed-off-by: Jared McArthur <j-mcarthur@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Changes since V1:
- Use PIN_GPIO_RANGE_IOPAD instead of PIN_GPIO_MUX_MODE
- Refactored on top of next-20240626 (refactored files)
V1: https://lore.kernel.org/linux-arm-kernel/20240618173123.2592074-4-nm@ti.com/
arch/arm64/boot/dts/ti/k3-j722s-main.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
index 228c6c89245c..28aac43aae45 100644
--- a/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j722s-main.dtsi
@@ -181,10 +181,28 @@ &inta_main_dmss {
ti,interrupt-ranges = <7 71 21>;
};
+&main_pmx0 {
+ pinctrl-single,gpio-range =
+ <&main_pmx0_range 0 32 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 33 55 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 101 25 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 137 5 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 143 3 PIN_GPIO_RANGE_IOPAD>,
+ <&main_pmx0_range 149 2 PIN_GPIO_RANGE_IOPAD>;
+
+ main_pmx0_range: gpio-range {
+ #pinctrl-single,gpio-range-cells = <3>;
+ };
+};
+
&main_gpio0 {
+ gpio-ranges = <&main_pmx0 0 0 32>, <&main_pmx0 32 33 38>,
+ <&main_pmx0 70 72 17>;
ti,ngpio = <87>;
};
&main_gpio1 {
+ gpio-ranges = <&main_pmx0 7 101 25>, <&main_pmx0 42 137 5>,
+ <&main_pmx0 47 143 3>, <&main_pmx0 50 149 2>;
ti,ngpio = <73>;
};
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties
2024-06-27 16:25 [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties Nishanth Menon
` (2 preceding siblings ...)
2024-06-27 16:25 ` [PATCH V2 3/3] arm64: dts: ti: k3-j722s: " Nishanth Menon
@ 2024-07-03 4:35 ` Vignesh Raghavendra
3 siblings, 0 replies; 5+ messages in thread
From: Vignesh Raghavendra @ 2024-07-03 4:35 UTC (permalink / raw)
To: Conor Dooley, Krzysztof Kozlowski, Rob Herring, Nishanth Menon
Cc: Vignesh Raghavendra, linux-kernel, devicetree, linux-arm-kernel,
Tero Kristo, Vaishnav Achath, Jared McArthur, Bryan Brattlof,
Dhruva Gole
Hi Nishanth Menon,
On Thu, 27 Jun 2024 11:25:36 -0500, Nishanth Menon wrote:
> This series was tested on BeagleY-AI[1] using the script[2].
>
> This allows gpiod to request for a gpio that is not in the default GPIO
> mux mode and the framework controls the mux over to required GPIO mode.
>
> The series is based off next-20240617.
>
> [...]
I have applied the following to branch ti-k3-dts-next on [1].
Thank you!
[1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode
commit: 50d9981fa12212cdc0110c42db0411209bb5d765
[2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties
commit: d72d73a44c3c98109764bfb56c329cd628c518cc
[3/3] arm64: dts: ti: k3-j722s: Add gpio-ranges properties
commit: 90d3d2eed998fef92f7bbc8557a843360516ccee
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Vignesh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-03 4:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-27 16:25 [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: Add gpio-ranges properties Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 1/3] arm64: dts: ti: k3-pinctrl: Define a generic GPIO MUX Mode Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 2/3] arm64: dts: ti: k3-am62p: Add gpio-ranges properties Nishanth Menon
2024-06-27 16:25 ` [PATCH V2 3/3] arm64: dts: ti: k3-j722s: " Nishanth Menon
2024-07-03 4:35 ` [PATCH V2 0/3] arm64: dts: ti: k3-am62p/j722s: " Vignesh Raghavendra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®