Makefile: Add target to generate hex output for combined spl and dtb
PATCH 1/2 Makefile: Add target to generate hex output for combined spl and dtb
From: Dalon Westergreen <[email protected]>
Some architectures, Stratix10, require a hex formatted spl that combines the spl image and dtb. This adds a target to create said hex file with and offset of SPL_TEXT_BASE.
--- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
Makefile +9 -0
@@ -1074,6 +1074,11 @@ OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex) spl/u-boot-spl.hex: spl/u-boot-spl FORCE $(call if_changed,objcopy) +OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE) + +spl/u-boot-spl-dtb.hex: spl/u-boot-spl-dtb.bin FORCE + $(call if_changed,objcopy) + binary_size_check: u-boot-nodtb.bin FORCE @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \ map_size=$(shell cat u-boot.map | \
@@ -1643,6 +1648,10 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE spl/u-boot-spl.bin: spl/u-boot-spl @: + +spl/u-boot-spl-dtb.bin: spl/u-boot-spl + @: + spl/u-boot-spl: tools prepare \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)
Signature · 1 line
2.20.1
PATCH 2/2 ARM: socfpga: stratix10: Remove CONFIG_OF_EMBED
From: Dalon Westergreen <[email protected]>
CONFIG_OF_EMBED was primarily enabled to support the stratix10 spl hex file requirements. Since this option now produces a warning during build, and the spl hex can be created using alternate methods, CONFIG_OF_EMBED is no longer needed.
--- configs/socfpga_stratix10_defconfig | 1 - include/configs/socfpga_stratix10_socdk.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
configs/socfpga_stratix10_defconfig +0 -1
@@ -26,7 +26,6 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y -CONFIG_OF_EMBED=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_stratix10_socdk" CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y
include/configs/socfpga_stratix10_socdk.h +2 -2
@@ -200,7 +200,7 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);* 0x8000_0000 ...... End of SDRAM_1 (assume 2GB) * */ -#define CONFIG_SPL_TARGET "spl/u-boot-spl.hex" +#define CONFIG_SPL_TARGET "spl/u-boot-spl-dtb.hex"#define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR#define CONFIG_SPL_MAX_SIZE CONFIG_SYS_INIT_RAM_SIZE#define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR
@@ -214,6 +214,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);/* SPL SDMMC boot support */ #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 -#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img"#endif /* __CONFIG_H */
Signature · 1 line
2.20.1
PATCH 2/2 ARM: socfpga: stratix10: Remove CONFIG_OF_EMBED
Quoted 8 lines · Dalon Westergreen
From: Dalon Westergreen <[email protected]>
CONFIG_OF_EMBEDwas primarily enabled to support the stratix10 spl hex file requirements. Since this option now produces a warning during build, and the spl hex can be created using alternate methods,CONFIG_OF_EMBEDis no longer needed.
Quoted 5 lines
Signed-off-by Dalon Westergreen <[email protected]>--- configs/socfpga_stratix10_defconfig | 1 - include/configs/socfpga_stratix10_socdk.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
PATCH 1/2 Makefile: Add target to generate hex output for combined spl and dtb
In reply to Dalon WestergreenHi,
Quoted 11 lines · Dalon Westergreen
From: Dalon Westergreen <[email protected]>
Some architectures, Stratix10, require a hex formatted spl that combines the spl image and dtb. This adds a target to create said hex file with and offset of
SPL_TEXT_BASE.Signed-off-by Dalon Westergreen <[email protected]>--- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
Please see below.
Makefile OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex) · line 1077
Quoted 10 lines
Makefile +1
-0@@ -1074,6 +1074,11 @@ OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex) spl/u-boot-spl.hex: spl/u-boot-spl FORCE $(call if_changed,objcopy) +OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)
Can we drop the -dtb part here? u-boot-spl includes the DTB anyway. It is the -nodtb version which does not.
Quoted 19 lines
Makefile +8
-1+ +spl/u-boot-spl-dtb.hex: spl/u-boot-spl-dtb.bin FORCE + $(call if_changed,objcopy) + binary_size_check: u-boot-nodtb.bin FORCE @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \ map_size=$(shell cat u-boot.map | \@@ -1643,6 +1648,10 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE spl/u-boot-spl.bin: spl/u-boot-spl @: + +spl/u-boot-spl-dtb.bin: spl/u-boot-spl + @: + spl/u-boot-spl: tools prepare \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb) --
Quoted 2 lines
2.20.1
Regards,
Simon
PATCH 1/2 Makefile: Add target to generate hex output for combined spl and dtb
Quoted 12 lines · Simon Glass
Hi,
Quoted 6 lines · Dalon Westergreen
From: Dalon Westergreen <[email protected]>
Some architectures, Stratix10, require a hex formatted spl that combinesthe spl image and dtb. This adds a target to create said hex file withand offset ofSPL_TEXT_BASE.Signed-off-by Dalon Westergreen <[email protected]>--- Makefile |9 +++++++++ 1 file changed, 9 insertions(+)
Reviewed-by Simon Glass <[email protected]>Please see below.
Quoted 9 lines
Quoted 6 lines
Makefileindex c52a33b403..ecba06ffce 100644--- renamed from Makefile +0
-0a/Makefile+++ b/Makefile@@ -1074,6 +1074,11 @@ OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex) spl/u-boot-spl.hex: spl/u-boot-spl
FORCE $(call if_changed,objcopy)
+OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change- address=$(CONFIG_SPL_TEXT_BASE)Can we drop the -dtb part here? u-boot-spl includes the DTB anyway. Itis the -nodtb version which does not.
sure thing.
Quoted 25 lines
Quoted 20 lines
Makefileindex c52a33b403..ecba06ffce 100644--- renamed from Makefile +8
-1+ +spl/u-boot-spl-dtb.hex: spl/u-boot-spl-dtb.bin FORCE + $(call if_changed,objcopy) + binary_size_check: u-boot-nodtb.bin FORCE @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \ map_size=$(shell cat u-boot.map | \@@ -1643,6 +1648,10 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE spl/u-boot-spl.bin: spl/u-boot-spl @: + +spl/u-boot-spl-dtb.bin: spl/u-boot-spl + @: + spl/u-boot-spl: tools prepare \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb) --Quoted 2 lines
2.20.1
Regards,
Simon