From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ee0-f52.google.com ([74.125.83.52]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UTD9y-0002pe-T7 for ptxdist@pengutronix.de; Fri, 19 Apr 2013 17:23:35 +0200 Received: by mail-ee0-f52.google.com with SMTP id d41so160493eek.11 for ; Fri, 19 Apr 2013 08:23:29 -0700 (PDT) From: Hubert Feurstein Date: Fri, 19 Apr 2013 17:23:13 +0200 Message-Id: <1366384993-30020-1-git-send-email-h.feurstein@gmail.com> Subject: [ptxdist] [RFC PATCH] kernel: add build support for device trees Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de 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 --- 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