2023-01-11 13:49:35

by Sjoerd Simons

[permalink] [raw]
Subject: [PATCH v3 0/3] Improve K3-am625-sk support (USB, MMC)


This series picks up a few patches from the TI BSP tree that
unfortunately didn't make it upstream thusfar.

The first patch improve SD card compatibility (allowing U1 class cards
to be used), the remaining ones add USB support.

The type-c connector isn't entirely modelled with these changes as
it goes through a TPS6598 PD controller. Unfortunately the dtb bindings
for that currently require an irq line, which is not connected on E1 and
E2 version boards. The patchese to support this setup unfortunately didn't land
yet[0].. As such the last patch ignored the PD controller and simply
configures usb0 as periphal only rather then mode switch capable, which
at least gives some basic usability of that USB port.

0: https://lore.kernel.org/lkml/[email protected]/T/

Changes in v3:
- Rebased against current ti-next aka 6.2-rc1
- Add Martyn's tested-by

Changes in v2:
- Rebase against linux-next 20221220

Aswath Govindraju (2):
arm64: dts: ti: k3-am62-main: Add support for USB
arm64: dts: ti: k3-am625-sk: Add support for USB

Nitin Yadav (1):
arm64: dts: ti: k3-am62-main: Update OTAP and ITAP delay select

arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 90 ++++++++++++++++++------
arch/arm64/boot/dts/ti/k3-am625-sk.dts | 50 +++++++++++++
2 files changed, 118 insertions(+), 22 deletions(-)

--
2.39.0


2023-01-11 13:50:10

by Sjoerd Simons

[permalink] [raw]
Subject: [PATCH v3 3/3] arm64: dts: ti: k3-am625-sk: Add support for USB

From: Aswath Govindraju <[email protected]>

AM62 SoC has two instances of USB and they are brought on to the board
in the following way,

-> USB0 instance
- This is brought out to a USB TypeC connector on board through TPS6598 PD
controller. The PD controller should decide the role based on CC pin in
the connector. Unfortunately the irq line for the TPS isn't hooked up
which is a mode not yet support by the driver (some patches were
submitted earlier this year[0]). So for now the PD controller is left
out and periphal mode chosen.

-> USB1 instance
- This is brought out to a USB TypeA connector on board.

Therefore, add the required device tree support for the above in the board
dts file.

0: https://lore.kernel.org/lkml/[email protected]/T/

Signed-off-by: Aswath Govindraju <[email protected]>
Signed-off-by: Vignesh Raghavendra <[email protected]>
[merge from vendor bsp, drop TPS6598 support, reword commit message]
Signed-off-by: Sjoerd Simons <[email protected]>
Tested-by: Martyn Welch <[email protected]>

---

Changes in v3:
- Rebased against current ti-next aka 6.2-rc1
- Add Martyn's tested-by

Changes in v2:
- Rebase against linux-next 20221220

arch/arm64/boot/dts/ti/k3-am625-sk.dts | 50 ++++++++++++++++++++++++++
1 file changed, 50 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
index 4f179b146cab..c82a0ebf6772 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -24,6 +24,8 @@ aliases {
spi0 = &ospi0;
ethernet0 = &cpsw_port1;
ethernet1 = &cpsw_port2;
+ usb0 = &usb0;
+ usb1 = &usb1;
};

chosen {
@@ -284,6 +286,12 @@ main_gpio1_ioexp_intr_pins_default: main-gpio1-ioexp-intr-pins-default {
AM62X_IOPAD(0x01d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */
>;
};
+
+ main_usb1_pins_default: main-usb1-pins-default {
+ pinctrl-single,pins = <
+ AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18) USB1_DRVVBUS */
+ >;
+ };
};

&wkup_uart0 {
@@ -464,3 +472,45 @@ partition@3fc0000 {
};
};
};
+
+&ecap0 {
+ status = "disabled";
+};
+
+&ecap1 {
+ status = "disabled";
+};
+
+&ecap2 {
+ status = "disabled";
+};
+
+&main_mcan0 {
+ status = "disabled";
+};
+
+&epwm0 {
+ status = "disabled";
+};
+
+&epwm1 {
+ status = "disabled";
+};
+
+&epwm2 {
+ status = "disabled";
+};
+
+&usbss0 {
+ ti,vbus-divider;
+};
+
+&usb0 {
+ dr_mode = "peripheral";
+};
+
+&usb1 {
+ dr_mode = "host";
+ pinctrl-names = "default";
+ pinctrl-0 = <&main_usb1_pins_default>;
+};
--
2.39.0

2023-01-11 19:18:31

by Vignesh Raghavendra

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] arm64: dts: ti: k3-am625-sk: Add support for USB

Hi Sjoerd,

Couple of comments which I failed to notice on v2, sorry

On 1/11/2023 6:53 PM, Sjoerd Simons wrote:
> From: Aswath Govindraju <[email protected]>
>
> AM62 SoC has two instances of USB and they are brought on to the board
> in the following way,
>
> -> USB0 instance
> - This is brought out to a USB TypeC connector on board through TPS6598 PD
> controller. The PD controller should decide the role based on CC pin in
> the connector. Unfortunately the irq line for the TPS isn't hooked up
> which is a mode not yet support by the driver (some patches were
> submitted earlier this year[0]). So for now the PD controller is left
> out and periphal mode chosen.

s/periphal/peripheral

>
> -> USB1 instance
> - This is brought out to a USB TypeA connector on board.
>
> Therefore, add the required device tree support for the above in the board
> dts file.
>
> 0: https://lore.kernel.org/lkml/[email protected]/T/
>
> Signed-off-by: Aswath Govindraju <[email protected]>
> Signed-off-by: Vignesh Raghavendra <[email protected]>
> [merge from vendor bsp, drop TPS6598 support, reword commit message]
> Signed-off-by: Sjoerd Simons <[email protected]>
> Tested-by: Martyn Welch <[email protected]>
>
> ---
>
> Changes in v3:
> - Rebased against current ti-next aka 6.2-rc1
> - Add Martyn's tested-by
>
> Changes in v2:
> - Rebase against linux-next 20221220
>
> arch/arm64/boot/dts/ti/k3-am625-sk.dts | 50 ++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>

[...]

> +
> +&ecap0 {
> + status = "disabled";
> +};
> +
> +&ecap1 {
> + status = "disabled";
> +};
> +
> +&ecap2 {
> + status = "disabled";
> +};
> +
> +&main_mcan0 {
> + status = "disabled";
> +};
> +
> +&epwm0 {
> + status = "disabled";
> +};
> +
> +&epwm1 {
> + status = "disabled";
> +};
> +
> +&epwm2 {
> + status = "disabled";
> +};
> +

Unlike downstream vendor kernel, these nodes are "disabled" by default
in k3-am62-main.dtsi. So, these can be dropped.

> +&usbss0 {
> + ti,vbus-divider;
> +};
> +
> +&usb0 {
> + dr_mode = "peripheral";
> +};
> +
> +&usb1 {
> + dr_mode = "host";
> + pinctrl-names = "default";
> + pinctrl-0 = <&main_usb1_pins_default>;
> +};

Regards
Vignesh