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: 3981 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3722C23EF8 for ; Thu, 8 Sep 2011 10:15:24 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2495FA18780 for ; Thu, 8 Sep 2011 10:15:24 +0000 (UTC) Received: by fxd18 with SMTP id 18so2029482fxd.11 for ; Thu, 08 Sep 2011 03:15:24 -0700 (PDT) Received: by 10.223.62.8 with SMTP id v8mr897840fah.43.1315476923811; Thu, 08 Sep 2011 03:15:23 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs170303lab; Thu, 8 Sep 2011 03:15:23 -0700 (PDT) Received: by 10.14.5.206 with SMTP id 54mr157054eel.157.1315476922494; Thu, 08 Sep 2011 03:15:22 -0700 (PDT) Received: from eu1sys200aog107.obsmtp.com (eu1sys200aog107.obsmtp.com [207.126.144.123]) by mx.google.com with SMTP id m52si1143181eeh.134.2011.09.08.03.15.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Sep 2011 03:15:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.123; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com 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: Cc: Lee Jones , , Linus Walleij , Nicolas Pitre , David Brown , Niklas Hernaeus , Grant Likely 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 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