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. Signed-off-by: Ying Zhang <[email protected]> --- 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(-) diff --git a/README b/README index daf1fa1..79ccfc9 100644 --- a/README +++ b/README @@ -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 diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c index 0dff37f..d21b324 100644 --- a/arch/powerpc/cpu/mpc85xx/tlb.c +++ b/arch/powerpc/cpu/mpc85xx/tlb.c @@ -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) { diff --git a/arch/powerpc/cpu/mpc8xxx/law.c b/arch/powerpc/cpu/mpc8xxx/law.c index 6f9d568..979c3c2 100644 --- a/arch/powerpc/cpu/mpc8xxx/law.c +++ b/arch/powerpc/cpu/mpc8xxx/law.c @@ -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; diff --git a/common/env_common.c b/common/env_common.c index 906b41f..5d82ea0 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -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. diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h index c28dfe0..9b917a3 100644 --- a/include/configs/MPC8313ERDB.h +++ b/include/configs/MPC8313ERDB.h @@ -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 */ diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h index 8b13b10..1cefed9 100644 --- a/include/configs/P1022DS.h +++ b/include/configs/P1022DS.h @@ -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 */ diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h index 7ed634b..d3d3bad 100644 --- a/include/configs/p1_p2_rdb_pc.h +++ b/include/configs/p1_p2_rdb_pc.h @@ -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 -- 1.7.0.4 _______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

