[U-Boot-Users] [Patch 2/4] U-Boot-V2: ARM: introduce CONFIG_SKIP_RELOCATION

Sascha Hauer s.hauer at pengutronix.de
Wed May 7 15:50:49 CEST 2008


On Wed, May 07, 2008 at 06:55:56AM -0500, Menon, Nishanth wrote:
> Introduce CONFIG_SKIP_RELOCATION as alternative define. This may be
> desired in some conditions where U-Boot is downloaded directly into SRAM
> during NAND/Peripheral download mode and is not expected to be
> relocated.

If U-Boot is not expected to be relocated, TEXT_BASE should be in SRAM
in which case the relocation loop just does nothing. So you end up in
saving 12 * 4 bytes of space. Is it really worth to introduce an #ifdef
for such a small saving?

Sascha

> 
> This patch also organizes SKIP_LOWLEVEL_INIT and SKIP_RELOCATION in a
> common arm feature dependent section.
> 
> Signed-off-by: Nishanth Menon <x0nishan at ti.com>
> 
> Index: u-boot-v2.git/arch/arm/cpu/start-arm.S
> ===================================================================
> --- u-boot-v2.git.orig/arch/arm/cpu/start-arm.S	2008-05-05
> 09:35:00.000000000 -0500
> +++ u-boot-v2.git/arch/arm/cpu/start-arm.S	2008-05-05
> 09:35:05.000000000 -0500
> @@ -160,6 +160,10 @@
>  	bl	board_init_lowlevel
>  #endif
>  
> +	/*
> +	 * In some circumstances, we may choose not to relocate u-boot
> +	 */
> +#ifndef CONFIG_SKIP_RELOCATION
>  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 */
> @@ -176,6 +180,7 @@
>  	stmia	r1!, {r3-r10}		/* copy to   target address [r1]
> */
>  	cmp	r0, r2			/* until source end addreee [r2]
> */
>  	ble	copy_loop
> +#endif
>  
>  	/* Set up the stack
> */
>  stack_setup:
> Index: u-boot-v2.git/arch/arm/Kconfig
> ===================================================================
> --- u-boot-v2.git.orig/arch/arm/Kconfig	2008-05-05 09:34:44.000000000
> -0500
> +++ u-boot-v2.git/arch/arm/Kconfig	2008-05-05 09:35:25.000000000
> -0500
> @@ -74,6 +74,7 @@
>  	bool
>  	select ARM926EJS
>  
> +
>  choice
>  	prompt "Select your board"
>  
> @@ -140,7 +141,7 @@
>  	  The i.MX SoCs have a Pin which can output different reference
> frequencies.
>  	  Say y here if you want to have the clko command which lets you
> select the
>  	  frequency to output on this pin.
> -	  
> +
>  source arch/arm/mach-netx/Kconfig
>  
>  menu "Arm specific settings         "
> @@ -164,6 +165,27 @@
>  	  If you want to start a 2.6 kernel and use an
>  	  initrd image say y here.
>  
> +menu "Boot Features"
> +
> +config SKIP_LOWLEVEL_INIT
> +	bool
> +	default n
> +	depends on ARM
> +	prompt "Skip lowlevel init"
> +	help
> +	  This entry skips the SDRAM initialising on many ARM based
> boards.
> +	  It enables using U-boot as a second stage bootloader.
> +
> +config SKIP_RELOCATION
> +	bool
> +	default n
> +	depends on ARM
> +	prompt "Skip U-Boot Relocation"
> +	help
> +	  This entry skips the relocation logic on certain platforms
> +	  It enables using U-boot as a second stage bootloader.
> +endmenu
> +
>  endmenu
>  
>  source common/Kconfig
> Index: u-boot-v2.git/common/Kconfig
> ===================================================================
> --- u-boot-v2.git.orig/common/Kconfig	2008-05-05 09:34:44.000000000
> -0500
> +++ u-boot-v2.git/common/Kconfig	2008-05-05 09:35:05.000000000
> -0500
> @@ -216,14 +216,6 @@
>  	help
>  	  Enable build of u-boot with -g.
>  
> -config SKIP_LOWLEVEL_INIT
> -	bool
> -	depends on ARM
> -	prompt "Skip lowlevel init"
> -	help
> -	  This entry skips the SDRAM initialising on many ARM based
> boards.
> -	  It enables using U-boot as a second stage bootloader.
> -
>  config ENABLE_FLASH_NOISE
>  	bool
>  	prompt "verbose flash handling"
> 

-- 
Pengutronix e.K. - Linux Solutions for Science and Industry
-----------------------------------------------------------
Kontakt-Informationen finden Sie im Header dieser Mail oder
auf der Webseite -> http://www.pengutronix.de/impressum/ <-




More information about the U-Boot mailing list