diff options
author | Han Xu <han.xu@nxp.com> | 2018-09-06 22:42:15 -0500 |
---|---|---|
committer | Han Xu <han.xu@nxp.com> | 2018-09-07 09:52:36 -0500 |
commit | 2804e4248bf638165c54c450528a14fe27cc58cd (patch) | |
tree | 480ee9c649914ff0faa6243d8c2e2bbc8b28e81b /arch | |
parent | 713a0dbe7ee70db8433948f95f066c9cac37f37e (diff) |
MLK-19483: i.MX6/7: pack qspi header with u-boot for i.MX6/7 qspi u-boot
To support the uuu, pack the common qspi header with u-boot binary for
i.MX6/7 qspi u-boot.
Signed-off-by: Han Xu <han.xu@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index d590768c898..097706d766d 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -101,8 +101,27 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imxim -e $(CONFIG_SYS_TEXT_BASE) u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log +QSPI_HEADER = board/freescale/common/qspi_header +QSPI_HEADER_OFF = 1 +QSPI_UBOOT_OFF = 4 +ifeq ($(SOC),$(filter $(SOC),mx7)) +QSPI_HEADER_OFF = 0 +QSPI_UBOOT_OFF = 1 +endif + u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE $(call if_changed,mkimage) +ifeq ($(CONFIG_QSPI_BOOT),y) + @awk '{s="0000000"$$1;l=length(s);if(!((NR-1)%4))printf "%08x ",(NR-1)*4; \ + for(i=1;i<8;i+=2)printf " %s",substr(s,l-i,2);if(!(NR%4))printf "\n";}' \ + $(QSPI_HEADER) > qspi.tmp + @xxd -r qspi.tmp qspi.bin + @dd if=u-boot.imx of=u-boot.tmp bs=1k seek=$(QSPI_UBOOT_OFF) + @dd if=qspi.bin of=u-boot.tmp bs=1k seek=$(QSPI_HEADER_OFF) conv=notrunc + @mv u-boot.tmp u-boot.imx + @rm qspi.tmp qspi.bin + @echo "Packed QSPI header with U-boot" +endif ifeq ($(CONFIG_OF_SEPARATE),y) MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \ |