summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPrathap Srinivas <msprathap@ti.com>2010-01-11 15:36:46 +0530
committerRemy Bohmer <linux@bohmer.net>2010-02-03 22:06:59 +0100
commit6e20e64f5c6deb5b48e40a0cba4877f9170545e0 (patch)
tree58a3c883143eadcd7b8045615ccc55e50da0a9a5 /drivers/usb
parentec2aadb40855cecb088b68c062e3534d6ce39128 (diff)
downloadu-boot-imx-6e20e64f5c6deb5b48e40a0cba4877f9170545e0.zip
u-boot-imx-6e20e64f5c6deb5b48e40a0cba4877f9170545e0.tar.gz
u-boot-imx-6e20e64f5c6deb5b48e40a0cba4877f9170545e0.tar.bz2
musb: Add host support for DM365 EVM
Add support for musb host on DM365 EVM. Signed-off-by: Prathap Srinivas <msprathap@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/davinci.c21
-rw-r--r--drivers/usb/musb/davinci.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index a7648fc..8fbadc9 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -24,6 +24,7 @@
#include <common.h>
#include <asm/io.h>
#include "davinci.h"
+#include <asm/arch/hardware.h>
/* MUSB platform configuration */
struct musb_config musb_cfg = {
@@ -41,10 +42,25 @@ struct davinci_usb_regs *dregs;
static u8 phy_on(void)
{
u32 timeout;
-
+#ifdef DAVINCI_DM365EVM
+ u32 val;
+#endif
/* Wait until the USB phy is turned on */
+#ifdef DAVINCI_DM365EVM
+ writel(USBPHY_PHY24MHZ | USBPHY_SESNDEN |
+ USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
+#else
writel(USBPHY_SESNDEN | USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
+#endif
timeout = musb_cfg.timeout;
+
+#ifdef DAVINCI_DM365EVM
+ /* Set the ownership of GIO33 to USB */
+ val = readl(PINMUX4);
+ val &= ~(PINMUX4_USBDRVBUS_BITCLEAR);
+ val |= PINMUX4_USBDRVBUS_BITSET;
+ writel(val, PINMUX4);
+#endif
while (timeout--)
if (readl(USBPHY_CTL_PADDR) & USBPHY_PHYCLKGD)
return 1;
@@ -70,8 +86,9 @@ int musb_platform_init(void)
u32 revision;
/* enable USB VBUS */
+#ifndef DAVINCI_DM365EVM
enable_vbus();
-
+#endif
/* start the on-chip USB phy and its pll */
if (!phy_on())
return -1;
diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h
index f6751bf..e0829d6 100644
--- a/drivers/usb/musb/davinci.h
+++ b/drivers/usb/musb/davinci.h
@@ -63,6 +63,7 @@ struct davinci_usb_regs {
/* Integrated highspeed/otg PHY */
#define USBPHY_CTL_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x34)
+#define USBPHY_PHY24MHZ (1 << 13)
#define USBPHY_PHYCLKGD (1 << 8)
#define USBPHY_SESNDEN (1 << 7) /* v(sess_end) comparator */
#define USBPHY_VBDTCTEN (1 << 6) /* v(bus) comparator */