I am using an Allwinner H3 SoC (on a zeropi board) and I want to start up a secondary core without using an OS. I am trying to use the SMC call CPU_ON, using the following code:
smc_call(0x84000003, 0x02, (void*)blink, 0);
globl smc_call .arch_extension sec smc_call: SMC #0 bx lr
1. uint32 Function ID (0x84000003)2. uint32 target CPU (0x02)3. uint32 entry_point_address (in my case, a function called 'blink')4. uint32 context_d (0, but this is only a guess from what I've seen in the Linux kernel)
The outcome is very interesting: Core0 starts executing 'blink', instead of returning and leaving Core3 to execute it.
What am I overlooking?
(Edit: fixed contradicting cpu numbering)
No, I start this program straight from uboot.
I watch the serial output, which, when the program terminates, should acknowledge it. The 'blink' function is an infinite loop, and therefore it does not return. The main 'thread' only has one job: spin up another core that will execute'blink', and terminate. It, however, does not terminate, and the LED is physically blinking, therefore _something_ must be executing it. I experimented with using the LED to encode the cpuID, and it also shows its running on core0 - however I'm not entirely sure if that's a good indicator (I took the code to determine the cpuID from the DS-5 examples)