Add the symbol for the minimal SPL used to eliminate unused code
PATCH 1/1 Add the symbol for the minimal SPL used to eliminate unused code
From: Ying Zhang <[email protected]>
Add the symbol CONFIG_SPL_BUILD_MINIMAL for the minimal SPL. It used to eliminate code unused in the minimal SPL but used in the SPL.
This patch is on top of the following patch:
1. common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment in SPL.
2. powerpc/mpc85xx: support application without resetvec segment in the linker script.
--- README | 4 ++++ arch/powerpc/cpu/mpc85xx/tlb.c | 2 +- arch/powerpc/cpu/mpc8xxx/law.c | 4 ++-- common/env_common.c | 2 +- include/configs/MPC8313ERDB.h | 1 + include/configs/P1022DS.h | 3 +++ include/configs/p1_p2_rdb_pc.h | 3 +++ 7 files changed, 15 insertions(+), 4 deletions(-)
README +4 -0
@@ -3976,6 +3976,10 @@ Low Level (hardware related) configuration options: that is executed before the actual U-Boot. E.g. when compiling a NAND SPL. +- CONFIG_SPL_BUILD_MINIMAL + Add for the minimal SPL, used to eliminate unused code to + save the code space. + - CONFIG_SYS_MPC85XX_NO_RESETVEC Only for 85xx systems. If this variable is specified, the section .resetvec is not kept and the section .bootpg is placed in the
arch/powerpc/cpu/mpc85xx/tlb.c +1 -1
@@ -55,7 +55,7 @@ void init_tlbs(void)return ; } -#if !defined(CONFIG_NAND_SPL ) && !defined(CONFIG_SPL_BUILD ) +#if !defined(CONFIG_NAND_SPL ) && !defined(CONFIG_SPL_BUILD_MINIMAL )void read_tlbcam_entry (int idx,u32 *valid,u32 *tsize,unsigned long *epn,phys_addr_t *rpn) {
arch/powerpc/cpu/mpc8xxx/law.c +2 -2
@@ -92,7 +92,7 @@ void disable_law(u8 idx)return ; } -#if !defined(CONFIG_NAND_SPL ) && !defined(CONFIG_SPL_BUILD ) +#if !defined(CONFIG_NAND_SPL ) && !defined(CONFIG_SPL_BUILD_MINIMAL )static int get_law_entry (u8 i,struct law_entry *e) {u32 lawar;
@@ -122,7 +122,7 @@ int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)return idx; } -#if !defined(CONFIG_NAND_SPL ) && !defined(CONFIG_SPL_BUILD ) +#if !defined(CONFIG_NAND_SPL ) && !defined(CONFIG_SPL_BUILD_MINIMAL )int set_last_law (phys_addr_t addr,enum law_size sz,enum law_trgt_if id) {u32 idx;
common/env_common.c +1 -1
@@ -156,7 +156,7 @@ int set_default_vars(int nvars, char * const vars[]) H_NOCLEAR | H_INTERACTIVE, nvars, vars); } -#ifndef CONFIG_SPL_BUILD +#ifndef CONFIG_SPL_BUILD_MINIMAL /* * Check if CRC is valid and (if yes) import the environment. * Note that "buf" may or may not be aligned.
include/configs/MPC8313ERDB.h +1 -0
@@ -47,6 +47,7 @@#ifdef CONFIG_SPL_BUILD #define CONFIG_NS16550_MIN_FUNCTIONS +#define CONFIG_SPL_BUILD_MINIMAL #endif #define CONFIG_SYS_TEXT_BASE 0x00100000/* CONFIG_SYS_NAND_U_BOOT_DST */
include/configs/P1022DS.h +3 -0
@@ -55,6 +55,9 @@#define CONFIG_SYS_NAND_U_BOOT_START 0x00200000#define CONFIG_SYS_NAND_U_BOOT_OFFS 0#define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds" +#ifdef CONFIG_SPL_BUILD +#define CONFIG_SPL_BUILD_MINIMAL +#endif #endif /* High Level Configuration Options */
include/configs/p1_p2_rdb_pc.h +3 -0
@@ -187,6 +187,9 @@#define CONFIG_SYS_NAND_U_BOOT_SIZE ((512 << 10) - 0x2000)#define CONFIG_SYS_NAND_U_BOOT_OFFS 0#define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds" +#ifdef CONFIG_SPL_BUILD +#define CONFIG_SPL_BUILD_MINIMAL +#endif #endif #ifndef CONFIG_SYS_TEXT_BASE
Signature · 1 line
1.7.0.4
PATCH 1/1 Add the symbol for the minimal SPL used to eliminate unused code
Quoted 5 lines · On Wed, May 15, 2013 at 2:02 AM, <[email protected]> wrote:
From: Ying Zhang <[email protected]>
Add the symbol
CONFIG_SPL_BUILD_MINIMALfor the minimal SPL. It used to eliminate code unused in the minimal SPL but used in the SPL.
Quoted 8 lines
This patch is on top of the following patch:
1. common/Makefile: Add new symbolCONFIG_SPL_ENV_SUPPORTfor environment in SPL.
2. powerpc/mpc85xx: support application without resetvec segment in the linker script.Signed-off-by Ying Zhang <[email protected]>
I'm a bit confused by this patch. As far as I can tell, despite the description, what this patch *actually* does is make CONFIG_SPL_BUILD take up more space, while CONFIG_SPL_BUILD_MINIMAL will take up the same space as CONFIG_SPL_BUILD used to.
It's important to make sure the commit message describes the purpose of the patch, and that the patch actually does what it says...
If the goal was to make CONFIG_SPL_BUILD contain more functionality, then say that in the commit message. If not, then please point out the error in my understanding of the patch.
Andy
PATCH 1/1 Add the symbol for the minimal SPL used to eliminate unused code
In reply to ying.zhang at freescale.comQuoted 4 lines · ying.zhang at freescale.com
From: Ying Zhang <[email protected]>
Add the symbol
CONFIG_SPL_BUILD_MINIMALfor the minimal SPL. It used to eliminate code unused in the minimal SPL but used in the SPL.
[snip]
common/env_common.c int set_default_vars(int nvars, char * const vars[]) · line 162
Quoted 13 lines
common/env_common.c +1
-1@@ -156,7 +156,7 @@ int set_default_vars(int nvars, char * const vars[]) H_NOCLEAR | H_INTERACTIVE, nvars, vars); } -#ifndef CONFIG_SPL_BUILD +#ifndef CONFIG_SPL_BUILD_MINIMAL /* * Check if CRC is valid and (if yes) import the environment. * Note that "buf" may or may not be aligned.
Hold up, this ignores the whole world of CONFIG_SPL_FRAMEWORK and
probably breaks the ARM targets. You need to instal an ARM toolchain
(either one of the Linaro ones or ELDK 5.x) and make sure that MAKEALL -a arm is also fine after your SPL changes.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130515/81664cf1/attachment.pgp>
PATCH 1/1 Add the symbol for the minimal SPL used to eliminate unused code
Quoted 18 lines · Tom Rini
Quoted 3 lines · ying.zhang at freescale.com
From: Ying Zhang <[email protected]>
Add the symbol
CONFIG_SPL_BUILD_MINIMALfor the minimal SPL. Itused to
Quoted 1 line
eliminate code unused in the minimal SPL but used in the SPL.
[snip]
common/env_common.c int set_default_vars(int nvars, char * const
Quoted 5 lines
common/env_common.c +0
-0@@ -156,7 +156,7 @@ int set_default_vars(int nvars, char * constvars[])
Quoted 3 lines
common/env_common.c +0
-0H_NOCLEAR | H_INTERACTIVE, nvars, vars); }
Quoted 10 lines
common/env_common.c int set_default_vars(int nvars, char * const vars[]) · line 162
Quoted 5 lines
common/env_common.c +1
-1-#ifndef CONFIG_SPL_BUILD +#ifndef CONFIG_SPL_BUILD_MINIMAL /* * Check if CRC is valid and (if yes) import the environment. * Note that "buf" may or may not be aligned. Hold up, this ignores the whole world of
CONFIG_SPL_FRAMEWORKand
probably breaks the ARM targets. You need to instal an ARM toolchain
(either one of the Linaro ones or ELDK 5.x) and make sure that MAKEALL -a arm is also fine after your SPL changes.
Not to mention that the "minimal init" concept is currently only well-defined for mpc85xx, so this really doesn't belong in common/. Minimal 85xx SPLs don't even include libcommon, so why is this change needed at all?
-SCott
PATCH 1/1 Add the symbol for the minimal SPL used to eliminate unused code
-----Original Message-----
From: Wood Scott-B07421
Sent: Thursday, May 16, 2013 8:01 AM
To: Tom Rini
Cc: Zhang Ying-B40530; u-boot at lists.denx.de; afleming at gmail.com; Xie Xiaobo-R63061; Zhang Ying-B40530
Subject: Re: [U-Boot] [PATCH] Add the symbol for the minimal SPL used to eliminate unused code
Quoted 18 lines · Tom Rini
Quoted 3 lines · ying.zhang at freescale.com
From: Ying Zhang <[email protected]>
Add the symbol
CONFIG_SPL_BUILD_MINIMALfor the minimal SPL. Itused to
Quoted 1 line
eliminate code unused in the minimal SPL but used in the SPL.
[snip]
common/env_common.c int set_default_vars(int nvars, char * const
Quoted 5 lines
common/env_common.c +0
-0@@ -156,7 +156,7 @@ int set_default_vars(int nvars, char * constvars[])
Quoted 3 lines
common/env_common.c +0
-0H_NOCLEAR | H_INTERACTIVE, nvars, vars); }
Quoted 10 lines
common/env_common.c int set_default_vars(int nvars, char * const vars[]) · line 162
Quoted 5 lines
common/env_common.c +1
-1-#ifndef CONFIG_SPL_BUILD +#ifndef CONFIG_SPL_BUILD_MINIMAL /* * Check if CRC is valid and (if yes) import the environment. * Note that "buf" may or may not be aligned. Hold up, this ignores the whole world of
CONFIG_SPL_FRAMEWORKand
probably breaks the ARM targets. You need to instal an ARM toolchain
(either one of the Linaro ones or ELDK 5.x) and make sure that MAKEALL -a arm is also fine after your SPL changes.
Not to mention that the "minimal init" concept is currently only well-defined for mpc85xx, so this really doesn't belong in common/. Minimal 85xx SPLs don't even include libcommon, so why is this change needed at all?
[Zhang Ying]
Just because some functionality is necessary for SPL booting from SD. They were excluded from the SPL by CONFIG_SPL_BUILD now. Of course, including the function env_import() in common/env_common.c.
Andy was right, the goal of this patch was to make CONFIG_SPL_BUILD contain more functionality.
PATCH 1/1 Add the symbol for the minimal SPL used to eliminate unused code
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 2 lines · On 05/16/2013 06:08 AM, Zhang Ying-B40530 wrote:
Andy was right, the goal of this patch was to make
CONFIG_SPL_BUILDcontain more functionality.
OK, here's the confusion. CONFIG_SPL_BUILD is _only_ for telling if we're building U-Boot or SPL. Everything else should be covered by some other CONFIG symbol. You either want to use CONFIG_SPL_FRAMEWORK (if you have the initial space for it), or add more options that are compatible with CONFIG_SPL_INIT_MINIMAL.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRlNLhAAoJENk4IS6UOR1WueYP/0t/XtPoBOcEwcZPvzAaDLkm GULtLaJI7LVJDakVacMvIkOL8aVfvuKJQKFigR2NLvNKDsDQAuUwFsgGtn3xjub8 asG9QyjeO+CZdKSQ3QJO2qb0+XThn8f3+w4dj0E+Fdnpjm4EFDSZ/bTvjKfxm7jD kTtDewo05sk434dUthsS3b/IM0NTAxnUSa4FGMvRQxK2+ORMXI23mDhy9yEOFOpJ 1IKlxYuI1yt/1BEuLkWxBP6cP60HeOIRP2YS41HjO5sTMhIBRmQWE/95VZvcqDLu SGjPCLUJ0dDM9w10lebYIr5UJe0j4FVtcy250MZRsiIlA6uYRD9Wq/B7A7QTGqVz R3igsPSfoh0NsObtx1HsswifYWnpyT7pycvj9dWTpY375dZKL2ENLRXIU9hQ9DNV dGpdQdr+xsCAI5y9cUKvUj9BvLU0oUGn+fanHqpg+89gAB0Zs4ZW08vnWdO2kmbs 9XcFXYec5ElSx2WMQ2cJpSzDto0As2Xa7A5Ld4Jw3LY6x5K9uBvwopu5UvRx4lM2 KaDRHtYx+omyfaIRNcC43swTaCvRNft+QwtKg22pS3gyX5Er+AOk5xW++MleiiPz yXnjRTtwcTilsj/txxNaLeU7H+sJNfi3HEk+jNgVWaGM3AZNhyeWW9noXZA7x/TY K6WYgBsV2wu4if75NlWA
=r7f7
-----END PGP SIGNATURE-----