public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] mpc8313 SPL, relocate_code,  large page NAND
@ 2010-04-20  8:36 Peter Vollmer
  2010-04-20  9:12 ` Peter Vollmer
  2010-04-20 12:44 ` Norbert van Bolhuis
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Vollmer @ 2010-04-20  8:36 UTC (permalink / raw)
  To: u-boot

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@ 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-20 21:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20  8:36 [U-Boot] mpc8313 SPL, relocate_code, large page NAND Peter Vollmer
2010-04-20  9:12 ` Peter Vollmer
2010-04-20  9:57   ` Joakim Tjernlund
2010-04-20 12:12     ` Peter Vollmer
2010-04-20 13:30       ` Joakim Tjernlund
2010-04-20 12:44 ` Norbert van Bolhuis
2010-04-20 17:02   ` Peter Vollmer
2010-04-20 21:43     ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox