source: trunk/target/linux/omap4/patches/000-hwmod_dont_wait.patch @ 29753

Last change on this file since 29753 was 29753, checked in by kaloz, 4 years ago

[target/omap4]: add support for OMAP4 based boards, starting with the PandaBoard

File size: 6.6 KB
  • arch/arm/mach-omap2/omap_hwmod.c

    From: Benoit Cousson <b-cousson@ti.com>
    Date: Sat, 17 Dec 2011 00:09:11 +0000 (-0800)
    Subject: ARM: OMAP4: hwmod: Don't wait for the idle status if modulemode is not supported
    X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git;a=commitdiff_plain;h=bfc141e3a515008d85e57af39c9faa4d2bbc65e0;hp=ddf536d0d7e1f0b63a681c970888730a4437414d
    
    ARM: OMAP4: hwmod: Don't wait for the idle status if modulemode is not supported
    
    If the module does not have any modulemode, the _disable_module function
    will do nothing. There is then no point waiting for a idle status change.
    
    It will remove the following warnings.
    
    [    0.331848] omap_hwmod: dmm: _wait_target_disable failed
    [    0.339935] omap_hwmod: emif_fw: _wait_target_disable failed
    [    0.348358] omap_hwmod: l3_main_1: _wait_target_disable failed
    [    0.356964] omap_hwmod: l3_main_2: _wait_target_disable failed
    [    0.365600] omap_hwmod: l4_abe: _wait_target_disable failed
    [    0.373931] omap_hwmod: l4_cfg: _wait_target_disable failed
    [    0.382263] omap_hwmod: l4_per: _wait_target_disable failed
    [    0.391113] omap_hwmod: l4_wkup: _wait_target_disable failed
    [    0.399536] omap_hwmod: dma_system: _wait_target_disable failed
    [    0.408325] omap_hwmod: dss_core: _wait_target_disable failed
    [    0.416839] omap_hwmod: dss_dispc: _wait_target_disable failed
    [    0.425445] omap_hwmod: dss_dsi1: _wait_target_disable failed
    [    0.433990] omap_hwmod: dss_dsi2: _wait_target_disable failed
    [    0.442504] omap_hwmod: dss_hdmi: _wait_target_disable failed
    [    0.451019] omap_hwmod: dss_rfbi: _wait_target_disable failed
    [    0.459564] omap_hwmod: dss_venc: _wait_target_disable failed
    [    0.489471] omap_hwmod: mailbox: _wait_target_disable failed
    [    0.505920] omap_hwmod: spinlock: _wait_target_disable failed
    
    Note: For such module, the state is managed automatically by HW according
    to clock domain transition. It is then not possible to wait for idle even
    later in the _idle function since the status will change at clock domain
    boundary.
    
    Signed-off-by: Benoit Cousson <b-cousson@ti.com>
    Cc: Paul Walmsley <paul@pwsan.com>
    Cc: Rajendra Nayak <rnayak@ti.com>
    [paul@pwsan.com: renamed fns to indicate that they are OMAP4-only; moved
     _wait_target_disable() into _disable_module(), removing duplicate code]
    Signed-off-by: Paul Walmsley <paul@pwsan.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    ---
    
    diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
    index 207a2ff..ebace0f 100644
    a b static void _enable_module(struct omap_hwmod *oh) 
    706706} 
    707707 
    708708/** 
    709  * _disable_module - enable CLKCTRL modulemode on OMAP4 
     709 * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4 
     710 * @oh: struct omap_hwmod * 
     711 * 
     712 * Wait for a module @oh to enter slave idle.  Returns 0 if the module 
     713 * does not have an IDLEST bit or if the module successfully enters 
     714 * slave idle; otherwise, pass along the return value of the 
     715 * appropriate *_cm*_wait_module_idle() function. 
     716 */ 
     717static int _omap4_wait_target_disable(struct omap_hwmod *oh) 
     718{ 
     719        if (!cpu_is_omap44xx()) 
     720                return 0; 
     721 
     722        if (!oh) 
     723                return -EINVAL; 
     724 
     725        if (oh->_int_flags & _HWMOD_NO_MPU_PORT) 
     726                return 0; 
     727 
     728        if (oh->flags & HWMOD_NO_IDLEST) 
     729                return 0; 
     730 
     731        return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition, 
     732                                             oh->clkdm->cm_inst, 
     733                                             oh->clkdm->clkdm_offs, 
     734                                             oh->prcm.omap4.clkctrl_offs); 
     735} 
     736 
     737/** 
     738 * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4 
    710739 * @oh: struct omap_hwmod * 
    711740 * 
    712741 * Disable the PRCM module mode related to the hwmod @oh. 
    713  * No return value. 
     742 * Return EINVAL if the modulemode is not supported and 0 in case of success. 
    714743 */ 
    715 static void _disable_module(struct omap_hwmod *oh) 
     744static int _omap4_disable_module(struct omap_hwmod *oh) 
    716745{ 
     746        int v; 
     747 
    717748        /* The module mode does not exist prior OMAP4 */ 
    718         if (cpu_is_omap24xx() || cpu_is_omap34xx()) 
    719                 return; 
     749        if (!cpu_is_omap44xx()) 
     750                return -EINVAL; 
    720751 
    721752        if (!oh->clkdm || !oh->prcm.omap4.modulemode) 
    722                 return; 
     753                return -EINVAL; 
    723754 
    724         pr_debug("omap_hwmod: %s: _disable_module\n", oh->name); 
     755        pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); 
    725756 
    726757        omap4_cminst_module_disable(oh->clkdm->prcm_partition, 
    727758                                    oh->clkdm->cm_inst, 
    728759                                    oh->clkdm->clkdm_offs, 
    729760                                    oh->prcm.omap4.clkctrl_offs); 
     761 
     762        v = _omap4_wait_target_disable(oh); 
     763        if (v) 
     764                pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", 
     765                        oh->name); 
     766 
     767        return 0; 
    730768} 
    731769 
    732770/** 
    static int _wait_target_ready(struct omap_hwmod *oh) 
    11531191} 
    11541192 
    11551193/** 
    1156  * _wait_target_disable - wait for a module to be disabled 
    1157  * @oh: struct omap_hwmod * 
    1158  * 
    1159  * Wait for a module @oh to enter slave idle.  Returns 0 if the module 
    1160  * does not have an IDLEST bit or if the module successfully enters 
    1161  * slave idle; otherwise, pass along the return value of the 
    1162  * appropriate *_cm*_wait_module_idle() function. 
    1163  */ 
    1164 static int _wait_target_disable(struct omap_hwmod *oh) 
    1165 { 
    1166         /* TODO: For now just handle OMAP4+ */ 
    1167         if (cpu_is_omap24xx() || cpu_is_omap34xx()) 
    1168                 return 0; 
    1169  
    1170         if (!oh) 
    1171                 return -EINVAL; 
    1172  
    1173         if (oh->_int_flags & _HWMOD_NO_MPU_PORT) 
    1174                 return 0; 
    1175  
    1176         if (oh->flags & HWMOD_NO_IDLEST) 
    1177                 return 0; 
    1178  
    1179         return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition, 
    1180                                              oh->clkdm->cm_inst, 
    1181                                              oh->clkdm->clkdm_offs, 
    1182                                              oh->prcm.omap4.clkctrl_offs); 
    1183 } 
    1184  
    1185 /** 
    11861194 * _lookup_hardreset - fill register bit info for this hwmod/reset line 
    11871195 * @oh: struct omap_hwmod * 
    11881196 * @name: name of the reset line in the context of this hwmod 
    static int _enable(struct omap_hwmod *oh) 
    15241532 */ 
    15251533static int _idle(struct omap_hwmod *oh) 
    15261534{ 
    1527         int ret; 
    1528  
    15291535        pr_debug("omap_hwmod: %s: idling\n", oh->name); 
    15301536 
    15311537        if (oh->_state != _HWMOD_STATE_ENABLED) { 
    static int _idle(struct omap_hwmod *oh) 
    15371543        if (oh->class->sysc) 
    15381544                _idle_sysc(oh); 
    15391545        _del_initiator_dep(oh, mpu_oh); 
    1540         _disable_module(oh); 
    1541         ret = _wait_target_disable(oh); 
    1542         if (ret) 
    1543                 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", 
    1544                         oh->name); 
     1546 
     1547        _omap4_disable_module(oh); 
     1548 
    15451549        /* 
    15461550         * The module must be in idle mode before disabling any parents 
    15471551         * clocks. Otherwise, the parent clock might be disabled before 
    static int _shutdown(struct omap_hwmod *oh) 
    16421646        if (oh->_state == _HWMOD_STATE_ENABLED) { 
    16431647                _del_initiator_dep(oh, mpu_oh); 
    16441648                /* XXX what about the other system initiators here? dma, dsp */ 
    1645                 _disable_module(oh); 
    1646                 ret = _wait_target_disable(oh); 
    1647                 if (ret) 
    1648                         pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", 
    1649                                 oh->name); 
     1649                _omap4_disable_module(oh); 
    16501650                _disable_clocks(oh); 
    16511651                if (oh->clkdm) 
    16521652                        clkdm_hwmod_disable(oh->clkdm, oh); 
Note: See TracBrowser for help on using the repository browser.