From: Sascha Hauer <s.hauer@pengutronix.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [Patch 2/4] U-Boot-V2: ARM: introduce CONFIG_SKIP_RELOCATION
Date: Wed, 7 May 2008 15:50:49 +0200 [thread overview]
Message-ID: <20080507135049.GG4326@pengutronix.de> (raw)
In-Reply-To: <8E8BB316C604E94AA019A54D0A5A82A201A2C94B@dlee13.ent.ti.com>
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@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/ <-
next prev parent reply other threads:[~2008-05-07 13:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 11:55 [U-Boot-Users] [Patch 2/4] U-Boot-V2: ARM: introduce CONFIG_SKIP_RELOCATION Menon, Nishanth
2008-05-07 12:52 ` Wolfgang Denk
2008-05-07 13:50 ` Sascha Hauer [this message]
2008-05-07 14:41 ` Menon, Nishanth
2008-05-07 15:29 ` Sascha Hauer
2008-05-07 15:38 ` Menon, Nishanth
2008-05-08 15:16 ` Sascha Hauer
2008-05-08 15:22 ` Menon, Nishanth
2008-05-07 17:56 ` Wolfgang Denk
2008-05-07 19:41 ` [U-Boot-Users] [Patch 2/4] U-Boot-V2: ARM: introduceCONFIG_SKIP_RELOCATION Ulf Samuelsson
2008-05-08 7:26 ` [U-Boot-Users] [Patch 2/4] U-Boot-V2: ARM: introduce CONFIG_SKIP_RELOCATION Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080507135049.GG4326@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox