# Pastebin WEl4MFTW quiet_cmd_cpp_cfg = CFGS $@ cmd_cpp_cfg = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -x c -o $@ $< # mkimage source config file IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%) # How to create a cpp processed config file, they all use the same source %.cfgout: $(IMX_CONFIG) FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cpp_cfg) IMX_CONTAINER_CFG = $(CONFIG_IMX_CONTAINER_CFG:"%"=%) container.cfg: $(IMX_CONTAINER_CFG) FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cpp_cfg) ifeq ($(CONFIG_ARCH_IMX8), y) CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh IMAGE_TYPE := imx8image ifeq ($(CONFIG_SPL_BUILD),y) SPL_DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG); if [ -f spl/u-boot-spl.cfgout ]; then $(CNTR_DEPFILES) spl/u-boot-spl.cfgout; echo $$?; fi) endif DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o u-boot-dtb.cfgout $(srctree)/$(IMX_CONFIG); if [ -f u-boot-dtb.cfgout ]; then $(CNTR_DEPFILES) u-boot-dtb.cfgout; echo $$?; fi) else ifeq ($(CONFIG_ARCH_IMX8M), y) IMAGE_TYPE := imx8mimage DEPFILE_EXISTS := 0 else IMAGE_TYPE := imximage DEPFILE_EXISTS := 0 endif MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \ -T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE) u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE $(call if_changed,mkimage) ifeq ($(CONFIG_MULTI_DTB_FIT),y) MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \ -T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE) u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log u-boot-dtb.imx: u-boot-fit-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE ifeq ($(DEPFILE_EXISTS),0) $(call if_changed,mkimage) endif else ifeq ($(CONFIG_OF_SEPARATE),y) MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \ -T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE) u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE ifeq ($(DEPFILE_EXISTS),0) $(call if_changed,mkimage) endif endif ifdef CONFIG_ARM64 ifeq ($(CONFIG_ARCH_IMX8M), y) SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout \ -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE) flash.bin: MKIMAGEOUTPUT = flash.log spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cpp_cfg) spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE $(call if_changed,mkimage) endif ifeq ($(CONFIG_ARCH_IMX8), y) SPL: MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e 0x100000 flash.bin: MKIMAGEOUTPUT = flash.log MKIMAGEFLAGS_u-boot.cnt = -n container.cfg -T $(IMAGE_TYPE) -e 0x100000 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) 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