Skip to contentSkip to conversation

relocate_code problem

U-Boot-Users Oliver Fuchs 2 participants 4 messages Jul 6, 2004

lore
Share & tools
lore
#0 lore raw

Hi all,

I try to get up U-Boot 1.1.1 on a "home brewed" board with MPC8280 and have problems with the relocation of code.
It crashes after the call of in_ram. It seems that it calculates the address of in_ram correctly, but the copied code is somehow shifted.
Is there anyone who can point me to the function that copies the code into RAM? Sorry, but the assembler code is not my favorite thing.

Thanks in advance,
Oliver

----
some extra info:

symbol in_ram is linked to 0xfff03404
relocate_code is called: relocate_code( 03fbdf48, 03fbdf6c, 03fdf000) relocate_ram jumps to 0x03fe2404 // there is code, but not in_ram

#1 lore raw
Quoted 5 lines · In message <40EA7675.1087.8A1955@localhost> you wrote:

I try to get up U-Boot 1.1.1 on a "home brewed" board with MPC8280 and have problems with the relocation of code.
It crashes after the call of in_ram. It seems that it calculates the address of in_ram correctly, but the copied code is somehow shifted.

Maybe it just looks shifted or repeated?

RTFM - http://www.denx.de/twiki/bin/view/DULG/UBootCrashAfterRelocation

Quoted 2 lines

Is there anyone who can point me to the function that copies the code into RAM? Sorry, but the assembler code is not my favorite thing.

You don't need much knowledge about assembler code. "grep" will just do fine (hint: search for "relocate_code", and probably you want to searchin the relevant directory with CPU specific code, i. e. "cpu/mpc8260/").

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
If the hours are long enough and the pay  is  short  enough,  someone
will say it's women's work.
#2 lore raw
From:           	Wolfgang Denk <[email protected]>
Date sent:      	Tue, 06 Jul 2004 10:06:21 +0200
Quoted 3 lines
Quoted 1 line

of in_ram correctly, but the copied code is somehow shifted.

Maybe it just looks shifted or repeated?

You are right. It was hard to accept the idea that the seen code was not within the RAM.

Quoted 5 lines

You don't need much knowledge about assembler code. "grep" will just do fine (hint: search for "relocate_code", and probably you want to searchin the relevant directory with CPU specific code, i. e. "cpu/mpc8260/").

It was not the problem to find relocate_code. I was not smart enough to recognize the nice little loop. Because the destination content did not change during relocate_code, I thought it was done elsewhere.

Quoted 3 lines

Best regards,

Wolfgang Denk

Thanks,
Oliver Fuchs

#3 lore raw
Quoted 5 lines · In message <40EADF20.20424.AE0466@localhost> you wrote:
Quoted 4 lines
Quoted 2 lines

of in_ram correctly, but the copied code is somehow shifted.

Maybe it just looks shifted or repeated?

You are right. It was hard to accept the idea that the seen code was not within the RAM.

Probably your SDRAM init sequence is broken.

Quoted 3 lines

It was not the problem to find relocate_code. I was not smart enough to recognize the nice little loop. Because the destination content did not change during relocate_code, I thought it was done elsewhere.

Well, check your RAM init code.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Wenn das dann in die Hose geht, nehme ich es auf meine Kappe.
                                         -- Rudi V?ller, 15. Nov 2003