ARM: OMAP2+: hwmod: add support for blocking WFI when a device is active
authorPaul Walmsley <paul@pwsan.com>
Sat, 26 Jan 2013 07:48:56 +0000 (00:48 -0700)
committerPaul Walmsley <paul@pwsan.com>
Sat, 26 Jan 2013 08:42:33 +0000 (01:42 -0700)
Apparently, on some OMAPs, the MPU can't be allowed to enter WFI while
certain peripherals are active.  It's not clear why, and it's likely
that there is simply some other bug in the driver or integration code.
But since the likelihood that anyone will have the time to track these
problems down in the future seems quite small, we'll provide a
flag, HWMOD_BLOCK_WFI, to mark these issues in the hwmod data.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod.h

index 4653efb87a2721ea20a9fe06a30a6c204d6d2282..6804d474a47da8492cf6a2e82bc65194acf505cf 100644 (file)
 #include <linux/slab.h>
 #include <linux/bootmem.h>
 
+#include <asm/system_misc.h>
+
 #include "clock.h"
 #include "omap_hwmod.h"
 
@@ -2134,6 +2136,8 @@ static int _enable(struct omap_hwmod *oh)
        _enable_clocks(oh);
        if (soc_ops.enable_module)
                soc_ops.enable_module(oh);
+       if (oh->flags & HWMOD_BLOCK_WFI)
+               disable_hlt();
 
        if (soc_ops.update_context_lost)
                soc_ops.update_context_lost(oh);
@@ -2195,6 +2199,8 @@ static int _idle(struct omap_hwmod *oh)
                _idle_sysc(oh);
        _del_initiator_dep(oh, mpu_oh);
 
+       if (oh->flags & HWMOD_BLOCK_WFI)
+               enable_hlt();
        if (soc_ops.disable_module)
                soc_ops.disable_module(oh);
 
@@ -2303,6 +2309,8 @@ 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 */
+               if (oh->flags & HWMOD_BLOCK_WFI)
+                       enable_hlt();
                if (soc_ops.disable_module)
                        soc_ops.disable_module(oh);
                _disable_clocks(oh);
index 3ae852a522f95fd0a8ad5dc53a6dbcadb5a4faa7..80c00e706d69254c18d0a9ca1af789e78ec7299b 100644 (file)
@@ -451,6 +451,14 @@ struct omap_hwmod_omap4_prcm {
  *     enabled.  This prevents the hwmod code from being able to
  *     enable and reset the IP block early.  XXX Eventually it should
  *     be possible to query the clock framework for this information.
+ * HWMOD_BLOCK_WFI: Some OMAP peripherals apparently don't work
+ *     correctly if the MPU is allowed to go idle while the
+ *     peripherals are active.  This is apparently true for the I2C on
+ *     OMAP2420, and also the EMAC on AM3517/3505.  It's unlikely that
+ *     this is really true -- we're probably not configuring something
+ *     correctly, or this is being abused to deal with some PM latency
+ *     issues -- but we're currently suffering from a shortage of
+ *     folks who are able to track these issues down properly.
  */
 #define HWMOD_SWSUP_SIDLE                      (1 << 0)
 #define HWMOD_SWSUP_MSTANDBY                   (1 << 1)
@@ -462,6 +470,7 @@ struct omap_hwmod_omap4_prcm {
 #define HWMOD_CONTROL_OPT_CLKS_IN_RESET                (1 << 7)
 #define HWMOD_16BIT_REG                                (1 << 8)
 #define HWMOD_EXT_OPT_MAIN_CLK                 (1 << 9)
+#define HWMOD_BLOCK_WFI                                (1 << 10)
 
 /*
  * omap_hwmod._int_flags definitions
This page took 0.029956 seconds and 5 git commands to generate.