diff options
Diffstat (limited to 'arch/arm/mach-imx/Makefile')
-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 \ |