summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/platsmp-scu.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2013-09-14 22:46:25 +0900
committerSimon Horman <horms+renesas@verge.net.au>2013-09-30 17:56:08 +0900
commit916d6121b5947f162979595cc1c0396192a9aa86 (patch)
tree52475b4b21d3f709c11b89a6711847615fd3ad12 /arch/arm/mach-shmobile/platsmp-scu.c
parentad09cb83811b228eb6f98230d307bb837e6a758f (diff)
downloadop-kernel-dev-916d6121b5947f162979595cc1c0396192a9aa86.zip
op-kernel-dev-916d6121b5947f162979595cc1c0396192a9aa86.tar.gz
ARM: shmobile: Add CPU notifier based SCU boot vector code
Add CPU notifiers for the shared mach-shmobile SCU code to allow removal of the shared SCU boot_secondary code. Regarding notifiers, at CPU_UP_PREPARE time the SMP boot vector is initialized so secondary CPU cores can boot. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/platsmp-scu.c')
-rw-r--r--arch/arm/mach-shmobile/platsmp-scu.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index c96f501..49ae8df 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -7,6 +7,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/cpu.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
@@ -16,6 +17,26 @@
#include <asm/smp_scu.h>
#include <mach/common.h>
+static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
+ unsigned long action, void *hcpu)
+{
+ unsigned int cpu = (long)hcpu;
+
+ switch (action) {
+ case CPU_UP_PREPARE:
+ /* For this particular CPU register SCU SMP boot vector */
+ shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
+ (unsigned long)shmobile_scu_base);
+ break;
+ };
+
+ return NOTIFY_OK;
+}
+
+static struct notifier_block shmobile_smp_scu_notifier = {
+ .notifier_call = shmobile_smp_scu_notifier_call,
+};
+
void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
{
/* install boot code shared by all CPUs */
@@ -25,6 +46,9 @@ void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
/* enable SCU and cache coherency on booting CPU */
scu_enable(shmobile_scu_base);
scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
+
+ /* Use CPU notifier for reset vector control */
+ register_cpu_notifier(&shmobile_smp_scu_notifier);
}
int shmobile_smp_scu_boot_secondary(unsigned int cpu, struct task_struct *idle)
OpenPOWER on IntegriCloud