diff options
author | Zhang Jiejing <jiejing.zhang@freescale.com> | 2011-12-14 19:12:20 +0800 |
---|---|---|
committer | Zhang Jiejing <jiejing.zhang@freescale.com> | 2011-12-15 11:23:48 +0800 |
commit | 6dd956ebdeb0d0b247a511de6302903be02802e3 (patch) | |
tree | 83bce1c11dad0ed46aa20df53b4288c5abed4342 /drivers/usb/gadget | |
parent | a32bc11e6e78753f7f5355a50098c966ff0f40fd (diff) | |
download | u-boot-imx-6dd956ebdeb0d0b247a511de6302903be02802e3.zip u-boot-imx-6dd956ebdeb0d0b247a511de6302903be02802e3.tar.gz u-boot-imx-6dd956ebdeb0d0b247a511de6302903be02802e3.tar.bz2 |
ENGR00170299-1 Android: add support fastboot function
add support for otg in MX6Q uboot to enable fastboot function.
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/imx_udc.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index 2761fdd..9f1f492 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c @@ -33,6 +33,7 @@ #include <asm/errno.h> #include <usbdevice.h> #include <usb/imx_udc.h> + #include "ep0.h" #ifdef DEBUG @@ -130,7 +131,6 @@ static int mxc_init_usb_qh(void) } memset(mxc_udc.ep_qh, 0, size); writel(mxc_udc.qh_dma & 0xfffff800, USB_ENDPOINTLISTADDR); - return 0; } @@ -453,6 +453,8 @@ static void usb_set_mode_device(void) temp &= ~USB_CMD_RUN_STOP; writel(temp, USB_USBCMD); + while (readl(USB_USBCMD) & USB_CMD_RUN_STOP) + ; /* Do core reset */ temp = readl(USB_USBCMD); temp |= USB_CMD_CTRL_RESET; @@ -461,6 +463,9 @@ static void usb_set_mode_device(void) ; DBG("DOORE RESET END\n"); +#ifdef CONFIG_MX6Q + reset_usb_phy1(); +#endif DBG("init core to device mode\n"); temp = readl(USB_USBMODE); temp &= ~USB_MODE_CTRL_MODE_MASK; /* clear mode bits */ @@ -474,7 +479,7 @@ static void usb_set_mode_device(void) static void usb_init_eps(void) { u32 temp; - + DBG("Flush begin\n"); temp = readl(USB_ENDPTNAKEN); temp |= 0x10001; /* clear mode bits */ writel(temp, USB_ENDPTNAKEN); @@ -789,6 +794,14 @@ void mxc_udc_wait_cable_insert(void) } while (1); } +int udc_disable_over_current() +{ + u32 temp; + temp = readl(USB_OTG_CTRL); + temp |= UCTRL_OVER_CUR_POL; + writel(temp, USB_OTG_CTRL); +} + /* * mxc_udc_init function */ @@ -797,6 +810,9 @@ int mxc_udc_init(void) set_usboh3_clk(); set_usb_phy1_clk(); enable_usboh3_clk(1); +#ifdef CONFIG_MX6Q + udc_disable_over_current(); +#endif enable_usb_phy1_clk(1); usb_udc_init(); |