[PATCH 0/3] usb: am654: Add support for host mode to the USB port on overlay board

The following series of patches - adds support for host mode to USB3SS0 controller - adds aliases for USB subsystems - adds a workaround to use USB0 in USB 2.0 only mode
Aswath Govindraju (3): board: ti: am65x: Set SERDES0 mux to PCIe to use USB 2.0 interface dts: am654-base-board-uboot: Set USB0 dr_mode to host dts: am654-base-board-uboot: Add aliases for USB subsystems
arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 4 +++- board/ti/am65x/evm.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)

It has been observed that setting SERDES0 lane mux to USB prevents USB 2.0 operation on USB0. Setting SERDES0 lane mux to non-USB when USB0 is used in USB 2.0 only mode solves this issue. However, for USB3.0+2.0 operation this issue is not present.
Implement this workaround by writing 1 to LANE_FUNC_SEL field in CTRLMMR_SERDES0_CTRL register.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com --- board/ti/am65x/evm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index 36063b11383d..4438f14e4ff1 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -38,6 +38,10 @@ enum { /* Max number of MAC addresses that are parsed/processed per daughter card */ #define DAUGHTER_CARD_NO_OF_MAC_ADDR 8
+/* Regiter that controls the SERDES0 lane and clock assignment */ +#define CTRLMMR_SERDES0_CTRL 0x00104080 +#define PCIE_LANE0 0x1 + DECLARE_GLOBAL_DATA_PTR;
int board_init(void) @@ -312,6 +316,18 @@ static int probe_daughtercards(void) (uchar *)mac_addr[j]); }
+ /* + * It has been observed that setting SERDES0 lane mux to USB prevents USB + * 2.0 operation on USB0. Setting SERDES0 lane mux to non-USB when USB0 is + * used in USB 2.0 only mode solves this issue. For USB3.0+2.0 operation + * this issue is not present. + * + * Implement this workaround by writing 1 to LANE_FUNC_SEL field in + * CTRLMMR_SERDES0_CTRL register. + */ + if (!strncmp(ep.name, "SER-PCIE2LEVM", sizeof(ep.name))) + writel(PCIE_LANE0, CTRLMMR_SERDES0_CTRL); + /* Skip if no overlays are to be added */ if (!strlen(cards[i].dtbo_name)) continue;

USB3SS0 controller is to be used as a host in U-boot. Fix it by changing the dr_mode to host.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com --- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi index d75d1b1c285a..bd2f334c2b50 100644 --- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi @@ -270,7 +270,7 @@ &usb0 { pinctrl-names = "default"; pinctrl-0 = <&usb0_pins_default>; - dr_mode = "peripheral"; + dr_mode = "host"; u-boot,dm-spl; };

On 20/11/20 9:18 pm, Aswath Govindraju wrote:
USB3SS0 controller is to be used as a host in U-boot. Fix it by changing the dr_mode to host.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com
Won't it break dfu support or is it used in different controller?
Thanks and regards, Lokesh
arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi index d75d1b1c285a..bd2f334c2b50 100644 --- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi @@ -270,7 +270,7 @@ &usb0 { pinctrl-names = "default"; pinctrl-0 = <&usb0_pins_default>;
- dr_mode = "peripheral";
- dr_mode = "host"; u-boot,dm-spl;
};

On 21/12/20 8:42 pm, Lokesh Vutla wrote:
On 20/11/20 9:18 pm, Aswath Govindraju wrote:
USB3SS0 controller is to be used as a host in U-boot. Fix it by changing the dr_mode to host.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com
Won't it break dfu support or is it used in different controller?
It is used in a different controller. The port on the base board is used for dfu and and the port on the overlay board is used for host mode.
Thanks, Aswath
arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi index d75d1b1c285a..bd2f334c2b50 100644 --- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi @@ -270,7 +270,7 @@ &usb0 { pinctrl-names = "default"; pinctrl-0 = <&usb0_pins_default>;
- dr_mode = "peripheral";
- dr_mode = "host"; u-boot,dm-spl;
};

The sequence number assigned for USB subsystem in a uclass is dependent on the order of occurrence in the device tree. If the dr_mode of USB3SS0 controller is varied then the sequence number of USB3SS1 controller also changes. If aliases are added then sequence numbers are assigned using the alias number. This makes the sequence number of USB3SS1 controller independent of USB3SS0 controller's dr_mode.
Therefore, add aliases to fix the sequence number assigned to the USB subsystems.
Signed-off-by: Aswath Govindraju a-govindraju@ti.com --- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi index bd2f334c2b50..727bc3e8a0e3 100644 --- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi @@ -14,6 +14,8 @@ aliases { serial2 = &main_uart0; ethernet0 = &cpsw_port1; + usb0 = &usb0; + usb1 = &usb1; }; };

Hi,
On 20/11/2020 17:48, Aswath Govindraju wrote:
The following series of patches
- adds support for host mode to USB3SS0 controller
- adds aliases for USB subsystems
- adds a workaround to use USB0 in USB 2.0 only mode
Aswath Govindraju (3): board: ti: am65x: Set SERDES0 mux to PCIe to use USB 2.0 interface dts: am654-base-board-uboot: Set USB0 dr_mode to host dts: am654-base-board-uboot: Add aliases for USB subsystems
For all patches,
Acked-by: Roger Quadros rogerq@ti.com
arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 4 +++- board/ti/am65x/evm.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
cheers, -roger

On 20/11/20 9:18 pm, Aswath Govindraju wrote:
The following series of patches
- adds support for host mode to USB3SS0 controller
- adds aliases for USB subsystems
- adds a workaround to use USB0 in USB 2.0 only mode
Fixed the dts patches subject to arm: dts: .... and applied to u-boot-ti for-next branch.
Thanks and regards, Lokesh
Aswath Govindraju (3): board: ti: am65x: Set SERDES0 mux to PCIe to use USB 2.0 interface dts: am654-base-board-uboot: Set USB0 dr_mode to host dts: am654-base-board-uboot: Add aliases for USB subsystems
arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 4 +++- board/ti/am65x/evm.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
participants (3)
-
Aswath Govindraju
-
Lokesh Vutla
-
Roger Quadros