mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC PATCH] kernel: add build support for device trees
@ 2013-04-19 15:23 Hubert Feurstein
  2013-05-13  8:09 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Hubert Feurstein @ 2013-04-19 15:23 UTC (permalink / raw)
  To: ptxdist

This patch adds direct build support for device trees within the kernel tree.
Since kernel version 3.10 the ARM device trees can not be directly processed
by dtc anymore. They have to pass a CPP stage first. The kernel makefile
takes care about that.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
---
 platforms/kernel.in | 18 ++++++++++++++++++
 rules/kernel.make   | 11 ++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/platforms/kernel.in b/platforms/kernel.in
index bf93a3a..8b28a16 100644
--- a/platforms/kernel.in
+++ b/platforms/kernel.in
@@ -30,6 +30,24 @@ config KERNEL_MODULES_BUILD
 	string
 	default "modules"
 
+config KERNEL_DTBS
+	bool
+	default n
+	prompt "build device trees"
+
+config KERNEL_DTBS_BUILD
+	prompt "list of device tree blobs"
+	string
+	depends on KERNEL_DTBS
+	help
+	  e.g: imx6q-sabresd.dtb
+
+config KERNEL_DTBS_INSTALL
+	bool
+	default y
+	prompt "Install device tree blobs into /boot"
+	depends on KERNEL_DTBS
+
 config KERNEL_VERSION
 	prompt "kernel version"
 	string
diff --git a/rules/kernel.make b/rules/kernel.make
index 9cf310d..28dbfab 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -98,6 +98,8 @@ $(KERNEL_CONFIG):
 	@exit 1
 endif
 
+KERNEL_DTBS_PATH := $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/dts
+KERNEL_DTBS 	 := $(call remove_quotes, $(PTXCONF_KERNEL_DTBS_BUILD))
 
 #
 # when compiling the rootfs into the kernel, we just include an empty
@@ -156,7 +158,8 @@ $(STATEDIR)/kernel.compile:
 		$(KERNEL_DIR)/usr/initramfs_data.cpio.* \
 		$(KERNEL_DIR)/usr/.initramfs_data.cpio.*
 	@cd $(KERNEL_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) \
-		$(KERNEL_MAKEVARS) $(KERNEL_IMAGE) $(PTXCONF_KERNEL_MODULES_BUILD)
+		$(KERNEL_MAKEVARS) $(KERNEL_IMAGE) $(PTXCONF_KERNEL_MODULES_BUILD) \
+		$(KERNEL_DTBS)
 	@$(call touch)
 
 endif # !PTXCONF_PROJECT_USE_PRODUCTION
@@ -200,6 +203,12 @@ ifdef PTXCONF_KERNEL_INSTALL
 	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
 endif
 
+ifdef PTXCONF_KERNEL_DTBS_INSTALL
+	@for dtb in $(KERNEL_DTBS); do \
+		$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_DTBS_PATH)/$${dtb}, /boot/$${dtb}, n); \
+	done
+endif
+
 # install the ELF kernel image for debugging purpose
 ifdef PTXCONF_KERNEL_VMLINUX
 	@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_DIR)/vmlinux, /boot/vmlinux, n)
-- 
1.8.1.3


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-13  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-19 15:23 [ptxdist] [RFC PATCH] kernel: add build support for device trees Hubert Feurstein
2013-05-13  8:09 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox