Xil_SetTlbAttributes(0xFFFF0000,0x14de2);cout<<"CPU1: Initialized."<<endl;wfe();cout<<"CPU1: After WFE."<<endl;
cout<<"CPU0: writing start address for CPU1."<<endl;
dmb(); //waits until write has finished
I expect after 5 seconds of CPU0's output, there will be CPU1's output. But actually, every time I run debug configuration, 3 cout strings of CPU0 and CPU1 appear instantly.
So I think that CPU1 is started automatically, how can I actually let CPU0 starts CPU1? What's more, wfe() instruction on CPU1 apparently has no effect.
1. I have add -DUSE_AMP=1 flags in CPU1's board support package.
Now by stepping instructions on CPU1 one by one:
/* only allow cpu1 through */
and r1, r1, #0xf
cmp r1, #1
ldr r1,[r0] /* Read eFuse setting */
ands r1,r1,#0x80 /* Check whether device is having single core */
I find that after CPU1 executing beq OKToRun, it goes to region OKToRun. It looks like CPU1 fails to recognize that it's in a multi-core system.