summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2014-06-09 17:32:04 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2014-06-10 20:17:47 +0200
commitb2ec1304d629ed57a9ae77363fa888a12abb30b8 (patch)
treeefd59854bf749402c118a8597a7e4ca5ce88927f
parent41e7c44df6bf631fbc3e722791e5e449ffff3bc7 (diff)
downloadptxdist-b2ec1304d629ed57a9ae77363fa888a12abb30b8.tar.gz
ptxdist-b2ec1304d629ed57a9ae77363fa888a12abb30b8.tar.xz
dtc: Seperate path and filename of dts
Creating multiple device trees result in a quite long DTC_OFTREE_DTS variable. Splitting it into a path variable and file variable makes it more handy. The path can be a ':' separated list to allow device trees from multiple directories. For backwards compatibility, the path is only used for relative file names. Based on a patch by Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--platforms/dtc.in15
-rw-r--r--rules/dtc.make10
-rw-r--r--rules/post/dts.make4
3 files changed, 22 insertions, 7 deletions
diff --git a/platforms/dtc.in b/platforms/dtc.in
index a39af97e1..4319b725e 100644
--- a/platforms/dtc.in
+++ b/platforms/dtc.in
@@ -19,14 +19,21 @@ config DTC_INSTALL_OFTREE
Creates an package to install the 'oftree' file to /boot
of your target system.
+config DTC_OFTREE_DTS_PATH
+ string "path to source dts file"
+ default "${PTXDIST_PLATFORMCONFIGDIR}/dts:${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts"
+ help
+ Define path to the dts source file. Multiple directories can be
+ specified separated by ':'.
+
config DTC_OFTREE_DTS
string "source dts file"
- default "${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts/<yourboard>.dts"
+ default "<yourboard>.dts"
help
Select the dts file to use for the device tree binary
- blob generation. Default is to use the one shipped with
- the kernel. Multiple dts files can be specified, separated
- by spaces.
+ blob generation. For relative file names DTC_OFTREE_DTS_PATH
+ is used as a search path for the device tree files specified
+ here. Multiple dts files can be specified, separated by spaces.
config DTC_KERNEL
bool
diff --git a/rules/dtc.make b/rules/dtc.make
index da3697160..4176a579c 100644
--- a/rules/dtc.make
+++ b/rules/dtc.make
@@ -22,16 +22,24 @@ DTC_VERSION := 1.0.0
# ----------------------------------------------------------------------------
ptx/dtb = $(notdir $(basename $(strip $(1)))).dtb
+ptx/dts = $(shell p=$(PTXCONF_DTC_OFTREE_DTS_PATH) ptxd_in_path p "$(strip $(1))" && echo "$${ptxd_reply}")
+
+ifdef PTXCONF_DTC_OFTREE_DTS
+DTC_OFTREE_DTS = $(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), \
+ $(if $(filter /%,$(dts)),$(dts),$(call ptx/dts,$(dts))))
+endif
%.dtb: TMP_DTS = $(STATEDIR)/$(notdir $<).tmp
%.dtb: TMP_DEPS = $(PTXDIST_TEMPDIR)/dts.deps
%.dtb: DEPS = $(STATEDIR)/dtc.$(notdir $<).deps
%.dtb:
- echo $(TMP_DTS)
@$(call targetinfo)
@if [ -z "$(strip $<)" ]; then \
ptxd_bailout "Device-tree for `ptxd_print_path '$@'` undefined!"; \
fi
+ @if [ ! -e "$(strip $<)" ]; then \
+ ptxd_bailout "Device-tree '$<' not found!"; \
+ fi
@echo CPP `ptxd_print_path "$(TMP_DTS)"`
@cpp \
-Wp,-MD,$(TMP_DEPS) \
diff --git a/rules/post/dts.make b/rules/post/dts.make
index 8d2b7fe67..4781625d5 100644
--- a/rules/post/dts.make
+++ b/rules/post/dts.make
@@ -12,10 +12,10 @@
# defined in post/ to make sure PTXCONF_DTC_OFTREE_DTS is fully defined
# .dtb depends on the .dts and dtc.install for all other dependencies
#
-$(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), \
+$(foreach dts, $(call remove_quotes,$(DTC_OFTREE_DTS)), \
$(eval $(IMAGEDIR)/$(call ptx/dtb, $(dts)): $(dts) $(STATEDIR)/dtc.install))
-$(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), \
+$(foreach dts, $(call remove_quotes,$(DTC_OFTREE_DTS)), \
$(eval $(dts): $(STATEDIR)/kernel.extract.post))
# vim: syntax=make