diff options
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_phy_internal.c | 138 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/usb-musb.c | 3 |
5 files changed, 7 insertions, 146 deletions
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 0d362e9f9cb9..3d2a988e3d9a 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/spi/ads7846.h> | 32 | #include <linux/spi/ads7846.h> |
33 | #include <linux/i2c/twl.h> | 33 | #include <linux/i2c/twl.h> |
34 | #include <linux/usb/otg.h> | 34 | #include <linux/usb/otg.h> |
35 | #include <linux/usb/nop-usb-xceiv.h> | ||
35 | #include <linux/smsc911x.h> | 36 | #include <linux/smsc911x.h> |
36 | 37 | ||
37 | #include <linux/wl12xx.h> | 38 | #include <linux/wl12xx.h> |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index afb60917a948..64b564f13d5b 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -5890,6 +5890,12 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { | |||
5890 | .pa_end = 0x4a0ab003, | 5890 | .pa_end = 0x4a0ab003, |
5891 | .flags = ADDR_TYPE_RT | 5891 | .flags = ADDR_TYPE_RT |
5892 | }, | 5892 | }, |
5893 | { | ||
5894 | /* XXX: Remove this once control module driver is in place */ | ||
5895 | .pa_start = 0x4a00233c, | ||
5896 | .pa_end = 0x4a00233f, | ||
5897 | .flags = ADDR_TYPE_RT | ||
5898 | }, | ||
5893 | { } | 5899 | { } |
5894 | }; | 5900 | }; |
5895 | 5901 | ||
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index d52651a05daa..874aecc0faca 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c | |||
@@ -31,144 +31,6 @@ | |||
31 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
32 | #include "control.h" | 32 | #include "control.h" |
33 | 33 | ||
34 | /* OMAP control module register for UTMI PHY */ | ||
35 | #define CONTROL_DEV_CONF 0x300 | ||
36 | #define PHY_PD 0x1 | ||
37 | |||
38 | #define USBOTGHS_CONTROL 0x33c | ||
39 | #define AVALID BIT(0) | ||
40 | #define BVALID BIT(1) | ||
41 | #define VBUSVALID BIT(2) | ||
42 | #define SESSEND BIT(3) | ||
43 | #define IDDIG BIT(4) | ||
44 | |||
45 | static struct clk *phyclk, *clk48m, *clk32k; | ||
46 | static void __iomem *ctrl_base; | ||
47 | static int usbotghs_control; | ||
48 | |||
49 | int omap4430_phy_init(struct device *dev) | ||
50 | { | ||
51 | ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K); | ||
52 | if (!ctrl_base) { | ||
53 | pr_err("control module ioremap failed\n"); | ||
54 | return -ENOMEM; | ||
55 | } | ||
56 | /* Power down the phy */ | ||
57 | __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); | ||
58 | |||
59 | if (!dev) { | ||
60 | iounmap(ctrl_base); | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | phyclk = clk_get(dev, "ocp2scp_usb_phy_ick"); | ||
65 | if (IS_ERR(phyclk)) { | ||
66 | dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n"); | ||
67 | iounmap(ctrl_base); | ||
68 | return PTR_ERR(phyclk); | ||
69 | } | ||
70 | |||
71 | clk48m = clk_get(dev, "ocp2scp_usb_phy_phy_48m"); | ||
72 | if (IS_ERR(clk48m)) { | ||
73 | dev_err(dev, "cannot clk_get ocp2scp_usb_phy_phy_48m\n"); | ||
74 | clk_put(phyclk); | ||
75 | iounmap(ctrl_base); | ||
76 | return PTR_ERR(clk48m); | ||
77 | } | ||
78 | |||
79 | clk32k = clk_get(dev, "usb_phy_cm_clk32k"); | ||
80 | if (IS_ERR(clk32k)) { | ||
81 | dev_err(dev, "cannot clk_get usb_phy_cm_clk32k\n"); | ||
82 | clk_put(phyclk); | ||
83 | clk_put(clk48m); | ||
84 | iounmap(ctrl_base); | ||
85 | return PTR_ERR(clk32k); | ||
86 | } | ||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | int omap4430_phy_set_clk(struct device *dev, int on) | ||
91 | { | ||
92 | static int state; | ||
93 | |||
94 | if (on && !state) { | ||
95 | /* Enable the phy clocks */ | ||
96 | clk_enable(phyclk); | ||
97 | clk_enable(clk48m); | ||
98 | clk_enable(clk32k); | ||
99 | state = 1; | ||
100 | } else if (state) { | ||
101 | /* Disable the phy clocks */ | ||
102 | clk_disable(phyclk); | ||
103 | clk_disable(clk48m); | ||
104 | clk_disable(clk32k); | ||
105 | state = 0; | ||
106 | } | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | int omap4430_phy_power(struct device *dev, int ID, int on) | ||
111 | { | ||
112 | if (on) { | ||
113 | if (ID) | ||
114 | /* enable VBUS valid, IDDIG groung */ | ||
115 | __raw_writel(AVALID | VBUSVALID, ctrl_base + | ||
116 | USBOTGHS_CONTROL); | ||
117 | else | ||
118 | /* | ||
119 | * Enable VBUS Valid, AValid and IDDIG | ||
120 | * high impedance | ||
121 | */ | ||
122 | __raw_writel(IDDIG | AVALID | VBUSVALID, | ||
123 | ctrl_base + USBOTGHS_CONTROL); | ||
124 | } else { | ||
125 | /* Enable session END and IDIG to high impedance. */ | ||
126 | __raw_writel(SESSEND | IDDIG, ctrl_base + | ||
127 | USBOTGHS_CONTROL); | ||
128 | } | ||
129 | return 0; | ||
130 | } | ||
131 | |||
132 | int omap4430_phy_suspend(struct device *dev, int suspend) | ||
133 | { | ||
134 | if (suspend) { | ||
135 | /* Disable the clocks */ | ||
136 | omap4430_phy_set_clk(dev, 0); | ||
137 | /* Power down the phy */ | ||
138 | __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); | ||
139 | |||
140 | /* save the context */ | ||
141 | usbotghs_control = __raw_readl(ctrl_base + USBOTGHS_CONTROL); | ||
142 | } else { | ||
143 | /* Enable the internel phy clcoks */ | ||
144 | omap4430_phy_set_clk(dev, 1); | ||
145 | /* power on the phy */ | ||
146 | if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) { | ||
147 | __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF); | ||
148 | mdelay(200); | ||
149 | } | ||
150 | |||
151 | /* restore the context */ | ||
152 | __raw_writel(usbotghs_control, ctrl_base + USBOTGHS_CONTROL); | ||
153 | } | ||
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | int omap4430_phy_exit(struct device *dev) | ||
159 | { | ||
160 | if (ctrl_base) | ||
161 | iounmap(ctrl_base); | ||
162 | if (phyclk) | ||
163 | clk_put(phyclk); | ||
164 | if (clk48m) | ||
165 | clk_put(clk48m); | ||
166 | if (clk32k) | ||
167 | clk_put(clk32k); | ||
168 | |||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | void am35x_musb_reset(void) | 34 | void am35x_musb_reset(void) |
173 | { | 35 | { |
174 | u32 regval; | 36 | u32 regval; |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index db5ff6642375..329b726012f3 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -251,11 +251,6 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | |||
251 | 251 | ||
252 | #if defined(CONFIG_ARCH_OMAP4) | 252 | #if defined(CONFIG_ARCH_OMAP4) |
253 | static struct twl4030_usb_data omap4_usb_pdata = { | 253 | static struct twl4030_usb_data omap4_usb_pdata = { |
254 | .phy_init = omap4430_phy_init, | ||
255 | .phy_exit = omap4430_phy_exit, | ||
256 | .phy_power = omap4430_phy_power, | ||
257 | .phy_set_clock = omap4430_phy_set_clk, | ||
258 | .phy_suspend = omap4430_phy_suspend, | ||
259 | }; | 254 | }; |
260 | 255 | ||
261 | static struct regulator_init_data omap4_vdac_idata = { | 256 | static struct regulator_init_data omap4_vdac_idata = { |
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index c4a576856661..e9b4b234dc5f 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -117,7 +117,4 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data) | |||
117 | dev->dma_mask = &musb_dmamask; | 117 | dev->dma_mask = &musb_dmamask; |
118 | dev->coherent_dma_mask = musb_dmamask; | 118 | dev->coherent_dma_mask = musb_dmamask; |
119 | put_device(dev); | 119 | put_device(dev); |
120 | |||
121 | if (cpu_is_omap44xx()) | ||
122 | omap4430_phy_init(dev); | ||
123 | } | 120 | } |