2 * OMAP4 SMP cpu-hotplug support
4 * Copyright (C) 2010 Texas Instruments, Inc.
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 * Platform file needed for the OMAP4 SMP. This file is based on arm
9 * realview smp platform.
10 * Copyright (c) 2002 ARM Limited.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
17 #include <linux/kernel.h>
18 #include <linux/errno.h>
19 #include <linux/smp.h>
20 #include <linux/completion.h>
22 #include <asm/cacheflush.h>
23 #include <mach/omap4-common.h>
25 static DECLARE_COMPLETION(cpu_killed);
27 int platform_cpu_kill(unsigned int cpu)
29 return wait_for_completion_timeout(&cpu_killed, 5000);
33 * platform-specific code to shutdown a CPU
34 * Called with IRQs disabled
36 void platform_cpu_die(unsigned int cpu)
38 unsigned int this_cpu = hard_smp_processor_id();
40 if (cpu != this_cpu) {
41 pr_crit("platform_cpu_die running on %u, should be %u\n",
45 pr_notice("CPU%u: shutdown\n", cpu);
46 complete(&cpu_killed);
51 * we're ready for shutdown now, so do it
53 if (omap_modify_auxcoreboot0(0x0, 0x200) != 0x0)
54 printk(KERN_CRIT "Secure clear status failed\n");
62 if (omap_read_auxcoreboot0() == cpu) {
64 * OK, proper wakeup, we're done
68 pr_debug("CPU%u: spurious wakeup call\n", cpu);
72 int platform_cpu_disable(unsigned int cpu)
75 * we don't allow CPU 0 to be shutdown (it is still too special
76 * e.g. clock tick interrupts)
78 return cpu == 0 ? -EPERM : 0;