summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-09-10 06:49:28 -0700
committerYe Li <ye.li@nxp.com>2018-09-10 08:11:35 -0700
commit0e0cb82c81a4bbb63170d0cdfaf3c1024da212d3 (patch)
tree7781cc03ce3647c27e18b4b5a671095907b12003 /arch
parenta612cab389049e5d3e0b2712b680954a440c1f0e (diff)
MLK-19521 imx: Fix out of tree build break by qspi-header
The script used to add qspi header to u-boot.imx/u-boot-dtb.imx fails to build out of tree when using O= option. Some problems found: 1. The qspi-header file need to be copied out of source tree. 2. In mkimage flags, we need to add $(QSPI-HEADER) and %$(PLUGIN).bin. Otherwise it will fails to filter out $(QSPI-HEADER) and $(PLUGIN).bin because the $(PLUGIN) is extend to full path. 3. u-boot-dtb.imx also need update to add qspi-header. Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/Makefile37
1 files changed, 29 insertions, 8 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 097706d766..3f7c43ce90 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -97,11 +97,12 @@ $(IMX_CONFIG): %.cfgtmp: % FORCE
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cpp_cfg)
-MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
+MKIMAGEFLAGS_u-boot.imx = -n $(filter-out %$(PLUGIN).bin $(QSPI_HEADER) $< $(PHONY),$^) -T imximage \
-e $(CONFIG_SYS_TEXT_BASE)
u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
-QSPI_HEADER = board/freescale/common/qspi_header
+QSPI_HEADER_SOURCE = board/freescale/common/qspi_header
+QSPI_HEADER = qspi_header
QSPI_HEADER_OFF = 1
QSPI_UBOOT_OFF = 4
ifeq ($(SOC),$(filter $(SOC),mx7))
@@ -109,27 +110,47 @@ QSPI_HEADER_OFF = 0
QSPI_UBOOT_OFF = 1
endif
-u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
+ifeq ($(CONFIG_QSPI_BOOT),y)
+$(QSPI_HEADER): $(QSPI_HEADER_SOURCE) FORCE
+ @cp $< $@
+
+else
+$(QSPI_HEADER):
+
+endif
+
+u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin $(QSPI_HEADER) 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=$@ 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
+ @mv u-boot.tmp $@
@rm qspi.tmp qspi.bin
- @echo "Packed QSPI header with U-boot"
+ @echo "Packed QSPI header with $@"
endif
ifeq ($(CONFIG_OF_SEPARATE),y)
-MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
+MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out %$(PLUGIN).bin $(QSPI_HEADER) $< $(PHONY),$^) -T imximage \
-e $(CONFIG_SYS_TEXT_BASE)
u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
-u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
+u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin $(QSPI_HEADER) 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=$@ 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 $@
+ @rm qspi.tmp qspi.bin
+ @echo "Packed QSPI header with $@"
+endif
endif
MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \