From 452918232b4cdbfd2a30f60404ee044f9533b49a Mon Sep 17 00:00:00 2001 From: Davide Cardillo <davide.cardillo@seco.com> Date: Fri, 22 Oct 2021 14:05:21 +0200 Subject: [PATCH] [DTBO] Add support for DTBO file all *.dts file with suffix "-overlay" into name will be managed as dtbo file --- .gitignore | 1 + Makefile | 3 +++ scripts/Makefile.dtbinst | 4 ++++ scripts/Makefile.lib | 14 +++++++++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 67d2f350312832..bdd07940316445 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ *.dt.yaml *.dtb *.dtb.S +*.dtbo *.dwo *.elf *.gcno diff --git a/Makefile b/Makefile index 23d656936d4055..b8f34f642fa8cf 100644 --- a/Makefile +++ b/Makefile @@ -1353,6 +1353,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ +%.dtbo: include/config/kernel.release scripts_dtc + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ + PHONY += dtbs dtbs_install dtbs_check dtbs: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index 50d580d77ae920..d797d427eded41 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst @@ -18,6 +18,7 @@ include scripts/Kbuild.include include $(src)/Makefile dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) +dtb0s := $(addprefix $(dst)/, $(dtbo-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtbo-))) subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m)) __dtbs_install: $(dtbs) $(subdirs) @@ -29,6 +30,9 @@ quiet_cmd_dtb_install = INSTALL $@ $(dst)/%.dtb: $(obj)/%.dtb $(call cmd,dtb_install) +$(dst)/%.dtbo: $(obj)/%.dtbo + $(call cmd,dtb_install) + PHONY += $(subdirs) $(subdirs): $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 94133708889d7f..0844d588d361e2 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -317,7 +317,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE quiet_cmd_dtc = DTC $@ cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ - $(DTC) -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \ + $(DTC) -@ -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \ $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) @@ -341,6 +341,18 @@ endef $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE $(call if_changed_rule,dtc,yaml) +quiet_cmd_dtco = DTCO $@ +cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ + $(DTC) -@ -H epapr -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)/%-overlay.dts $(DTCO) FORCE + $(call if_changed_dep,dtco,yaml) + + dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) # Bzip2 -- GitLab