ls1046ardb: SPL size reduction in case of non-xip boot
PATCH 1/1 ls1046ardb: SPL size reduction in case of non-xip boot
Using changes in this patch we were able to reduce approx 4k size of u-boot-spl.bin image. Following is breif description of changes to reduce SPL size:
1. Changes in board/freescale/ls1046ardb/Makefile to remove compilation of eth.c and cpld.c in case of SPL build.
2. Changes in board/freescale/ls1046ardb/ls1046ardb.c to keep only ddr_init and board_early_init_f funcations in case of SPL build.
3. Changes in ls1046a_common.h & ls1046ardb.h to remove driver specific macros due to which static data was being compiled in case of SPL build.
4. Disable MMC driver from bieng compiled in case of SPL NAND build and NAND driver from bieng compiled in case of SPL MMC build.
--- board/freescale/ls1046ardb/Makefile | 4 +++- board/freescale/ls1046ardb/ls1046ardb.c | 30 ++++++++++++++++-------------- include/configs/ls1046a_common.h | 12 ++++++++++-- include/configs/ls1046ardb.h | 7 ++++++- 4 files changed, 35 insertions(+), 18 deletions(-)
board/freescale/ls1046ardb/Makefile +3 -1
@@ -4,7 +4,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y += cpld.o obj-y += ddr.o obj-y += ls1046ardb.o +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o +obj-y += cpld.o +endif
board/freescale/ls1046ardb/ls1046ardb.c +16 -14
@@ -24,6 +24,21 @@DECLARE_GLOBAL_DATA_PTR ; +int dram_init (void ) +{ + gd->ram_size =initdram (0 ); + +return 0 ; +} + +int board_early_init_f (void ) +{ +fsl_lsch2_early_init_f (); + +return 0 ; +} + +#ifndef CONFIG_SPL_BUILD int checkboard (void ) {static const char *freq[2 ] = {"100.00MHZ" ,"156.25MHZ" };
@@ -56,20 +71,6 @@ int checkboard(void)return 0 ; } -int dram_init (void ) -{ - gd->ram_size =initdram (0 ); - -return 0 ; -} - -int board_early_init_f (void ) -{ -fsl_lsch2_early_init_f (); - -return 0 ; -} -int board_init (void ) {struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR ;
@@ -168,3 +169,4 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } +#endif
include/configs/ls1046a_common.h +10 -2
@@ -109,24 +109,28 @@#define CONFIG_SYS_I2C_MXC_I2C3 #define CONFIG_SYS_I2C_MXC_I2C4 +#ifndef CONFIG_SPL_BUILD /* Command line configuration */ #define CONFIG_CMD_ENV +#endif +#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_NAND_BOOT ))/* MMC */ #ifdef CONFIG_MMC #define CONFIG_FSL_ESDHC #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 #endif +#endif #define CONFIG_FSL_CAAM /* Enable SEC/CAAM */ +#ifndef CONFIG_SPL_BUILD #define CONFIG_SYS_DPAA_QBMAN /* Support Q/Bman */ -/* FMan ucode */ #define CONFIG_SYS_DPAA_FMAN #ifdef CONFIG_SYS_DPAA_FMAN #define CONFIG_SYS_FM_MURAM_SIZE 0x60000 - +#endif #ifdef CONFIG_SD_BOOT /* * PBL SD boot image should stored at 0x1000(8 blocks), the size of the image is
@@ -159,6 +163,7 @@#define CONFIG_HWCONFIG #define HWCONFIG_BUFFER_SIZE 128 +#ifndef CONFIG_SPL_BUILD /* Initial environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ "hwconfig=fsl_ddr:bank_intlv=auto\0" \
@@ -176,13 +181,16 @@#define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ "earlycon=uart8250,mmio,0x21c0500 " \ MTDPARTS_DEFAULT +#endif /* Monitor Command Prompt */ #define CONFIG_SYS_CBSIZE 512/* Console I/O Buffer Size */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ sizeof(CONFIG_SYS_PROMPT) + 16)#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE/* Boot args buffer */ #define CONFIG_SYS_LONGHELP +#ifndef CONFIG_SPL_BUILD #define CONFIG_CMDLINE_EDITING 1 +#endif #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_MAXARGS 64/* max command args */
include/configs/ls1046ardb.h +6 -1
@@ -49,13 +49,14 @@#endif #endif +#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SD_BOOT ))/* IFC */ #define CONFIG_FSL_IFC -/* * NAND Flash Definitions */ #define CONFIG_NAND_FSL_IFC +#endif #define CONFIG_SYS_NAND_BASE 0x7e800000#define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
@@ -156,10 +157,12 @@#define CONFIG_POWER_I2C #endif +#ifndef CONFIG_SPL_BUILD /* * Environment */ #define CONFIG_ENV_OVERWRITE +#endif #if defined(CONFIG_SD_BOOT )#define CONFIG_ENV_IS_IN_MMC
@@ -173,6 +176,7 @@#define CONFIG_ENV_SECT_SIZE 0x40000/* 256KB */ #endif +#ifndef CONFIG_SPL_BUILD /* FMan */ #ifdef CONFIG_SYS_DPAA_FMAN #define CONFIG_FMAN_ENET
@@ -236,5 +240,6 @@"15m(u-boot),48m(kernel.itb);" \"7e800000.flash:16m(nand_uboot)," \ "48m(nand_kernel),448m(nand_free)" +#endif /* CONFIG_SPL_BUILD */ #endif /* __LS1046ARDB_H__ */
Signature · 1 line
1.9.1
PATCH 1/1 ls1046ardb: SPL size reduction in case of non-xip boot
Quoted 14 lines · Sumit Garg
Using changes in this patch we were able to reduce approx 4k size of u-boot-spl.bin image. Following is breif description of changes to reduce SPL size:
1. Changes in board/freescale/ls1046ardb/Makefile to remove compilation ofeth.candcpld.cin case of SPL build.
2. Changes inboard/freescale/ls1046ardb/ls1046ardb.cto keep onlyddr_initandboard_early_init_ffuncations in case of SPL build.
3. Changes inls1046a_common.h&ls1046ardb.hto remove driver specific macros due to which static data was being compiled in case of SPL build.
4. Disable MMC driver from bieng compiled in case of SPL NAND build and NAND driver from bieng compiled in case of SPL MMC build.
Quoted 1 line
Signed-off-by Vinitha Pillai-B57223 <[email protected]>
Remove B57223 from the name.
Quoted 8 lines
Signed-off-by Sumit Garg <[email protected]>--- board/freescale/ls1046ardb/Makefile | 4 +++- board/freescale/ls1046ardb/ls1046ardb.c | 30 ++++++++++++++++-------------- include/configs/ls1046a_common.h | 12 ++++++++++-- include/configs/ls1046ardb.h | 7 ++++++- 4 files changed, 35 insertions(+), 18 deletions(-)
This patch causes compiling warning forboard/freescale/ls1046aqds/eth.c. Please fix.
York
PATCH 1/1 ls1046ardb: SPL size reduction in case of non-xip boot
Quoted 24 lines
-----Original Message-----
From: york sun
Sent: Monday, February 27, 2017 10:34 PM
To: Sumit Garg <[email protected]>; u-boot at lists.denx.de
Cc: Ruchika Gupta <[email protected]>; Prabhakar Kushwaha <[email protected]>; Mingkai Hu <[email protected]>; Vini Pillai <[email protected]>
Subject: Re: [PATCH] ls1046ardb: SPL size reduction in case of non-xip bootQuoted 14 lines · Sumit Garg
Using changes in this patch we were able to reduce approx 4k size of u-boot-spl.bin image. Following is breif description of changes to reduce SPL size:
1. Changes in board/freescale/ls1046ardb/Makefile to remove compilation ofeth.candcpld.cin case of SPL build.
2. Changes inboard/freescale/ls1046ardb/ls1046ardb.cto keep onlyddr_initandboard_early_init_ffuncations in case of SPL build.
3. Changes inls1046a_common.h&ls1046ardb.hto remove driver specific macros due to which static data was being compiled in case of SPL build.
4. Disable MMC driver from bieng compiled in case of SPL NAND build and NAND driver from bieng compiled in case of SPL MMC build.
Quoted 4 lines
Quoted 1 line
Signed-off-by Vinitha Pillai-B57223 <[email protected]>Remove B57223 from the name.
Sure, will remove it.
Quoted 10 lines
Quoted 4 lines
Signed-off-by Sumit Garg <[email protected]>--- board/freescale/ls1046ardb/Makefile | 4 +++- board/freescale/ls1046ardb/ls1046ardb.c | 30 ++++++++++++++++--------------
Quoted 4 lines
include/configs/ls1046a_common.h | 12 ++++++++++-- include/configs/ls1046ardb.h | 7 ++++++- 4 files changed, 35 insertions(+), 18 deletions(-)
Quoted 4 lines
This patch causes compiling warning for
board/freescale/ls1046aqds/eth.c. Please fix.York
Will fix compilation warning.
Sumit