Merge branch 'ehci' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into omap/ehci
This commit is contained in:
commit
c0ee8cd68f
@ -193,7 +193,7 @@ static struct platform_device rx51_charger_device = {
|
||||
static void __init rx51_charger_init(void)
|
||||
{
|
||||
WARN_ON(gpio_request_one(RX51_USB_TRANSCEIVER_RST_GPIO,
|
||||
GPIOF_OUT_INIT_LOW, "isp1704_reset"));
|
||||
GPIOF_OUT_INIT_HIGH, "isp1704_reset"));
|
||||
|
||||
platform_device_register(&rx51_charger_device);
|
||||
}
|
||||
|
@ -2480,6 +2480,16 @@ static struct clk uart4_fck = {
|
||||
.recalc = &followparent_recalc,
|
||||
};
|
||||
|
||||
static struct clk uart4_fck_am35xx = {
|
||||
.name = "uart4_fck",
|
||||
.ops = &clkops_omap2_dflt_wait,
|
||||
.parent = &per_48m_fck,
|
||||
.enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
|
||||
.enable_bit = OMAP3430_EN_UART4_SHIFT,
|
||||
.clkdm_name = "core_l4_clkdm",
|
||||
.recalc = &followparent_recalc,
|
||||
};
|
||||
|
||||
static struct clk gpt2_fck = {
|
||||
.name = "gpt2_fck",
|
||||
.ops = &clkops_omap2_dflt_wait,
|
||||
@ -3287,7 +3297,7 @@ static struct omap_clk omap3xxx_clks[] = {
|
||||
CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs-omap.0", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs_omap", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
|
||||
CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
|
||||
CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
|
||||
@ -3323,7 +3333,7 @@ static struct omap_clk omap3xxx_clks[] = {
|
||||
CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX),
|
||||
CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
|
||||
CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs_omap", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
|
||||
CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
|
||||
@ -3369,20 +3379,18 @@ static struct omap_clk omap3xxx_clks[] = {
|
||||
CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
|
||||
CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
|
||||
CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs-omap.0", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs-omap.0", "utmi_p1_gfclk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "utmi_p2_gfclk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "xclk60mhsp1_ck", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "xclk60mhsp2_ck", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs-omap.0", "init_60m_fclk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
|
||||
CLK("usbhs_omap", "utmi_p1_gfclk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "utmi_p2_gfclk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "xclk60mhsp1_ck", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "xclk60mhsp2_ck", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
|
||||
CLK("usbhs_omap", "init_60m_fclk", &dummy_ck, CK_3XXX),
|
||||
CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
|
||||
CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
|
||||
CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
|
||||
@ -3403,6 +3411,7 @@ static struct omap_clk omap3xxx_clks[] = {
|
||||
CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX),
|
||||
CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX),
|
||||
CLK(NULL, "uart4_fck", &uart4_fck, CK_36XX),
|
||||
CLK(NULL, "uart4_fck", &uart4_fck_am35xx, CK_3505 | CK_3517),
|
||||
CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX),
|
||||
CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX),
|
||||
CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX),
|
||||
|
@ -3295,7 +3295,7 @@ static struct omap_clk omap44xx_clks[] = {
|
||||
CLK(NULL, "uart2_fck", &uart2_fck, CK_443X),
|
||||
CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
|
||||
CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
|
||||
CLK("usbhs-omap.0", "fs_fck", &usb_host_fs_fck, CK_443X),
|
||||
CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
|
||||
CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
|
||||
CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
|
||||
CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
|
||||
@ -3306,7 +3306,7 @@ static struct omap_clk omap44xx_clks[] = {
|
||||
CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
|
||||
CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
|
||||
CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
|
||||
CLK("usbhs-omap.0", "hs_fck", &usb_host_hs_fck, CK_443X),
|
||||
CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X),
|
||||
CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
|
||||
CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
|
||||
CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
|
||||
@ -3314,7 +3314,7 @@ static struct omap_clk omap44xx_clks[] = {
|
||||
CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
|
||||
CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
|
||||
CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
|
||||
CLK("usbhs-omap.0", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
|
||||
CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
|
||||
CLK(NULL, "usim_ck", &usim_ck, CK_443X),
|
||||
CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
|
||||
CLK(NULL, "usim_fck", &usim_fck, CK_443X),
|
||||
@ -3374,8 +3374,8 @@ static struct omap_clk omap44xx_clks[] = {
|
||||
CLK(NULL, "uart2_ick", &dummy_ck, CK_443X),
|
||||
CLK(NULL, "uart3_ick", &dummy_ck, CK_443X),
|
||||
CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
|
||||
CLK("usbhs-omap.0", "usbhost_ick", &dummy_ck, CK_443X),
|
||||
CLK("usbhs-omap.0", "usbtll_fck", &dummy_ck, CK_443X),
|
||||
CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X),
|
||||
CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X),
|
||||
CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
|
||||
CLK("omap_timer.1", "32k_ck", &sys_32k_ck, CK_443X),
|
||||
CLK("omap_timer.2", "32k_ck", &sys_32k_ck, CK_443X),
|
||||
|
@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
|
||||
pdata->reg_size = 4;
|
||||
pdata->has_ccr = true;
|
||||
}
|
||||
pdata->set_clk_src = omap2_mcbsp_set_clk_src;
|
||||
if (id == 1)
|
||||
pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
|
||||
|
||||
if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
|
||||
if (id == 2)
|
||||
@ -174,9 +177,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
|
||||
name, oh->name);
|
||||
return PTR_ERR(pdev);
|
||||
}
|
||||
pdata->set_clk_src = omap2_mcbsp_set_clk_src;
|
||||
if (id == 1)
|
||||
pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
|
||||
omap_mcbsp_count++;
|
||||
return 0;
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
|
||||
static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
|
||||
static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
|
||||
static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
|
||||
static struct omap_hwmod omap3xxx_usb_host_hs_hwmod;
|
||||
static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod;
|
||||
|
||||
/* L3 -> L4_CORE interface */
|
||||
static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
|
||||
@ -164,6 +166,7 @@ static struct omap_hwmod omap3xxx_uart1_hwmod;
|
||||
static struct omap_hwmod omap3xxx_uart2_hwmod;
|
||||
static struct omap_hwmod omap3xxx_uart3_hwmod;
|
||||
static struct omap_hwmod omap3xxx_uart4_hwmod;
|
||||
static struct omap_hwmod am35xx_uart4_hwmod;
|
||||
static struct omap_hwmod omap3xxx_usbhsotg_hwmod;
|
||||
|
||||
/* l3_core -> usbhsotg interface */
|
||||
@ -299,6 +302,23 @@ static struct omap_hwmod_ocp_if omap3_l4_per__uart4 = {
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
/* AM35xx: L4 CORE -> UART4 interface */
|
||||
static struct omap_hwmod_addr_space am35xx_uart4_addr_space[] = {
|
||||
{
|
||||
.pa_start = OMAP3_UART4_AM35XX_BASE,
|
||||
.pa_end = OMAP3_UART4_AM35XX_BASE + SZ_1K - 1,
|
||||
.flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
|
||||
},
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if am35xx_l4_core__uart4 = {
|
||||
.master = &omap3xxx_l4_core_hwmod,
|
||||
.slave = &am35xx_uart4_hwmod,
|
||||
.clk = "uart4_ick",
|
||||
.addr = am35xx_uart4_addr_space,
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
/* L4 CORE -> I2C1 interface */
|
||||
static struct omap_hwmod_ocp_if omap3_l4_core__i2c1 = {
|
||||
.master = &omap3xxx_l4_core_hwmod,
|
||||
@ -1162,6 +1182,7 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
|
||||
SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
|
||||
SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
|
||||
.clockact = CLOCKACT_TEST_ICLK,
|
||||
.sysc_fields = &omap_hwmod_sysc_type1,
|
||||
};
|
||||
|
||||
@ -1309,6 +1330,39 @@ static struct omap_hwmod omap3xxx_uart4_hwmod = {
|
||||
.class = &omap2_uart_class,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = {
|
||||
{ .irq = INT_35XX_UART4_IRQ, },
|
||||
};
|
||||
|
||||
static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = {
|
||||
{ .name = "rx", .dma_req = AM35XX_DMA_UART4_RX, },
|
||||
{ .name = "tx", .dma_req = AM35XX_DMA_UART4_TX, },
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *am35xx_uart4_slaves[] = {
|
||||
&am35xx_l4_core__uart4,
|
||||
};
|
||||
|
||||
static struct omap_hwmod am35xx_uart4_hwmod = {
|
||||
.name = "uart4",
|
||||
.mpu_irqs = am35xx_uart4_mpu_irqs,
|
||||
.sdma_reqs = am35xx_uart4_sdma_reqs,
|
||||
.main_clk = "uart4_fck",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.module_offs = CORE_MOD,
|
||||
.prcm_reg_id = 1,
|
||||
.module_bit = OMAP3430_EN_UART4_SHIFT,
|
||||
.idlest_reg_id = 1,
|
||||
.idlest_idle_bit = OMAP3430_EN_UART4_SHIFT,
|
||||
},
|
||||
},
|
||||
.slaves = am35xx_uart4_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(am35xx_uart4_slaves),
|
||||
.class = &omap2_uart_class,
|
||||
};
|
||||
|
||||
|
||||
static struct omap_hwmod_class i2c_class = {
|
||||
.name = "i2c",
|
||||
.sysc = &i2c_sysc,
|
||||
@ -1636,7 +1690,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_i2c1_slaves[] = {
|
||||
|
||||
static struct omap_hwmod omap3xxx_i2c1_hwmod = {
|
||||
.name = "i2c1",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = omap2_i2c1_mpu_irqs,
|
||||
.sdma_reqs = omap2_i2c1_sdma_reqs,
|
||||
.main_clk = "i2c1_fck",
|
||||
@ -1670,7 +1724,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_i2c2_slaves[] = {
|
||||
|
||||
static struct omap_hwmod omap3xxx_i2c2_hwmod = {
|
||||
.name = "i2c2",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = omap2_i2c2_mpu_irqs,
|
||||
.sdma_reqs = omap2_i2c2_sdma_reqs,
|
||||
.main_clk = "i2c2_fck",
|
||||
@ -1715,7 +1769,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_i2c3_slaves[] = {
|
||||
|
||||
static struct omap_hwmod omap3xxx_i2c3_hwmod = {
|
||||
.name = "i2c3",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = i2c3_mpu_irqs,
|
||||
.sdma_reqs = i2c3_sdma_reqs,
|
||||
.main_clk = "i2c3_fck",
|
||||
@ -3072,7 +3126,35 @@ static struct omap_mmc_dev_attr mmc1_dev_attr = {
|
||||
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_mmc1_hwmod = {
|
||||
/* See 35xx errata 2.1.1.128 in SPRZ278F */
|
||||
static struct omap_mmc_dev_attr mmc1_pre_es3_dev_attr = {
|
||||
.flags = (OMAP_HSMMC_SUPPORTS_DUAL_VOLT |
|
||||
OMAP_HSMMC_BROKEN_MULTIBLOCK_READ),
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_pre_es3_mmc1_hwmod = {
|
||||
.name = "mmc1",
|
||||
.mpu_irqs = omap34xx_mmc1_mpu_irqs,
|
||||
.sdma_reqs = omap34xx_mmc1_sdma_reqs,
|
||||
.opt_clks = omap34xx_mmc1_opt_clks,
|
||||
.opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks),
|
||||
.main_clk = "mmchs1_fck",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.module_offs = CORE_MOD,
|
||||
.prcm_reg_id = 1,
|
||||
.module_bit = OMAP3430_EN_MMC1_SHIFT,
|
||||
.idlest_reg_id = 1,
|
||||
.idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT,
|
||||
},
|
||||
},
|
||||
.dev_attr = &mmc1_pre_es3_dev_attr,
|
||||
.slaves = omap3xxx_mmc1_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves),
|
||||
.class = &omap34xx_mmc_class,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_es3plus_mmc1_hwmod = {
|
||||
.name = "mmc1",
|
||||
.mpu_irqs = omap34xx_mmc1_mpu_irqs,
|
||||
.sdma_reqs = omap34xx_mmc1_sdma_reqs,
|
||||
@ -3115,7 +3197,34 @@ static struct omap_hwmod_ocp_if *omap3xxx_mmc2_slaves[] = {
|
||||
&omap3xxx_l4_core__mmc2,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_mmc2_hwmod = {
|
||||
/* See 35xx errata 2.1.1.128 in SPRZ278F */
|
||||
static struct omap_mmc_dev_attr mmc2_pre_es3_dev_attr = {
|
||||
.flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_pre_es3_mmc2_hwmod = {
|
||||
.name = "mmc2",
|
||||
.mpu_irqs = omap34xx_mmc2_mpu_irqs,
|
||||
.sdma_reqs = omap34xx_mmc2_sdma_reqs,
|
||||
.opt_clks = omap34xx_mmc2_opt_clks,
|
||||
.opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks),
|
||||
.main_clk = "mmchs2_fck",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.module_offs = CORE_MOD,
|
||||
.prcm_reg_id = 1,
|
||||
.module_bit = OMAP3430_EN_MMC2_SHIFT,
|
||||
.idlest_reg_id = 1,
|
||||
.idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT,
|
||||
},
|
||||
},
|
||||
.dev_attr = &mmc2_pre_es3_dev_attr,
|
||||
.slaves = omap3xxx_mmc2_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves),
|
||||
.class = &omap34xx_mmc_class,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_es3plus_mmc2_hwmod = {
|
||||
.name = "mmc2",
|
||||
.mpu_irqs = omap34xx_mmc2_mpu_irqs,
|
||||
.sdma_reqs = omap34xx_mmc2_sdma_reqs,
|
||||
@ -3177,13 +3286,223 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = {
|
||||
.class = &omap34xx_mmc_class,
|
||||
};
|
||||
|
||||
/*
|
||||
* 'usb_host_hs' class
|
||||
* high-speed multi-port usb host controller
|
||||
*/
|
||||
static struct omap_hwmod_ocp_if omap3xxx_usb_host_hs__l3_main_2 = {
|
||||
.master = &omap3xxx_usb_host_hs_hwmod,
|
||||
.slave = &omap3xxx_l3_main_hwmod,
|
||||
.clk = "core_l3_ick",
|
||||
.user = OCP_USER_MPU,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class_sysconfig omap3xxx_usb_host_hs_sysc = {
|
||||
.rev_offs = 0x0000,
|
||||
.sysc_offs = 0x0010,
|
||||
.syss_offs = 0x0014,
|
||||
.sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
|
||||
SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
|
||||
SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
|
||||
MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
|
||||
.sysc_fields = &omap_hwmod_sysc_type1,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class omap3xxx_usb_host_hs_hwmod_class = {
|
||||
.name = "usb_host_hs",
|
||||
.sysc = &omap3xxx_usb_host_hs_sysc,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *omap3xxx_usb_host_hs_masters[] = {
|
||||
&omap3xxx_usb_host_hs__l3_main_2,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_addr_space omap3xxx_usb_host_hs_addrs[] = {
|
||||
{
|
||||
.name = "uhh",
|
||||
.pa_start = 0x48064000,
|
||||
.pa_end = 0x480643ff,
|
||||
.flags = ADDR_TYPE_RT
|
||||
},
|
||||
{
|
||||
.name = "ohci",
|
||||
.pa_start = 0x48064400,
|
||||
.pa_end = 0x480647ff,
|
||||
},
|
||||
{
|
||||
.name = "ehci",
|
||||
.pa_start = 0x48064800,
|
||||
.pa_end = 0x48064cff,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if omap3xxx_l4_core__usb_host_hs = {
|
||||
.master = &omap3xxx_l4_core_hwmod,
|
||||
.slave = &omap3xxx_usb_host_hs_hwmod,
|
||||
.clk = "usbhost_ick",
|
||||
.addr = omap3xxx_usb_host_hs_addrs,
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *omap3xxx_usb_host_hs_slaves[] = {
|
||||
&omap3xxx_l4_core__usb_host_hs,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = {
|
||||
{ .role = "ehci_logic_fck", .clk = "usbhost_120m_fck", },
|
||||
};
|
||||
|
||||
static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = {
|
||||
{ .name = "ohci-irq", .irq = 76 },
|
||||
{ .name = "ehci-irq", .irq = 77 },
|
||||
{ .irq = -1 }
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
|
||||
.name = "usb_host_hs",
|
||||
.class = &omap3xxx_usb_host_hs_hwmod_class,
|
||||
.clkdm_name = "l3_init_clkdm",
|
||||
.mpu_irqs = omap3xxx_usb_host_hs_irqs,
|
||||
.main_clk = "usbhost_48m_fck",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.module_offs = OMAP3430ES2_USBHOST_MOD,
|
||||
.prcm_reg_id = 1,
|
||||
.module_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
|
||||
.idlest_reg_id = 1,
|
||||
.idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT,
|
||||
.idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
|
||||
},
|
||||
},
|
||||
.opt_clks = omap3xxx_usb_host_hs_opt_clks,
|
||||
.opt_clks_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_opt_clks),
|
||||
.slaves = omap3xxx_usb_host_hs_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_slaves),
|
||||
.masters = omap3xxx_usb_host_hs_masters,
|
||||
.masters_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_masters),
|
||||
|
||||
/*
|
||||
* Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
|
||||
* id: i660
|
||||
*
|
||||
* Description:
|
||||
* In the following configuration :
|
||||
* - USBHOST module is set to smart-idle mode
|
||||
* - PRCM asserts idle_req to the USBHOST module ( This typically
|
||||
* happens when the system is going to a low power mode : all ports
|
||||
* have been suspended, the master part of the USBHOST module has
|
||||
* entered the standby state, and SW has cut the functional clocks)
|
||||
* - an USBHOST interrupt occurs before the module is able to answer
|
||||
* idle_ack, typically a remote wakeup IRQ.
|
||||
* Then the USB HOST module will enter a deadlock situation where it
|
||||
* is no more accessible nor functional.
|
||||
*
|
||||
* Workaround:
|
||||
* Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE
|
||||
*/
|
||||
|
||||
/*
|
||||
* Errata: USB host EHCI may stall when entering smart-standby mode
|
||||
* Id: i571
|
||||
*
|
||||
* Description:
|
||||
* When the USBHOST module is set to smart-standby mode, and when it is
|
||||
* ready to enter the standby state (i.e. all ports are suspended and
|
||||
* all attached devices are in suspend mode), then it can wrongly assert
|
||||
* the Mstandby signal too early while there are still some residual OCP
|
||||
* transactions ongoing. If this condition occurs, the internal state
|
||||
* machine may go to an undefined state and the USB link may be stuck
|
||||
* upon the next resume.
|
||||
*
|
||||
* Workaround:
|
||||
* Don't use smart standby; use only force standby,
|
||||
* hence HWMOD_SWSUP_MSTANDBY
|
||||
*/
|
||||
|
||||
/*
|
||||
* During system boot; If the hwmod framework resets the module
|
||||
* the module will have smart idle settings; which can lead to deadlock
|
||||
* (above Errata Id:i660); so, dont reset the module during boot;
|
||||
* Use HWMOD_INIT_NO_RESET.
|
||||
*/
|
||||
|
||||
.flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
|
||||
HWMOD_INIT_NO_RESET,
|
||||
};
|
||||
|
||||
/*
|
||||
* 'usb_tll_hs' class
|
||||
* usb_tll_hs module is the adapter on the usb_host_hs ports
|
||||
*/
|
||||
static struct omap_hwmod_class_sysconfig omap3xxx_usb_tll_hs_sysc = {
|
||||
.rev_offs = 0x0000,
|
||||
.sysc_offs = 0x0010,
|
||||
.syss_offs = 0x0014,
|
||||
.sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
|
||||
SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
|
||||
SYSC_HAS_AUTOIDLE),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
|
||||
.sysc_fields = &omap_hwmod_sysc_type1,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class omap3xxx_usb_tll_hs_hwmod_class = {
|
||||
.name = "usb_tll_hs",
|
||||
.sysc = &omap3xxx_usb_tll_hs_sysc,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = {
|
||||
{ .name = "tll-irq", .irq = 78 },
|
||||
{ .irq = -1 }
|
||||
};
|
||||
|
||||
static struct omap_hwmod_addr_space omap3xxx_usb_tll_hs_addrs[] = {
|
||||
{
|
||||
.name = "tll",
|
||||
.pa_start = 0x48062000,
|
||||
.pa_end = 0x48062fff,
|
||||
.flags = ADDR_TYPE_RT
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if omap3xxx_l4_core__usb_tll_hs = {
|
||||
.master = &omap3xxx_l4_core_hwmod,
|
||||
.slave = &omap3xxx_usb_tll_hs_hwmod,
|
||||
.clk = "usbtll_ick",
|
||||
.addr = omap3xxx_usb_tll_hs_addrs,
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *omap3xxx_usb_tll_hs_slaves[] = {
|
||||
&omap3xxx_l4_core__usb_tll_hs,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = {
|
||||
.name = "usb_tll_hs",
|
||||
.class = &omap3xxx_usb_tll_hs_hwmod_class,
|
||||
.clkdm_name = "l3_init_clkdm",
|
||||
.mpu_irqs = omap3xxx_usb_tll_hs_irqs,
|
||||
.main_clk = "usbtll_fck",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.module_offs = CORE_MOD,
|
||||
.prcm_reg_id = 3,
|
||||
.module_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
|
||||
.idlest_reg_id = 3,
|
||||
.idlest_idle_bit = OMAP3430ES2_ST_USBTLL_SHIFT,
|
||||
},
|
||||
},
|
||||
.slaves = omap3xxx_usb_tll_hs_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(omap3xxx_usb_tll_hs_slaves),
|
||||
};
|
||||
|
||||
static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
|
||||
&omap3xxx_l3_main_hwmod,
|
||||
&omap3xxx_l4_core_hwmod,
|
||||
&omap3xxx_l4_per_hwmod,
|
||||
&omap3xxx_l4_wkup_hwmod,
|
||||
&omap3xxx_mmc1_hwmod,
|
||||
&omap3xxx_mmc2_hwmod,
|
||||
&omap3xxx_mmc3_hwmod,
|
||||
&omap3xxx_mpu_hwmod,
|
||||
|
||||
@ -3198,12 +3517,12 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
|
||||
&omap3xxx_timer9_hwmod,
|
||||
&omap3xxx_timer10_hwmod,
|
||||
&omap3xxx_timer11_hwmod,
|
||||
&omap3xxx_timer12_hwmod,
|
||||
|
||||
&omap3xxx_wd_timer2_hwmod,
|
||||
&omap3xxx_uart1_hwmod,
|
||||
&omap3xxx_uart2_hwmod,
|
||||
&omap3xxx_uart3_hwmod,
|
||||
|
||||
/* dss class */
|
||||
&omap3xxx_dss_dispc_hwmod,
|
||||
&omap3xxx_dss_dsi1_hwmod,
|
||||
@ -3245,20 +3564,38 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* GP-only hwmods */
|
||||
static __initdata struct omap_hwmod *omap3xxx_gp_hwmods[] = {
|
||||
&omap3xxx_timer12_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* 3430ES1-only hwmods */
|
||||
static __initdata struct omap_hwmod *omap3430es1_hwmods[] = {
|
||||
&omap3xxx_iva_hwmod,
|
||||
&omap3430es1_dss_core_hwmod,
|
||||
&omap3xxx_mailbox_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* 3430ES2+-only hwmods */
|
||||
static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = {
|
||||
&omap3xxx_iva_hwmod,
|
||||
&omap3xxx_dss_core_hwmod,
|
||||
&omap3xxx_usbhsotg_hwmod,
|
||||
&omap3xxx_mailbox_hwmod,
|
||||
&omap3xxx_usb_host_hs_hwmod,
|
||||
&omap3xxx_usb_tll_hs_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* <= 3430ES3-only hwmods */
|
||||
static struct omap_hwmod *omap3430_pre_es3_hwmods[] __initdata = {
|
||||
&omap3xxx_pre_es3_mmc1_hwmod,
|
||||
&omap3xxx_pre_es3_mmc2_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* 3430ES3+-only hwmods */
|
||||
static struct omap_hwmod *omap3430_es3plus_hwmods[] __initdata = {
|
||||
&omap3xxx_es3plus_mmc1_hwmod,
|
||||
&omap3xxx_es3plus_mmc2_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -3280,12 +3617,21 @@ static __initdata struct omap_hwmod *omap36xx_hwmods[] = {
|
||||
&omap36xx_sr2_hwmod,
|
||||
&omap3xxx_usbhsotg_hwmod,
|
||||
&omap3xxx_mailbox_hwmod,
|
||||
&omap3xxx_usb_host_hs_hwmod,
|
||||
&omap3xxx_usb_tll_hs_hwmod,
|
||||
&omap3xxx_es3plus_mmc1_hwmod,
|
||||
&omap3xxx_es3plus_mmc2_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
static __initdata struct omap_hwmod *am35xx_hwmods[] = {
|
||||
&omap3xxx_dss_core_hwmod, /* XXX ??? */
|
||||
&am35xx_usbhsotg_hwmod,
|
||||
&am35xx_uart4_hwmod,
|
||||
&omap3xxx_usb_host_hs_hwmod,
|
||||
&omap3xxx_usb_tll_hs_hwmod,
|
||||
&omap3xxx_es3plus_mmc1_hwmod,
|
||||
&omap3xxx_es3plus_mmc2_hwmod,
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -3300,6 +3646,13 @@ int __init omap3xxx_hwmod_init(void)
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
/* Register GP-only hwmods. */
|
||||
if (omap_type() == OMAP2_DEVICE_TYPE_GP) {
|
||||
r = omap_hwmod_register(omap3xxx_gp_hwmods);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
rev = omap_rev();
|
||||
|
||||
/*
|
||||
@ -3338,6 +3691,21 @@ int __init omap3xxx_hwmod_init(void)
|
||||
h = omap3430es2plus_hwmods;
|
||||
};
|
||||
|
||||
if (h) {
|
||||
r = omap_hwmod_register(h);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
h = NULL;
|
||||
if (rev == OMAP3430_REV_ES1_0 || rev == OMAP3430_REV_ES2_0 ||
|
||||
rev == OMAP3430_REV_ES2_1) {
|
||||
h = omap3430_pre_es3_hwmods;
|
||||
} else if (rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
|
||||
rev == OMAP3430_REV_ES3_1_2) {
|
||||
h = omap3430_es3plus_hwmods;
|
||||
};
|
||||
|
||||
if (h)
|
||||
r = omap_hwmod_register(h);
|
||||
|
||||
|
@ -70,6 +70,8 @@ static struct omap_hwmod omap44xx_mmc2_hwmod;
|
||||
static struct omap_hwmod omap44xx_mpu_hwmod;
|
||||
static struct omap_hwmod omap44xx_mpu_private_hwmod;
|
||||
static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
|
||||
static struct omap_hwmod omap44xx_usb_host_hs_hwmod;
|
||||
static struct omap_hwmod omap44xx_usb_tll_hs_hwmod;
|
||||
|
||||
/*
|
||||
* Interconnects omap_hwmod structures
|
||||
@ -2246,6 +2248,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = {
|
||||
SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
|
||||
SIDLE_SMART_WKUP),
|
||||
.clockact = CLOCKACT_TEST_ICLK,
|
||||
.sysc_fields = &omap_hwmod_sysc_type1,
|
||||
};
|
||||
|
||||
@ -2300,7 +2303,7 @@ static struct omap_hwmod omap44xx_i2c1_hwmod = {
|
||||
.name = "i2c1",
|
||||
.class = &omap44xx_i2c_hwmod_class,
|
||||
.clkdm_name = "l4_per_clkdm",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = omap44xx_i2c1_irqs,
|
||||
.sdma_reqs = omap44xx_i2c1_sdma_reqs,
|
||||
.main_clk = "i2c1_fck",
|
||||
@ -2356,7 +2359,7 @@ static struct omap_hwmod omap44xx_i2c2_hwmod = {
|
||||
.name = "i2c2",
|
||||
.class = &omap44xx_i2c_hwmod_class,
|
||||
.clkdm_name = "l4_per_clkdm",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = omap44xx_i2c2_irqs,
|
||||
.sdma_reqs = omap44xx_i2c2_sdma_reqs,
|
||||
.main_clk = "i2c2_fck",
|
||||
@ -2412,7 +2415,7 @@ static struct omap_hwmod omap44xx_i2c3_hwmod = {
|
||||
.name = "i2c3",
|
||||
.class = &omap44xx_i2c_hwmod_class,
|
||||
.clkdm_name = "l4_per_clkdm",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = omap44xx_i2c3_irqs,
|
||||
.sdma_reqs = omap44xx_i2c3_sdma_reqs,
|
||||
.main_clk = "i2c3_fck",
|
||||
@ -2468,7 +2471,7 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = {
|
||||
.name = "i2c4",
|
||||
.class = &omap44xx_i2c_hwmod_class,
|
||||
.clkdm_name = "l4_per_clkdm",
|
||||
.flags = HWMOD_16BIT_REG,
|
||||
.flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
|
||||
.mpu_irqs = omap44xx_i2c4_irqs,
|
||||
.sdma_reqs = omap44xx_i2c4_sdma_reqs,
|
||||
.main_clk = "i2c4_fck",
|
||||
@ -5276,6 +5279,207 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
|
||||
.slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves),
|
||||
};
|
||||
|
||||
/*
|
||||
* 'usb_host_hs' class
|
||||
* high-speed multi-port usb host controller
|
||||
*/
|
||||
static struct omap_hwmod_ocp_if omap44xx_usb_host_hs__l3_main_2 = {
|
||||
.master = &omap44xx_usb_host_hs_hwmod,
|
||||
.slave = &omap44xx_l3_main_2_hwmod,
|
||||
.clk = "l3_div_ck",
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class_sysconfig omap44xx_usb_host_hs_sysc = {
|
||||
.rev_offs = 0x0000,
|
||||
.sysc_offs = 0x0010,
|
||||
.syss_offs = 0x0014,
|
||||
.sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
|
||||
SYSC_HAS_SOFTRESET),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
|
||||
SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
|
||||
MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
|
||||
.sysc_fields = &omap_hwmod_sysc_type2,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class omap44xx_usb_host_hs_hwmod_class = {
|
||||
.name = "usb_host_hs",
|
||||
.sysc = &omap44xx_usb_host_hs_sysc,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_masters[] = {
|
||||
&omap44xx_usb_host_hs__l3_main_2,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_addr_space omap44xx_usb_host_hs_addrs[] = {
|
||||
{
|
||||
.name = "uhh",
|
||||
.pa_start = 0x4a064000,
|
||||
.pa_end = 0x4a0647ff,
|
||||
.flags = ADDR_TYPE_RT
|
||||
},
|
||||
{
|
||||
.name = "ohci",
|
||||
.pa_start = 0x4a064800,
|
||||
.pa_end = 0x4a064bff,
|
||||
},
|
||||
{
|
||||
.name = "ehci",
|
||||
.pa_start = 0x4a064c00,
|
||||
.pa_end = 0x4a064fff,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static struct omap_hwmod_irq_info omap44xx_usb_host_hs_irqs[] = {
|
||||
{ .name = "ohci-irq", .irq = 76 + OMAP44XX_IRQ_GIC_START },
|
||||
{ .name = "ehci-irq", .irq = 77 + OMAP44XX_IRQ_GIC_START },
|
||||
{ .irq = -1 }
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = {
|
||||
.master = &omap44xx_l4_cfg_hwmod,
|
||||
.slave = &omap44xx_usb_host_hs_hwmod,
|
||||
.clk = "l4_div_ck",
|
||||
.addr = omap44xx_usb_host_hs_addrs,
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_slaves[] = {
|
||||
&omap44xx_l4_cfg__usb_host_hs,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap44xx_usb_host_hs_hwmod = {
|
||||
.name = "usb_host_hs",
|
||||
.class = &omap44xx_usb_host_hs_hwmod_class,
|
||||
.clkdm_name = "l3_init_clkdm",
|
||||
.main_clk = "usb_host_hs_fck",
|
||||
.prcm = {
|
||||
.omap4 = {
|
||||
.clkctrl_offs = OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET,
|
||||
.context_offs = OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET,
|
||||
.modulemode = MODULEMODE_SWCTRL,
|
||||
},
|
||||
},
|
||||
.mpu_irqs = omap44xx_usb_host_hs_irqs,
|
||||
.slaves = omap44xx_usb_host_hs_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_slaves),
|
||||
.masters = omap44xx_usb_host_hs_masters,
|
||||
.masters_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_masters),
|
||||
|
||||
/*
|
||||
* Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
|
||||
* id: i660
|
||||
*
|
||||
* Description:
|
||||
* In the following configuration :
|
||||
* - USBHOST module is set to smart-idle mode
|
||||
* - PRCM asserts idle_req to the USBHOST module ( This typically
|
||||
* happens when the system is going to a low power mode : all ports
|
||||
* have been suspended, the master part of the USBHOST module has
|
||||
* entered the standby state, and SW has cut the functional clocks)
|
||||
* - an USBHOST interrupt occurs before the module is able to answer
|
||||
* idle_ack, typically a remote wakeup IRQ.
|
||||
* Then the USB HOST module will enter a deadlock situation where it
|
||||
* is no more accessible nor functional.
|
||||
*
|
||||
* Workaround:
|
||||
* Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE
|
||||
*/
|
||||
|
||||
/*
|
||||
* Errata: USB host EHCI may stall when entering smart-standby mode
|
||||
* Id: i571
|
||||
*
|
||||
* Description:
|
||||
* When the USBHOST module is set to smart-standby mode, and when it is
|
||||
* ready to enter the standby state (i.e. all ports are suspended and
|
||||
* all attached devices are in suspend mode), then it can wrongly assert
|
||||
* the Mstandby signal too early while there are still some residual OCP
|
||||
* transactions ongoing. If this condition occurs, the internal state
|
||||
* machine may go to an undefined state and the USB link may be stuck
|
||||
* upon the next resume.
|
||||
*
|
||||
* Workaround:
|
||||
* Don't use smart standby; use only force standby,
|
||||
* hence HWMOD_SWSUP_MSTANDBY
|
||||
*/
|
||||
|
||||
/*
|
||||
* During system boot; If the hwmod framework resets the module
|
||||
* the module will have smart idle settings; which can lead to deadlock
|
||||
* (above Errata Id:i660); so, dont reset the module during boot;
|
||||
* Use HWMOD_INIT_NO_RESET.
|
||||
*/
|
||||
|
||||
.flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
|
||||
HWMOD_INIT_NO_RESET,
|
||||
};
|
||||
|
||||
/*
|
||||
* 'usb_tll_hs' class
|
||||
* usb_tll_hs module is the adapter on the usb_host_hs ports
|
||||
*/
|
||||
static struct omap_hwmod_class_sysconfig omap44xx_usb_tll_hs_sysc = {
|
||||
.rev_offs = 0x0000,
|
||||
.sysc_offs = 0x0010,
|
||||
.syss_offs = 0x0014,
|
||||
.sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
|
||||
SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
|
||||
SYSC_HAS_AUTOIDLE),
|
||||
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
|
||||
.sysc_fields = &omap_hwmod_sysc_type1,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_class omap44xx_usb_tll_hs_hwmod_class = {
|
||||
.name = "usb_tll_hs",
|
||||
.sysc = &omap44xx_usb_tll_hs_sysc,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_irq_info omap44xx_usb_tll_hs_irqs[] = {
|
||||
{ .name = "tll-irq", .irq = 78 + OMAP44XX_IRQ_GIC_START },
|
||||
{ .irq = -1 }
|
||||
};
|
||||
|
||||
static struct omap_hwmod_addr_space omap44xx_usb_tll_hs_addrs[] = {
|
||||
{
|
||||
.name = "tll",
|
||||
.pa_start = 0x4a062000,
|
||||
.pa_end = 0x4a063fff,
|
||||
.flags = ADDR_TYPE_RT
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_tll_hs = {
|
||||
.master = &omap44xx_l4_cfg_hwmod,
|
||||
.slave = &omap44xx_usb_tll_hs_hwmod,
|
||||
.clk = "l4_div_ck",
|
||||
.addr = omap44xx_usb_tll_hs_addrs,
|
||||
.user = OCP_USER_MPU | OCP_USER_SDMA,
|
||||
};
|
||||
|
||||
static struct omap_hwmod_ocp_if *omap44xx_usb_tll_hs_slaves[] = {
|
||||
&omap44xx_l4_cfg__usb_tll_hs,
|
||||
};
|
||||
|
||||
static struct omap_hwmod omap44xx_usb_tll_hs_hwmod = {
|
||||
.name = "usb_tll_hs",
|
||||
.class = &omap44xx_usb_tll_hs_hwmod_class,
|
||||
.clkdm_name = "l3_init_clkdm",
|
||||
.main_clk = "usb_tll_hs_ick",
|
||||
.prcm = {
|
||||
.omap4 = {
|
||||
.clkctrl_offs = OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET,
|
||||
.context_offs = OMAP4_RM_L3INIT_USB_TLL_CONTEXT_OFFSET,
|
||||
.modulemode = MODULEMODE_HWCTRL,
|
||||
},
|
||||
},
|
||||
.mpu_irqs = omap44xx_usb_tll_hs_irqs,
|
||||
.slaves = omap44xx_usb_tll_hs_slaves,
|
||||
.slaves_cnt = ARRAY_SIZE(omap44xx_usb_tll_hs_slaves),
|
||||
};
|
||||
|
||||
static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
|
||||
|
||||
/* dmm class */
|
||||
@ -5415,13 +5619,16 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
|
||||
&omap44xx_uart3_hwmod,
|
||||
&omap44xx_uart4_hwmod,
|
||||
|
||||
/* usb host class */
|
||||
&omap44xx_usb_host_hs_hwmod,
|
||||
&omap44xx_usb_tll_hs_hwmod,
|
||||
|
||||
/* usb_otg_hs class */
|
||||
&omap44xx_usb_otg_hs_hwmod,
|
||||
|
||||
/* wd_timer class */
|
||||
&omap44xx_wd_timer2_hwmod,
|
||||
&omap44xx_wd_timer3_hwmod,
|
||||
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
@ -201,6 +201,8 @@
|
||||
#define OMAP3430_EN_MMC2_SHIFT 25
|
||||
#define OMAP3430_EN_MMC1_MASK (1 << 24)
|
||||
#define OMAP3430_EN_MMC1_SHIFT 24
|
||||
#define OMAP3430_EN_UART4_MASK (1 << 23)
|
||||
#define OMAP3430_EN_UART4_SHIFT 23
|
||||
#define OMAP3430_EN_MCSPI4_MASK (1 << 21)
|
||||
#define OMAP3430_EN_MCSPI4_SHIFT 21
|
||||
#define OMAP3430_EN_MCSPI3_MASK (1 << 20)
|
||||
|
@ -28,51 +28,28 @@
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <plat/usb.h>
|
||||
#include <plat/omap_device.h>
|
||||
|
||||
#include "mux.h"
|
||||
|
||||
#ifdef CONFIG_MFD_OMAP_USB_HOST
|
||||
|
||||
#define OMAP_USBHS_DEVICE "usbhs-omap"
|
||||
|
||||
static struct resource usbhs_resources[] = {
|
||||
{
|
||||
.name = "uhh",
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.name = "tll",
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.name = "ehci",
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.name = "ehci-irq",
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.name = "ohci",
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.name = "ohci-irq",
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device usbhs_device = {
|
||||
.name = OMAP_USBHS_DEVICE,
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(usbhs_resources),
|
||||
.resource = usbhs_resources,
|
||||
};
|
||||
#define OMAP_USBHS_DEVICE "usbhs_omap"
|
||||
#define USBHS_UHH_HWMODNAME "usb_host_hs"
|
||||
#define USBHS_TLL_HWMODNAME "usb_tll_hs"
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_data;
|
||||
static struct ehci_hcd_omap_platform_data ehci_data;
|
||||
static struct ohci_hcd_omap_platform_data ohci_data;
|
||||
|
||||
static struct omap_device_pm_latency omap_uhhtll_latency[] = {
|
||||
{
|
||||
.deactivate_func = omap_device_idle_hwmods,
|
||||
.activate_func = omap_device_enable_hwmods,
|
||||
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
|
||||
},
|
||||
};
|
||||
|
||||
/* MUX settings for EHCI pins */
|
||||
/*
|
||||
* setup_ehci_io_mux - initialize IO pad mux for USBHOST
|
||||
@ -508,7 +485,10 @@ static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
|
||||
|
||||
void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
|
||||
{
|
||||
int i;
|
||||
struct omap_hwmod *oh[2];
|
||||
struct omap_device *od;
|
||||
int bus_id = -1;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
|
||||
usbhs_data.port_mode[i] = pdata->port_mode[i];
|
||||
@ -523,44 +503,34 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
|
||||
usbhs_data.ohci_data = &ohci_data;
|
||||
|
||||
if (cpu_is_omap34xx()) {
|
||||
usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE;
|
||||
usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
|
||||
usbhs_resources[1].start = OMAP34XX_USBTLL_BASE;
|
||||
usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
|
||||
usbhs_resources[2].start = OMAP34XX_EHCI_BASE;
|
||||
usbhs_resources[2].end = OMAP34XX_EHCI_BASE + SZ_1K - 1;
|
||||
usbhs_resources[3].start = INT_34XX_EHCI_IRQ;
|
||||
usbhs_resources[4].start = OMAP34XX_OHCI_BASE;
|
||||
usbhs_resources[4].end = OMAP34XX_OHCI_BASE + SZ_1K - 1;
|
||||
usbhs_resources[5].start = INT_34XX_OHCI_IRQ;
|
||||
setup_ehci_io_mux(pdata->port_mode);
|
||||
setup_ohci_io_mux(pdata->port_mode);
|
||||
} else if (cpu_is_omap44xx()) {
|
||||
usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE;
|
||||
usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
|
||||
usbhs_resources[1].start = OMAP44XX_USBTLL_BASE;
|
||||
usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
|
||||
usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE;
|
||||
usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
|
||||
usbhs_resources[3].start = OMAP44XX_IRQ_EHCI;
|
||||
usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE;
|
||||
usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
|
||||
usbhs_resources[5].start = OMAP44XX_IRQ_OHCI;
|
||||
setup_4430ehci_io_mux(pdata->port_mode);
|
||||
setup_4430ohci_io_mux(pdata->port_mode);
|
||||
}
|
||||
|
||||
if (platform_device_add_data(&usbhs_device,
|
||||
&usbhs_data, sizeof(usbhs_data)) < 0) {
|
||||
printk(KERN_ERR "USBHS platform_device_add_data failed\n");
|
||||
goto init_end;
|
||||
oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
|
||||
if (!oh[0]) {
|
||||
pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
|
||||
return;
|
||||
}
|
||||
|
||||
if (platform_device_register(&usbhs_device) < 0)
|
||||
printk(KERN_ERR "USBHS platform_device_register failed\n");
|
||||
oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
|
||||
if (!oh[1]) {
|
||||
pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
|
||||
return;
|
||||
}
|
||||
|
||||
init_end:
|
||||
return;
|
||||
od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,
|
||||
(void *)&usbhs_data, sizeof(usbhs_data),
|
||||
omap_uhhtll_latency,
|
||||
ARRAY_SIZE(omap_uhhtll_latency), false);
|
||||
if (IS_ERR(od)) {
|
||||
pr_err("Could not build hwmod devices %s,%s\n",
|
||||
USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
@ -570,5 +540,3 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -357,7 +357,7 @@
|
||||
#define INT_35XX_EMAC_C0_TX_PULSE_IRQ 69
|
||||
#define INT_35XX_EMAC_C0_MISC_PULSE_IRQ 70
|
||||
#define INT_35XX_USBOTG_IRQ 71
|
||||
#define INT_35XX_UART4 84
|
||||
#define INT_35XX_UART4_IRQ 84
|
||||
#define INT_35XX_CCDC_VD0_IRQ 88
|
||||
#define INT_35XX_CCDC_VD1_IRQ 92
|
||||
#define INT_35XX_CCDC_VD2_IRQ 93
|
||||
|
@ -44,6 +44,7 @@
|
||||
#define OMAP3_UART2_BASE OMAP2_UART2_BASE
|
||||
#define OMAP3_UART3_BASE 0x49020000
|
||||
#define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
|
||||
#define OMAP3_UART4_AM35XX_BASE 0x4809E000 /* Only on AM35xx */
|
||||
|
||||
/* OMAP4 serial ports */
|
||||
#define OMAP4_UART1_BASE OMAP2_UART1_BASE
|
||||
|
@ -100,9 +100,6 @@ extern void usb_musb_init(struct omap_musb_board_data *board_data);
|
||||
|
||||
extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
|
||||
|
||||
extern int omap_usbhs_enable(struct device *dev);
|
||||
extern void omap_usbhs_disable(struct device *dev);
|
||||
|
||||
extern int omap4430_phy_power(struct device *dev, int ID, int on);
|
||||
extern int omap4430_phy_set_clk(struct device *dev, int on);
|
||||
extern int omap4430_phy_init(struct device *dev);
|
||||
|
@ -27,8 +27,9 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <plat/usb.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
#define USBHS_DRIVER_NAME "usbhs-omap"
|
||||
#define USBHS_DRIVER_NAME "usbhs_omap"
|
||||
#define OMAP_EHCI_DEVICE "ehci-omap"
|
||||
#define OMAP_OHCI_DEVICE "ohci-omap3"
|
||||
|
||||
@ -147,9 +148,6 @@
|
||||
|
||||
|
||||
struct usbhs_hcd_omap {
|
||||
struct clk *usbhost_ick;
|
||||
struct clk *usbhost_hs_fck;
|
||||
struct clk *usbhost_fs_fck;
|
||||
struct clk *xclk60mhsp1_ck;
|
||||
struct clk *xclk60mhsp2_ck;
|
||||
struct clk *utmi_p1_fck;
|
||||
@ -159,8 +157,7 @@ struct usbhs_hcd_omap {
|
||||
struct clk *usbhost_p2_fck;
|
||||
struct clk *usbtll_p2_fck;
|
||||
struct clk *init_60m_fclk;
|
||||
struct clk *usbtll_fck;
|
||||
struct clk *usbtll_ick;
|
||||
struct clk *ehci_logic_fck;
|
||||
|
||||
void __iomem *uhh_base;
|
||||
void __iomem *tll_base;
|
||||
@ -169,7 +166,6 @@ struct usbhs_hcd_omap {
|
||||
|
||||
u32 usbhs_rev;
|
||||
spinlock_t lock;
|
||||
int count;
|
||||
};
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@ -319,269 +315,6 @@ err_end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* usbhs_omap_probe - initialize TI-based HCDs
|
||||
*
|
||||
* Allocates basic resources for this USB host controller.
|
||||
*/
|
||||
static int __devinit usbhs_omap_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct usbhs_omap_platform_data *pdata = dev->platform_data;
|
||||
struct usbhs_hcd_omap *omap;
|
||||
struct resource *res;
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
if (!pdata) {
|
||||
dev_err(dev, "Missing platform data\n");
|
||||
ret = -ENOMEM;
|
||||
goto end_probe;
|
||||
}
|
||||
|
||||
omap = kzalloc(sizeof(*omap), GFP_KERNEL);
|
||||
if (!omap) {
|
||||
dev_err(dev, "Memory allocation failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto end_probe;
|
||||
}
|
||||
|
||||
spin_lock_init(&omap->lock);
|
||||
|
||||
for (i = 0; i < OMAP3_HS_USB_PORTS; i++)
|
||||
omap->platdata.port_mode[i] = pdata->port_mode[i];
|
||||
|
||||
omap->platdata.ehci_data = pdata->ehci_data;
|
||||
omap->platdata.ohci_data = pdata->ohci_data;
|
||||
|
||||
omap->usbhost_ick = clk_get(dev, "usbhost_ick");
|
||||
if (IS_ERR(omap->usbhost_ick)) {
|
||||
ret = PTR_ERR(omap->usbhost_ick);
|
||||
dev_err(dev, "usbhost_ick failed error:%d\n", ret);
|
||||
goto err_end;
|
||||
}
|
||||
|
||||
omap->usbhost_hs_fck = clk_get(dev, "hs_fck");
|
||||
if (IS_ERR(omap->usbhost_hs_fck)) {
|
||||
ret = PTR_ERR(omap->usbhost_hs_fck);
|
||||
dev_err(dev, "usbhost_hs_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_ick;
|
||||
}
|
||||
|
||||
omap->usbhost_fs_fck = clk_get(dev, "fs_fck");
|
||||
if (IS_ERR(omap->usbhost_fs_fck)) {
|
||||
ret = PTR_ERR(omap->usbhost_fs_fck);
|
||||
dev_err(dev, "usbhost_fs_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_hs_fck;
|
||||
}
|
||||
|
||||
omap->usbtll_fck = clk_get(dev, "usbtll_fck");
|
||||
if (IS_ERR(omap->usbtll_fck)) {
|
||||
ret = PTR_ERR(omap->usbtll_fck);
|
||||
dev_err(dev, "usbtll_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_fs_fck;
|
||||
}
|
||||
|
||||
omap->usbtll_ick = clk_get(dev, "usbtll_ick");
|
||||
if (IS_ERR(omap->usbtll_ick)) {
|
||||
ret = PTR_ERR(omap->usbtll_ick);
|
||||
dev_err(dev, "usbtll_ick failed error:%d\n", ret);
|
||||
goto err_usbtll_fck;
|
||||
}
|
||||
|
||||
omap->utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
|
||||
if (IS_ERR(omap->utmi_p1_fck)) {
|
||||
ret = PTR_ERR(omap->utmi_p1_fck);
|
||||
dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
|
||||
goto err_usbtll_ick;
|
||||
}
|
||||
|
||||
omap->xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
|
||||
if (IS_ERR(omap->xclk60mhsp1_ck)) {
|
||||
ret = PTR_ERR(omap->xclk60mhsp1_ck);
|
||||
dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
|
||||
goto err_utmi_p1_fck;
|
||||
}
|
||||
|
||||
omap->utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk");
|
||||
if (IS_ERR(omap->utmi_p2_fck)) {
|
||||
ret = PTR_ERR(omap->utmi_p2_fck);
|
||||
dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret);
|
||||
goto err_xclk60mhsp1_ck;
|
||||
}
|
||||
|
||||
omap->xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck");
|
||||
if (IS_ERR(omap->xclk60mhsp2_ck)) {
|
||||
ret = PTR_ERR(omap->xclk60mhsp2_ck);
|
||||
dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
|
||||
goto err_utmi_p2_fck;
|
||||
}
|
||||
|
||||
omap->usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk");
|
||||
if (IS_ERR(omap->usbhost_p1_fck)) {
|
||||
ret = PTR_ERR(omap->usbhost_p1_fck);
|
||||
dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret);
|
||||
goto err_xclk60mhsp2_ck;
|
||||
}
|
||||
|
||||
omap->usbtll_p1_fck = clk_get(dev, "usb_tll_hs_usb_ch0_clk");
|
||||
if (IS_ERR(omap->usbtll_p1_fck)) {
|
||||
ret = PTR_ERR(omap->usbtll_p1_fck);
|
||||
dev_err(dev, "usbtll_p1_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_p1_fck;
|
||||
}
|
||||
|
||||
omap->usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk");
|
||||
if (IS_ERR(omap->usbhost_p2_fck)) {
|
||||
ret = PTR_ERR(omap->usbhost_p2_fck);
|
||||
dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret);
|
||||
goto err_usbtll_p1_fck;
|
||||
}
|
||||
|
||||
omap->usbtll_p2_fck = clk_get(dev, "usb_tll_hs_usb_ch1_clk");
|
||||
if (IS_ERR(omap->usbtll_p2_fck)) {
|
||||
ret = PTR_ERR(omap->usbtll_p2_fck);
|
||||
dev_err(dev, "usbtll_p2_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_p2_fck;
|
||||
}
|
||||
|
||||
omap->init_60m_fclk = clk_get(dev, "init_60m_fclk");
|
||||
if (IS_ERR(omap->init_60m_fclk)) {
|
||||
ret = PTR_ERR(omap->init_60m_fclk);
|
||||
dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
|
||||
goto err_usbtll_p2_fck;
|
||||
}
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "uhh");
|
||||
if (!res) {
|
||||
dev_err(dev, "UHH EHCI get resource failed\n");
|
||||
ret = -ENODEV;
|
||||
goto err_init_60m_fclk;
|
||||
}
|
||||
|
||||
omap->uhh_base = ioremap(res->start, resource_size(res));
|
||||
if (!omap->uhh_base) {
|
||||
dev_err(dev, "UHH ioremap failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_init_60m_fclk;
|
||||
}
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tll");
|
||||
if (!res) {
|
||||
dev_err(dev, "UHH EHCI get resource failed\n");
|
||||
ret = -ENODEV;
|
||||
goto err_tll;
|
||||
}
|
||||
|
||||
omap->tll_base = ioremap(res->start, resource_size(res));
|
||||
if (!omap->tll_base) {
|
||||
dev_err(dev, "TLL ioremap failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_tll;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, omap);
|
||||
|
||||
ret = omap_usbhs_alloc_children(pdev);
|
||||
if (ret) {
|
||||
dev_err(dev, "omap_usbhs_alloc_children failed\n");
|
||||
goto err_alloc;
|
||||
}
|
||||
|
||||
goto end_probe;
|
||||
|
||||
err_alloc:
|
||||
iounmap(omap->tll_base);
|
||||
|
||||
err_tll:
|
||||
iounmap(omap->uhh_base);
|
||||
|
||||
err_init_60m_fclk:
|
||||
clk_put(omap->init_60m_fclk);
|
||||
|
||||
err_usbtll_p2_fck:
|
||||
clk_put(omap->usbtll_p2_fck);
|
||||
|
||||
err_usbhost_p2_fck:
|
||||
clk_put(omap->usbhost_p2_fck);
|
||||
|
||||
err_usbtll_p1_fck:
|
||||
clk_put(omap->usbtll_p1_fck);
|
||||
|
||||
err_usbhost_p1_fck:
|
||||
clk_put(omap->usbhost_p1_fck);
|
||||
|
||||
err_xclk60mhsp2_ck:
|
||||
clk_put(omap->xclk60mhsp2_ck);
|
||||
|
||||
err_utmi_p2_fck:
|
||||
clk_put(omap->utmi_p2_fck);
|
||||
|
||||
err_xclk60mhsp1_ck:
|
||||
clk_put(omap->xclk60mhsp1_ck);
|
||||
|
||||
err_utmi_p1_fck:
|
||||
clk_put(omap->utmi_p1_fck);
|
||||
|
||||
err_usbtll_ick:
|
||||
clk_put(omap->usbtll_ick);
|
||||
|
||||
err_usbtll_fck:
|
||||
clk_put(omap->usbtll_fck);
|
||||
|
||||
err_usbhost_fs_fck:
|
||||
clk_put(omap->usbhost_fs_fck);
|
||||
|
||||
err_usbhost_hs_fck:
|
||||
clk_put(omap->usbhost_hs_fck);
|
||||
|
||||
err_usbhost_ick:
|
||||
clk_put(omap->usbhost_ick);
|
||||
|
||||
err_end:
|
||||
kfree(omap);
|
||||
|
||||
end_probe:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* usbhs_omap_remove - shutdown processing for UHH & TLL HCDs
|
||||
* @pdev: USB Host Controller being removed
|
||||
*
|
||||
* Reverses the effect of usbhs_omap_probe().
|
||||
*/
|
||||
static int __devexit usbhs_omap_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev);
|
||||
|
||||
if (omap->count != 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"Either EHCI or OHCI is still using usbhs core\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
iounmap(omap->tll_base);
|
||||
iounmap(omap->uhh_base);
|
||||
clk_put(omap->init_60m_fclk);
|
||||
clk_put(omap->usbtll_p2_fck);
|
||||
clk_put(omap->usbhost_p2_fck);
|
||||
clk_put(omap->usbtll_p1_fck);
|
||||
clk_put(omap->usbhost_p1_fck);
|
||||
clk_put(omap->xclk60mhsp2_ck);
|
||||
clk_put(omap->utmi_p2_fck);
|
||||
clk_put(omap->xclk60mhsp1_ck);
|
||||
clk_put(omap->utmi_p1_fck);
|
||||
clk_put(omap->usbtll_ick);
|
||||
clk_put(omap->usbtll_fck);
|
||||
clk_put(omap->usbhost_fs_fck);
|
||||
clk_put(omap->usbhost_hs_fck);
|
||||
clk_put(omap->usbhost_ick);
|
||||
kfree(omap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool is_ohci_port(enum usbhs_omap_port_mode pmode)
|
||||
{
|
||||
switch (pmode) {
|
||||
@ -689,30 +422,85 @@ static void usbhs_omap_tll_init(struct device *dev, u8 tll_channel_count)
|
||||
}
|
||||
}
|
||||
|
||||
static int usbhs_enable(struct device *dev)
|
||||
static int usbhs_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
|
||||
struct usbhs_omap_platform_data *pdata = &omap->platdata;
|
||||
unsigned long flags = 0;
|
||||
int ret = 0;
|
||||
unsigned long timeout;
|
||||
unsigned reg;
|
||||
unsigned long flags;
|
||||
|
||||
dev_dbg(dev, "usbhs_runtime_resume\n");
|
||||
|
||||
dev_dbg(dev, "starting TI HSUSB Controller\n");
|
||||
if (!pdata) {
|
||||
dev_dbg(dev, "missing platform_data\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&omap->lock, flags);
|
||||
if (omap->count > 0)
|
||||
goto end_count;
|
||||
|
||||
clk_enable(omap->usbhost_ick);
|
||||
clk_enable(omap->usbhost_hs_fck);
|
||||
clk_enable(omap->usbhost_fs_fck);
|
||||
clk_enable(omap->usbtll_fck);
|
||||
clk_enable(omap->usbtll_ick);
|
||||
if (omap->ehci_logic_fck && !IS_ERR(omap->ehci_logic_fck))
|
||||
clk_enable(omap->ehci_logic_fck);
|
||||
|
||||
if (is_ehci_tll_mode(pdata->port_mode[0])) {
|
||||
clk_enable(omap->usbhost_p1_fck);
|
||||
clk_enable(omap->usbtll_p1_fck);
|
||||
}
|
||||
if (is_ehci_tll_mode(pdata->port_mode[1])) {
|
||||
clk_enable(omap->usbhost_p2_fck);
|
||||
clk_enable(omap->usbtll_p2_fck);
|
||||
}
|
||||
clk_enable(omap->utmi_p1_fck);
|
||||
clk_enable(omap->utmi_p2_fck);
|
||||
|
||||
spin_unlock_irqrestore(&omap->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int usbhs_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
|
||||
struct usbhs_omap_platform_data *pdata = &omap->platdata;
|
||||
unsigned long flags;
|
||||
|
||||
dev_dbg(dev, "usbhs_runtime_suspend\n");
|
||||
|
||||
if (!pdata) {
|
||||
dev_dbg(dev, "missing platform_data\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&omap->lock, flags);
|
||||
|
||||
if (is_ehci_tll_mode(pdata->port_mode[0])) {
|
||||
clk_disable(omap->usbhost_p1_fck);
|
||||
clk_disable(omap->usbtll_p1_fck);
|
||||
}
|
||||
if (is_ehci_tll_mode(pdata->port_mode[1])) {
|
||||
clk_disable(omap->usbhost_p2_fck);
|
||||
clk_disable(omap->usbtll_p2_fck);
|
||||
}
|
||||
clk_disable(omap->utmi_p2_fck);
|
||||
clk_disable(omap->utmi_p1_fck);
|
||||
|
||||
if (omap->ehci_logic_fck && !IS_ERR(omap->ehci_logic_fck))
|
||||
clk_disable(omap->ehci_logic_fck);
|
||||
|
||||
spin_unlock_irqrestore(&omap->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void omap_usbhs_init(struct device *dev)
|
||||
{
|
||||
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
|
||||
struct usbhs_omap_platform_data *pdata = &omap->platdata;
|
||||
unsigned long flags;
|
||||
unsigned reg;
|
||||
|
||||
dev_dbg(dev, "starting TI HSUSB Controller\n");
|
||||
|
||||
pm_runtime_get_sync(dev);
|
||||
spin_lock_irqsave(&omap->lock, flags);
|
||||
|
||||
if (pdata->ehci_data->phy_reset) {
|
||||
if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) {
|
||||
@ -736,50 +524,6 @@ static int usbhs_enable(struct device *dev)
|
||||
omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION);
|
||||
dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev);
|
||||
|
||||
/* perform TLL soft reset, and wait until reset is complete */
|
||||
usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
|
||||
OMAP_USBTLL_SYSCONFIG_SOFTRESET);
|
||||
|
||||
/* Wait for TLL reset to complete */
|
||||
timeout = jiffies + msecs_to_jiffies(1000);
|
||||
while (!(usbhs_read(omap->tll_base, OMAP_USBTLL_SYSSTATUS)
|
||||
& OMAP_USBTLL_SYSSTATUS_RESETDONE)) {
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout)) {
|
||||
dev_dbg(dev, "operation timed out\n");
|
||||
ret = -EINVAL;
|
||||
goto err_tll;
|
||||
}
|
||||
}
|
||||
|
||||
dev_dbg(dev, "TLL RESET DONE\n");
|
||||
|
||||
/* (1<<3) = no idle mode only for initial debugging */
|
||||
usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
|
||||
OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
|
||||
OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
|
||||
OMAP_USBTLL_SYSCONFIG_AUTOIDLE);
|
||||
|
||||
/* Put UHH in NoIdle/NoStandby mode */
|
||||
reg = usbhs_read(omap->uhh_base, OMAP_UHH_SYSCONFIG);
|
||||
if (is_omap_usbhs_rev1(omap)) {
|
||||
reg |= (OMAP_UHH_SYSCONFIG_ENAWAKEUP
|
||||
| OMAP_UHH_SYSCONFIG_SIDLEMODE
|
||||
| OMAP_UHH_SYSCONFIG_CACTIVITY
|
||||
| OMAP_UHH_SYSCONFIG_MIDLEMODE);
|
||||
reg &= ~OMAP_UHH_SYSCONFIG_AUTOIDLE;
|
||||
|
||||
|
||||
} else if (is_omap_usbhs_rev2(omap)) {
|
||||
reg &= ~OMAP4_UHH_SYSCONFIG_IDLEMODE_CLEAR;
|
||||
reg |= OMAP4_UHH_SYSCONFIG_NOIDLE;
|
||||
reg &= ~OMAP4_UHH_SYSCONFIG_STDBYMODE_CLEAR;
|
||||
reg |= OMAP4_UHH_SYSCONFIG_NOSTDBY;
|
||||
}
|
||||
|
||||
usbhs_write(omap->uhh_base, OMAP_UHH_SYSCONFIG, reg);
|
||||
|
||||
reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
|
||||
/* setup ULPI bypass and burst configurations */
|
||||
reg |= (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN
|
||||
@ -825,49 +569,6 @@ static int usbhs_enable(struct device *dev)
|
||||
reg &= ~OMAP4_P1_MODE_CLEAR;
|
||||
reg &= ~OMAP4_P2_MODE_CLEAR;
|
||||
|
||||
if (is_ehci_phy_mode(pdata->port_mode[0])) {
|
||||
ret = clk_set_parent(omap->utmi_p1_fck,
|
||||
omap->xclk60mhsp1_ck);
|
||||
if (ret != 0) {
|
||||
dev_err(dev, "xclk60mhsp1_ck set parent"
|
||||
"failed error:%d\n", ret);
|
||||
goto err_tll;
|
||||
}
|
||||
} else if (is_ehci_tll_mode(pdata->port_mode[0])) {
|
||||
ret = clk_set_parent(omap->utmi_p1_fck,
|
||||
omap->init_60m_fclk);
|
||||
if (ret != 0) {
|
||||
dev_err(dev, "init_60m_fclk set parent"
|
||||
"failed error:%d\n", ret);
|
||||
goto err_tll;
|
||||
}
|
||||
clk_enable(omap->usbhost_p1_fck);
|
||||
clk_enable(omap->usbtll_p1_fck);
|
||||
}
|
||||
|
||||
if (is_ehci_phy_mode(pdata->port_mode[1])) {
|
||||
ret = clk_set_parent(omap->utmi_p2_fck,
|
||||
omap->xclk60mhsp2_ck);
|
||||
if (ret != 0) {
|
||||
dev_err(dev, "xclk60mhsp1_ck set parent"
|
||||
"failed error:%d\n", ret);
|
||||
goto err_tll;
|
||||
}
|
||||
} else if (is_ehci_tll_mode(pdata->port_mode[1])) {
|
||||
ret = clk_set_parent(omap->utmi_p2_fck,
|
||||
omap->init_60m_fclk);
|
||||
if (ret != 0) {
|
||||
dev_err(dev, "init_60m_fclk set parent"
|
||||
"failed error:%d\n", ret);
|
||||
goto err_tll;
|
||||
}
|
||||
clk_enable(omap->usbhost_p2_fck);
|
||||
clk_enable(omap->usbtll_p2_fck);
|
||||
}
|
||||
|
||||
clk_enable(omap->utmi_p1_fck);
|
||||
clk_enable(omap->utmi_p2_fck);
|
||||
|
||||
if (is_ehci_tll_mode(pdata->port_mode[0]) ||
|
||||
(is_ohci_port(pdata->port_mode[0])))
|
||||
reg |= OMAP4_P1_MODE_TLL;
|
||||
@ -913,106 +614,14 @@ static int usbhs_enable(struct device *dev)
|
||||
(pdata->ehci_data->reset_gpio_port[1], 1);
|
||||
}
|
||||
|
||||
end_count:
|
||||
omap->count++;
|
||||
spin_unlock_irqrestore(&omap->lock, flags);
|
||||
return 0;
|
||||
|
||||
err_tll:
|
||||
if (pdata->ehci_data->phy_reset) {
|
||||
if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
|
||||
gpio_free(pdata->ehci_data->reset_gpio_port[0]);
|
||||
|
||||
if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
|
||||
gpio_free(pdata->ehci_data->reset_gpio_port[1]);
|
||||
}
|
||||
|
||||
clk_disable(omap->usbtll_ick);
|
||||
clk_disable(omap->usbtll_fck);
|
||||
clk_disable(omap->usbhost_fs_fck);
|
||||
clk_disable(omap->usbhost_hs_fck);
|
||||
clk_disable(omap->usbhost_ick);
|
||||
spin_unlock_irqrestore(&omap->lock, flags);
|
||||
return ret;
|
||||
pm_runtime_put_sync(dev);
|
||||
}
|
||||
|
||||
static void usbhs_disable(struct device *dev)
|
||||
static void omap_usbhs_deinit(struct device *dev)
|
||||
{
|
||||
struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
|
||||
struct usbhs_omap_platform_data *pdata = &omap->platdata;
|
||||
unsigned long flags = 0;
|
||||
unsigned long timeout;
|
||||
|
||||
dev_dbg(dev, "stopping TI HSUSB Controller\n");
|
||||
|
||||
spin_lock_irqsave(&omap->lock, flags);
|
||||
|
||||
if (omap->count == 0)
|
||||
goto end_disble;
|
||||
|
||||
omap->count--;
|
||||
|
||||
if (omap->count != 0)
|
||||
goto end_disble;
|
||||
|
||||
/* Reset OMAP modules for insmod/rmmod to work */
|
||||
usbhs_write(omap->uhh_base, OMAP_UHH_SYSCONFIG,
|
||||
is_omap_usbhs_rev2(omap) ?
|
||||
OMAP4_UHH_SYSCONFIG_SOFTRESET :
|
||||
OMAP_UHH_SYSCONFIG_SOFTRESET);
|
||||
|
||||
timeout = jiffies + msecs_to_jiffies(100);
|
||||
while (!(usbhs_read(omap->uhh_base, OMAP_UHH_SYSSTATUS)
|
||||
& (1 << 0))) {
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
dev_dbg(dev, "operation timed out\n");
|
||||
}
|
||||
|
||||
while (!(usbhs_read(omap->uhh_base, OMAP_UHH_SYSSTATUS)
|
||||
& (1 << 1))) {
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
dev_dbg(dev, "operation timed out\n");
|
||||
}
|
||||
|
||||
while (!(usbhs_read(omap->uhh_base, OMAP_UHH_SYSSTATUS)
|
||||
& (1 << 2))) {
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
dev_dbg(dev, "operation timed out\n");
|
||||
}
|
||||
|
||||
usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG, (1 << 1));
|
||||
|
||||
while (!(usbhs_read(omap->tll_base, OMAP_USBTLL_SYSSTATUS)
|
||||
& (1 << 0))) {
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
dev_dbg(dev, "operation timed out\n");
|
||||
}
|
||||
|
||||
if (is_omap_usbhs_rev2(omap)) {
|
||||
if (is_ehci_tll_mode(pdata->port_mode[0]))
|
||||
clk_disable(omap->usbtll_p1_fck);
|
||||
if (is_ehci_tll_mode(pdata->port_mode[1]))
|
||||
clk_disable(omap->usbtll_p2_fck);
|
||||
clk_disable(omap->utmi_p2_fck);
|
||||
clk_disable(omap->utmi_p1_fck);
|
||||
}
|
||||
|
||||
clk_disable(omap->usbtll_ick);
|
||||
clk_disable(omap->usbtll_fck);
|
||||
clk_disable(omap->usbhost_fs_fck);
|
||||
clk_disable(omap->usbhost_hs_fck);
|
||||
clk_disable(omap->usbhost_ick);
|
||||
|
||||
/* The gpio_free migh sleep; so unlock the spinlock */
|
||||
spin_unlock_irqrestore(&omap->lock, flags);
|
||||
|
||||
if (pdata->ehci_data->phy_reset) {
|
||||
if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
|
||||
@ -1021,28 +630,272 @@ static void usbhs_disable(struct device *dev)
|
||||
if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
|
||||
gpio_free(pdata->ehci_data->reset_gpio_port[1]);
|
||||
}
|
||||
return;
|
||||
|
||||
end_disble:
|
||||
spin_unlock_irqrestore(&omap->lock, flags);
|
||||
}
|
||||
|
||||
int omap_usbhs_enable(struct device *dev)
|
||||
|
||||
/**
|
||||
* usbhs_omap_probe - initialize TI-based HCDs
|
||||
*
|
||||
* Allocates basic resources for this USB host controller.
|
||||
*/
|
||||
static int __devinit usbhs_omap_probe(struct platform_device *pdev)
|
||||
{
|
||||
return usbhs_enable(dev->parent);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(omap_usbhs_enable);
|
||||
struct device *dev = &pdev->dev;
|
||||
struct usbhs_omap_platform_data *pdata = dev->platform_data;
|
||||
struct usbhs_hcd_omap *omap;
|
||||
struct resource *res;
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
void omap_usbhs_disable(struct device *dev)
|
||||
{
|
||||
usbhs_disable(dev->parent);
|
||||
if (!pdata) {
|
||||
dev_err(dev, "Missing platform data\n");
|
||||
ret = -ENOMEM;
|
||||
goto end_probe;
|
||||
}
|
||||
|
||||
omap = kzalloc(sizeof(*omap), GFP_KERNEL);
|
||||
if (!omap) {
|
||||
dev_err(dev, "Memory allocation failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto end_probe;
|
||||
}
|
||||
|
||||
spin_lock_init(&omap->lock);
|
||||
|
||||
for (i = 0; i < OMAP3_HS_USB_PORTS; i++)
|
||||
omap->platdata.port_mode[i] = pdata->port_mode[i];
|
||||
|
||||
omap->platdata.ehci_data = pdata->ehci_data;
|
||||
omap->platdata.ohci_data = pdata->ohci_data;
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
|
||||
for (i = 0; i < OMAP3_HS_USB_PORTS; i++)
|
||||
if (is_ehci_phy_mode(i) || is_ehci_tll_mode(i) ||
|
||||
is_ehci_hsic_mode(i)) {
|
||||
omap->ehci_logic_fck = clk_get(dev, "ehci_logic_fck");
|
||||
if (IS_ERR(omap->ehci_logic_fck)) {
|
||||
ret = PTR_ERR(omap->ehci_logic_fck);
|
||||
dev_warn(dev, "ehci_logic_fck failed:%d\n",
|
||||
ret);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
omap->utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
|
||||
if (IS_ERR(omap->utmi_p1_fck)) {
|
||||
ret = PTR_ERR(omap->utmi_p1_fck);
|
||||
dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
|
||||
goto err_end;
|
||||
}
|
||||
|
||||
omap->xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
|
||||
if (IS_ERR(omap->xclk60mhsp1_ck)) {
|
||||
ret = PTR_ERR(omap->xclk60mhsp1_ck);
|
||||
dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
|
||||
goto err_utmi_p1_fck;
|
||||
}
|
||||
|
||||
omap->utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk");
|
||||
if (IS_ERR(omap->utmi_p2_fck)) {
|
||||
ret = PTR_ERR(omap->utmi_p2_fck);
|
||||
dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret);
|
||||
goto err_xclk60mhsp1_ck;
|
||||
}
|
||||
|
||||
omap->xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck");
|
||||
if (IS_ERR(omap->xclk60mhsp2_ck)) {
|
||||
ret = PTR_ERR(omap->xclk60mhsp2_ck);
|
||||
dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
|
||||
goto err_utmi_p2_fck;
|
||||
}
|
||||
|
||||
omap->usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk");
|
||||
if (IS_ERR(omap->usbhost_p1_fck)) {
|
||||
ret = PTR_ERR(omap->usbhost_p1_fck);
|
||||
dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret);
|
||||
goto err_xclk60mhsp2_ck;
|
||||
}
|
||||
|
||||
omap->usbtll_p1_fck = clk_get(dev, "usb_tll_hs_usb_ch0_clk");
|
||||
if (IS_ERR(omap->usbtll_p1_fck)) {
|
||||
ret = PTR_ERR(omap->usbtll_p1_fck);
|
||||
dev_err(dev, "usbtll_p1_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_p1_fck;
|
||||
}
|
||||
|
||||
omap->usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk");
|
||||
if (IS_ERR(omap->usbhost_p2_fck)) {
|
||||
ret = PTR_ERR(omap->usbhost_p2_fck);
|
||||
dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret);
|
||||
goto err_usbtll_p1_fck;
|
||||
}
|
||||
|
||||
omap->usbtll_p2_fck = clk_get(dev, "usb_tll_hs_usb_ch1_clk");
|
||||
if (IS_ERR(omap->usbtll_p2_fck)) {
|
||||
ret = PTR_ERR(omap->usbtll_p2_fck);
|
||||
dev_err(dev, "usbtll_p2_fck failed error:%d\n", ret);
|
||||
goto err_usbhost_p2_fck;
|
||||
}
|
||||
|
||||
omap->init_60m_fclk = clk_get(dev, "init_60m_fclk");
|
||||
if (IS_ERR(omap->init_60m_fclk)) {
|
||||
ret = PTR_ERR(omap->init_60m_fclk);
|
||||
dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
|
||||
goto err_usbtll_p2_fck;
|
||||
}
|
||||
|
||||
if (is_ehci_phy_mode(pdata->port_mode[0])) {
|
||||
/* for OMAP3 , the clk set paretn fails */
|
||||
ret = clk_set_parent(omap->utmi_p1_fck,
|
||||
omap->xclk60mhsp1_ck);
|
||||
if (ret != 0)
|
||||
dev_err(dev, "xclk60mhsp1_ck set parent"
|
||||
"failed error:%d\n", ret);
|
||||
} else if (is_ehci_tll_mode(pdata->port_mode[0])) {
|
||||
ret = clk_set_parent(omap->utmi_p1_fck,
|
||||
omap->init_60m_fclk);
|
||||
if (ret != 0)
|
||||
dev_err(dev, "init_60m_fclk set parent"
|
||||
"failed error:%d\n", ret);
|
||||
}
|
||||
|
||||
if (is_ehci_phy_mode(pdata->port_mode[1])) {
|
||||
ret = clk_set_parent(omap->utmi_p2_fck,
|
||||
omap->xclk60mhsp2_ck);
|
||||
if (ret != 0)
|
||||
dev_err(dev, "xclk60mhsp2_ck set parent"
|
||||
"failed error:%d\n", ret);
|
||||
} else if (is_ehci_tll_mode(pdata->port_mode[1])) {
|
||||
ret = clk_set_parent(omap->utmi_p2_fck,
|
||||
omap->init_60m_fclk);
|
||||
if (ret != 0)
|
||||
dev_err(dev, "init_60m_fclk set parent"
|
||||
"failed error:%d\n", ret);
|
||||
}
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "uhh");
|
||||
if (!res) {
|
||||
dev_err(dev, "UHH EHCI get resource failed\n");
|
||||
ret = -ENODEV;
|
||||
goto err_init_60m_fclk;
|
||||
}
|
||||
|
||||
omap->uhh_base = ioremap(res->start, resource_size(res));
|
||||
if (!omap->uhh_base) {
|
||||
dev_err(dev, "UHH ioremap failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_init_60m_fclk;
|
||||
}
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tll");
|
||||
if (!res) {
|
||||
dev_err(dev, "UHH EHCI get resource failed\n");
|
||||
ret = -ENODEV;
|
||||
goto err_tll;
|
||||
}
|
||||
|
||||
omap->tll_base = ioremap(res->start, resource_size(res));
|
||||
if (!omap->tll_base) {
|
||||
dev_err(dev, "TLL ioremap failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_tll;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, omap);
|
||||
|
||||
ret = omap_usbhs_alloc_children(pdev);
|
||||
if (ret) {
|
||||
dev_err(dev, "omap_usbhs_alloc_children failed\n");
|
||||
goto err_alloc;
|
||||
}
|
||||
|
||||
omap_usbhs_init(dev);
|
||||
|
||||
goto end_probe;
|
||||
|
||||
err_alloc:
|
||||
iounmap(omap->tll_base);
|
||||
|
||||
err_tll:
|
||||
iounmap(omap->uhh_base);
|
||||
|
||||
err_init_60m_fclk:
|
||||
clk_put(omap->init_60m_fclk);
|
||||
|
||||
err_usbtll_p2_fck:
|
||||
clk_put(omap->usbtll_p2_fck);
|
||||
|
||||
err_usbhost_p2_fck:
|
||||
clk_put(omap->usbhost_p2_fck);
|
||||
|
||||
err_usbtll_p1_fck:
|
||||
clk_put(omap->usbtll_p1_fck);
|
||||
|
||||
err_usbhost_p1_fck:
|
||||
clk_put(omap->usbhost_p1_fck);
|
||||
|
||||
err_xclk60mhsp2_ck:
|
||||
clk_put(omap->xclk60mhsp2_ck);
|
||||
|
||||
err_utmi_p2_fck:
|
||||
clk_put(omap->utmi_p2_fck);
|
||||
|
||||
err_xclk60mhsp1_ck:
|
||||
clk_put(omap->xclk60mhsp1_ck);
|
||||
|
||||
err_utmi_p1_fck:
|
||||
clk_put(omap->utmi_p1_fck);
|
||||
|
||||
err_end:
|
||||
clk_put(omap->ehci_logic_fck);
|
||||
pm_runtime_disable(dev);
|
||||
kfree(omap);
|
||||
|
||||
end_probe:
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(omap_usbhs_disable);
|
||||
|
||||
/**
|
||||
* usbhs_omap_remove - shutdown processing for UHH & TLL HCDs
|
||||
* @pdev: USB Host Controller being removed
|
||||
*
|
||||
* Reverses the effect of usbhs_omap_probe().
|
||||
*/
|
||||
static int __devexit usbhs_omap_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev);
|
||||
|
||||
omap_usbhs_deinit(&pdev->dev);
|
||||
iounmap(omap->tll_base);
|
||||
iounmap(omap->uhh_base);
|
||||
clk_put(omap->init_60m_fclk);
|
||||
clk_put(omap->usbtll_p2_fck);
|
||||
clk_put(omap->usbhost_p2_fck);
|
||||
clk_put(omap->usbtll_p1_fck);
|
||||
clk_put(omap->usbhost_p1_fck);
|
||||
clk_put(omap->xclk60mhsp2_ck);
|
||||
clk_put(omap->utmi_p2_fck);
|
||||
clk_put(omap->xclk60mhsp1_ck);
|
||||
clk_put(omap->utmi_p1_fck);
|
||||
clk_put(omap->ehci_logic_fck);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
kfree(omap);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
|
||||
.runtime_suspend = usbhs_runtime_suspend,
|
||||
.runtime_resume = usbhs_runtime_resume,
|
||||
};
|
||||
|
||||
static struct platform_driver usbhs_omap_driver = {
|
||||
.driver = {
|
||||
.name = (char *)usbhs_driver_name,
|
||||
.owner = THIS_MODULE,
|
||||
.pm = &usbhsomap_dev_pm_ops,
|
||||
},
|
||||
.remove = __exit_p(usbhs_omap_remove),
|
||||
};
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <linux/usb/ulpi.h>
|
||||
#include <plat/usb.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
/* EHCI Register Set */
|
||||
#define EHCI_INSNREG04 (0xA0)
|
||||
@ -190,11 +191,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
ret = omap_usbhs_enable(dev);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to start usbhs with err %d\n", ret);
|
||||
goto err_enable;
|
||||
}
|
||||
pm_runtime_enable(dev);
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
/*
|
||||
* An undocumented "feature" in the OMAP3 EHCI controller,
|
||||
@ -240,11 +238,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
err_add_hcd:
|
||||
omap_usbhs_disable(dev);
|
||||
|
||||
err_enable:
|
||||
disable_put_regulator(pdata);
|
||||
usb_put_hcd(hcd);
|
||||
pm_runtime_put_sync(dev);
|
||||
|
||||
err_io:
|
||||
iounmap(regs);
|
||||
@ -266,10 +261,12 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
|
||||
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
||||
|
||||
usb_remove_hcd(hcd);
|
||||
omap_usbhs_disable(dev);
|
||||
disable_put_regulator(dev->platform_data);
|
||||
iounmap(hcd->regs);
|
||||
usb_put_hcd(hcd);
|
||||
pm_runtime_put_sync(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <plat/usb.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@ -134,7 +135,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
|
||||
int irq;
|
||||
|
||||
if (usb_disabled())
|
||||
goto err_end;
|
||||
return -ENODEV;
|
||||
|
||||
if (!dev->parent) {
|
||||
dev_err(dev, "Missing parent device\n");
|
||||
@ -172,11 +173,8 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
|
||||
hcd->rsrc_len = resource_size(res);
|
||||
hcd->regs = regs;
|
||||
|
||||
ret = omap_usbhs_enable(dev);
|
||||
if (ret) {
|
||||
dev_dbg(dev, "failed to start ohci\n");
|
||||
goto err_end;
|
||||
}
|
||||
pm_runtime_enable(dev);
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
ohci_hcd_init(hcd_to_ohci(hcd));
|
||||
|
||||
@ -189,9 +187,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
err_add_hcd:
|
||||
omap_usbhs_disable(dev);
|
||||
|
||||
err_end:
|
||||
pm_runtime_put_sync(dev);
|
||||
usb_put_hcd(hcd);
|
||||
|
||||
err_io:
|
||||
@ -220,9 +216,9 @@ static int __devexit ohci_hcd_omap3_remove(struct platform_device *pdev)
|
||||
|
||||
iounmap(hcd->regs);
|
||||
usb_remove_hcd(hcd);
|
||||
omap_usbhs_disable(dev);
|
||||
pm_runtime_put_sync(dev);
|
||||
pm_runtime_disable(dev);
|
||||
usb_put_hcd(hcd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user