1 From 18d53dfa103e63154fb8e548d55016d6ad210d28 Mon Sep 17 00:00:00 2001
2 From: Rohit Vaswani <rvaswani@codeaurora.org>
3 Date: Fri, 21 Jun 2013 12:17:37 -0700
4 Subject: [PATCH 002/182] ARM: msm: Remove pen_release usage
6 pen_release is no longer required as the synchronization
7 is now managed by generic arm code.
8 This is done as suggested in https://lkml.org/lkml/2013/6/4/184
10 Cc: Russell King <linux@arm.linux.org.uk>
11 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
12 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
13 Signed-off-by: Kumar Gala <galak@codeaurora.org>
15 arch/arm/mach-msm/Makefile | 2 +-
16 arch/arm/mach-msm/headsmp.S | 39 ---------------------------------------
17 arch/arm/mach-msm/hotplug.c | 31 ++++---------------------------
18 arch/arm/mach-msm/platsmp.c | 37 +++----------------------------------
19 4 files changed, 8 insertions(+), 101 deletions(-)
20 delete mode 100644 arch/arm/mach-msm/headsmp.S
22 diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
23 index 8e307a1..721f27f 100644
24 --- a/arch/arm/mach-msm/Makefile
25 +++ b/arch/arm/mach-msm/Makefile
26 @@ -19,7 +19,7 @@ obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
27 CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
29 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
30 -obj-$(CONFIG_SMP) += headsmp.o platsmp.o
31 +obj-$(CONFIG_SMP) += platsmp.o
33 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
34 obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
35 diff --git a/arch/arm/mach-msm/headsmp.S b/arch/arm/mach-msm/headsmp.S
36 deleted file mode 100644
37 index 6c62c3f..0000000
38 --- a/arch/arm/mach-msm/headsmp.S
42 - * linux/arch/arm/mach-realview/headsmp.S
44 - * Copyright (c) 2003 ARM Limited
45 - * All Rights Reserved
47 - * This program is free software; you can redistribute it and/or modify
48 - * it under the terms of the GNU General Public License version 2 as
49 - * published by the Free Software Foundation.
51 -#include <linux/linkage.h>
52 -#include <linux/init.h>
55 - * MSM specific entry point for secondary CPUs. This provides
56 - * a "holding pen" into which all secondary cores are held until we're
57 - * ready for them to initialise.
59 -ENTRY(msm_secondary_startup)
60 - mrc p15, 0, r0, c0, c0, 5
71 - * we've been released from the holding pen: secondary_stack
72 - * should now contain the SVC stack for this core
75 -ENDPROC(msm_secondary_startup)
80 diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
81 index 326a872..cea80fc 100644
82 --- a/arch/arm/mach-msm/hotplug.c
83 +++ b/arch/arm/mach-msm/hotplug.c
84 @@ -24,33 +24,10 @@ static inline void cpu_leave_lowpower(void)
86 static inline void platform_do_lowpower(unsigned int cpu)
88 - /* Just enter wfi for now. TODO: Properly shut off the cpu. */
98 - if (pen_release == cpu_logical_map(cpu)) {
100 - * OK, proper wakeup, we're done
106 - * getting here, means that we have come out of WFI without
107 - * having been woken up - this shouldn't happen
109 - * The trouble is, letting people know about this is not really
110 - * possible, since we are currently running incoherently, and
111 - * therefore cannot safely call printk() or anything else
113 - pr_debug("CPU%u: spurious wakeup call\n", cpu);
122 diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
123 index f10a1f5..3721b31 100644
124 --- a/arch/arm/mach-msm/platsmp.c
125 +++ b/arch/arm/mach-msm/platsmp.c
127 #include <linux/errno.h>
128 #include <linux/delay.h>
129 #include <linux/device.h>
130 -#include <linux/jiffies.h>
131 #include <linux/smp.h>
132 #include <linux/io.h>
134 -#include <asm/cacheflush.h>
135 #include <asm/cputype.h>
136 -#include <asm/mach-types.h>
137 #include <asm/smp_plat.h>
139 #include "scm-boot.h"
141 #define SCSS_CPU1CORE_RESET 0xD80
142 #define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64
144 -extern void msm_secondary_startup(void);
145 +extern void secondary_startup(void);
147 static DEFINE_SPINLOCK(boot_lock);
149 @@ -41,13 +38,6 @@ static inline int get_core_count(void)
150 static void msm_secondary_init(unsigned int cpu)
153 - * let the primary processor know we're out of the
154 - * pen, then head off into the C entry point
160 * Synchronise with the boot thread.
162 spin_lock(&boot_lock);
163 @@ -57,7 +47,7 @@ static void msm_secondary_init(unsigned int cpu)
164 static void prepare_cold_cpu(unsigned int cpu)
167 - ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup),
168 + ret = scm_set_boot_addr(virt_to_phys(secondary_startup),
169 SCM_FLAG_COLDBOOT_CPU1);
171 void __iomem *sc1_base_ptr;
172 @@ -75,7 +65,6 @@ static void prepare_cold_cpu(unsigned int cpu)
174 static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
176 - unsigned long timeout;
177 static int cold_boot_done;
179 /* Only need to bring cpu out of reset this way once */
180 @@ -91,39 +80,19 @@ static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
181 spin_lock(&boot_lock);
184 - * The secondary processor is waiting to be released from
185 - * the holding pen - release it, then wait for it to flag
186 - * that it has been released by resetting pen_release.
188 - * Note that "pen_release" is the hardware CPU ID, whereas
189 - * "cpu" is Linux's internal ID.
191 - pen_release = cpu_logical_map(cpu);
192 - sync_cache_w(&pen_release);
195 * Send the secondary CPU a soft interrupt, thereby causing
196 * the boot monitor to read the system wide flags register,
197 * and branch to the address found there.
199 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
201 - timeout = jiffies + (1 * HZ);
202 - while (time_before(jiffies, timeout)) {
204 - if (pen_release == -1)
211 * now the secondary core is starting up let it run its
212 * calibrations, then wait for it to finish
214 spin_unlock(&boot_lock);
216 - return pen_release != -1 ? -ENOSYS : 0;