From patchwork Wed Aug 23 13:30:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 9917373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6044E603FA for ; Wed, 23 Aug 2017 13:30:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 506B828989 for ; Wed, 23 Aug 2017 13:30:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 443E32898C; Wed, 23 Aug 2017 13:30:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D03528989 for ; Wed, 23 Aug 2017 13:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Wek0CLIgqXwc1Lim9i6O5Iuz6tTDZjoGfx1TINTSaJs=; b=kLPkIWrWh/vJg8 AAGYoOcIdoAUJT2N7ztBcd9sZjjfXPZ+81vm+QR97afzMkkh5G9oiNBPTok1h0da76UQHJfAACJjx 99fUro6NlKeXjWg53+K3HVUvCe5/XqeunagkWsXuTn8m4vKcOcH2M8dPqTL5Jpb9OuTqWrXChnKxI x2jg+9pHeCceJ1Nkcj/Mje8NUNp2bTutHComzbJjAdLeIvUAPyJTFyoasKJZJr/ULWDN994M6D+3x rDnxEZY9RnxHGHpAaIS8O+0XticCx5Zu7+jrUcQpwm2sthvBTCPVSBcwhc1ap9M24/1CkK0vsyw8W 39eHDLcBH2n0Pz+AMVuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkVk9-0002Sw-DV; Wed, 23 Aug 2017 13:30:49 +0000 Received: from mail-yw0-f195.google.com ([209.85.161.195]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkVjn-0001fx-L8 for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2017 13:30:34 +0000 Received: by mail-yw0-f195.google.com with SMTP id c13so67847ywa.2 for ; Wed, 23 Aug 2017 06:30:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=px3fXr+ArtUxADMyHXpzg/WFUqeFuDhb/JErPiPxpYc=; b=f6WKrniFXKbrIYktST6GNE9PGNRiZ0WAIc2vpTAb1qoc8WAQquGwEhfRNlqrdyRiXx ttsgYwiDUR7Qyjo/alXzhUOa1Bu/oFZT0htpaQQaGyfdgnN6Cfncbk6gpbNGwxPtNSBs rfbQ+hpl4CoyGDPqD0QsaelUUUKjSKox2/1PhJFQJ0a3UXBmPLdRYW1mfR3hWF0ETA0h QeJfJ3nkc+DQa6s8TyxV6ah4e11olzZF3ApbecuaSNGhnJiHNv/+/NPYfb5O3SwetKsJ Qphq3bRbN+4hB51dR7gH+sxMhxGUxVk00ei6BGQYhaOsLxVSC18xY7jGa0WwGvLcw5iA 53kw== X-Gm-Message-State: AHYfb5hA42O7m9h0NbAmQctaaVx1aYY/ruyOuEvDOuerOJf3+kgtL9zb N8CIMozxq/085LeZ X-Received: by 10.37.220.146 with SMTP id y140mr2297362ybe.108.1503495005860; Wed, 23 Aug 2017 06:30:05 -0700 (PDT) Received: from localhost.localdomain (cpe-174-106-0-58.ec.res.rr.com. [174.106.0.58]) by smtp.gmail.com with ESMTPSA id v2sm224552ywh.19.2017.08.23.06.30.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Aug 2017 06:30:05 -0700 (PDT) From: Tom Rini To: linux-arm-kernel@lists.infradead.org Subject: [PATCHv4][DO NOT MERGE] Build a zImage or uImage with dtb already appended Date: Wed, 23 Aug 2017 09:30:13 -0400 Message-Id: <1503495013-7931-1-git-send-email-trini@konsulko.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170823_063027_837301_5637E921 X-CRM114-Status: GOOD ( 10.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Domenico Andreoli Add new targets to build zImage and uImage with DTB appended (i.e. make 'uImage-dtb.am335x-bone' or 'make zImage-dtb.omap3-evm'). Signed-off-by: Jeremy Kerr Signed-off-by: Grant Likely Signed-off-by: Domenico Andreoli Signed-off-by: Tom Rini --- There are still times where you will run into the need to run a modern kernel on a board with old firmware that you cannot update. This patch is not intended for merging anywhere, but just to make use of this mechanism when needed easier. V1: by Grant Likely (02 Aug 2011) V2: by Domenico Andreoli (29 Jun 2012) added .gitignore change V3: by Christoph Junghans (14 Jan 2015) added archhelp V4: Rebase to v4.13-rc6, update depends --- arch/arm/Makefile | 8 ++++++++ arch/arm/boot/.gitignore | 2 ++ arch/arm/boot/Makefile | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 47d3a1ab08d2..d169430c79e4 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -337,6 +337,12 @@ $(BOOT_TARGETS): vmlinux $(INSTALL_TARGETS): $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ +zImage-dtb.%: + $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ + +uImage-dtb.%: + $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ + %.dtb: | scripts $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ @@ -364,9 +370,11 @@ bp:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage define archhelp echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' + echo ' zImage-dtb.* - zImage' with appended dtb blob for machine=*' echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' echo '* xipImage - XIP kernel image, if configured (arch/$(ARCH)/boot/xipImage)' echo ' uImage - U-Boot wrapped zImage' + echo ' uImage-dtb.* - U-Boot wrapped zImage' with appended dtb blob for machine=*' echo ' bootpImage - Combined zImage and initial RAM disk' echo ' (supply initrd image via make variable INITRD=)' echo '* dtbs - Build device tree blobs for enabled boards' diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore index 3c79f85975aa..3d7e1c88c488 100644 --- a/arch/arm/boot/.gitignore +++ b/arch/arm/boot/.gitignore @@ -1,6 +1,8 @@ Image zImage +zImage-dtb.* xipImage bootpImage uImage +uImage-dtb.* *.dtb diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 50f8d1be7fcb..6c4435b44e8f 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -55,6 +55,9 @@ $(obj)/compressed/vmlinux: $(obj)/Image FORCE $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(call if_changed,objcopy) +$(obj)/zImage-dtb.%: $(obj)/dts/%.dtb $(obj)/zImage + cat $(obj)/zImage $< > $@ + endif ifneq ($(LOADADDR),) @@ -79,6 +82,10 @@ $(obj)/uImage: $(obj)/zImage FORCE @$(check_for_multiple_loadaddr) $(call if_changed,uimage) +$(obj)/uImage-dtb.%: $(obj)/zImage-dtb.% FORCE + $(call if_changed,uimage) + @echo ' Image $@ is ready' + $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE $(Q)$(MAKE) $(build)=$(obj)/bootp $@