From patchwork Mon Jul 8 19:18:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1129302 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JMZ0VGD7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45jG5x5ZZrz9sDB for ; Tue, 9 Jul 2019 05:41:09 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 75520C21E38; Mon, 8 Jul 2019 19:29:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 023A7C21E0F; Mon, 8 Jul 2019 19:21:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B57ADC21E75; Mon, 8 Jul 2019 19:21:24 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id BE8B7C21D65 for ; Mon, 8 Jul 2019 19:21:19 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id o9so22256810iom.3 for ; Mon, 08 Jul 2019 12:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OeQWxWEZ1N1OBg/HUFfXhQQYKnBZ9mvAl1QQhpzYay0=; b=JMZ0VGD7StJKTdtqaOFcGkWpoOs8UsucnMPSZp3Z8CtmIRYjEnM5YjcxfPGpgInUFx TMeqXbba9l5APk+ZITd4SmsQAFykFgsFJiW4QyiHtwmCEQ2G7c+05qhnJZ/hkK1qkbFr JeBlzCYHhGQvg/VcJ08PWxZERdoC85ZzhibX8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OeQWxWEZ1N1OBg/HUFfXhQQYKnBZ9mvAl1QQhpzYay0=; b=GGAd+tl87DrEJQ1nGgbypq2I5hI631SdulOsm9stT8rjE2SvoVaWo89W5LLq88nYnV pXeResx/KPdYza8t1EqlKkEXMSol3EccO4wWQQWHxhrTsJdaUYr2SNQfeyZhxl1c3va3 cNsb/aeCQCYH1L27pWxzPPlBC9Yc4SoWbKuGwvyCObLyJbl2RX3DtCzTMsJmZOvv2KWA 1xLi2ZtWmAAZidmzL41vtk7ZI0RIQF2MwM1BgPb9DHvir4hnWDR830G9n/0JT8LOOxHx IIvunQCgPJPX4q896S3mMgQy3nZA4Em3tcbkCQ2LQyo7bdh6ecZX/F+8dIIhQjMc+D8h 6LLw== X-Gm-Message-State: APjAAAUe/dyp21CcFyi6WTep7f8TE6fwkIu7Il0ygoXM5vniub1mD2or xF754JjGqLZS/XvE12w4wlhvskXA17Q= X-Google-Smtp-Source: APXvYqyChVv2SbBWKSkx1qor1vWZNmoaqoVp2wuEQ3uCyi5wWSuHYiPXrij5Wip/5qYA14SfXNk93Q== X-Received: by 2002:a02:3093:: with SMTP id q141mr23430174jaq.128.1562613678637; Mon, 08 Jul 2019 12:21:18 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id j1sm15545094iop.14.2019.07.08.12.21.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 12:21:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 8 Jul 2019 13:18:46 -0600 Message-Id: <20190708191856.138863-28-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190708191856.138863-1-sjg@chromium.org> References: <20190708191856.138863-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 27/37] binman: Support ELF files for TPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We currenty support using the ELF file in U-Boot proper and SPL, but not TPL. Add this as it is useful both with sandbox and for CBFS to allow adding TPL as a 'stage'. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v2: None tools/binman/README.entries | 11 +++++++++++ tools/binman/etype/u_boot_tpl_elf.py | 24 ++++++++++++++++++++++++ tools/binman/ftest.py | 2 ++ tools/binman/test/096_elf.dts | 2 ++ 4 files changed, 39 insertions(+) create mode 100644 tools/binman/etype/u_boot_tpl_elf.py diff --git a/tools/binman/README.entries b/tools/binman/README.entries index c26addcfe64..9a316763ace 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -574,6 +574,17 @@ process. +Entry: u-boot-tpl-elf: U-Boot TPL ELF image +------------------------------------------- + +Properties / Entry arguments: + - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl') + +This is the U-Boot TPL ELF image. It does not include a device tree but can +be relocated to any address for execution. + + + Entry: u-boot-tpl-with-ucode-ptr: U-Boot TPL with embedded microcode pointer ---------------------------------------------------------------------------- diff --git a/tools/binman/etype/u_boot_tpl_elf.py b/tools/binman/etype/u_boot_tpl_elf.py new file mode 100644 index 00000000000..9cc1cc2c450 --- /dev/null +++ b/tools/binman/etype/u_boot_tpl_elf.py @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2018 Google, Inc +# Written by Simon Glass +# +# Entry-type module for U-Boot TPL ELF image +# + +from entry import Entry +from blob import Entry_blob + +class Entry_u_boot_tpl_elf(Entry_blob): + """U-Boot TPL ELF image + + Properties / Entry arguments: + - filename: Filename of TPL u-boot (default 'tpl/u-boot-tpl') + + This is the U-Boot TPL ELF image. It does not include a device tree but can + be relocated to any address for execution. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) + + def GetDefaultFilename(self): + return 'tpl/u-boot-tpl' diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 6ff871b3c16..9cec5f42fa3 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1745,6 +1745,8 @@ class TestFunctional(unittest.TestCase): def testElf(self): """Basic test of ELF entries""" self._SetupSplElf() + with open(self.TestFile('bss_data'), 'rb') as fd: + TestFunctional._MakeInputFile('tpl/u-boot-tpl', fd.read()) with open(self.TestFile('bss_data'), 'rb') as fd: TestFunctional._MakeInputFile('-boot', fd.read()) data = self._DoReadFile('096_elf.dts') diff --git a/tools/binman/test/096_elf.dts b/tools/binman/test/096_elf.dts index df3440c3194..8e3f3f15ef0 100644 --- a/tools/binman/test/096_elf.dts +++ b/tools/binman/test/096_elf.dts @@ -10,5 +10,7 @@ }; u-boot-spl-elf { }; + u-boot-tpl-elf { + }; }; };