Add linux-next specific files for 20110831
[linux-2.6/next.git] / arch / arm / mach-omap2 / omap-hotplug.c
blob4976b9393e49123ad04eaa8fabb15b7ca4357c99
1 /*
2 * OMAP4 SMP cpu-hotplug support
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Author:
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>
21 #include <asm/cacheflush.h>
22 #include <mach/omap4-common.h>
24 int platform_cpu_kill(unsigned int cpu)
26 return 1;
30 * platform-specific code to shutdown a CPU
31 * Called with IRQs disabled
33 void platform_cpu_die(unsigned int cpu)
35 flush_cache_all();
36 dsb();
39 * we're ready for shutdown now, so do it
41 if (omap_modify_auxcoreboot0(0x0, 0x200) != 0x0)
42 printk(KERN_CRIT "Secure clear status failed\n");
44 for (;;) {
46 * Execute WFI
48 do_wfi();
50 if (omap_read_auxcoreboot0() == cpu) {
52 * OK, proper wakeup, we're done
54 break;
56 pr_debug("CPU%u: spurious wakeup call\n", cpu);
60 int platform_cpu_disable(unsigned int cpu)
63 * we don't allow CPU 0 to be shutdown (it is still too special
64 * e.g. clock tick interrupts)
66 return cpu == 0 ? -EPERM : 0;