diff options
Diffstat (limited to 'arch/arm/mach-imx/include/mach/usb.h')
-rw-r--r-- | arch/arm/mach-imx/include/mach/usb.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/include/mach/usb.h b/arch/arm/mach-imx/include/mach/usb.h index 85528d77e6..3b5e24d1cc 100644 --- a/arch/arm/mach-imx/include/mach/usb.h +++ b/arch/arm/mach-imx/include/mach/usb.h @@ -14,4 +14,27 @@ int imx6_usb_phy2_disable_oc(void); int imx6_usb_phy2_enable(void); +#define USBCMD 0x140 +#define USB_CMD_RESET 0x00000002 + +/* + * imx_reset_otg_controller - reset the USB OTG controller + * @base: The base address of the controller + * + * When booting from USB the ROM just leaves the controller enabled. This can + * have bad side effects when for example we change PLL frequencies. In this + * case it is seen that the hub the board is connected to gets confused and USB + * is no longer working properly on the remote host. This function resets the + * OTG controller. It should be called before the clocks the controller hangs on + * is fiddled with. + */ +static inline void imx_reset_otg_controller(void __iomem *base) +{ + u32 r; + + r = readl(base + USBCMD); + r |= USB_CMD_RESET; + writel(r, base + USBCMD); +} + #endif /* __MACH_USB_H_*/ |