diff options
Diffstat (limited to 'arch/mips/kernel/smp-cmp.c')
-rw-r--r-- | arch/mips/kernel/smp-cmp.c | 66 |
1 files changed, 5 insertions, 61 deletions
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c index 653be061b9ec..ad0ff5dc4d59 100644 --- a/arch/mips/kernel/smp-cmp.c +++ b/arch/mips/kernel/smp-cmp.c | |||
@@ -37,80 +37,24 @@ | |||
37 | #include <asm/mipsregs.h> | 37 | #include <asm/mipsregs.h> |
38 | #include <asm/mipsmtregs.h> | 38 | #include <asm/mipsmtregs.h> |
39 | #include <asm/mips_mt.h> | 39 | #include <asm/mips_mt.h> |
40 | 40 | #include <asm/amon.h> | |
41 | /* | 41 | #include <asm/gic.h> |
42 | * Crude manipulation of the CPU masks to control which | ||
43 | * which CPU's are brought online during initialisation | ||
44 | * | ||
45 | * Beware... this needs to be called after CPU discovery | ||
46 | * but before CPU bringup | ||
47 | */ | ||
48 | static int __init allowcpus(char *str) | ||
49 | { | ||
50 | cpumask_t cpu_allow_map; | ||
51 | char buf[256]; | ||
52 | int len; | ||
53 | |||
54 | cpus_clear(cpu_allow_map); | ||
55 | if (cpulist_parse(str, &cpu_allow_map) == 0) { | ||
56 | cpu_set(0, cpu_allow_map); | ||
57 | cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map); | ||
58 | len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map); | ||
59 | buf[len] = '\0'; | ||
60 | pr_debug("Allowable CPUs: %s\n", buf); | ||
61 | return 1; | ||
62 | } else | ||
63 | return 0; | ||
64 | } | ||
65 | __setup("allowcpus=", allowcpus); | ||
66 | 42 | ||
67 | static void ipi_call_function(unsigned int cpu) | 43 | static void ipi_call_function(unsigned int cpu) |
68 | { | 44 | { |
69 | unsigned int action = 0; | ||
70 | |||
71 | pr_debug("CPU%d: %s cpu %d status %08x\n", | 45 | pr_debug("CPU%d: %s cpu %d status %08x\n", |
72 | smp_processor_id(), __func__, cpu, read_c0_status()); | 46 | smp_processor_id(), __func__, cpu, read_c0_status()); |
73 | 47 | ||
74 | switch (cpu) { | 48 | gic_send_ipi(plat_ipi_call_int_xlate(cpu)); |
75 | case 0: | ||
76 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE0; | ||
77 | break; | ||
78 | case 1: | ||
79 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE1; | ||
80 | break; | ||
81 | case 2: | ||
82 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE2; | ||
83 | break; | ||
84 | case 3: | ||
85 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE3; | ||
86 | break; | ||
87 | } | ||
88 | gic_send_ipi(action); | ||
89 | } | 49 | } |
90 | 50 | ||
91 | 51 | ||
92 | static void ipi_resched(unsigned int cpu) | 52 | static void ipi_resched(unsigned int cpu) |
93 | { | 53 | { |
94 | unsigned int action = 0; | ||
95 | |||
96 | pr_debug("CPU%d: %s cpu %d status %08x\n", | 54 | pr_debug("CPU%d: %s cpu %d status %08x\n", |
97 | smp_processor_id(), __func__, cpu, read_c0_status()); | 55 | smp_processor_id(), __func__, cpu, read_c0_status()); |
98 | 56 | ||
99 | switch (cpu) { | 57 | gic_send_ipi(plat_ipi_resched_int_xlate(cpu)); |
100 | case 0: | ||
101 | action = GIC_IPI_EXT_INTR_RESCHED_VPE0; | ||
102 | break; | ||
103 | case 1: | ||
104 | action = GIC_IPI_EXT_INTR_RESCHED_VPE1; | ||
105 | break; | ||
106 | case 2: | ||
107 | action = GIC_IPI_EXT_INTR_RESCHED_VPE2; | ||
108 | break; | ||
109 | case 3: | ||
110 | action = GIC_IPI_EXT_INTR_RESCHED_VPE3; | ||
111 | break; | ||
112 | } | ||
113 | gic_send_ipi(action); | ||
114 | } | 58 | } |
115 | 59 | ||
116 | /* | 60 | /* |
@@ -206,7 +150,7 @@ static void cmp_boot_secondary(int cpu, struct task_struct *idle) | |||
206 | (unsigned long)(gp + sizeof(struct thread_info))); | 150 | (unsigned long)(gp + sizeof(struct thread_info))); |
207 | #endif | 151 | #endif |
208 | 152 | ||
209 | amon_cpu_start(cpu, pc, sp, gp, a0); | 153 | amon_cpu_start(cpu, pc, sp, (unsigned long)gp, a0); |
210 | } | 154 | } |
211 | 155 | ||
212 | /* | 156 | /* |