0128-usb-xhci-mtk-check-clock-stability-of-U3_MAC.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 4422c4efeed2a8b9fa745c6e529623d89c0be75e Mon Sep 17 00:00:00 2001
  2. From: Chunfeng Yun <[email protected]>
  3. Date: Fri, 13 Oct 2017 16:26:35 +0800
  4. Subject: [PATCH 128/224] usb: xhci-mtk: check clock stability of U3_MAC
  5. This is useful to find out the root cause when the Super Speed doesn't
  6. work. Such as when the T-PHY is switched to PCIe or SATA, and affects
  7. Super Speed function, the check will fail.
  8. Signed-off-by: Chunfeng Yun <[email protected]>
  9. Acked-by: Mathias Nyman <[email protected]>
  10. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  11. ---
  12. drivers/usb/host/xhci-mtk.c | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
  15. index 9502ca408f01..7a92bb782e5c 100644
  16. --- a/drivers/usb/host/xhci-mtk.c
  17. +++ b/drivers/usb/host/xhci-mtk.c
  18. @@ -43,6 +43,7 @@
  19. /* ip_pw_sts1 register */
  20. #define STS1_IP_SLEEP_STS BIT(30)
  21. +#define STS1_U3_MAC_RST BIT(16)
  22. #define STS1_XHCI_RST BIT(11)
  23. #define STS1_SYS125_RST BIT(10)
  24. #define STS1_REF_RST BIT(8)
  25. @@ -125,6 +126,9 @@ static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk)
  26. check_val = STS1_SYSPLL_STABLE | STS1_REF_RST |
  27. STS1_SYS125_RST | STS1_XHCI_RST;
  28. + if (mtk->num_u3_ports)
  29. + check_val |= STS1_U3_MAC_RST;
  30. +
  31. ret = readl_poll_timeout(&ippc->ip_pw_sts1, value,
  32. (check_val == (value & check_val)), 100, 20000);
  33. if (ret) {
  34. --
  35. 2.11.0