aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/platsmp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-07 14:50:14 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-07 14:50:14 -0800
commitd074b104cefcb6e8ded55a53e62fed59a246f55d (patch)
tree8c5b3a3992c5abab8b41b6e1f2837bc46f82b207 /arch/arm/mach-shmobile/platsmp.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input (diff)
parentARM: mach-shmobile: update for SMP changes. (diff)
downloadlinux-dev-d074b104cefcb6e8ded55a53e62fed59a246f55d.tar.xz
linux-dev-d074b104cefcb6e8ded55a53e62fed59a246f55d.zip
Merge branch 'rmobile-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'rmobile-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (67 commits) ARM: mach-shmobile: update for SMP changes. ARM: mach-shmobile: update for GIC changes. ARM: mach-shmobile: Fix up clkdev fallout for SH73A0. dma: shdma: don't register the global die notifier multiple times ARM: mach-shmobile: Rely on run-time IRQ handlers ARM: mach-shmobile: Run-time IRQ handler for GIC ARM: mach-shmobile: Run-time IRQ handler for INTCA ARM: mach-shmobile: Enable CONFIG_MULTI_IRQ_HANDLER ARM: mach-shmobile: Use shared GIC entry macros ARM: mach-shmobile: mackerel: Add zboot support ARM: mach-shmobile: mackerel: Add HDMI sound support ARM: mach-shmobile: mackerel: add HDMI video support ARM: mach-shmobile: ap4evb: fixup clk_put timing of fsib_clk ARM: mach-shmobile: sh73a0: fix div4 table ARM: mach-shmobile: ap4/mackerel: modify wrong comment out of USB ARM: mach-shmobile: Mackerel VGA camera support mmc: sh_mmcif: make DMA support by the driver unconditional ARM: mach-shmobile: Add eMMC support through MMCIF on AG5EVM ARM: mach-shmobile: Use pullups for AG5EVM KEYSC pins ARM: mach-shmobile: sh73a0 GPIO pullup improvement ...
Diffstat (limited to 'arch/arm/mach-shmobile/platsmp.c')
-rw-r--r--arch/arm/mach-shmobile/platsmp.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
new file mode 100644
index 000000000000..65e879bab4dc
--- /dev/null
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -0,0 +1,70 @@
+/*
+ * SMP support for R-Mobile / SH-Mobile
+ *
+ * Copyright (C) 2010 Magnus Damm
+ * Copyright (C) 2011 Paul Mundt
+ *
+ * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/smp.h>
+#include <linux/io.h>
+#include <asm/localtimer.h>
+#include <asm/mach-types.h>
+#include <mach/common.h>
+
+static unsigned int __init shmobile_smp_get_core_count(void)
+{
+ if (machine_is_ag5evm())
+ return sh73a0_get_core_count();
+
+ return 1;
+}
+
+static void __init shmobile_smp_prepare_cpus(void)
+{
+ if (machine_is_ag5evm())
+ sh73a0_smp_prepare_cpus();
+}
+
+void __cpuinit platform_secondary_init(unsigned int cpu)
+{
+ trace_hardirqs_off();
+
+ if (machine_is_ag5evm())
+ sh73a0_secondary_init(cpu);
+}
+
+int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+ if (machine_is_ag5evm())
+ return sh73a0_boot_secondary(cpu);
+
+ return -ENOSYS;
+}
+
+void __init smp_init_cpus(void)
+{
+ unsigned int ncores = shmobile_smp_get_core_count();
+ unsigned int i;
+
+ for (i = 0; i < ncores; i++)
+ set_cpu_possible(i, true);
+}
+
+void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+{
+ int i;
+
+ for (i = 0; i < max_cpus; i++)
+ set_cpu_present(i, true);
+
+ shmobile_smp_prepare_cpus();
+}