[PATCH 09/13] usb: ehci-mx6: Fix USB QTD data buffer error

peng.fan at nxp.com peng.fan at nxp.com
Wed Sep 16 14:57:01 CEST 2020


From: Ye Li <ye.li at nxp.com>

Some iMX6 platforms will meet "EHCI timed out on TD" when reading
or writing data to USB disk. The root cause is last QTD reports
data buffer error.
Accroding to RM, this event indicates that an overrun of incoming
data or a underrun of outgoing data has occurred for this transaction.
This would generally be caused by the host controller not being able
to access required data buffers in memory within necessary latency
requirements.

Follow kernel's method to fix the issue by disabling stream mode

Signed-off-by: Ye Li <ye.li at nxp.com>
Reviewed-by: Peter Chen <peter.chen at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 drivers/usb/host/ehci-mx6.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index de0b0c3156..aa0c1c355d 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -488,6 +488,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 		board_ehci_power(index, (type == USB_INIT_DEVICE) ? 0 : 1);
 	if (type != init)
 		return -ENODEV;
+
+	if (is_mx6dqp() || is_mx6dq() || is_mx6sdl() ||
+		((is_mx6sl() || is_mx6sx()) && type == USB_INIT_HOST))
+		setbits_le32(&ehci->usbmode, SDIS);
+
 	if (type == USB_INIT_DEVICE)
 		return 0;
 
@@ -542,6 +547,10 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
 	}
 #endif
 
+	if (is_mx6dqp() || is_mx6dq() || is_mx6sdl() ||
+		((is_mx6sl() || is_mx6sx()) && type == USB_INIT_HOST))
+		setbits_le32(&ehci->usbmode, SDIS);
+
 	if (type == USB_INIT_DEVICE)
 		return 0;
 
-- 
2.28.0



More information about the U-Boot mailing list