]>
Commit | Line | Data |
---|---|---|
1c51ed4f MD |
1 | /* |
2 | * SMP support for R-Mobile / SH-Mobile | |
3 | * | |
4 | * Copyright (C) 2010 Magnus Damm | |
c413521e | 5 | * Copyright (C) 2011 Paul Mundt |
1c51ed4f MD |
6 | * |
7 | * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License version 2 as | |
11 | * published by the Free Software Foundation. | |
12 | */ | |
13 | #include <linux/init.h> | |
1c51ed4f | 14 | #include <linux/smp.h> |
cc61591e MD |
15 | #include <asm/cacheflush.h> |
16 | #include <asm/smp_plat.h> | |
17 | #include <mach/common.h> | |
1c51ed4f | 18 | |
a62580e5 | 19 | void __init shmobile_smp_init_cpus(unsigned int ncores) |
1c51ed4f | 20 | { |
1c51ed4f MD |
21 | unsigned int i; |
22 | ||
a06f916b RK |
23 | if (ncores > nr_cpu_ids) { |
24 | pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", | |
25 | ncores, nr_cpu_ids); | |
26 | ncores = nr_cpu_ids; | |
27 | } | |
28 | ||
1c51ed4f MD |
29 | for (i = 0; i < ncores; i++) |
30 | set_cpu_possible(i, true); | |
31 | } | |
cc61591e MD |
32 | |
33 | extern unsigned long shmobile_smp_fn[]; | |
34 | extern unsigned long shmobile_smp_arg[]; | |
35 | extern unsigned long shmobile_smp_mpidr[]; | |
36 | ||
37 | void shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg) | |
38 | { | |
39 | shmobile_smp_fn[cpu] = 0; | |
40 | flush_cache_all(); | |
41 | ||
42 | shmobile_smp_mpidr[cpu] = cpu_logical_map(cpu); | |
43 | shmobile_smp_fn[cpu] = fn; | |
44 | shmobile_smp_arg[cpu] = arg; | |
45 | flush_cache_all(); | |
46 | } |