Reputation: 1272
This question has already been answered for x86 however, I couldn't find much about ARM MP cpus like Cortex-A9, Cortex-A15 etc...
More importantly i want to know if interrupts can be raised on non-primary cpu without any configuration etc.
I am working on a software which deals only with the primary cpu hence i put the rest in WFI state however I am unaware of how interrupts work on the MP arm cpus, Is it possible that the main cpu continues executing code and one of the secondary cpu picks it up and jumps to the instruction in vector table and execute that code ?
btw here is the code I'm using to put them to low power mode
uint32_t reg;
__asm__ volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (reg));
reg &= 0xF;
if(reg > 0)
goto spin;
<code snipped>
spin:
for(;;)
cpu_idle(); // cpu_idle -> wfi
Upvotes: 6
Views: 10615
Reputation: 6234
The short and for practical purposes correct answer is that what you ask for is not possible without some configuration being performed on the secondary cores...
The interrupt controller architecture is described (in quite some detail) in http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ihi0048b/index.html
To prepare the secondary cores to receive IPIs, you need to:
If you don't intend to implement an interrupt handler, skip the clearing of the I-bit. The core will come out of WFI and continue executing. That is normally what you want for a system boot operation.
Upvotes: 10