diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap-hotplug.c')
-rw-r--r-- | arch/arm/mach-omap2/omap-hotplug.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c index 56c345b8b931..414083b427df 100644 --- a/arch/arm/mach-omap2/omap-hotplug.c +++ b/arch/arm/mach-omap2/omap-hotplug.c | |||
@@ -17,8 +17,10 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
19 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
20 | #include <linux/io.h> | ||
20 | 21 | ||
21 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
23 | #include <mach/omap-wakeupgen.h> | ||
22 | 24 | ||
23 | #include "common.h" | 25 | #include "common.h" |
24 | 26 | ||
@@ -35,7 +37,8 @@ int platform_cpu_kill(unsigned int cpu) | |||
35 | */ | 37 | */ |
36 | void __ref platform_cpu_die(unsigned int cpu) | 38 | void __ref platform_cpu_die(unsigned int cpu) |
37 | { | 39 | { |
38 | unsigned int this_cpu; | 40 | unsigned int boot_cpu = 0; |
41 | void __iomem *base = omap_get_wakeupgen_base(); | ||
39 | 42 | ||
40 | flush_cache_all(); | 43 | flush_cache_all(); |
41 | dsb(); | 44 | dsb(); |
@@ -43,16 +46,27 @@ void __ref platform_cpu_die(unsigned int cpu) | |||
43 | /* | 46 | /* |
44 | * we're ready for shutdown now, so do it | 47 | * we're ready for shutdown now, so do it |
45 | */ | 48 | */ |
46 | if (omap_modify_auxcoreboot0(0x0, 0x200) != 0x0) | 49 | if (omap_secure_apis_support()) { |
47 | pr_err("Secure clear status failed\n"); | 50 | if (omap_modify_auxcoreboot0(0x0, 0x200) != 0x0) |
51 | pr_err("Secure clear status failed\n"); | ||
52 | } else { | ||
53 | __raw_writel(0, base + OMAP_AUX_CORE_BOOT_0); | ||
54 | } | ||
55 | |||
48 | 56 | ||
49 | for (;;) { | 57 | for (;;) { |
50 | /* | 58 | /* |
51 | * Enter into low power state | 59 | * Enter into low power state |
52 | */ | 60 | */ |
53 | omap4_hotplug_cpu(cpu, PWRDM_POWER_OFF); | 61 | omap4_hotplug_cpu(cpu, PWRDM_POWER_OFF); |
54 | this_cpu = smp_processor_id(); | 62 | |
55 | if (omap_read_auxcoreboot0() == this_cpu) { | 63 | if (omap_secure_apis_support()) |
64 | boot_cpu = omap_read_auxcoreboot0(); | ||
65 | else | ||
66 | boot_cpu = | ||
67 | __raw_readl(base + OMAP_AUX_CORE_BOOT_0) >> 5; | ||
68 | |||
69 | if (boot_cpu == smp_processor_id()) { | ||
56 | /* | 70 | /* |
57 | * OK, proper wakeup, we're done | 71 | * OK, proper wakeup, we're done |
58 | */ | 72 | */ |