[U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200

Wolfgang Denk wd at denx.de
Tue Nov 23 17:42:48 CET 2004


In message <41A35A7E.1020605 at imc-berlin.de> you wrote:
> 
> is there a standard way in U-Boot to prevent to the startup code from relocating 
> into RAM?

No. U-Boot will always relocate itself to RAM. Well, nearly always  -
in any halfway sane implementation.

> I know that arm920t figures out the currebt address. compares it to _TEXT_BASE 
> and decides wether to relocate or not.
> 
> relocate:				/* relocate U-Boot to RAM	    */
> 	adr	r0, _start		/* r0 <- current position of code   */
> 	ldr	r1, _TEXT_BASE		/* test if we run from flash or RAM */
> 	cmp     r0, r1                  /* don't reloc during debug         */

I wish that code was never written.

> So there might be no need for a define like CFG_DONT_RELOCATE. But how about 
> other cpus?

All CPUs always relocate the code to RAM. This is the  general  case.
Anything else is not supported.

> (I am asking cause you wrapped the relocate code in cpu/at91rm9200/start.S with 
> CONFIG_BOOTBINFUNC instead of using the above technique.

Please consider the CONFIG_BOOTBINFUNC as an optimization  of  effort
and  effect (read: quick & dirty hack). Feel free to clean up as long
the result is working code, too.

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
Fools ignore complexity. Pragmatists suffer it. Some  can  avoid  it.
Geniuses remove it.
     - Perlis's Programming Proverb #58, SIGPLAN Notices, Sept.  1982




More information about the U-Boot mailing list