/
0008-usb-musb-dsps-enable-phy-control-for-am335x.patch
61 lines (56 loc) · 2.38 KB
/
0008-usb-musb-dsps-enable-phy-control-for-am335x.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
From 941d302d686329a63e05a8d0de6bd16c181bb7de Mon Sep 17 00:00:00 2001
From: Ajay Kumar Gupta <ajay.gupta@ti.com>
Date: Thu, 5 Jul 2012 14:35:06 +0530
Subject: [PATCH 8/9] usb: musb: dsps: enable phy control for am335x
Enabled the phy control logic for am335x also based on usbss
revision register.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
arch/arm/plat-omap/include/plat/usb.h | 1 +
drivers/usb/musb/musb_dsps.c | 17 +++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 43052e7f..bb27e88 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -127,6 +127,7 @@ extern void am35x_set_mode(u8 musb_mode);
/* TI81XX specific definitions */
#define MUSB_USBSS_REV_816X 0x9
#define MUSB_USBSS_REV_814X 0xb
+#define MUSB_USBSS_REV_33XX 0xd
/* TI816X PHY controls bits */
#define TI816X_USBPHY0_NORMAL_MODE (1 << 0)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 1151760..ed3b379 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -149,16 +149,21 @@ static void musb_dsps_phy_control(struct dsps_glue *glue, u8 id, u8 on)
if (glue->usbss_rev == MUSB_USBSS_REV_816X) {
usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
- } else if (glue->usbss_rev == MUSB_USBSS_REV_814X) {
- usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
- | USBPHY_DPINPUT | USBPHY_DMINPUT);
- usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
- | USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
+ } else if (glue->usbss_rev == MUSB_USBSS_REV_814X ||
+ glue->usbss_rev == MUSB_USBSS_REV_33XX) {
+ usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN);
+ usbphycfg |= USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN;
+ if (glue->usbss_rev == MUSB_USBSS_REV_814X) {
+ usbphycfg &= ~(USBPHY_DPINPUT | USBPHY_DMINPUT);
+ usbphycfg |= USBPHY_DPOPBUFCTL
+ | USBPHY_DMOPBUFCTL;
+ }
}
} else {
if (glue->usbss_rev == MUSB_USBSS_REV_816X)
usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
- else if (glue->usbss_rev == MUSB_USBSS_REV_814X)
+ else if (glue->usbss_rev == MUSB_USBSS_REV_814X ||
+ glue->usbss_rev == MUSB_USBSS_REV_33XX)
usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
}
__raw_writel(usbphycfg, glue->usb_ctrl[id]);
--
1.7.7.6