[U-Boot] cpu/mpc512x/start.S question: the compare test during relocation...

I have a board similar to the ads512101 evaluation board, at least that's my starting point.
I'm booting and running, after making a slight change to start.S to get lowboot working, as my board is hard-wired for lowboot.
In order to boot-through to the console I needed to disable a bne on a compare failure under relocate_code: in cpu/mpc512x/start.S.
1) Can anyone tell me what is going on with this comparison?
With my comment removed, I've set a breakpoint (I use BDI2000) there and indeed seen that r20 and r21 are equal for many trips through the loop. I also set a breakpoint at 30: (compare fail) and I see that indeed r20 and r21 are different.
-It's not clear why the comparison if failing, or maybe where: could I be over-running source or destination memory, causing a compare fail? -I'm challenged by the assembly code. I wouldn't say intimidated, but often confused.
***Can anyone provide a top-down description of what is happenign here, and maybe a hint as to some memory range/size issue that could cause this compare to fail!
/* and compare */ 20: lwzu r20,4(r8) lwzu r21,4(r7) xor. r22, r20, r21 /* bne 30f */ /* Mike - FIXME */ bdnz 20b b 4f /* compare failed */ 30: li r3, 0 blr
Thanks!
-Mike

Dear Mike Timmons,
In message f55acef80908080754x6ad194dbu189a6ea1cc829dd7@mail.gmail.com you wrote:
I have a board similar to the ads512101 evaluation board, at least that's my starting point.
Is your board really similar, i. e. did you copy all the CPLD stuff from MPC5121ADS as well? Otherwise, ARIA might be a better choice to copy code from.
In order to boot-through to the console I needed to disable a bne on a compare failure under relocate_code: in cpu/mpc512x/start.S.
This typically means that you memory initialization is not correct.
- Can anyone tell me what is going on with this comparison?
With my comment removed, I've set a breakpoint (I use BDI2000) there and indeed seen that r20 and r21 are equal for many trips through the loop. I also set a breakpoint at 30: (compare fail) and I see that indeed r20 and r21 are different.
So the content of the RAM where the code got copied to is not identical to the content of the flash where the code got copied from ==> RAM error.
Best regards,
Wolfgang Denk
participants (2)
-
Mike Timmons
-
Wolfgang Denk