1 /* linux arch/arm/mach-exynos4/hotplug.c
3 * Cloned from linux/arch/arm/mach-realview/hotplug.c
5 * Copyright (C) 2002 ARM Ltd.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/errno.h>
15 #include <linux/smp.h>
18 #include <asm/cacheflush.h>
20 #include <asm/smp_plat.h>
25 static inline void cpu_leave_lowpower(void)
30 "mrc p15, 0, %0, c1, c0, 0\n"
32 " mcr p15, 0, %0, c1, c0, 0\n"
33 " mrc p15, 0, %0, c1, c0, 1\n"
35 " mcr p15, 0, %0, c1, c0, 1\n"
37 : "Ir" (CR_C), "Ir" (0x40)
41 static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
43 u32 mpidr = cpu_logical_map(cpu);
44 u32 core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
48 /* Turn the CPU off on next WFI instruction. */
49 exynos_cpu_power_down(core_id);
53 if (pen_release == core_id) {
55 * OK, proper wakeup, we're done
61 * Getting here, means that we have come out of WFI without
62 * having been woken up - this shouldn't happen
64 * Just note it happening - when we're woken, we can report
72 * platform-specific code to shutdown a CPU
74 * Called with IRQs disabled
76 void __ref exynos_cpu_die(unsigned int cpu)
80 v7_exit_coherency_flush(louis);
82 platform_do_lowpower(cpu, &spurious);
85 * bring this CPU back into the world of cache
86 * coherency, and then restore interrupts
91 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);