This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to start cpu in ARMv7 baremetal environment?

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);


Where I use the assembler routine smc_call:

globl smc_call
.arch_extension sec
smc_call:
SMC #0
bx lr


According to the Documentation, the following parameters should be (and to the best of my knowledge, are) passed:

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)