39
39
/* Load the mailbox register to figure out what we're supposed to do */
40
action = cvmx_read_csr(CVMX_CIU_MBOX_CLRX(coreid));
40
action = cvmx_read_csr(CVMX_CIU_MBOX_CLRX(coreid)) & 0xffff;
42
42
/* Clear the mailbox to clear the interrupt */
43
43
cvmx_write_csr(CVMX_CIU_MBOX_CLRX(coreid), action);
45
45
if (action & SMP_CALL_FUNCTION)
46
46
smp_call_function_interrupt();
47
if (action & SMP_RESCHEDULE_YOURSELF)
48
50
/* Check if we've been told to flush the icache */
49
51
if (action & SMP_ICACHE_FLUSH)
171
173
* After we've done initial boot, this function is called to allow the
172
174
* board code to clean up state, if needed
174
static void octeon_init_secondary(void)
176
static void __cpuinit octeon_init_secondary(void)
176
const int coreid = cvmx_get_core_num();
177
union cvmx_ciu_intx_sum0 interrupt_enable;
180
#ifdef CONFIG_HOTPLUG_CPU
181
struct linux_app_boot_info *labi;
183
labi = (struct linux_app_boot_info *)PHYS_TO_XKSEG_CACHED(LABI_ADDR_IN_BOOTLOADER);
185
if (labi->labi_signature != LABI_SIGNATURE)
186
panic("The bootloader version on this board is incorrect.");
189
180
sr = set_c0_status(ST0_BEV);
190
181
write_c0_ebase((u32)ebase);
191
182
write_c0_status(sr);
193
184
octeon_check_cpu_bist();
194
185
octeon_init_cvmcount();
196
pr_info("SMP: CPU%d (CoreId %lu) started\n", cpu, coreid);
198
/* Enable Mailbox interrupts to this core. These are the only
199
interrupts allowed on line 3 */
200
cvmx_write_csr(CVMX_CIU_MBOX_CLRX(coreid), 0xffffffff);
201
interrupt_enable.u64 = 0;
202
interrupt_enable.s.mbox = 0x3;
203
cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2)), interrupt_enable.u64);
204
cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2 + 1)), 0);
205
cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2)), 0);
206
cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2 + 1)), 0);
207
/* Enable core interrupt processing for 2,3 and 7 */
208
set_c0_status(0x8c01);
187
octeon_irq_setup_secondary();
188
raw_local_irq_enable();
215
195
void octeon_prepare_cpus(unsigned int max_cpus)
217
cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff);
197
#ifdef CONFIG_HOTPLUG_CPU
198
struct linux_app_boot_info *labi;
200
labi = (struct linux_app_boot_info *)PHYS_TO_XKSEG_CACHED(LABI_ADDR_IN_BOOTLOADER);
202
if (labi->labi_signature != LABI_SIGNATURE)
203
panic("The bootloader version on this board is incorrect.");
206
* Only the low order mailbox bits are used for IPIs, leave
207
* the other bits alone.
209
cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffff);
218
210
if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_DISABLED,
219
"mailbox0", mailbox_interrupt)) {
211
"SMP-IPI", mailbox_interrupt)) {
220
212
panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n");
222
if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_DISABLED,
223
"mailbox1", mailbox_interrupt)) {
224
panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n");