20 #include <linux/kernel.h>
26 #include <mach/common.h>
33 #define AVECR IOMEM(0xfe700040)
54 [1] = &r8a7779_ch_cpu1,
55 [2] = &r8a7779_ch_cpu2,
56 [3] = &r8a7779_ch_cpu3,
61 return (
void __iomem *)0xf0000000;
65 static unsigned long tmp;
67 #ifdef CONFIG_HAVE_ARM_TWD
76 static void modify_scu_cpu_psr(
unsigned long set,
unsigned long clr)
84 spin_unlock(&scu_lock);
90 static unsigned int __init r8a7779_get_core_count(
void)
97 static int r8a7779_platform_cpu_kill(
unsigned int cpu)
105 modify_scu_cpu_psr(3 << (cpu * 8), 0);
108 ch = r8a7779_ch_cpu[
cpu];
113 return ret ? ret : 1;
124 for (k = 0; k < 1000; k++) {
126 return r8a7779_platform_cpu_kill(cpu);
135 static void __cpuinit r8a7779_secondary_init(
unsigned int cpu)
148 modify_scu_cpu_psr(0, 3 << (cpu * 8));
151 ch = r8a7779_ch_cpu[
cpu];
159 static void __init r8a7779_smp_prepare_cpus(
unsigned int max_cpus)
169 modify_scu_cpu_psr(0, 3 << (cpu * 8));
174 r8a7779_platform_cpu_kill(1);
175 r8a7779_platform_cpu_kill(2);
176 r8a7779_platform_cpu_kill(3);
179 static void __init r8a7779_smp_init_cpus(
void)
181 unsigned int ncores = r8a7779_get_core_count();
187 .smp_init_cpus = r8a7779_smp_init_cpus,
188 .smp_prepare_cpus = r8a7779_smp_prepare_cpus,
189 .smp_secondary_init = r8a7779_secondary_init,
190 .smp_boot_secondary = r8a7779_boot_secondary,
191 #ifdef CONFIG_HOTPLUG_CPU
192 .cpu_kill = r8a7779_cpu_kill,