diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore index 3c79f859..4e5c1d59 100644 --- a/arch/arm/boot/.gitignore +++ b/arch/arm/boot/.gitignore @@ -3,3 +3,5 @@ zImage xipImage bootpImage uImage +*.dtb* +*.scr diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index 50d580d77..a08f9bee3 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst @@ -13,24 +13,40 @@ src := $(obj) PHONY := __dtbs_install __dtbs_install: +export dtbinst_root ?= $(obj) + include include/config/auto.conf include scripts/Kbuild.include include $(src)/Makefile -dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) -subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m)) +dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-))) +dtboinst-files := $(dtbo-y) +script-files := $(scr-y) +readme-files := $(dtbotxt-y) +dtbinst-dirs := $(subdir-y) $(subdir-m) + +# Helper targets for Installing DTBs into the boot directory +quiet_cmd_dtb_install = INSTALL $< + cmd_dtb_install = mkdir -p $(2); cp $< $(2) + +install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) + +$(dtbinst-files): %.dtb: $(obj)/%.dtb + $(call cmd,dtb_install,$(install-dir)) + +$(dtboinst-files): %.dtbo: $(obj)/%.dtbo + $(call cmd,dtb_install,$(install-dir)) -__dtbs_install: $(dtbs) $(subdirs) - @: +$(script-files): %.scr: $(obj)/%.scr + $(call cmd,dtb_install,$(install-dir)) -quiet_cmd_dtb_install = INSTALL $@ - cmd_dtb_install = install -D $< $@ +$(readme-files): %: $(src)/% + $(call cmd,dtb_install,$(install-dir)) -$(dst)/%.dtb: $(obj)/%.dtb - $(call cmd,dtb_install) +$(dtbinst-dirs): + $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ -PHONY += $(subdirs) -$(subdirs): - $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@) +PHONY += $(dtbinst-files) $(dtboinst-files) $(script-files) $(readme-files) $(dtbinst-dirs) +__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(script-files) $(readme-files) $(dtbinst-dirs) .PHONY: $(PHONY) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 58c05e5d..2b95dda9 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -278,6 +278,9 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ # --------------------------------------------------------------------------- DTC ?= $(objtree)/scripts/dtc/dtc +# Overlay support +DTC_FLAGS += -@ -Wno-unit_address_format -Wno-simple_bus_reg + # Disable noisy checks by default ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) DTC_FLAGS += -Wno-unit_address_vs_reg \ @@ -324,6 +327,23 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) +quiet_cmd_dtco = DTCO $@ +cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ + -d $(depfile).dtc.tmp $(dtc-tmp) ; \ + cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) + +$(obj)/%.dtbo: $(src)/%.dts FORCE + $(call if_changed_dep,dtco) + +quiet_cmd_scr = MKIMAGE $@ +cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@ + +$(obj)/%.scr: $(src)/%.scr-cmd FORCE + $(call if_changed,scr) + dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) # Bzip2