public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] MPC8xx boards broken by commit some weeks ago
@ 2007-07-16  8:31 Martin Krause
  2007-07-17 11:15 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Krause @ 2007-07-16  8:31 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot-Users] MPC8xx boards broken by commit some weeks ago
  2007-07-16  8:31 [U-Boot-Users] MPC8xx boards broken by commit some weeks ago Martin Krause
@ 2007-07-17 11:15 ` Stefan Roese
  2007-07-17 11:32   ` Martin Krause
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Roese @ 2007-07-17 11:15 UTC (permalink / raw)
  To: u-boot

Hi Martin,

On Monday 16 July 2007, Martin Krause wrote:
> 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:

<snip>

> 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);  \  <--

We are currently working on a fix for this. Sorry for the inconvenience.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office@denx.de
=====================================================================

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

* [U-Boot-Users] MPC8xx boards broken by commit some weeks ago
  2007-07-17 11:15 ` Stefan Roese
@ 2007-07-17 11:32   ` Martin Krause
  2007-07-17 11:36     ` Stefan Roese
  2007-07-17 16:39     ` Rafal Jaworowski
  0 siblings, 2 replies; 6+ messages in thread
From: Martin Krause @ 2007-07-17 11:32 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

Stefan Roese wrote on Tuesday, July 17, 2007 1:15 PM:
> Hi Martin,
> 
> On Monday 16 July 2007, Martin Krause wrote:
> > 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: 
> 
> <snip>
> 
> > 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);  \  <--
> 
> We are currently working on a fix for this. Sorry for the

Great! I tried to figure out what's going on myself, but get
stuck because I'm no ppc assembler expert. It seems, that the
"DEAR" special purpose register is not available on the MPC885D
(and other MPC8xx processors?)?

Best regards,
Martin Krause

Development
Tel. +49 8153 93 08-157, Fax +49 8153 93 08-7157
mailto:martin.krause at 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

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

* [U-Boot-Users] MPC8xx boards broken by commit some weeks ago
  2007-07-17 11:32   ` Martin Krause
@ 2007-07-17 11:36     ` Stefan Roese
  2007-07-17 16:39     ` Rafal Jaworowski
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2007-07-17 11:36 UTC (permalink / raw)
  To: u-boot

HI Martin,

On Tuesday 17 July 2007, Martin Krause wrote:
> > > @@ -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);  \  <--
> >
> > We are currently working on a fix for this. Sorry for the
>
> Great! I tried to figure out what's going on myself, but get
> stuck because I'm no ppc assembler expert. It seems, that the
> "DEAR" special purpose register is not available on the MPC885D
> (and other MPC8xx processors?)?

Yep, that's the case and as it seems the cause of this problem.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot-Users] MPC8xx boards broken by commit some weeks ago
  2007-07-17 11:32   ` Martin Krause
  2007-07-17 11:36     ` Stefan Roese
@ 2007-07-17 16:39     ` Rafal Jaworowski
  2007-07-19 15:18       ` Detlev Zundel
  1 sibling, 1 reply; 6+ messages in thread
From: Rafal Jaworowski @ 2007-07-17 16:39 UTC (permalink / raw)
  To: u-boot

Martin Krause wrote:
> 
> Great! I tried to figure out what's going on myself, but get
> stuck because I'm no ppc assembler expert. It seems, that the
> "DEAR" special purpose register is not available on the MPC885D
> (and other MPC8xx processors?)?
> 

Hi Martin,

Could you please test with the attached patch? This switches to using 
DAR on all PPC variants that do not really have DEAR.

kind reagards,
Rafal
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dar_dear.diff
Url: http://lists.denx.de/pipermail/u-boot/attachments/20070717/ef770455/attachment.txt 

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

* [U-Boot-Users] MPC8xx boards broken by commit some weeks ago
  2007-07-17 16:39     ` Rafal Jaworowski
@ 2007-07-19 15:18       ` Detlev Zundel
  0 siblings, 0 replies; 6+ messages in thread
From: Detlev Zundel @ 2007-07-19 15:18 UTC (permalink / raw)
  To: u-boot

Hi Rafal,

> Could you please test with the attached patch? This switches to using
> DAR on all PPC variants that do not really have DEAR.

Thanks, merged.

Cheers
  Detlev

-- 
Support organized crime: use Micro$oft products!
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

end of thread, other threads:[~2007-07-19 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-16  8:31 [U-Boot-Users] MPC8xx boards broken by commit some weeks ago Martin Krause
2007-07-17 11:15 ` Stefan Roese
2007-07-17 11:32   ` Martin Krause
2007-07-17 11:36     ` Stefan Roese
2007-07-17 16:39     ` Rafal Jaworowski
2007-07-19 15:18       ` Detlev Zundel

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