[U-Boot-Users] u-boot hangs in ./cpu/mpc8xx/cpu_init.c when changing br0
Jeff Mann
MannJ at embeddedplanet.com
Wed Jun 21 21:42:52 CEST 2006
>You did read http://www.denx.de/wiki/view/DULG/DebuggingTricks , didn't
you?
I did, but those compiler flags were in by board directory, I moved them
to the makefile in the top directory, and this simplifies watching the
code.
But back to the problem.
./cpu/mpc8xx/cpu_init.c
In "C":
118 reg = memctl->memc_br0;
119 reg &= BR_PS_MSK; /* Clear everything except Port
Size bits */
120 reg |= BR_V; /* then add just the "Bank Valid"
bit */
121 memctl->memc_br0 = reg;
In Assembly, this compiles to:
Ln 118 0xff007ce4 <cpu_init_f+172>: lwz r0,0(r28)
Ln 119 0xff007ce8 <cpu_init_f+176>: rlwinm r0,r0,0,20,21
Ln 120 0xff007cec <cpu_init_f+180>: ori r0,r0,1
Ln 121 0xff007cf0 <cpu_init_f+184>: stw r0,0(r28)
r28 holds the value 0xfa200100 (the location of br0)
At line 118, br0 is loaded into r0. r0 then holds 0xfc000001.
At line 119, r0 becomes 0x00000000. <<-- This is the problem, I think
At line 120, r0 becomes 0x00000001
At line 121, r0 is saved to br0 (the address pointed to by r28).
(br0 becomes 0x00000001)
in ./include/mpc8xx.h:
#define BR_PS_MSK 0x00000C00
Is this right?
The program fails at ln 180 with:
"Program received signal SIGABRT, aborted."
But by this time, br0 was reloaded with CFG_BR0_PRELIM from line 176.
Any more ideas?
Thanks,
JM
-----Original Message-----
From: wd at denx.de [mailto:wd at denx.de]
Sent: Tuesday, June 20, 2006 5:53 PM
To: Jeff Mann
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] u-boot hangs in ./cpu/mpc8xx/cpu_init.c when
changing br0
In message
<1628E43D99629C46988BE46087A3FBB95C57DD at ep-01.EmbeddedPlanet.local> you
wrote:
>
> reg does not get the value of br0 at line 118, like it should. In
> fact, DDD acts like the variable does not even exist. So at line 121,
> br0 is
...
> Any suggestions?
You did read http://www.denx.de/wiki/view/DULG/DebuggingTricks , didn't
you?
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The light at the end of the tunnel is usually a "No Exit" sign.
More information about the U-Boot
mailing list