]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: OMAP4: PM: CPU1 wakeup workaround from Low power modes
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Wed, 16 Jun 2010 16:49:49 +0000 (22:19 +0530)
committerKevin Hilman <khilman@ti.com>
Thu, 8 Dec 2011 19:29:00 +0000 (11:29 -0800)
The SGI(Software Generated Interrupts) are not wakeup capable from
low power states. This is known limitation on OMAP4 and needs to be
worked around by using software forced clockdomain wake-up. CPU0 forces
the CPU1 clockdomain to software force wakeup.

More details can be found in OMAP4430 TRM - Version J
Section :
4.3.4.2 Power States of CPU0 and CPU1

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/omap-smp.c

index ee83808de0ff08eabfc2d1ae31c6f62e07645d2f..c1bf3ef0ba02d5ffe0ea8af5642b9a078d9f0b66 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "common.h"
 
+#include "clockdomain.h"
+
 /* SCU base address */
 static void __iomem *scu_base;
 
@@ -68,6 +70,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 
 int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+       static struct clockdomain *cpu1_clkdm;
+       static bool booted;
        /*
         * Set synchronisation state between this boot processor
         * and the secondary one
@@ -83,6 +87,29 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
        omap_modify_auxcoreboot0(0x200, 0xfffffdff);
        flush_cache_all();
        smp_wmb();
+
+       if (!cpu1_clkdm)
+               cpu1_clkdm = clkdm_lookup("mpu1_clkdm");
+
+       /*
+        * The SGI(Software Generated Interrupts) are not wakeup capable
+        * from low power states. This is known limitation on OMAP4 and
+        * needs to be worked around by using software forced clockdomain
+        * wake-up. To wakeup CPU1, CPU0 forces the CPU1 clockdomain to
+        * software force wakeup. The clockdomain is then put back to
+        * hardware supervised mode.
+        * More details can be found in OMAP4430 TRM - Version J
+        * Section :
+        *      4.3.4.2 Power States of CPU0 and CPU1
+        */
+       if (booted) {
+               clkdm_wakeup(cpu1_clkdm);
+               clkdm_allow_idle(cpu1_clkdm);
+       } else {
+               dsb_sev();
+               booted = true;
+       }
+
        gic_raise_softirq(cpumask_of(cpu), 1);
 
        /*