armv8: fsl-layerscape: SPL size reduction
PATCH v2 1/3 armv8: fsl-layerscape: SPL size reduction
Compile-off mp.c and libfdt.c in case of SPL build. SPL size reduces by approx 2k.
---
Changes in v2:
Removed code specific to D-Cache off. With GCC 6.2 tool-chain, able to reduce size to 79K.
arch/arm/cpu/armv8/fsl-layerscape/Makefile | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/Makefile +2 -0
@@ -7,8 +7,10 @@ obj-y += cpu.o obj-y += lowlevel.o obj-y += soc.o +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_MP) += mp.o obj-$(CONFIG_OF_LIBFDT) += fdt.o +endif obj-$(CONFIG_SPL) += spl.o obj-$(CONFIG_$(SPL_)FSL_LS_PPA) += ppa.o
Signature · 1 line
1.9.1
PATCH v2 2/3 armv8: ls1088a: SPL size reduction
Using changes in this patch we were able to reduce approx 8k size of u-boot-spl.bin image. Following is breif description of changes to reduce SPL size:
1. Changes in board/freescale/ls1088a/Makefile to remove compilation of eth.c and cpld.c in case of SPL build.
2. Changes in board/freescale/ls1088a/ls1088a.c to keep board_early_init_f funcations in case of SPL build.
3. Changes in ls1088a_common.h & ls1088ardb.h to remove driver specific macros due to which static data was being compiled in case of SPL build.
---
Changes in v2:
Removed code specific to D-Cache off. With GCC 6.2 tool-chain, able to reduce size to 79K.
board/freescale/ls1088a/Makefile | 4 +++- board/freescale/ls1088a/ls1088a.c | 16 ++++++++++------ include/configs/ls1088a_common.h | 19 +++++++++++++++++++ include/configs/ls1088ardb.h | 20 ++++++++++++++++++++ 4 files changed, 52 insertions(+), 7 deletions(-)
board/freescale/ls1088a/Makefile +3 -1
@@ -5,6 +5,8 @@ # obj-y += ls1088a.o +obj-y += ddr.o +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_TARGET_LS1088ARDB) += eth_ls1088ardb.o obj-$(CONFIG_TARGET_LS1088AQDS) += eth_ls1088aqds.o -obj-y += ddr.o +endif
board/freescale/ls1088a/ls1088a.c +10 -6
@@ -25,6 +25,13 @@DECLARE_GLOBAL_DATA_PTR ; +int board_early_init_f (void ) +{ +fsl_lsch3_early_init_f (); +return 0 ; +} + +#ifdef CONFIG_FSL_QIXIS unsigned long long get_qixis_addr (void ) {unsigned long long addr;
@@ -42,7 +49,9 @@ unsigned long long get_qixis_addr(void)return addr; } +#endif +#if !defined(CONFIG_SPL_BUILD )int checkboard (void ) {char buf[64 ];
@@ -342,12 +351,6 @@ int board_init(void)return 0 ; } -int board_early_init_f (void ) -{ -fsl_lsch3_early_init_f (); -return 0 ; -} -void detail_board_ddr_info (void ) {puts ("\nDDR " );
@@ -451,3 +454,4 @@ int ft_board_setup(void *blob, bd_t *bd)return 0 ; }#endif +#endif /* defined(CONFIG_SPL_BUILD) */
include/configs/ls1088a_common.h +19 -0
@@ -7,6 +7,19 @@#ifndef __LS1088_COMMON_H#define __LS1088_COMMON_H +/* SPL build */ +#ifdef CONFIG_SPL_BUILD +#define SPL_NO_BOARDINFO +#define SPL_NO_QIXIS +#define SPL_NO_PCI +#define SPL_NO_ENV +#define SPL_NO_RTC +#define SPL_NO_USB +#define SPL_NO_SATA +#define SPL_NO_QSPI +#define SPL_NO_IFC +#undef CONFIG_DISPLAY_CPUINFO +#endif #define CONFIG_REMAKE_ELF #define CONFIG_FSL_LAYERSCAPE
@@ -74,8 +87,10 @@#define CONFIG_BAUDRATE 115200#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } +#if !defined(SPL_NO_IFC ) || defined(CONFIG_TARGET_LS1088AQDS )/* IFC */ #define CONFIG_FSL_IFC +#endif /* * During booting, IFC is mapped at the region of 0x30000000.
@@ -172,6 +187,7 @@ unsigned long long get_qixis_addr(void);/* #define CONFIG_DISPLAY_CPUINFO */ +#ifndef SPL_NO_ENV /* Allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE
@@ -211,6 +227,7 @@ unsigned long long get_qixis_addr(void);" cp.b $kernel_start $kernel_load" \ " $kernel_size && bootm $kernel_load"#endif +#endif /* Monitor Command Prompt */ #define CONFIG_SYS_CBSIZE 512/* Console I/O Buffer Size */
@@ -219,7 +236,9 @@ unsigned long long get_qixis_addr(void);#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE/* Boot args buffer */ #define CONFIG_SYS_LONGHELP +#ifndef SPL_NO_ENV #define CONFIG_CMDLINE_EDITING 1 +#endif #define CONFIG_AUTO_COMPLETE #define CONFIG_SYS_MAXARGS 64/* max command args */
include/configs/ls1088ardb.h +20 -0
@@ -9,7 +9,9 @@#include "ls1088a_common.h" +#ifndef SPL_NO_BOARDINFO #define CONFIG_DISPLAY_BOARDINFO_LATE +#endif #define CONFIG_MISC_INIT_R
@@ -29,7 +31,9 @@#endif #if defined(CONFIG_QSPI_BOOT ) || defined(CONFIG_SD_BOOT_QSPI ) +#ifndef CONFIG_SPL_BUILD #define CONFIG_QIXIS_I2C_ACCESS +#endif #define SYS_NO_FLASH #undef CONFIG_CMD_IMLS#endif
@@ -97,7 +101,11 @@#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }#endif #endif + +#ifndef SPL_NO_IFC #define CONFIG_NAND_FSL_IFC +#endif +#define CONFIG_SYS_NAND_MAX_ECCPOS 256#define CONFIG_SYS_NAND_MAX_OOBFREE 2
@@ -139,7 +147,10 @@#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) +#ifndef SPL_NO_QIXIS #define CONFIG_FSL_QIXIS +#endif +#define CONFIG_SYS_I2C_FPGA_ADDR 0x66#define QIXIS_LBMAP_SWITCH 2#define QIXIS_QMAP_MASK 0xe0
@@ -223,6 +234,8 @@#define I2C_RETIMER_ADDR 0x18#define I2C_MUX_CH_DEFAULT 0x8#define I2C_MUX_CH5 0xD + +#ifndef SPL_NO_RTC /* * RTC configuration */
@@ -230,6 +243,7 @@#define CONFIG_RTC_PCF8563 1#define CONFIG_SYS_I2C_RTC_ADDR 0x51/* Channel 3*/ #define CONFIG_CMD_DATE +#endif /* EEPROM */ #define CONFIG_ID_EEPROM
@@ -240,12 +254,14 @@#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 +#ifndef SPL_NO_QSPI /* QSPI device */ #if defined(CONFIG_QSPI_BOOT ) || defined(CONFIG_SD_BOOT_QSPI )#define CONFIG_FSL_QSPI #define FSL_QSPI_FLASH_SIZE (1 << 26)#define FSL_QSPI_FLASH_NUM 2#endif +#endif #define CONFIG_CMD_MEMINFO #define CONFIG_CMD_MEMTEST
@@ -260,6 +276,7 @@#define CONFIG_FSL_MEMAC +#ifndef SPL_NO_ENV /* Initial environment variables */ #if defined(CONFIG_QSPI_BOOT )#define MC_INIT_CMD \
@@ -408,6 +425,7 @@#define CONFIG_ETHPRIME "DPMAC1@xgmii"#define CONFIG_PHY_GIGE #endif +#endif /* MMC */ #ifdef CONFIG_MMC
@@ -415,6 +433,7 @@#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 #endif +#ifndef SPL_NO_ENV #undef CONFIG_CMDLINE_EDITING#include <config_distro_defaults.h>
@@ -423,6 +442,7 @@ func(SCSI, scsi, 0) \ func(DHCP, dhcp, na)#include <config_distro_bootcmd.h> +#endif #include <asm/fsl_secure_boot.h>
Signature · 1 line
1.9.1
PATCH v2 3/3 ls1088ardb: Add SD Secure boot target support
In reply to Sumit Garg---
Changes in v2:
Rebased to top of master
arch/arm/include/asm/fsl_secure_boot.h | 16 ++++---- board/freescale/ls1088a/MAINTAINERS | 5 +++ .../ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 45 ++++++++++++++++++++++ include/configs/ls1088a_common.h | 15 +++++++- 4 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
arch/arm/include/asm/fsl_secure_boot.h +8 -8
@@ -26,6 +26,14 @@#define CONFIG_KEY_REVOCATION +#if defined(CONFIG_FSL_LAYERSCAPE ) +/* +* For fsl layerscape based platforms, ESBC image Address in Header +* is 64 bit. +*/ +#define CONFIG_ESBC_ADDR_64BIT +#endif +#ifndef CONFIG_SPL_BUILD #ifndef CONFIG_SYS_RAMBOOT /* The key used for verification of next level images
@@ -42,14 +50,6 @@#endif -#if defined(CONFIG_FSL_LAYERSCAPE ) -/* -* For fsl layerscape based platforms, ESBC image Address in Header -* is 64 bit. -*/ -#define CONFIG_ESBC_ADDR_64BIT -#endif -#ifdef CONFIG_ARCH_LS2080A #define CONFIG_EXTRA_ENV \ "setenv fdt_high 0xa0000000;" \
board/freescale/ls1088a/MAINTAINERS +5 -0
@@ -27,3 +27,8 @@ M: Udit Agarwal <[email protected]> M: Vinitha Pillai-B57223 <[email protected]> S: Maintained F: configs/ls1088ardb_qspi_SECURE_BOOT_defconfig + +LS1088ARDB_SD_SECURE_BOOT BOARD +M: Sumit Garg <[email protected]> +S: Maintained +F: configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig new file +45 -0
45 lines not on this page · raw message
include/configs/ls1088a_common.h +14 -1
@@ -254,7 +254,20 @@ unsigned long long get_qixis_addr(void);#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000#define CONFIG_SYS_SPL_MALLOC_START 0x80200000 -#define CONFIG_SYS_MONITOR_LEN (512 * 1024) + +#ifdef CONFIG_SECURE_BOOT +#define CONFIG_U_BOOT_HDR_SIZE (16 << 10) +/* +* HDR would be appended@end of image and copied to DDR along +* with U-Boot image. Here u-boot max. size is 512K. So if binary +* size increases then increase this size in case of secure boot as +* it uses raw u-boot image instead of fit image. +*/ +#define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE) +#else +#define CONFIG_SYS_MONITOR_LEN 0x100000 +#endif /* ifdef CONFIG_SECURE_BOOT */ +#endif #define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */
Signature · 1 line
1.9.1
PATCH v2 3/3 ls1088ardb: Add SD Secure boot target support
Quoted 87 lines · Sumit Garg
Signed-off-by Udit Agarwal <[email protected]>Signed-off-by Sumit Garg <[email protected]>---
Changes in v2:
Rebased to top of masterarch/arm/include/asm/fsl_secure_boot.h | 16 ++++---- board/freescale/ls1088a/MAINTAINERS | 5 +++ .../ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 45 ++++++++++++++++++++++ include/configs/ls1088a_common.h | 15 +++++++- 4 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfigarch/arm/include/asm/fsl_secure_boot.h +8
-8@@ -26,6 +26,14 @@#define CONFIG_KEY_REVOCATION +#if defined(CONFIG_FSL_LAYERSCAPE ) +/* +* For fsl layerscape based platforms, ESBC image Address in Header +* is 64 bit. +*/ +#define CONFIG_ESBC_ADDR_64BIT +#endif +#ifndef CONFIG_SPL_BUILD #ifndef CONFIG_SYS_RAMBOOT /* The key used for verification of next level images @@ -42,14 +50,6 @@#endif -#if defined(CONFIG_FSL_LAYERSCAPE ) -/* -* For fsl layerscape based platforms, ESBC image Address in Header -* is 64 bit. -*/ -#define CONFIG_ESBC_ADDR_64BIT -#endif -#ifdef CONFIG_ARCH_LS2080A #define CONFIG_EXTRA_ENV \ "setenv fdt_high 0xa0000000;" \board/freescale/ls1088a/MAINTAINERS +5
-0@@ -27,3 +27,8 @@ M: Udit Agarwal <[email protected]> M: Vinitha Pillai-B57223 <[email protected]> S: Maintained F: configs/ls1088ardb_qspi_SECURE_BOOT_defconfig + +LS1088ARDB_SD_SECURE_BOOT BOARD +M: Sumit Garg <[email protected]> +S: Maintained +F: configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfigconfigs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig new file +20
-0@@ -0,0 +1,45 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1088ARDB=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_FSL_LS_PPA=y +CONFIG_SPL_MMC_SUPPORT=y +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-rdb" +CONFIG_DISTRO_DEFAULTS=y +# CONFIG_SYS_MALLOC_F is not set +CONFIG_FIT_VERBOSE=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI" +CONFIG_SECURE_BOOT=y +CONFIG_SD_BOOT=y +# CONFIG_USE_BOOTCOMMAND is not set +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_SPL=y +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig line 30
Quoted 10 lines
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig new file +10
-0+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0 +CONFIG_SPL_ENV_SUPPORT=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_OF_CONTROL=y +CONFIG_ENV_IS_IN_MMC=y
This looks wrong. For secure boot you don't use env, do you? If you agree I can drop this line when applying this patch.
York
PATCH v2 3/3 ls1088ardb: Add SD Secure boot target support
Quoted 114 lines
-----Original Message-----
From: York Sun
Sent: Thursday, January 11, 2018 1:03 AM
To: Sumit Garg <[email protected]>; u-boot at lists.denx.de
Cc: Ruchika Gupta <[email protected]>; Prabhakar Kushwaha <[email protected]>; Ashish Kumar <[email protected]>; Udit Agarwal <[email protected]>
Subject: Re: [PATCH v2 3/3] ls1088ardb: Add SD Secure boot target supportQuoted 10 lines · Sumit Garg
Signed-off-by Udit Agarwal <[email protected]>Signed-off-by Sumit Garg <[email protected]>---
Changes in v2:
Rebased to top of masterarch/arm/include/asm/fsl_secure_boot.h | 16 ++++---- board/freescale/ls1088a/MAINTAINERS | 5 +++ .../ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 45++++++++++++++++++++++
Quoted 79 lines
include/configs/ls1088a_common.h | 15 +++++++- 4 files changed, 72 insertions(+), 9 deletions(-) create mode 100644configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
arch/arm/include/asm/fsl_secure_boot.h +8
-0@@ -26,6 +26,14 @@#define CONFIG_KEY_REVOCATION +#if defined(CONFIG_FSL_LAYERSCAPE ) +/* +* For fsl layerscape based platforms, ESBC image Address in Header +* is 64 bit. +*/ +#define CONFIG_ESBC_ADDR_64BIT +#endif +#ifndef CONFIG_SPL_BUILD #ifndef CONFIG_SYS_RAMBOOT /* The key used for verification of next level images @@ -42,14 +50,6 @@
#endif
arch/arm/include/asm/fsl_secure_boot.h +0
-8-#if defined(CONFIG_FSL_LAYERSCAPE ) -/* -* For fsl layerscape based platforms, ESBC image Address in Header -* is 64 bit. -*/ -#define CONFIG_ESBC_ADDR_64BIT -#endif -#ifdef CONFIG_ARCH_LS2080A #define CONFIG_EXTRA_ENV \ "setenv fdt_high 0xa0000000;" \board/freescale/ls1088a/MAINTAINERS +5
-0@@ -27,3 +27,8 @@ M: Udit Agarwal <[email protected]> M: Vinitha Pillai-B57223 <[email protected]> S: Maintained F: configs/ls1088ardb_qspi_SECURE_BOOT_defconfig + +LS1088ARDB_SD_SECURE_BOOT BOARD +M: Sumit Garg <[email protected]> +S: Maintained +F: configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfigconfigs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig new file +19
-0@@ -0,0 +1,45 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1088ARDB=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_FSL_LS_PPA=y +CONFIG_SPL_MMC_SUPPORT=y +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-rdb" +CONFIG_DISTRO_DEFAULTS=y +# CONFIG_SYS_MALLOC_F is not set +CONFIG_FIT_VERBOSE=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_SYS_EXTRA_OPTIONS="SD_BOOT_QSPI" +CONFIG_SECURE_BOOT=y +CONFIG_SD_BOOT=y +# CONFIG_USE_BOOTCOMMAND is not set +# CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=yconfigs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig line 29
Quoted 10 lines
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig new file +10
-0+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x8b0 +CONFIG_SPL_ENV_SUPPORT=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_OF_CONTROL=y +CONFIG_ENV_IS_IN_MMC=yThis looks wrong. For secure boot you don't use env, do you? If you agree I can drop this line when applying this patch.
Quoted 1 line
York
Yeah I agree with you. Please drop this config.
-Sumit
York Sun
AppliedPATCH v2 1/3 armv8: fsl-layerscape: SPL size reduction
In reply to Sumit GargQuoted 9 lines · Sumit Garg
Compile-off
mp.candlibfdt.cin case of SPL build. SPL size reduces by approx 2k.Signed-off-by Sumit Garg <[email protected]>---
Changes in v2:
Removed code specific to D-Cache off. With GCC 6.2 tool-chain, able to reduce size to 79K.
Applied to fsl-qoriq master. Thanks.
York
York Sun
AppliedPATCH v2 2/3 armv8: ls1088a: SPL size reduction
In reply to Sumit GargQuoted 11 lines · Sumit Garg
Using changes in this patch we were able to reduce approx 8k size of u-boot-spl.bin image. Following is breif description of changes to reduce SPL size:
1. Changes in board/freescale/ls1088a/Makefile to remove compilation ofeth.candcpld.cin case of SPL build.
2. Changes inboard/freescale/ls1088a/ls1088a.cto keepboard_early_init_ffuncations in case of SPL build.
3. Changes inls1088a_common.h&ls1088ardb.hto remove driver specific macros due to which static data was being compiled in case of SPL build.
Quoted 7 lines
Signed-off-by Sumit Garg <[email protected]>---
Changes in v2:
Removed code specific to D-Cache off. With GCC 6.2 tool-chain, able to reduce size to 79K.
Applied to fsl-qoriq master. Thanks.
York
PATCH v2 3/3 ls1088ardb: Add SD Secure boot target support
In reply to Sumit GargQuoted 6 lines · Sumit Garg
Signed-off-by Udit Agarwal <[email protected]>Signed-off-by Sumit Garg <[email protected]>---
Changes in v2:
Rebased to top of master
Dropped CONFIG_ENV_IS_IN_MMC=y from defconfig file. Applied to fsl-qoriq master. Thanks.
York