diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-09-23 10:18:44 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2019-10-08 16:36:36 +0200 |
commit | d1c07785fd68def6aa2251a15eed99f2e9c8071f (patch) | |
tree | 1eb94144642dfea3a90911eb33426a1da78552db /arch/arm/mach-imx/Makefile | |
parent | 2c79229c02ad9f0eae4faee028a76394d00a699d (diff) |
imx8: Add support to get container image set size
To avoid hardcoded offset when adding u-boot.cnt to flash.bin, we use
flexible offset which is calculated based on the size of the container
image generated int the first stage. And pad u-boot.cnt at 1KB
alignment.
So add code to get the offset when SPL loading u-boot.cnt.
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx/Makefile')
-rw-r--r-- | arch/arm/mach-imx/Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 17b241ae99..87fd69706d 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -169,9 +169,16 @@ u-boot.cnt: MKIMAGEOUTPUT = u-boot.cnt.log ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y) u-boot.cnt: u-boot.bin container.cfg FORCE $(call if_changed,mkimage) -endif flash.bin: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) + @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \ + pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \ + echo "append u-boot.cnt at $$pad_cnt KB"; \ + dd if=u-boot.cnt of=flash.bin bs=1K seek=$$pad_cnt; +else +flash.bin: spl/u-boot-spl.bin FORCE + $(call if_changed,mkimage) +endif endif else |