Skip to contentSkip to conversation

arm64: dts: ti: k3-am69-aquila: fix SPI hardware CS issue

PATCH Applied Vitor Soares 3 participants 5 messages Jan 12 – Jan 14

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover arm64: dts: ti: k3-am69-aquila: fix SPI hardware CS issue

From: Vitor Soares <[email protected]>

Hardware chip select does not work correctly on main_spi0 and main_spi2 controllers on the Aquila AM69 module. Testing revealed main_spi2 loses CS state during runtime PM suspend, while main_spi0 cannot drive CS HIGH when bus is idle. This series switches both controllers to use GPIO-based chip select instead.

Vitor Soares (2):
arm64: dts: ti: k3-am69-aquila: change main_spi0/2 CS to GPIO mode
arm64: dts: ti: k3-am69-aquila-clover: change main_spi2 CS0 to GPIO
mode

 arch/arm64/boot/dts/ti/k3-am69-aquila-clover.dts | 3 ++-
 arch/arm64/boot/dts/ti/k3-am69-aquila.dtsi       | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH 1/2 arm64: dts: ti: k3-am69-aquila: change main_spi0/2 CS to GPIO mode

From: Vitor Soares <[email protected]>

Hardware chip select does not work correctly on main_spi0 and main_spi2 controllers. Testing shows main_spi2 loses CS state during runtime PM suspend, while main_spi0 cannot drive CS HIGH when bus is idle.

Use GPIO-based chip select for both controllers.

Fixes 39ac6623b1d8 ("arm64: dts: ti: Add Aquila AM69 Support")
---
 arch/arm64/boot/dts/ti/k3-am69-aquila.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am69-aquila.dtsi +4 -2
index 0866eb8a6f34..5119baf62a4c 100644
@@ -479,7 +479,7 @@ J784S4_IOPAD(0x0dc, PIN_OUTPUT, 0) /* (AM36) SPI0_D1  */ /* AQUILA D17 */
 	/* Aquila SPI_2 CS */
 	pinctrl_main_spi0_cs0: main-spi0-cs0-default-pins {
 		pinctrl-single,pins = <
-			J784S4_IOPAD(0x0cc, PIN_OUTPUT, 0) /* (AM37) SPI0_CS0 */ /* AQUILA D16 */
+			J784S4_IOPAD(0x0cc, PIN_OUTPUT, 7) /* (AM37) SPI0_CS0.GPIO0_51 */ /* AQUILA D16 */
 		>;
 	};
 
@@ -495,7 +495,7 @@ J784S4_IOPAD(0x0ac, PIN_OUTPUT, 10) /* (AE34) MCASP0_AXR15.SPI2_D1  */ /* AQUILA
 	/* Aquila SPI_1 CS */
 	pinctrl_main_spi2_cs0: main-spi2-cs0-default-pins {
 		pinctrl-single,pins = <
-			J784S4_IOPAD(0x09c, PIN_OUTPUT, 10) /* (AF35) MCASP0_AXR11.SPI2_CS1 */ /* AQUILA D9 */
+			J784S4_IOPAD(0x09c, PIN_OUTPUT, 7) /* (AF35) MCASP0_AXR11.GPIO0_39 */ /* AQUILA D9 */
 		>;
 	};
 
@@ -1204,6 +1204,7 @@ &main_sdhci1 {
 &main_spi0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_main_spi0>, <&pinctrl_main_spi0_cs0>;
+	cs-gpios = <&main_gpio0 51 GPIO_ACTIVE_LOW>;
 	status = "disabled";
 };
 
@@ -1211,6 +1212,7 @@ &main_spi0 {
 &main_spi2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_main_spi2>, <&pinctrl_main_spi2_cs0>;
+	cs-gpios = <&main_gpio0 39 GPIO_ACTIVE_LOW>;
 	status = "disabled";
 };
 
Signature · 1 line
2.52.0
#2 lore raw

PATCH 2/2 arm64: dts: ti: k3-am69-aquila-clover: change main_spi2 CS0 to GPIO mode

In reply to Vitor Soares

From: Vitor Soares <[email protected]>

Change CS0 from hardware chip select to GPIO-based chip select to align with the base aquila device tree configuration.

Fixes 9f748a6177e1 ("arm64: dts: ti: am69-aquila: Add Clover")
---
 arch/arm64/boot/dts/ti/k3-am69-aquila-clover.dts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am69-aquila-clover.dts +2 -1
index 55fd214a82e4..927d0877d7f8 100644
@@ -208,7 +208,8 @@ &main_spi2 {
 	pinctrl-0 = <&pinctrl_main_spi2>,
 		    <&pinctrl_main_spi2_cs0>,
 		    <&pinctrl_gpio_05>;
-	cs-gpios = <0>, <&wkup_gpio0 29 GPIO_ACTIVE_LOW>;
+	cs-gpios = <&main_gpio0 39 GPIO_ACTIVE_LOW>,
+		   <&wkup_gpio0 29 GPIO_ACTIVE_LOW>;
 	status = "okay";
 
 	tpm@1 {
Signature · 1 line
2.52.0
Reviewed-by on the v1 series
#3 lore raw
In reply to Vitor Soares
Quoted 7 lines · Vitor Soares

From: Vitor Soares <[email protected]>

Hardware chip select does not work correctly on main_spi0 and main_spi2 controllers on the Aquila AM69 module. Testing revealed main_spi2 loses CS state during runtime PM suspend, while main_spi0 cannot drive CS HIGH when bus is idle. This series switches both controllers to use GPIO-based chip select instead.

maintainer Applied
#4 lore raw
In reply to Vitor Soares

Hi Vitor Soares,

Quoted 9 lines · Vitor Soares

From: Vitor Soares <[email protected]>

Hardware chip select does not work correctly on main_spi0 and main_spi2 controllers on the Aquila AM69 module. Testing revealed main_spi2 loses CS state during runtime PM suspend, while main_spi0 cannot drive CS HIGH when bus is idle. This series switches both controllers to use GPIO-based chip select instead.

[...]

I have applied the following to branch ti-k3-dts-next on [1]. Thank you!

[1/2] arm64: dts: ti: k3-am69-aquila: change main_spi0/2 CS to GPIO mode

      commit: 78a123f45a7e9ac2a59f0eff8a37d31773e7a021
[2/2] arm64: dts: ti: k3-am69-aquila-clover: change main_spi2 CS0 to GPIO mode
      commit: 319fff9c7d620af83d8ab67050a54f63f16ae4e8

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

Signature · 4 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource