[U-Boot] [PATCH v2] ls1043ardb: SPL size reduction in case of non-xip boot
york sun
york.sun at nxp.com
Mon Mar 27 16:46:57 UTC 2017
On 03/27/2017 09:39 AM, Sumit Garg wrote:
>> -----Original Message-----
>> From: york sun
>> Sent: Monday, March 27, 2017 9:41 PM
>> To: Sumit Garg <sumit.garg at nxp.com>; u-boot at lists.denx.de
>> Cc: Ruchika Gupta <ruchika.gupta at nxp.com>; Prabhakar Kushwaha
>> <prabhakar.kushwaha at nxp.com>; Mingkai Hu <mingkai.hu at nxp.com>; Vini
>> Pillai <vinitha.pillai at nxp.com>
>> Subject: Re: [PATCH v2] ls1043ardb: SPL size reduction in case of non-xip boot
>>
>> On 03/27/2017 08:59 AM, Sumit Garg wrote:
>>> Using changes in this patch we were able to reduce approx 10k size of
>>> u-boot-spl.bin image. Following is breif description of changes to
>>> reduce SPL size:
>>> 1. Changes in board/freescale/ls1043ardb/Makefile to remove
>>> compilation of eth.c and cpld.c in case of SPL build.
>>> 2. Changes in board/freescale/ls1043ardb/ls1043ardb.c to keep
>>> only ddr_init and board_early_init_f funcations in case of SPL
>>> build.
>>> 3. Changes in ls1043a_common.h & ls1043ardb.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.
>>> 5. Remove I2C driver support from SPL in case of LS1043ARDB.
>>>
>>> Signed-off-by: Vinitha Pillai <vinitha.pillai at nxp.com>
>>> Signed-off-by: Sumit Garg <sumit.garg at nxp.com>
>>> ---
>>>
>>> Changes in v2:
>>> Rebased and fixed compilation warning on ls1043aqds.
>>>
>>> board/freescale/ls1043aqds/Makefile | 2 ++
>>> board/freescale/ls1043ardb/Makefile | 4 +++-
>>> board/freescale/ls1043ardb/ls1043ardb.c | 18 +++++++++++-------
>>> configs/ls1043ardb_sdcard_defconfig | 1 -
>>> include/configs/ls1043a_common.h | 10 ++++++++++
>>> include/configs/ls1043ardb.h | 6 ++++++
>>> 6 files changed, 32 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/board/freescale/ls1043aqds/Makefile
>>> b/board/freescale/ls1043aqds/Makefile
>>> index f727bfd..49d8d7d 100644
>>> --- a/board/freescale/ls1043aqds/Makefile
>>> +++ b/board/freescale/ls1043aqds/Makefile
>>> @@ -5,5 +5,7 @@
>>> #
>>>
>>> obj-y += ddr.o
>>> +ifndef CONFIG_SPL_BUILD
>>> obj-y += eth.o
>>> +endif
>>> obj-y += ls1043aqds.o
>>> diff --git a/board/freescale/ls1043ardb/Makefile
>>> b/board/freescale/ls1043ardb/Makefile
>>> index 5fe1cc9..2a4452e 100644
>>> --- a/board/freescale/ls1043ardb/Makefile
>>> +++ b/board/freescale/ls1043ardb/Makefile
>>> @@ -4,7 +4,9 @@
>>> # SPDX-License-Identifier: GPL-2.0+
>>> #
>>>
>>> -obj-y += cpld.o
>>> obj-y += ddr.o
>>> obj-y += ls1043ardb.o
>>> +ifndef CONFIG_SPL_BUILD
>>> obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o
>>> +obj-y += cpld.o
>>> +endif
>>> diff --git a/board/freescale/ls1043ardb/ls1043ardb.c
>>> b/board/freescale/ls1043ardb/ls1043ardb.c
>>> index 2333843..6de7f9a 100644
>>> --- a/board/freescale/ls1043ardb/ls1043ardb.c
>>> +++ b/board/freescale/ls1043ardb/ls1043ardb.c
>>> @@ -29,6 +29,15 @@
>>>
>>> DECLARE_GLOBAL_DATA_PTR;
>>>
>>> +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"}; @@ -67,13
>>> +76,6 @@ int checkboard(void)
>>> 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; @@ -215,3 +217,5 @@ u16
>> flash_read16(void
>>> *addr)
>>>
>>> return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00); }
>>> +
>>> +#endif
>>> diff --git a/configs/ls1043ardb_sdcard_defconfig
>>> b/configs/ls1043ardb_sdcard_defconfig
>>> index e57c42b..6bebbd9 100644
>>> --- a/configs/ls1043ardb_sdcard_defconfig
>>> +++ b/configs/ls1043ardb_sdcard_defconfig
>>> @@ -17,7 +17,6 @@ CONFIG_SPL=y
>>> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
>>> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
>>> CONFIG_SPL_ENV_SUPPORT=y
>>> -CONFIG_SPL_I2C_SUPPORT=y
>>> CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
>>> CONFIG_HUSH_PARSER=y
>>> CONFIG_CMD_GPT=y
>>> diff --git a/include/configs/ls1043a_common.h
>>> b/include/configs/ls1043a_common.h
>>> index 5a5f951..3dd4dd6 100644
>>> --- a/include/configs/ls1043a_common.h
>>> +++ b/include/configs/ls1043a_common.h
>>> @@ -81,6 +81,7 @@
>>> #define CONFIG_SYS_MONITOR_LEN 0xa0000
>>> #endif
>>>
>>> +#if !(defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT))
>>
>> Is this right? You would skip IFC if SD_BOOT is not enabled. Did you try NOR
>> boot with this change?
>>
>
> Here this check is with "!" operation, means to skip IFC if SD_BOOT & SPL_BUILD are enabled.
OK. I guess missed one pair of brackets.
It is not easy to maintain if you add many #if in this header file.
Maybe you can put #ifndef CONFIG_SPL_BUILD on the top, and select some
features to be included. At least we will have a central place to check
when we need to make adjustment. Please keep it in mind, the config
macros are being moved into Kconfig.
York
More information about the U-Boot
mailing list