mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Hubert Feurstein <h.feurstein@gmail.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [RFC PATCH] kernel: add build support for device trees
Date: Fri, 19 Apr 2013 17:23:13 +0200	[thread overview]
Message-ID: <1366384993-30020-1-git-send-email-h.feurstein@gmail.com> (raw)

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

             reply	other threads:[~2013-04-19 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 15:23 Hubert Feurstein [this message]
2013-05-13  8:09 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366384993-30020-1-git-send-email-h.feurstein@gmail.com \
    --to=h.feurstein@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox