From patchwork Mon Feb 1 01:10:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 576266 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C051B140BC4 for ; Mon, 1 Feb 2016 12:11:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=fPJnz42E; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0CFEEA7533; Mon, 1 Feb 2016 02:11:13 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tc4QxoOS_AN0; Mon, 1 Feb 2016 02:11:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 29978A74D0; Mon, 1 Feb 2016 02:11:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A204A74D0 for ; Mon, 1 Feb 2016 02:11:08 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b4nz1i23YEMq for ; Mon, 1 Feb 2016 02:11:08 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by theia.denx.de (Postfix) with ESMTPS id C9FB3A7517 for ; Mon, 1 Feb 2016 02:11:00 +0100 (CET) Received: by mail-oi0-f49.google.com with SMTP id j125so15746754oih.3 for ; Sun, 31 Jan 2016 17:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=CjtoTgS46MwXv4s+KSjHYH6sKpZ8iLyLkxlnmZ6k9dU=; b=fPJnz42EqxW0Oa8a5qKnJOZ7OOy2dilBReTjrv4cq3+fyWwWYhJ588NvqDb+CEKtAU N2lwXyciU3b6RZrA38tviVM4hbJJSn5gdSul84NP3pvVqwflCjoA3IzrarVdHLDSaow3 Uho6BsX4eMHFBFXqZL3CiF/PaHb4P7f6l0pBPihSplnSIV8lTa/WomVShCaLEU46lXE8 D35C+hh/qTSH88EvpvJEyLvCRTXDZVBNGSNPX/frNB9a3PBYTHkKS95vW5hEc5lfokPI t9eWeAgCNJJcDdJ9aKh8Lq3lDXmEV+qH5g7enfpdJ/nL2KfYMDiSqlQHwHL/b+U/9GhA kxqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=CjtoTgS46MwXv4s+KSjHYH6sKpZ8iLyLkxlnmZ6k9dU=; b=gV90WantJFVg1eo44dwL9kMEeUxLPvYaWoithx/SixPKrwgNxyuAkcv78v9lPkA/yt 3bt6N4XqUNd/dWGvKlOeNC+T2Um9ZOdrbRbQAKUK4tg1jxO/1otGog7YxihPGedBZei3 c7o0vmX8NpgUTu6rdunj5M56W6j01LoMYyLsmFfAvlaXhuyGxre7WgHyY/+NYa0vKL+R IyWQ/LfGfDvFQaPg0wTqmqlj7DXzzg3Bv1vlwrggHJX7g4h4Z87pHmfeNm16v0FTaJkj aFcmlCak28isrocZbBmnCQY2nY0NTMO1GrLLHR4AFTzLiCbKe8TUK54WzpAKTQBxJoNS T/JA== X-Gm-Message-State: AG10YOTjyw3QZsGuznp+rAB8+fvvn5UZfLeHTKRLy9M4Zh8Fm+DgkJPLI9IZvqydaD6A4cn1 X-Received: by 10.202.204.7 with SMTP id c7mr46486oig.42.1454289059617; Sun, 31 Jan 2016 17:10:59 -0800 (PST) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:5567:9246:497b:9030]) by smtp.gmail.com with ESMTPSA id rh8sm13658086oeb.14.2016.01.31.17.10.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Jan 2016 17:10:57 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 097062207DC; Sun, 31 Jan 2016 18:10:56 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 31 Jan 2016 18:10:50 -0700 Message-Id: <1454289055-17054-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1454289055-17054-1-git-send-email-sjg@chromium.org> References: <1454289055-17054-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Stephen Warren , Jerry Van Baren , Tom Warren Subject: [U-Boot] [PATCH v3 2/7] fdt: Build a U-Boot binary without device tree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present u-boot.bin holds the plain U-Boot binary without the device tree. This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin depending on whether device tree is used. Adjust the build such that u-boot.bin includes a device tree (if enabled), and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the same. This should be acceptable since: - without OF_CONTROL, u-boot.bin still does not include a device tree - with OF_CONTROL, u-boot-dtb.bin does not change The main impact is build systems which are set up to use u-boot.bin as the output file and then add a device tree. These will have to change to use u-boot-nodtb.bin instead. Adjust tegra rules so it continues to produce the correct files. Signed-off-by: Simon Glass --- Changes in v3: - Adjust rules based on Masahiro's expert comments Changes in v2: None Makefile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index dbb914a..67824ac 100644 --- a/Makefile +++ b/Makefile @@ -747,7 +747,7 @@ endif ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin +ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb ifeq ($(CONFIG_SPL_FRAMEWORK),y) ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif @@ -823,15 +823,23 @@ PHONY += dtbs dtbs dts/dt.dtb: checkdtc u-boot $(Q)$(MAKE) $(build)=dts dtbs -u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE +quiet_cmd_copy = COPY $@ + cmd_copy = cp $< $@ + +ifeq ($(CONFIG_OF_SEPARATE),y) +u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE $(call if_changed,cat) +u-boot.bin: u-boot-dtb.bin FORCE + $(call if_changed,copy) +else +u-boot.bin: u-boot-nodtb.bin FORCE + $(call if_changed,copy) +endif + %.imx: %.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ -quiet_cmd_copy = COPY $@ - cmd_copy = cp $< $@ - u-boot.dtb: dts/dt.dtb $(call cmd,copy) @@ -842,11 +850,11 @@ OBJCOPYFLAGS_u-boot.srec := -O srec u-boot.hex u-boot.srec: u-boot FORCE $(call if_changed,objcopy) -OBJCOPYFLAGS_u-boot.bin := -O binary \ +OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \ $(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec) -binary_size_check: u-boot.bin FORCE - @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \ +binary_size_check: u-boot-nodtb.bin FORCE + @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \ map_size=$(shell cat u-boot.map | \ awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ | sed 's/0X//g' \ @@ -854,12 +862,12 @@ binary_size_check: u-boot.bin FORCE if [ "" != "$$map_size" ]; then \ if test $$map_size -ne $$file_size; then \ echo "u-boot.map shows a binary size of $$map_size" >&2 ; \ - echo " but u-boot.bin shows $$file_size" >&2 ; \ + echo " but u-boot-nodtb.bin shows $$file_size" >&2 ; \ exit 1; \ fi \ fi -u-boot.bin: u-boot FORCE +u-boot-nodtb.bin: u-boot FORCE $(call if_changed,objcopy) $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) $(BOARD_SIZE_CHECK) @@ -1018,7 +1026,7 @@ rom: u-boot.rom FORCE IFDTOOL=$(objtree)/tools/ifdtool IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1) -IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin +IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin IFDTOOL_FLAGS += -C @@ -1069,7 +1077,7 @@ endif ifneq ($(CONFIG_TEGRA),) OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE +u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE $(call if_changed,pad_cat) OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)