From patchwork Sat Nov 26 03:15:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 699452 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 3tQdRr5MSmz9sD6 for ; Sat, 26 Nov 2016 14:18:00 +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="LFfZ+AWu"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A37BEA7580; Sat, 26 Nov 2016 04:17:24 +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 Sp6LkEu0F4HA; Sat, 26 Nov 2016 04:17:24 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD732B3850; Sat, 26 Nov 2016 04:16:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E132A75B4 for ; Sat, 26 Nov 2016 04:16:26 +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 E_szjaXRX61e for ; Sat, 26 Nov 2016 04:16:26 +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-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by theia.denx.de (Postfix) with ESMTPS id 0E670A7564 for ; Sat, 26 Nov 2016 04:16:17 +0100 (CET) Received: by mail-oi0-f54.google.com with SMTP id v84so98128441oie.3 for ; Fri, 25 Nov 2016 19:16:17 -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=xJbyT2L/t/knSW1OSOnBG9IxLNG+4BaqAja0QldItwA=; b=LFfZ+AWuJobG6RtAu2zE1WIRuA9KLFe6M+7vR3mkQF58t/5HD7Deuk8qxAFipRvcbp Sd4raUW86PjFeqgtQCzQF7V+Bld4BrXGmx9AOsEonyFMXufsa+eDKRVtvxMU7anQE8Ql eulQwxl0X5niXmYYpeqZ0Jm512qewE5B6yC4lfqbFYSOslXj0lT0n8dM5BBBOaLmiqcw rrpimjCd5+T/acrUeu23kqNH4jzKgczMj73uVMff5C9RoZB4s+yGto7Ma6ngbYaLcAKn KqWg3euwt7Ye0eB3idY6omipNVL49Xt2LYB0/QVR1ehimkV7xfs/KSClBx5mSr9+7oAn 4IpA== 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=xJbyT2L/t/knSW1OSOnBG9IxLNG+4BaqAja0QldItwA=; b=Wo8gOxb1auEhltFAEDvv8MwuluDvyrUEEEGC1B2AZKjftASxdiRqGtvMKuFt/9R2Sn dtRB/h9wO1ewGwhq+vbnIG3T/urye/+9uHeaaWAp7jpYZ1z76hysDcOyYvIAx8t6vSz+ smaRtP1DgRPEGVaJhovZGnv1WKMvI6AXWo+WNAASeGNG+b72p/DZ9Ft4AlSsvYsuaksE 5BgczGQvND06viGEYpwlGPLoGrlXut5ssvqb9/JffWcAFs28Yu8ueqvk0CRE80yADIgW YRTOgJeO8RNNV1PmxzYgIPpE6H2bT0GaXDYuey1dAMWW73mgwbmA6i9ggYx7LtpLd8Rl HF/A== X-Gm-Message-State: AKaTC03EaZqQpI4pGtynu47oV8orRlFrD1x9JgzKY+3NqkH1b4q1RxjYo9ZB7PIl0/bXyTH1 X-Received: by 10.202.79.203 with SMTP id d194mr5811859oib.46.1480130175937; Fri, 25 Nov 2016 19:16:15 -0800 (PST) Received: from kaki.bld.corp.google.com ([2620:0:10f2:12:f124:5c32:c68:92db]) by smtp.gmail.com with ESMTPSA id q59sm14162384ota.20.2016.11.25.19.16.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2016 19:16:15 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id EC6564039C; Fri, 25 Nov 2016 20:16:14 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 25 Nov 2016 20:15:56 -0700 Message-Id: <1480130164-15709-7-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 06/13] binman: Add support for building x86 images with FSP/CMC 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" Add support for two more from the inexhaustible supply of x86 binary blob types. Signed-off-by: Simon Glass Tested-by: Bin Meng --- Changes in v6: None Changes in v5: None Changes in v4: - Add new patch to support building x86 images with FSP/CMC Changes in v3: None Changes in v2: None tools/binman/etype/intel_cmc.py | 17 +++++++++++++++++ tools/binman/etype/intel_fsp.py | 17 +++++++++++++++++ tools/binman/func_test.py | 14 ++++++++++++++ tools/binman/test/42_intel-fsp.dts | 13 +++++++++++++ tools/binman/test/43_intel-cmc.dts | 13 +++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 tools/binman/etype/intel_cmc.py create mode 100644 tools/binman/etype/intel_fsp.py create mode 100644 tools/binman/test/42_intel-fsp.dts create mode 100644 tools/binman/test/43_intel-cmc.dts diff --git a/tools/binman/etype/intel_cmc.py b/tools/binman/etype/intel_cmc.py new file mode 100644 index 0000000..9bce8ae --- /dev/null +++ b/tools/binman/etype/intel_cmc.py @@ -0,0 +1,17 @@ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Entry-type module for Intel Chip Microcode binary blob +# + +from entry import Entry +from blob import Entry_blob + +class Entry_intel_cmc(Entry_blob): + def __init__(self, image, etype, node): + Entry_blob.__init__(self, image, etype, node) + + def GetDefaultFilename(self): + return 'cmc.bin' diff --git a/tools/binman/etype/intel_fsp.py b/tools/binman/etype/intel_fsp.py new file mode 100644 index 0000000..d75be5b --- /dev/null +++ b/tools/binman/etype/intel_fsp.py @@ -0,0 +1,17 @@ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Entry-type module for Intel Firmware Support Package binary blob +# + +from entry import Entry +from blob import Entry_blob + +class Entry_intel_fsp(Entry_blob): + def __init__(self, image, etype, node): + Entry_blob.__init__(self, image, etype, node) + + def GetDefaultFilename(self): + return 'fsp.bin' diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py index cb8bd31..740fa9e 100644 --- a/tools/binman/func_test.py +++ b/tools/binman/func_test.py @@ -36,6 +36,8 @@ VGA_DATA = 'vga' U_BOOT_DTB_DATA = 'udtb' X86_START16_DATA = 'start16' U_BOOT_NODTB_DATA = 'nodtb with microcode pointer somewhere in here' +FSP_DATA = 'fsp' +CMC_DATA = 'cmc' class TestFunctional(unittest.TestCase): """Functional tests for binman @@ -70,6 +72,8 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA) TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA) TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA) + TestFunctional._MakeInputFile('fsp.bin', FSP_DATA) + TestFunctional._MakeInputFile('cmc.bin', CMC_DATA) self._output_setup = False # ELF file with a '_dt_ucode_base_size' symbol @@ -806,3 +810,13 @@ class TestFunctional(unittest.TestCase): self._DoReadFile('41_unknown_pos_size.dts', True) self.assertIn("Image '/binman': Unable to set pos/size for unknown " "entry 'invalid-entry'", str(e.exception)) + + def testPackFsp(self): + """Test that an image with a FSP binary can be created""" + data = self._DoReadFile('42_intel-fsp.dts') + self.assertEqual(FSP_DATA, data[:len(FSP_DATA)]) + + def testPackCmc(self): + """Test that an image with a FSP binary can be created""" + data = self._DoReadFile('43_intel-cmc.dts') + self.assertEqual(CMC_DATA, data[:len(CMC_DATA)]) diff --git a/tools/binman/test/42_intel-fsp.dts b/tools/binman/test/42_intel-fsp.dts new file mode 100644 index 0000000..e0a1e76 --- /dev/null +++ b/tools/binman/test/42_intel-fsp.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + intel-fsp { + }; + }; +}; diff --git a/tools/binman/test/43_intel-cmc.dts b/tools/binman/test/43_intel-cmc.dts new file mode 100644 index 0000000..26c456d --- /dev/null +++ b/tools/binman/test/43_intel-cmc.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + intel-cmc { + }; + }; +};