
Hi all,
support for - at least some - MPC8xx boards seems broken. To prepare some new patches, I build a current U-Boot (top of tree) for our TQM885D board. With this U-Boot, some time after relocation to RAM the board hangs:
U-Boot 1.2.0-g668229de-dirty (Jul 13 2007 - 14:41:16)
CPU: MPC885ZPnn at 133 MHz [15.0...133.0 MHz] 8 kB I-Cache 8 kB D-Cache FEC present Board: TQM885DGEAAD39-E133 I2C: ready DRAM: 128 MB Top of RAM usable for U-Boot at: 08000000 Reserving 199k for U-Boot at: 07fce000 Reserving 288k for malloc() at: 07f86000 Reserving 60 Bytes for Board Info at: 07f85fc4 Reserving 52 Bytes for Global Data at: 07f85f90 Stack Pointer at: 07f85f78 New Stack Pointer is: 07f85f78 Now running in RAM - U-Boot at: 07fce000 -> board hangs
U-Boot runs till line 974 in function board_init_r() in lib_ppc/board.c:
/* Initialize from environment */ if ((s = getenv ("loadaddr")) != NULL) { load_addr = simple_strtoul (s, NULL, 16); }
Somewhere (at varying positions) in the getenv("loadaddr") function, the cpu gets stuck (the single step command in gdb does not return, and/or a SIGSTOP is received).
I tracked the problem down (git bisect is great!) to the commit "ppc4xx: Clean up 440 exceptions handling" from Stefan Roese on 15 Jun 2007 (efa35cf12d914d4caba942acd5a6c45f217de302).
More precisely to the following patch:
--- a/include/ppc_asm.tmpl +++ b/include/ppc_asm.tmpl @@ -217,7 +217,7 @@ * We assume sprg3 has the physical address of the current * task's thread_struct. */ -#define EXCEPTION_PROLOG \ +#define EXCEPTION_PROLOG(reg1, reg2) \ mtspr SPRG0,r20; \ mtspr SPRG1,r21; \ mfcr r20; \ @@ -235,8 +235,10 @@ stw r22,_CTR(r21); \ mfspr r20,XER; \ stw r20,_XER(r21); \ - mfspr r22,SRR0; \ - mfspr r23,SRR1; \ + mfspr r20,DEAR; \ <-- + stw r20,_DAR(r21); \ <-- + mfspr r22,reg1; \ + mfspr r23,reg2; \ stw r0,GPR0(r21); \ stw r1,GPR1(r21); \ stw r2,GPR2(r21); \
If I remove the marked assembler instructions, the board runs again. I could reproduce the same behaviour with a TQM866M board (without the marked instuctions, the board runs fine, with the instructions the board gets stuck some time after relocation to RAM).
Has someone encountered similar problems? What are the two newly added assembler commands good for?
Regards Martin Krause
-- Entwicklung Tel. +49 8153 93 08-157, Fax +49 8153 93 08-7157 mailto:martin.krause@tqs.de
TQ-Systems GmbH Muehlstrasse 2, Gut Delling, D-82229 Seefeld Amtsgericht Muenchen, HRB 105 018, UST-IdNr. DE 811 607 913 Geschaeftsfuehrer: Dipl.-Ing. (FH) Detlef Schneider, Dipl.-Ing. (FH) Ruediger Stahl http://www.tq-group.com