From patchwork Thu Sep 8 10:14:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1129372 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p88AFl0Y030864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 8 Sep 2011 10:16:08 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1R1bdq-0005Hy-MD; Thu, 08 Sep 2011 10:15:30 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1R1bdq-0003Cc-6I; Thu, 08 Sep 2011 10:15:30 +0000 Received: from eu1sys200aog107.obsmtp.com ([207.126.144.123]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1R1bdi-0003CH-G6 for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2011 10:15:27 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob107.postini.com ([207.126.147.11]) with SMTP ID DSNKTmiVpYBqD+kyifMrs+dNkTEp+gyy62Ty@postini.com; Thu, 08 Sep 2011 10:15:22 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EA8F7DB; Thu, 8 Sep 2011 10:14:57 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6E14E2391; Thu, 8 Sep 2011 10:14:57 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id C09BAA8095; Thu, 8 Sep 2011 12:14:52 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 8 Sep 2011 12:14:56 +0200 From: Linus Walleij To: Subject: [PATCH] ARM: supply a DTB file to be appended Date: Thu, 8 Sep 2011 12:14:44 +0200 Message-ID: <1315476884-28470-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110908_061522_825402_8A4EB2FE X-CRM114-Status: GOOD ( 18.74 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.123 listed in list.dnswl.org] Cc: Nicolas Pitre , Niklas Hernaeus , Linus Walleij , Grant Likely , David Brown , Lee Jones , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 08 Sep 2011 10:16:08 +0000 (UTC) From: Linus Walleij This adds a Kconfig string where you can specify a file to be appended to the zImage on build, then auto-appends it. The idea is to mimic how we supply an initramfs image by a similar parameter. This makes it easy to script the kernel build with different device trees, and it also vastly simplifies building uImages since "make uImage" will now pick up the devcie tree and include it in the final image as part of the build process. Cc: Nicolas Pitre Cc: David Brown Cc: Niklas Hernaeus Cc: Grant Likely Signed-off-by: Linus Walleij --- This builds on top of Nicos pending appended device tree patches. Nico, if this gains some liking, please include it in your series. --- arch/arm/Kconfig | 10 ++++++++++ arch/arm/boot/Makefile | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4ea9974..cb8ee68 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1789,6 +1789,16 @@ config ARM_APPENDED_DTB (dtb) appended to zImage (e.g. cat zImage .dtb > zImage_w_dtb). +config ARM_APPENDED_DTB_FILE + string "DTB file" + depends on ARM_APPENDED_DTB + default "" + help + This gives the name of file from the build directory to append + to the zImage after it has been built. + + If you are not sure, leave it blank. + config ARM_ATAG_DTB_COMPAT bool "Supplement the appended DTB with traditional ATAG information" depends on ARM_APPENDED_DTB diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index a1edfd5..5ab6abf 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -53,8 +53,14 @@ $(obj)/Image: vmlinux FORCE $(obj)/compressed/vmlinux: $(obj)/Image FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ -$(obj)/zImage: $(obj)/compressed/vmlinux FORCE +# Rule to optionally append a DTB +dtbfile := $(shell echo $(CONFIG_ARM_APPENDED_DTB_FILE)) +quiet_cmd_append = CAT $@ + cmd_append = (cat /dev/null $(dtbfile) >> $@) + +$(obj)/zImage: $(obj)/compressed/vmlinux $(dtbfile) FORCE $(call if_changed,objcopy) + $(call if_changed,append) @echo ' Kernel: $@ is ready' endif