forked from clearlinux-pkgs/linux-iot-lts2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0069-REVERTME-dwc3-setup-highspeed-to-USB3.0-on-bxtp.patch
78 lines (72 loc) · 2.27 KB
/
0069-REVERTME-dwc3-setup-highspeed-to-USB3.0-on-bxtp.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From d12c09e8c6b1596647a6a267da18f6dd4c929381 Mon Sep 17 00:00:00 2001
From: Alice Liu <[email protected]>
Date: Thu, 10 Nov 2016 20:11:59 +0800
Subject: [PATCH 01/15] [REVERTME] dwc3 setup highspeed to USB3.0 on bxtp
platform
We find USB3.0 dwc3 can't work at superspeed on bxtp platform. We
setup dwc3 highspeed to enable USB3.0 on bxtp platform.
Change-Id: I48df90c39b652f8e2a48598e9e31947e5d68ca17
Tracked-On:
Signed-off-by: xiao jin <[email protected]>
Signed-off-by: Liu, Alice <[email protected]>
Signed-off-by: Greniger, Jacek <[email protected]>
(cherry picked from commit 4fc6d0494f0d5f21223c5b3f802a116a757c5893)
---
drivers/usb/dwc3/gadget.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 2b53194081ba..cefd586301c8 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -18,6 +18,7 @@
#include <linux/io.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
+#include <asm/processor.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
@@ -1810,6 +1811,17 @@ static void dwc3_gadget_setup_nump(struct dwc3 *dwc)
dwc3_writel(dwc->regs, DWC3_DCFG, reg);
}
+static inline bool platform_is_bxtp(void)
+{
+#ifdef CONFIG_X86_64
+ if ((boot_cpu_data.x86_model == 0x5c)
+ && (boot_cpu_data.x86_stepping >= 0x8)
+ && (boot_cpu_data.x86_stepping <= 0xf))
+ return true;
+#endif
+ return false;
+}
+
static int __dwc3_gadget_start(struct dwc3 *dwc)
{
struct dwc3_ep *dep;
@@ -2018,10 +2030,23 @@ static void dwc3_gadget_set_speed(struct usb_gadget *g,
reg |= DWC3_DCFG_HIGHSPEED;
break;
case USB_SPEED_SUPER:
- reg |= DWC3_DCFG_SUPERSPEED;
+ /*
+ * WORKAROUND: BXTP platform USB3.0 port SS fail,
+ * We switch SS to HS to enable USB3.0.
+ */
+ if (platform_is_bxtp())
+ reg |= DWC3_DCFG_HIGHSPEED;
+ else
+ reg |= DWC3_DCFG_SUPERSPEED;
break;
case USB_SPEED_SUPER_PLUS:
- if (dwc3_is_usb31(dwc))
+ /*
+ * WORKAROUND: BXTP platform USB3.0 port SS fail,
+ * We switch SS to HS to enable USB3.0.
+ */
+ if (platform_is_bxtp())
+ reg |= DWC3_DCFG_HIGHSPEED;
+ else if (dwc3_is_usb31(dwc))
reg |= DWC3_DCFG_SUPERSPEED_PLUS;
else
reg |= DWC3_DCFG_SUPERSPEED;
--
2.19.1