From c89c306a042bc0a402b77b5b60f72d5dc887a32c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 10 Dec 2011 10:08:08 +0800 Subject: [PATCH] --- yaml --- r: 281498 b: refs/heads/master c: 61cbaa928705eaeabefb8a5264bc22b4ca909f6b h: refs/heads/master v: v3 --- [refs] | 2 +- .../arm/mach-omap2/board-rx51-peripherals.c | 2 +- trunk/arch/arm/mach-omap2/clock44xx_data.c | 9 -- trunk/arch/arm/mach-omap2/mcbsp.c | 6 +- trunk/arch/arm/mach-omap2/omap_hwmod.c | 98 +++++++++---------- .../arm/mach-omap2/omap_hwmod_3xxx_data.c | 18 +--- .../arm/mach-omap2/voltagedomains3xxx_data.c | 40 ++------ trunk/arch/arm/mach-pxa/balloon3.c | 1 + trunk/arch/arm/plat-omap/dma.c | 22 +---- 9 files changed, 67 insertions(+), 131 deletions(-) diff --git a/[refs] b/[refs] index 2b2a78a62d72..8048da486cbd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bcdbbe3d45fab12eb8a34eb52b89f91624dc4d6f +refs/heads/master: 61cbaa928705eaeabefb8a5264bc22b4ca909f6b diff --git a/trunk/arch/arm/mach-omap2/board-rx51-peripherals.c b/trunk/arch/arm/mach-omap2/board-rx51-peripherals.c index c15c5c9c9085..ba1aa07bdb29 100644 --- a/trunk/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/trunk/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -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_HIGH, "isp1704_reset")); + GPIOF_OUT_INIT_LOW, "isp1704_reset")); platform_device_register(&rx51_charger_device); } diff --git a/trunk/arch/arm/mach-omap2/clock44xx_data.c b/trunk/arch/arm/mach-omap2/clock44xx_data.c index 730097ee0f23..0798a802497a 100644 --- a/trunk/arch/arm/mach-omap2/clock44xx_data.c +++ b/trunk/arch/arm/mach-omap2/clock44xx_data.c @@ -1206,14 +1206,6 @@ static const struct clksel ocp_abe_iclk_div[] = { { .parent = NULL }, }; -static struct clk mpu_periphclk = { - .name = "mpu_periphclk", - .parent = &dpll_mpu_ck, - .ops = &clkops_null, - .fixed_div = 2, - .recalc = &omap_fixed_divisor_recalc, -}; - static struct clk ocp_abe_iclk = { .name = "ocp_abe_iclk", .parent = &aess_fclk, @@ -3197,7 +3189,6 @@ static struct omap_clk omap44xx_clks[] = { CLK(NULL, "l4_div_ck", &l4_div_ck, CK_443X), CLK(NULL, "lp_clk_div_ck", &lp_clk_div_ck, CK_443X), CLK(NULL, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, CK_443X), - CLK("smp_twd", NULL, &mpu_periphclk, CK_443X), CLK(NULL, "ocp_abe_iclk", &ocp_abe_iclk, CK_443X), CLK(NULL, "per_abe_24m_fclk", &per_abe_24m_fclk, CK_443X), CLK(NULL, "per_abe_nc_fclk", &per_abe_nc_fclk, CK_443X), diff --git a/trunk/arch/arm/mach-omap2/mcbsp.c b/trunk/arch/arm/mach-omap2/mcbsp.c index 28fcb27005d2..292eee3be15f 100644 --- a/trunk/arch/arm/mach-omap2/mcbsp.c +++ b/trunk/arch/arm/mach-omap2/mcbsp.c @@ -145,9 +145,6 @@ 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) @@ -177,6 +174,9 @@ 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; } diff --git a/trunk/arch/arm/mach-omap2/omap_hwmod.c b/trunk/arch/arm/mach-omap2/omap_hwmod.c index ebace0f6069c..207a2ff9a8c4 100644 --- a/trunk/arch/arm/mach-omap2/omap_hwmod.c +++ b/trunk/arch/arm/mach-omap2/omap_hwmod.c @@ -706,65 +706,27 @@ static void _enable_module(struct omap_hwmod *oh) } /** - * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4 - * @oh: struct omap_hwmod * - * - * Wait for a module @oh to enter slave idle. Returns 0 if the module - * does not have an IDLEST bit or if the module successfully enters - * slave idle; otherwise, pass along the return value of the - * appropriate *_cm*_wait_module_idle() function. - */ -static int _omap4_wait_target_disable(struct omap_hwmod *oh) -{ - if (!cpu_is_omap44xx()) - return 0; - - if (!oh) - return -EINVAL; - - if (oh->_int_flags & _HWMOD_NO_MPU_PORT) - return 0; - - if (oh->flags & HWMOD_NO_IDLEST) - return 0; - - return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition, - oh->clkdm->cm_inst, - oh->clkdm->clkdm_offs, - oh->prcm.omap4.clkctrl_offs); -} - -/** - * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4 + * _disable_module - enable CLKCTRL modulemode on OMAP4 * @oh: struct omap_hwmod * * * Disable the PRCM module mode related to the hwmod @oh. - * Return EINVAL if the modulemode is not supported and 0 in case of success. + * No return value. */ -static int _omap4_disable_module(struct omap_hwmod *oh) +static void _disable_module(struct omap_hwmod *oh) { - int v; - /* The module mode does not exist prior OMAP4 */ - if (!cpu_is_omap44xx()) - return -EINVAL; + if (cpu_is_omap24xx() || cpu_is_omap34xx()) + return; if (!oh->clkdm || !oh->prcm.omap4.modulemode) - return -EINVAL; + return; - pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); + pr_debug("omap_hwmod: %s: _disable_module\n", oh->name); omap4_cminst_module_disable(oh->clkdm->prcm_partition, oh->clkdm->cm_inst, oh->clkdm->clkdm_offs, oh->prcm.omap4.clkctrl_offs); - - v = _omap4_wait_target_disable(oh); - if (v) - pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", - oh->name); - - return 0; } /** @@ -1190,6 +1152,36 @@ static int _wait_target_ready(struct omap_hwmod *oh) return ret; } +/** + * _wait_target_disable - wait for a module to be disabled + * @oh: struct omap_hwmod * + * + * Wait for a module @oh to enter slave idle. Returns 0 if the module + * does not have an IDLEST bit or if the module successfully enters + * slave idle; otherwise, pass along the return value of the + * appropriate *_cm*_wait_module_idle() function. + */ +static int _wait_target_disable(struct omap_hwmod *oh) +{ + /* TODO: For now just handle OMAP4+ */ + if (cpu_is_omap24xx() || cpu_is_omap34xx()) + return 0; + + if (!oh) + return -EINVAL; + + if (oh->_int_flags & _HWMOD_NO_MPU_PORT) + return 0; + + if (oh->flags & HWMOD_NO_IDLEST) + return 0; + + return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition, + oh->clkdm->cm_inst, + oh->clkdm->clkdm_offs, + oh->prcm.omap4.clkctrl_offs); +} + /** * _lookup_hardreset - fill register bit info for this hwmod/reset line * @oh: struct omap_hwmod * @@ -1532,6 +1524,8 @@ static int _enable(struct omap_hwmod *oh) */ static int _idle(struct omap_hwmod *oh) { + int ret; + pr_debug("omap_hwmod: %s: idling\n", oh->name); if (oh->_state != _HWMOD_STATE_ENABLED) { @@ -1543,9 +1537,11 @@ static int _idle(struct omap_hwmod *oh) if (oh->class->sysc) _idle_sysc(oh); _del_initiator_dep(oh, mpu_oh); - - _omap4_disable_module(oh); - + _disable_module(oh); + ret = _wait_target_disable(oh); + if (ret) + pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", + oh->name); /* * The module must be in idle mode before disabling any parents * clocks. Otherwise, the parent clock might be disabled before @@ -1646,7 +1642,11 @@ static int _shutdown(struct omap_hwmod *oh) if (oh->_state == _HWMOD_STATE_ENABLED) { _del_initiator_dep(oh, mpu_oh); /* XXX what about the other system initiators here? dma, dsp */ - _omap4_disable_module(oh); + _disable_module(oh); + ret = _wait_target_disable(oh); + if (ret) + pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", + oh->name); _disable_clocks(oh); if (oh->clkdm) clkdm_hwmod_disable(oh->clkdm, oh); diff --git a/trunk/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/trunk/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 126cb49c0de7..7f8915ad5099 100644 --- a/trunk/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/trunk/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -3198,6 +3198,7 @@ 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, @@ -3244,22 +3245,20 @@ 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, NULL }; @@ -3301,13 +3300,6 @@ 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(); /* diff --git a/trunk/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/trunk/arch/arm/mach-omap2/voltagedomains3xxx_data.c index 636b688bca78..071101debbbc 100644 --- a/trunk/arch/arm/mach-omap2/voltagedomains3xxx_data.c +++ b/trunk/arch/arm/mach-omap2/voltagedomains3xxx_data.c @@ -31,14 +31,6 @@ * VDD data */ -/* OMAP3-common voltagedomain data */ - -static struct voltagedomain omap3_voltdm_wkup = { - .name = "wakeup", -}; - -/* 34xx/36xx voltagedomain data */ - static const struct omap_vfsm_instance omap3_vdd1_vfsm = { .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET, .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK, @@ -71,6 +63,10 @@ static struct voltagedomain omap3_voltdm_core = { .vp = &omap3_vp_core, }; +static struct voltagedomain omap3_voltdm_wkup = { + .name = "wakeup", +}; + static struct voltagedomain *voltagedomains_omap3[] __initdata = { &omap3_voltdm_mpu, &omap3_voltdm_core, @@ -78,30 +74,11 @@ static struct voltagedomain *voltagedomains_omap3[] __initdata = { NULL, }; -/* AM35xx voltagedomain data */ - -static struct voltagedomain am35xx_voltdm_mpu = { - .name = "mpu_iva", -}; - -static struct voltagedomain am35xx_voltdm_core = { - .name = "core", -}; - -static struct voltagedomain *voltagedomains_am35xx[] __initdata = { - &am35xx_voltdm_mpu, - &am35xx_voltdm_core, - &omap3_voltdm_wkup, - NULL, -}; - - static const char *sys_clk_name __initdata = "sys_ck"; void __init omap3xxx_voltagedomains_init(void) { struct voltagedomain *voltdm; - struct voltagedomain **voltdms; int i; /* @@ -116,13 +93,8 @@ void __init omap3xxx_voltagedomains_init(void) omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data; } - if (cpu_is_omap3517() || cpu_is_omap3505()) - voltdms = voltagedomains_am35xx; - else - voltdms = voltagedomains_omap3; - - for (i = 0; voltdm = voltdms[i], voltdm; i++) + for (i = 0; voltdm = voltagedomains_omap3[i], voltdm; i++) voltdm->sys_clk.name = sys_clk_name; - voltdm_init(voltdms); + voltdm_init(voltagedomains_omap3); }; diff --git a/trunk/arch/arm/mach-pxa/balloon3.c b/trunk/arch/arm/mach-pxa/balloon3.c index 4b81f59a4cba..f3a456a0680e 100644 --- a/trunk/arch/arm/mach-pxa/balloon3.c +++ b/trunk/arch/arm/mach-pxa/balloon3.c @@ -13,6 +13,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include diff --git a/trunk/arch/arm/plat-omap/dma.c b/trunk/arch/arm/plat-omap/dma.c index 002fb4d96bbc..c22217c2ee5f 100644 --- a/trunk/arch/arm/plat-omap/dma.c +++ b/trunk/arch/arm/plat-omap/dma.c @@ -1034,18 +1034,6 @@ dma_addr_t omap_get_dma_src_pos(int lch) if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0) offset = p->dma_read(CSAC, lch); - if (!cpu_is_omap15xx()) { - /* - * CDAC == 0 indicates that the DMA transfer on the channel has - * not been started (no data has been transferred so far). - * Return the programmed source start address in this case. - */ - if (likely(p->dma_read(CDAC, lch))) - offset = p->dma_read(CSAC, lch); - else - offset = p->dma_read(CSSA, lch); - } - if (cpu_class_is_omap1()) offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000); @@ -1074,16 +1062,8 @@ dma_addr_t omap_get_dma_dst_pos(int lch) * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is * read before the DMA controller finished disabling the channel. */ - if (!cpu_is_omap15xx() && offset == 0) { + if (!cpu_is_omap15xx() && offset == 0) offset = p->dma_read(CDAC, lch); - /* - * CDAC == 0 indicates that the DMA transfer on the channel has - * not been started (no data has been transferred so far). - * Return the programmed destination start address in this case. - */ - if (unlikely(!offset)) - offset = p->dma_read(CDSA, lch); - } if (cpu_class_is_omap1()) offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000);