spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control
[zen-stable.git] / arch / arm / mach-shmobile / platsmp.c
blob993381257f69a6352adcc7e61df3d92d65b88643
1 /*
2 * SMP support for R-Mobile / SH-Mobile
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2011 Paul Mundt
7 * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
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.
13 #include <linux/init.h>
14 #include <linux/errno.h>
15 #include <linux/delay.h>
16 #include <linux/device.h>
17 #include <linux/smp.h>
18 #include <linux/io.h>
19 #include <asm/hardware/gic.h>
20 #include <asm/localtimer.h>
21 #include <asm/mach-types.h>
22 #include <mach/common.h>
24 #define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2())
25 #define is_r8a7779() machine_is_marzen()
27 static unsigned int __init shmobile_smp_get_core_count(void)
29 if (is_sh73a0())
30 return sh73a0_get_core_count();
32 if (is_r8a7779())
33 return r8a7779_get_core_count();
35 return 1;
38 static void __init shmobile_smp_prepare_cpus(void)
40 if (is_sh73a0())
41 sh73a0_smp_prepare_cpus();
43 if (is_r8a7779())
44 r8a7779_smp_prepare_cpus();
47 int shmobile_platform_cpu_kill(unsigned int cpu)
49 if (is_r8a7779())
50 return r8a7779_platform_cpu_kill(cpu);
52 return 1;
55 void __cpuinit platform_secondary_init(unsigned int cpu)
57 trace_hardirqs_off();
59 if (is_sh73a0())
60 sh73a0_secondary_init(cpu);
62 if (is_r8a7779())
63 r8a7779_secondary_init(cpu);
66 int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
68 if (is_sh73a0())
69 return sh73a0_boot_secondary(cpu);
71 if (is_r8a7779())
72 return r8a7779_boot_secondary(cpu);
74 return -ENOSYS;
77 void __init smp_init_cpus(void)
79 unsigned int ncores = shmobile_smp_get_core_count();
80 unsigned int i;
82 if (ncores > nr_cpu_ids) {
83 pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
84 ncores, nr_cpu_ids);
85 ncores = nr_cpu_ids;
88 for (i = 0; i < ncores; i++)
89 set_cpu_possible(i, true);
91 set_smp_cross_call(gic_raise_softirq);
94 void __init platform_smp_prepare_cpus(unsigned int max_cpus)
96 shmobile_smp_prepare_cpus();