summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Mittal <mittals@codeaurora.org>2017-02-10 14:52:32 -0800
committerShashank Mittal <mittals@codeaurora.org>2017-04-06 11:22:41 -0700
commit18a3ceeb5e7a8e88909014722d0b5be418aa2b1a (patch)
tree96ec3752a758aa53112c257e7b0760852c02c4e2
parent7515bfb3f1517b27c0119ccc8376ee89ea90df11 (diff)
scripts: Makefile: add support to compile DT overlay blobs
Add support to compile device tree overlay blob. 'dtbo-y' target can be used to specify DT overlay blob. '<target>-obj' must be specified to list base and overlay blobs. Change-Id: Ib5036c70ba46374619cc43f9f7b697e1a444aebf Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
-rw-r--r--scripts/Makefile.build5
-rw-r--r--scripts/Makefile.dtbo24
2 files changed, 29 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 01df30af4d4a..45473ca4290c 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -64,6 +64,11 @@ ifneq ($(hostprogs-y)$(hostprogs-m),)
include scripts/Makefile.host
endif
+# Do not include host rules unless needed
+ifneq ($(dtbo-y),)
+include scripts/Makefile.dtbo
+endif
+
ifneq ($(KBUILD_SRC),)
# Create output directory if not already present
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
diff --git a/scripts/Makefile.dtbo b/scripts/Makefile.dtbo
new file mode 100644
index 000000000000..db4a0f4b9a56
--- /dev/null
+++ b/scripts/Makefile.dtbo
@@ -0,0 +1,24 @@
+__dtbo := $(sort $(dtbo-y))
+
+dtbo-base := $(sort $(foreach m,$(__dtbo),$($(m)-base)))
+dtbo := $(foreach m,$(__dtbo),$(if $($(m)-base),$(m)))
+
+__dtbo := $(addprefix $(obj)/,$(__dtbo))
+dtbo-base := $(addprefix $(obj)/,$(dtbo-base))
+dtbo := $(addprefix $(obj)/,$(dtbo))
+
+ifneq ($(DTC_OVERLAY_TEST_EXT),)
+DTC_OVERLAY_TEST = $(DTC_OVERLAY_TEST_EXT)
+quiet_cmd_dtbo_verify = VERIFY $@
+cmd_dtbo_verify = $(DTC_OVERLAY_TEST) $(addprefix $(obj)/,$($(@F)-base)) $@ $(dot-target).dtb
+else
+cmd_dtbo_verify = true
+endif
+
+$(obj)/%.dtbo: $(src)/%.dts FORCE
+ $(call if_changed_dep,dtc)
+ $(call if_changed,dtbo_verify)
+
+$(call multi_depend, $(dtbo), , -base)
+
+always += $(dtbo)