aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/hotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/hotplug.c')
-rwxr-xr-xarch/arm/mach-ux500/hotplug.c97
1 files changed, 22 insertions, 75 deletions
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c
index f0c9471519c..65fad7251ee 100755
--- a/arch/arm/mach-ux500/hotplug.c
+++ b/arch/arm/mach-ux500/hotplug.c
@@ -13,81 +13,40 @@
#include <linux/smp.h>
#include <linux/completion.h>
-extern volatile int pen_release;
-
-static DECLARE_COMPLETION(cpu_killed);
-
-static inline void cpu_enter_lowpower(void)
-{
- unsigned int v;
- asm volatile("bl v7_flush_kern_cache_all\n"
- " mcr p15, 0, %1, c7, c5, 0\n"
- " dsb\n"
- /*
- * Turn off coherency
- */
- " mrc p15, 0, %0, c1, c0, 1\n"
- " bic %0, %0, #0x40\n"
- " mcr p15, 0, %0, c1, c0, 1\n"
- " mrc p15, 0, %0, c1, c0, 0\n"
- " bic %0, %0, #0x04\n"
- " mcr p15, 0, %0, c1, c0, 0\n"
- : "=&r" (v)
- : "r" (0)
- : "cc");
+#include <asm/cacheflush.h>
-}
+#include "pm.h"
-static inline void cpu_leave_lowpower(void)
-{
- unsigned int v;
+extern volatile int pen_release;
- asm volatile("mrc p15, 0, %0, c1, c0, 0\n"
- " orr %0, %0, #0x04\n"
- " mcr p15, 0, %0, c1, c0, 0\n"
- " mrc p15, 0, %0, c1, c0, 1\n"
- " orr %0, %0, #0x40\n"
- " mcr p15, 0, %0, c1, c0, 1\n"
- : "=&r" (v)
- :
- : "cc");
-}
+static DECLARE_COMPLETION(cpu_killed);
static inline void platform_do_lowpower(unsigned int cpu)
{
+ flush_cache_all();
+
/*
- * there is no power-control hardware on this platform, so all
- * we can do is put the core into WFI; this is safe as the calling
- * code will have already disabled interrupts
+ * backup cpu specific context
+ * one woken upm we wud have restored
+ * our cpu specific context
*/
- for (;;) {
+ /* for SVP builds. SVP doesnt incorporate
+ * CONFIG_PM yet!
+ */
+#ifdef CONFIG_PM
+ ux500_cpu_context_deepsleep(cpu);
+#else
+ __asm__ __volatile__("dsb\n\t" "wfi\n\t" \
+ : : : "memory");
+#endif
+ for (;;) {
/*
- * here's the WFI
+ * whiling around till some one releases
+ * the holding pen; if true, v r done!
*/
- asm(".word 0xe320f003\n"
- :
- :
- : "memory", "cc");
-
- if (pen_release == cpu) {
- /*
- * OK, proper wakeup, we're done
- */
+ if (pen_release == cpu)
break;
- }
-
- /*
- * getting here, means that we have come out of WFI without
- * having been woken up - this shouldn't happen
- *
- * The trouble is, letting people know about this is not really
- * possible, since we are currently running incoherently, and
- * therefore cannot safely call printk() or anything else
- */
-#ifdef DEBUG
- printk("CPU%u: spurious wakeup call\n", cpu);
-#endif
}
}
@@ -116,19 +75,7 @@ void platform_cpu_die(unsigned int cpu)
printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
complete(&cpu_killed);
- /*
- * we're ready for shutdown now, so do it
- */
- /* FIXME : skipping this for a temp hack */
- /* cpu_enter_lowpower(); */
platform_do_lowpower(cpu);
-
- /*
- * bring this CPU back into the world of cache
- * coherency, and then restore interrupts
- */
- /* FIXME : skipping this for a temp hack */
- /* cpu_leave_lowpower(); */
}
int mach_cpu_disable(unsigned int cpu)