ls1043ardb: SPL size reduction in case of non-xip boot
PATCH v2 1/1 ls1043ardb: SPL size reduction in case of non-xip boot
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.
---
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(-)
board/freescale/ls1043aqds/Makefile +2 -0
@@ -5,5 +5,7 @@ # obj-y += ddr.o +ifndef CONFIG_SPL_BUILD obj-y += eth.o +endif obj-y += ls1043aqds.o
board/freescale/ls1043ardb/Makefile +3 -1
@@ -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
board/freescale/ls1043ardb/ls1043ardb.c +11 -7
@@ -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
configs/ls1043ardb_sdcard_defconfig +0 -1
@@ -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
include/configs/ls1043a_common.h +10 -0
@@ -81,6 +81,7 @@#define CONFIG_SYS_MONITOR_LEN 0xa0000#endif +#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SD_BOOT ))/* IFC */ #if !defined(CONFIG_QSPI_BOOT ) && !defined(CONFIG_SD_BOOT_QSPI )#define CONFIG_FSL_IFC
@@ -102,6 +103,7 @@#define CONFIG_FLASH_SHOW_PROGRESS 45/* count down from 45/5: 9..1 */ #endif #endif +#endif /* I2C */ #define CONFIG_SYS_I2C
@@ -111,6 +113,7 @@#define CONFIG_SYS_I2C_MXC_I2C3 #define CONFIG_SYS_I2C_MXC_I2C4 +#ifndef CONFIG_SPL_BUILD /* PCIe */ #define CONFIG_PCIE1 /* PCIE controller 1 */ #define CONFIG_PCIE2 /* PCIE controller 2 */
@@ -124,13 +127,17 @@/* 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 +#ifndef CONFIG_SPL_BUILD /* DSPI */ #define CONFIG_FSL_DSPI #ifdef CONFIG_FSL_DSPI
@@ -176,6 +183,7 @@#define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000#define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)#endif +#endif /* Miscellaneous configurable options */ #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000)
@@ -183,6 +191,7 @@#define CONFIG_HWCONFIG #define HWCONFIG_BUFFER_SIZE 128 +#ifndef CONFIG_SPL_BUILD #if defined(CONFIG_QSPI_BOOT ) || defined(CONFIG_SD_BOOT_QSPI )#define MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \ "5m(kernel),1m(dtb),9m(file_system)"
@@ -221,6 +230,7 @@#define CONFIG_BOOTCOMMAND "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 */
include/configs/ls1043ardb.h +6 -0
@@ -90,7 +90,9 @@/* * NAND Flash Definitions */ +#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SD_BOOT ))#define CONFIG_NAND_FSL_IFC +#endif #define CONFIG_SYS_NAND_BASE 0x7e800000#define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
@@ -212,6 +214,7 @@#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_CPLD_FTIM2#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_CPLD_FTIM3 +#ifndef CONFIG_SPL_BUILD /* EEPROM */ #define CONFIG_ID_EEPROM #define CONFIG_SYS_I2C_EEPROM_NXID
@@ -225,6 +228,7 @@* Environment */ #define CONFIG_ENV_OVERWRITE +#endif #if defined(CONFIG_NAND_BOOT )#define CONFIG_ENV_IS_IN_NAND
@@ -242,6 +246,7 @@#define CONFIG_ENV_SIZE 0x20000#endif +#ifndef CONFIG_SPL_BUILD /* FMan */ #ifdef CONFIG_SYS_DPAA_FMAN #define CONFIG_FMAN_ENET
@@ -299,6 +304,7 @@#define SCSI_VEND_ID 0x1b4b#define SCSI_DEV_ID 0x9170#define CONFIG_SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID} +#endif #include <asm/fsl_secure_boot.h>
Signature · 1 line
1.9.1
PATCH v2 1/1 ls1043ardb: SPL size reduction in case of non-xip boot
Quoted 114 lines · Sumit Garg
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 ofeth.candcpld.cin case of SPL build.
2. Changes inboard/freescale/ls1043ardb/ls1043ardb.cto keep onlyddr_initandboard_early_init_ffuncations in case of SPL build.
3. Changes inls1043a_common.h&ls1043ardb.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.
5. Remove I2C driver support from SPL in case of LS1043ARDB.Signed-off-by Vinitha Pillai <[email protected]>Signed-off-by Sumit Garg <[email protected]>---
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(-)board/freescale/ls1043aqds/Makefile +2
-0@@ -5,5 +5,7 @@ # obj-y += ddr.o +ifndef CONFIG_SPL_BUILD obj-y += eth.o +endif obj-y += ls1043aqds.oboard/freescale/ls1043ardb/Makefile +3
-1@@ -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 +endifboard/freescale/ls1043ardb/ls1043ardb.c +11
-7@@ -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 configs/ls1043ardb_sdcard_defconfig +0
-1@@ -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=yinclude/configs/ls1043a_common.h +0
-0
include/configs/ls1043a_common.h line 84
Quoted 4 lines
include/configs/ls1043a_common.h +1
-0@@ -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?
Quoted 20 lines
include/configs/ls1043a_common.h +2
-0/* IFC */ #if !defined(CONFIG_QSPI_BOOT ) && !defined(CONFIG_SD_BOOT_QSPI )#define CONFIG_FSL_IFC @@ -102,6 +103,7 @@#define CONFIG_FLASH_SHOW_PROGRESS 45/* count down from 45/5: 9..1 */ #endif #endif +#endif /* I2C */ #define CONFIG_SYS_I2C @@ -111,6 +113,7 @@#define CONFIG_SYS_I2C_MXC_I2C3 #define CONFIG_SYS_I2C_MXC_I2C4 +#ifndef CONFIG_SPL_BUILD /* PCIe */ #define CONFIG_PCIE1 /* PCIE controller 1 */ #define CONFIG_PCIE2 /* PCIE controller 2 */
include/configs/ls1043a_common.h line 132
Quoted 6 lines
include/configs/ls1043a_common.h +2
-0@@ -124,13 +127,17 @@/* Command line configuration */ #define CONFIG_CMD_ENV +#endif +#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_NAND_BOOT ))
So MMC is only available for NAND_BOOT?
include/configs/ls1043a_common.h line 139
Quoted 7 lines
include/configs/ls1043a_common.h +1
-0/* MMC */ #ifdef CONFIG_MMC #define CONFIG_FSL_ESDHC #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 #endif +#endif
York
PATCH v2 1/1 ls1043ardb: SPL size reduction in case of non-xip boot
Quoted 133 lines
-----Original Message-----
From: york sun
Sent: Monday, March 27, 2017 9:41 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 v2] ls1043ardb: SPL size reduction in case of non-xip bootQuoted 94 lines · Sumit Garg
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 ofeth.candcpld.cin case of SPL build.
2. Changes inboard/freescale/ls1043ardb/ls1043ardb.cto keep onlyddr_initandboard_early_init_ffuncations in case of SPL build.
3. Changes inls1043a_common.h&ls1043ardb.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.
5. Remove I2C driver support from SPL in case of LS1043ARDB.Signed-off-by Vinitha Pillai <[email protected]>Signed-off-by Sumit Garg <[email protected]>---
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(-)board/freescale/ls1043aqds/Makefile +2
-0@@ -5,5 +5,7 @@ # obj-y += ddr.o +ifndef CONFIG_SPL_BUILD obj-y += eth.o +endif obj-y += ls1043aqds.oboard/freescale/ls1043ardb/Makefile +3
-1@@ -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 +endifboard/freescale/ls1043ardb/ls1043ardb.c +10
-7@@ -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_scfgQuoted 1 line
*)CONFIG_SYS_FSL_SCFG_ADDR; @@ -215,3 +217,5 @@ u16
flash_read16(void
Quoted 27 lines
*addr)
board/freescale/ls1043ardb/ls1043ardb.c +2
-0return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00); } + +#endif configs/ls1043ardb_sdcard_defconfig +0
-1@@ -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=yinclude/configs/ls1043a_common.h +0
-0@@ -81,6 +81,7 @@#define CONFIG_SYS_MONITOR_LEN 0xa0000#endif
Quoted 5 lines
include/configs/ls1043a_common.h line 84
Quoted 1 line
include/configs/ls1043a_common.h +1
-0+#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SD_BOOT ))Is this right? You would skip IFC if
SD_BOOTis 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.
Quoted 21 lines
Quoted 4 lines
include/configs/ls1043a_common.h +0
-0/* IFC */ #if !defined(CONFIG_QSPI_BOOT ) && !defined(CONFIG_SD_BOOT_QSPI )#define CONFIG_FSL_IFC @@ -102,6 +103,7 @@#define
CONFIG_FLASH_SHOW_PROGRESS45 /* count down from45/5: 9..1 */
Quoted 16 lines
#endif
#endifinclude/configs/ls1043a_common.h +2
-0+#endif /* I2C */ #define CONFIG_SYS_I2C @@ -111,6 +113,7 @@#define CONFIG_SYS_I2C_MXC_I2C3 #define CONFIG_SYS_I2C_MXC_I2C4 +#ifndef CONFIG_SPL_BUILD /* PCIe */ #define CONFIG_PCIE1 /* PCIE controller 1 */ #define CONFIG_PCIE2 /* PCIE controller 2 */ @@ -124,13 +127,17 @@
Quoted 7 lines
include/configs/ls1043a_common.h line 132
Quoted 5 lines
include/configs/ls1043a_common.h +2
-0/* Command line configuration */ #define CONFIG_CMD_ENV +#endif +#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_NAND_BOOT ))So MMC is only available for
NAND_BOOT?
Here also check is with "!" operation, means to skip MMC if NAND_BOOT & SPL_BUILD are enabled.
Quoted 10 lines
include/configs/ls1043a_common.h line 139
Quoted 8 lines
include/configs/ls1043a_common.h +1
-0/* MMC */ #ifdef CONFIG_MMC #define CONFIG_FSL_ESDHC #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 #endif +#endif York
Sumit
PATCH v2 1/1 ls1043ardb: SPL size reduction in case of non-xip boot
Quoted 133 lines · Sumit Garg
Quoted 133 lines
-----Original Message-----
From: york sun
Sent: Monday, March 27, 2017 9:41 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 v2] ls1043ardb: SPL size reduction in case of non-xip bootQuoted 94 lines · Sumit Garg
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 ofeth.candcpld.cin case of SPL build.
2. Changes inboard/freescale/ls1043ardb/ls1043ardb.cto keep onlyddr_initandboard_early_init_ffuncations in case of SPL build.
3. Changes inls1043a_common.h&ls1043ardb.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.
5. Remove I2C driver support from SPL in case of LS1043ARDB.Signed-off-by Vinitha Pillai <[email protected]>Signed-off-by Sumit Garg <[email protected]>---
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(-)board/freescale/ls1043aqds/Makefile +2
-0@@ -5,5 +5,7 @@ # obj-y += ddr.o +ifndef CONFIG_SPL_BUILD obj-y += eth.o +endif obj-y += ls1043aqds.oboard/freescale/ls1043ardb/Makefile +3
-1@@ -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 +endifboard/freescale/ls1043ardb/ls1043ardb.c +10
-7@@ -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_scfgQuoted 1 line
*)CONFIG_SYS_FSL_SCFG_ADDR; @@ -215,3 +217,5 @@ u16
flash_read16(void
Quoted 27 lines
*addr)
board/freescale/ls1043ardb/ls1043ardb.c +2
-0return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00); } + +#endif configs/ls1043ardb_sdcard_defconfig +0
-1@@ -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=yinclude/configs/ls1043a_common.h +0
-0@@ -81,6 +81,7 @@#define CONFIG_SYS_MONITOR_LEN 0xa0000#endif
Quoted 7 lines
Quoted 5 lines
include/configs/ls1043a_common.h line 84
Quoted 1 line
include/configs/ls1043a_common.h +1
-0+#if !(defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SD_BOOT ))Is this right? You would skip IFC if
SD_BOOTis not enabled. Did you try NOR boot with this change?Here this check is with "!" operation, means to skip IFC if
SD_BOOT&SPL_BUILDare 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