From patchwork Sat Nov 26 03:16:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 699457 X-Patchwork-Delegate: sjg@chromium.org 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 3tQdTC5VGBz9tlB for ; Sat, 26 Nov 2016 14:19:11 +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="Ht013+Ho"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CEC5EA7646; Sat, 26 Nov 2016 04:18:05 +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 IXMJhAQoa3kq; Sat, 26 Nov 2016 04:18:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 020E9B3869; Sat, 26 Nov 2016 04:17:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E020FA7573 for ; Sat, 26 Nov 2016 04:16:36 +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 FiHBWrin42-f for ; Sat, 26 Nov 2016 04:16:36 +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-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by theia.denx.de (Postfix) with ESMTPS id 280C0B3838 for ; Sat, 26 Nov 2016 04:16:27 +0100 (CET) Received: by mail-oi0-f50.google.com with SMTP id b126so98195201oia.2 for ; Fri, 25 Nov 2016 19:16:27 -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=S0okO+hq7GPVAH23WyuT+veIqfCIFDsf/k0Wk2XWUbg=; b=Ht013+HoxHcYLaJTVsjHkz21TTlulnldX7wUZyYMI4SVie3LGdyZ16XO5V2FQDioM6 INq+4gkeKylb/1c+NOFgX8yZug+ZeZAZp5gq1VV9B5TTrZdWjODPSdyJsWaGwxP/lXwm HhwDXAQlowOEnMm9QTcNmZyxA2I9vJhak/gyuKrfjAZ5Hxwb3t44Xp79kbG+g3O0/OUW 6STjlcg1QtFDdFs2D5XhdR6413gFTBRjrCVwmhUBZXkbUHxqTLhMOXGiHgHSFYX3HChx Ht+3VVaR0rwTvbKNKCKo/Z8iEzDLmojYDYGJlt3onX15Lyyv0hme30v99B88rmHGLH7u Ra9g== 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=S0okO+hq7GPVAH23WyuT+veIqfCIFDsf/k0Wk2XWUbg=; b=PBGKIF9yOTAKUljtfUK+TNQ5FmCWh1t/2CwoKaOKWI0hZYznqIVbFzpon+k+dfaUqc stg+p3YnD4RDolCTXeTyg93zs+gkEmd0nPJebmXuwSJv6x3WomoUQaG99XN18xvBQXbG GHW+PgjKezI6Bu3RVois7PJKfW/QVmqQfMvvyJ4Pw5d4c9Jdk8MombdxhD3cGWvuaIJ3 7XS+5mrLodhVyZE44NVcUUHmOdv1F3DHhwcBpnqJXz/0Cg8mSxQpOWsvXSmosGPP69MC iAJKYAYsZpmdeLMMajJF3eq8dPObhpqhvXcHVZWDGTpiCphXKXeh8wtXqkJYgXu4/063 c0cQ== X-Gm-Message-State: AKaTC0347l7sC/+olO9IfNZwB3LATF5yzR3rGItgUw8IEnA3SVzmXucTeXeXFFaC7vQigz3z X-Received: by 10.202.55.70 with SMTP id e67mr6324719oia.51.1480130186465; Fri, 25 Nov 2016 19:16:26 -0800 (PST) Received: from kaki.bld.corp.google.com ([2620:0:10f2:12:f124:5c32:c68:92db]) by smtp.gmail.com with ESMTPSA id r34sm14248694otr.12.2016.11.25.19.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2016 19:16:25 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 6FB284039C; Fri, 25 Nov 2016 20:16:25 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 25 Nov 2016 20:16:02 -0700 Message-Id: <1480130164-15709-13-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1480130164-15709-1-git-send-email-sjg@chromium.org> References: <1480130164-15709-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v6 12/13] x86: Use binman all x86 boards 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" Change x86 boards to use binman to produce the ROM. This involves adding the image definition to the device tree and using it in the Makefile. The existing ifdtool features are no-longer needed. Note that the u-boot.dtsi file is common and is used for all x86 boards which use microcode. A separate emulation-u-boot-dtsi is used for the others. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes in v6: None Changes in v5: None Changes in v4: - Remove RFC tag - Use binman for all x86 boards Changes in v3: - Put the binman definition in u-boot.dtsi Changes in v2: - Add automated test coverage - Put the binman definition in a common file for x86 - Various changes and improvements based on using this tool for a while Makefile | 45 ++------------------------- arch/x86/dts/emulation-u-boot.dtsi | 18 +++++++++++ arch/x86/dts/u-boot.dtsi | 62 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 42 deletions(-) create mode 100644 arch/x86/dts/emulation-u-boot.dtsi create mode 100644 arch/x86/dts/u-boot.dtsi diff --git a/Makefile b/Makefile index 751f70e..4121b25 100644 --- a/Makefile +++ b/Makefile @@ -1053,50 +1053,11 @@ endif # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in -# the middle. +# the middle. This is handled by binman based on an image description in the +# board's device tree. ifneq ($(CONFIG_X86_RESET_VECTOR),) 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-nodtb.bin -IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin -IFDTOOL_FLAGS += -C - -ifneq ($(CONFIG_HAVE_INTEL_ME),) -IFDTOOL_ME_FLAGS = -D $(srctree)/board/$(BOARDDIR)/descriptor.bin -IFDTOOL_ME_FLAGS += -i ME:$(srctree)/board/$(BOARDDIR)/me.bin -endif - -ifneq ($(CONFIG_HAVE_MRC),) -IFDTOOL_FLAGS += -w $(CONFIG_X86_MRC_ADDR):$(srctree)/board/$(BOARDDIR)/mrc.bin -endif - -ifneq ($(CONFIG_HAVE_FSP),) -IFDTOOL_FLAGS += -w $(CONFIG_FSP_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_FSP_FILE) -endif - -ifneq ($(CONFIG_HAVE_CMC),) -IFDTOOL_FLAGS += -w $(CONFIG_CMC_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_CMC_FILE) -endif - -ifneq ($(CONFIG_HAVE_VGA_BIOS),) -IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE) -endif - -ifneq ($(CONFIG_HAVE_REFCODE),) -IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin -endif - -quiet_cmd_ifdtool = IFDTOOL $@ -cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp; -ifneq ($(CONFIG_HAVE_INTEL_ME),) -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_ME_FLAGS) u-boot.tmp; -endif -cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp; -cmd_ifdtool += mv u-boot.tmp $@ - refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE $(call if_changed,copy) @@ -1106,7 +1067,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) - $(call if_changed,ifdtool) + $(call if_changed,binman) OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec u-boot-x86-16bit.bin: u-boot FORCE diff --git a/arch/x86/dts/emulation-u-boot.dtsi b/arch/x86/dts/emulation-u-boot.dtsi new file mode 100644 index 0000000..56d34af --- /dev/null +++ b/arch/x86/dts/emulation-u-boot.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2016 Google, Inc + * Written by Simon Glass + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +#ifdef CONFIG_ROM_SIZE +/ { + binman { + u-boot-with-ucode-ptr { + optional-ucode; + }; + }; +}; +#endif diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi new file mode 100644 index 0000000..724913f --- /dev/null +++ b/arch/x86/dts/u-boot.dtsi @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2016 Google, Inc + * Written by Simon Glass + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +#ifdef CONFIG_ROM_SIZE +/ { + binman { + filename = "u-boot.rom"; + end-at-4gb; + sort-by-pos; + pad-byte = <0xff>; + size = ; +#ifdef CONFIG_HAVE_INTEL_ME + intel-descriptor { + }; + intel-me { + }; +#endif + u-boot-with-ucode-ptr { + pos = ; + }; + u-boot-dtb-with-ucode { + }; + u-boot-ucode { + align = <16>; + }; +#ifdef CONFIG_HAVE_MRC + intel-mrc { + pos = ; + }; +#endif +#ifdef CONFIG_HAVE_FSP + intel-fsp { + pos = ; + }; +#endif +#ifdef CONFIG_HAVE_CMC + intel-cmc { + pos = ; + }; +#endif +#ifdef CONFIG_HAVE_VGA_BIOS + intel-vga { + pos = ; + }; +#endif +#ifdef CONFIG_HAVE_REFCODE + intel-refcode { + pos = ; + }; +#endif + x86-start16 { + pos = ; + }; + }; +}; +#endif