[meta-xilinx] AMP using Yocto meta-xilinx

Andrea Scian rnd4 at dave-tech.it
Mon May 18 00:08:01 PDT 2015


Dear Edward,

On 16/05/2015 02:23, Edward Wingate wrote:
> If I have an elf file that was compiled against a BSP targeted for
> ps7_cortexa9_0, do I need to re-create the elf compiled against a new
> BSP targeted for ps7_cortexa9_1 in order to have Linux load it to run
> on CPU1?  I'm having problems doing this.
>
> I created a BSP targeted for ps7_cortexa9_1.  Other than the target
> CPU, the only other difference is I added an extra compiler flag
> "-DUSE_AMP=1".

Yes, you have to use ps7_cortexa9_1 to build a binary that can run 
(only!) con core 1 (more on this later)
Also if using AMP you have to add -DUSE_AMP=1, see below

>    But when I re-build my elf referencing this new BSP,
> it no longer works when I load via JTAG (just to test it first).  I
> also tried it without USE_AMP defined so that BSP's should be
> identical except for the target CPU, but that didn't help.
>
> When I debug it, it ends up in EndlessLoop1 in boot.S:
>
> /* this initializes the various processor modes */
> _prestart:
> _boot:
>
> #if XPAR_CPU_ID==0
> /* only allow cpu0 through */
>      mrc p15,0,r1,c0,c0,5
>      and r1, r1, #0xf
>      cmp r1, #0
>      beq OKToRun
> EndlessLoop0:
>      wfe
>      b EndlessLoop0
>
> #elif XPAR_CPU_ID==1
> /* only allow cpu1 through */
>      mrc p15,0,r1,c0,c0,5
>      and r1, r1, #0xf
>      cmp r1, #1
>      beq OKToRun
> EndlessLoop1:
>      wfe
>      b EndlessLoop1
> #endif
>
> I guess it never gets the OK to branch to OKToRun.  Anyone know what
> I'm doing wrong here?

The code above is reading the CPU ID to know which core is running on (0 
vs 1) and, if the binary was build for the other core, it do an endless 
wfe loop. If the CPU ID match the desired core it jumps to OKToRun to 
continue normal execution.

> If I try to use the working elf that was created using the original
> BSP targeted to CPU0, will that cause other problems?

Yes
First of all it will not pass the check above (Linux shuts down core 1 
and run AMP binary from that one).
If you bypass somehow that code it will not work either.
There's code all around Xilinx SDK that looks for CPU ID and USE_AMP 
define to do the right initialization (e.g. L2 cache, MMU mapping and so on)

IOW: you can NOT run an "AMP suitable" binary from JTAG (or vice-versa), 
because of all the above reason.

> Thanks for your help.

You're welcome

Kind Regards,

-- 

Andrea SCIAN

DAVE Embedded Systems




More information about the meta-xilinx mailing list