[U-Boot] mpc8313 SPL, relocate_code, large page NAND

Peter Vollmer pvollmer-u-boot at innominate.com
Tue Apr 20 10:36:08 CEST 2010


Hi all,

I'm currently seeing a weird heisen-bug kind of problem on a mpc8313-based  
board with large page NAND flash. The problem happens in u-boot-spl in  
relocate_code. When I set a breakpoint after the first cycle of

...cpu/mpc83xx/start.S

relocate_code:
1: lwzu    r0,4(r8)
    stwu    r0,4(r7)
    bdnz    1b         <- breakpoint

    addi    r0,r5,3

   ...
and simply go on with the execution after it gets hit, everything is  
working perfectly well and I get to the u-boot CLI . But if I move the  
breakpoint to the next instruction (addi), it never gets hit. Looking at  
the relocation destination (0x10000) afterwards in that case, I see that  
only the first 32 bytes were copied over to RAM.

I then inserted 8 pairs of lwzu/stwu inside the loop to see when exactly  
the problem occurs:

1: lwzu    r0,4(r8)
    stwu    r0,4(r7)
    lwzu    r0,4(r8)
    stwu    r0,4(r7)
    ...
    lwzu    r0,4(r8)
    stwu    r0,4(r7)
    bdnz    1b

and the last breakpoint location that would get hit is after 6 times of  
lwzu/stwu. I tested this with both a BDI2000 and a Ronetix Peedi emulator  
with exactly the same result. The jtag emulators do not do any register  
modification I know of, they just set the breakpoint.

I also tried to insert a delay of a couple of milliseconds before  
relocate_code to no avail.

I'm working with u-boot v2009.11 based on MPC8313ERDB. The RCW is read  
 from EEPROM, with ROMLOC set to large page NAND:
RCWHR = 0xa4540000
RCWLR = 0x65040000

I can see the 4kb bootblock from the first NAND page correctly mapped to  
0xfff00000.

Could anybody give me a clue whats happening here ? Could it be a cache  
related problem, or wrong RAM timing settings?

Thanks and best regards

-- 
Peter Vollmer
Innominate Security Technologies AG
Berlin / Germany


More information about the U-Boot mailing list