From: make shi Date: Tue, 25 Oct 2011 08:23:51 +0000 (+0800) Subject: ENGR00156766 [MX6Q]USB: Enable USB host1 function X-Git-Tag: v3.0.35-fsl_4.1.0~2192 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c325e84a145a07e5237add088122bbc349981a7e;p=karo-tx-linux.git ENGR00156766 [MX6Q]USB: Enable USB host1 function Add necessary implement to Enable USB host1 function Signed-off-by: make shi --- diff --git a/arch/arm/mach-mx6/usb_h1.c b/arch/arm/mach-mx6/usb_h1.c index b3b354f95371..f33f7365664e 100644 --- a/arch/arm/mach-mx6/usb_h1.c +++ b/arch/arm/mach-mx6/usb_h1.c @@ -139,9 +139,9 @@ static void _wake_up_enable(struct fsl_usb2_platform_data *pdata, bool enable) | BM_USBPHY_CTRL_ENAUTOCLR_CLKGATE | BM_USBPHY_CTRL_ENAUTOCLR_USBCLKGATE | BM_USBPHY_CTRL_ENAUTO_PWRON_PLL , phy_reg + HW_USBPHY_CTRL_SET); - USB_H1_CTRL |= (UCTRL_OWIE | UCTRL_WKUP_ID_EN); + USB_H1_CTRL |= (UCTRL_OWIE); } else { - USB_H1_CTRL &= ~(UCTRL_OWIE | UCTRL_WKUP_ID_EN); + USB_H1_CTRL &= ~(UCTRL_OWIE); /* The interrupt must be disabled for at least 3 * cycles of the standby clock(32k Hz) , that is 0.094 ms*/ udelay(100); @@ -189,22 +189,10 @@ static void _phy_lowpower_suspend(struct fsl_usb2_platform_data *pdata, bool ena static enum usb_wakeup_event _is_usbh1_wakeup(struct fsl_usb2_platform_data *pdata) { u32 wakeup_req = USB_H1_CTRL & UCTRL_OWIR; - u32 otgsc = UOG_OTGSC; - if (wakeup_req) { - pr_debug("the otgsc is 0x%x, usbsts is 0x%x, portsc is 0x%x, wakeup_irq is 0x%x\n", UOG_OTGSC, UOG_USBSTS, UOG_PORTSC1, wakeup_req); - } - /* if ID change sts, it is a host wakeup event */ - if (wakeup_req && (otgsc & OTGSC_IS_USB_ID)) { - pr_debug("otg host ID wakeup\n"); - /* if host ID wakeup, we must clear the b session change sts */ - otgsc &= (~OTGSC_IS_USB_ID); - return WAKEUP_EVENT_ID; - } - if (wakeup_req && (!(otgsc & OTGSC_STS_USB_ID))) { - pr_debug("otg host Remote wakeup\n"); - return WAKEUP_EVENT_DPDM; - } + if (wakeup_req) + return !WAKEUP_EVENT_INVALID; + pr_err("host1, %s, invalid wake up\n", __func__); return WAKEUP_EVENT_INVALID; } @@ -251,10 +239,11 @@ static struct fsl_usb2_wakeup_platform_data usbh1_wakeup_config = { void __init mx6_usb_h1_init(void) { + struct platform_device *pdev; static void __iomem *anatop_base_addr = MX6_IO_ADDRESS(ANATOP_BASE_ADDR); usbh1_config.wakeup_pdata = &usbh1_wakeup_config; - imx6q_add_fsl_ehci_hs(1, &usbh1_config); - + pdev = imx6q_add_fsl_ehci_hs(1, &usbh1_config); + usbh1_wakeup_config.usb_pdata[0] = pdev->dev.platform_data; imx6q_add_fsl_usb2_hs_wakeup(1, &usbh1_wakeup_config); /* Some phy and power's special controls for host1 * 1. The external charger detector needs to be disabled @@ -266,10 +255,10 @@ void __init mx6_usb_h1_init(void) __raw_writel(BM_ANADIG_USB2_CHRG_DETECT_EN_B \ | BM_ANADIG_USB2_CHRG_DETECT_CHK_CHRG_B, \ anatop_base_addr + HW_ANADIG_USB2_CHRG_DETECT); - + __raw_writel(BM_ANADIG_USB2_PLL_480_CTRL_BYPASS, + anatop_base_addr + HW_ANADIG_USB2_PLL_480_CTRL_CLR); __raw_writel(BM_ANADIG_USB2_PLL_480_CTRL_ENABLE \ | BM_ANADIG_USB2_PLL_480_CTRL_POWER \ | BM_ANADIG_USB2_PLL_480_CTRL_EN_USB_CLKS, \ anatop_base_addr + HW_ANADIG_USB2_PLL_480_CTRL_SET); } -