aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-10-30 15:52:04 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-25 13:21:34 -0500
commitca6a272a4f1c2b81ec062f39cdc02ce7aed26d14 (patch)
treedaa0eab08393f8782f4d4e63cca2212e67451039 /arch/arm/mach-davinci
parentb0ea26e1c8970c1b252a43e6c33555829ba4b0d2 (diff)
DA830 EVM: MUSB platform code
Properly set up the OTG mode thru the CFGCHIP2 register, enable the USB0_DRVVBUS pin, and finally register the MUSB platform device. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index bfa790297f79..ccf66c755a7f 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -171,8 +171,37 @@ static __init void da830_evm_usb_init(void)
171 cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX; 171 cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX;
172 cfgchip2 |= CFGCHIP2_USB2PHYCLKMUX; 172 cfgchip2 |= CFGCHIP2_USB2PHYCLKMUX;
173 173
174 /*
175 * We have to override VBUS/ID signals when MUSB is configured into the
176 * host-only mode -- ID pin will float if no cable is connected, so the
177 * controller won't be able to drive VBUS thinking that it's a B-device.
178 * Otherwise, we want to use the OTG mode and enable VBUS comparators.
179 */
180 cfgchip2 &= ~CFGCHIP2_OTGMODE;
181#ifdef CONFIG_USB_MUSB_HOST
182 cfgchip2 |= CFGCHIP2_FORCE_HOST;
183#else
184 cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN;
185#endif
186
174 __raw_writel(cfgchip2, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG)); 187 __raw_writel(cfgchip2, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG));
175 188
189 /* USB_REFCLKIN is not used. */
190 ret = davinci_cfg_reg(DA830_USB0_DRVVBUS);
191 if (ret)
192 pr_warning("%s: USB 2.0 PinMux setup failed: %d\n",
193 __func__, ret);
194 else {
195 /*
196 * TPS2065 switch @ 5V supplies 1 A (sustains 1.5 A),
197 * with the power on to power good time of 3 ms.
198 */
199 ret = da8xx_register_usb20(1000, 3);
200 if (ret)
201 pr_warning("%s: USB 2.0 registration failed: %d\n",
202 __func__, ret);
203 }
204
176 ret = da8xx_pinmux_setup(da830_evm_usb11_pins); 205 ret = da8xx_pinmux_setup(da830_evm_usb11_pins);
177 if (ret) { 206 if (ret) {
178 pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", 207 pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",