From: Wolfgang Denk Date: Tue, 23 Nov 2004 17:42:48 +0100 Subject: [U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200 In-Reply-To: Your message of "Tue, 23 Nov 2004 16:42:54 +0100." <41A35A7E.1020605@imc-berlin.de> Message-ID: <20041123164253.C38A7C1430@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <41A35A7E.1020605@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