From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06223C636CC for ; Sun, 5 Feb 2023 20:21:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 109D585824; Sun, 5 Feb 2023 21:21:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="PkejUzRh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C17585347; Sun, 5 Feb 2023 21:21:25 +0100 (CET) Received: from xvfrqvdb.outbound-mail.sendgrid.net (xvfrqvdb.outbound-mail.sendgrid.net [168.245.72.219]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 885FD85348 for ; Sun, 5 Feb 2023 21:21:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=uAhDY7HDAG2WTAWM16LkGCo/T/s9e9Fx28kcsHtHu4w=; b=PkejUzRhopQTbk8VD9pnJWgbXkPlwbc9JJBgWPfye5ej6UOWadkkK0yc7tkjiUEIZ6Ox ULl2IjZahjWM8cgAFsHvtmbxIQaOFtW+Dhwg6KW+8s+SM8R0hXEFhmhjiJb2DH1qcJ4ePt oY57Lu2XSw9nH6oI/nGRWuc2b8BVd5M9TfYQ1F2DXwhUTdrv7O53tLbZlxoQYWF/4O9GIr 48Fu115+5BkiiGCpUoTAm2mR+lgesutYKiEWfLCClsTmINSDW4ri8uMKuHnIlXz5+MP3iw sglKG9XFRsof6uRoqmOmo5w0qox2U5CtuNCBfK3J8FrIlfNdh/lsdMzsbQxEzSpw== Received: by filterdrecv-6b9548745c-b6qpv with SMTP id filterdrecv-6b9548745c-b6qpv-1-63E00FC1-3 2023-02-05 20:21:21.129562344 +0000 UTC m=+6901984.615188354 Received: from bionic.localdomain (unknown) by geopod-ismtpd-5-2 (SG) with ESMTP id bTotQ4_SRGWU56Bm6PaLNw Sun, 05 Feb 2023 20:21:20.946 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 1/3] binman: Add support for an external-tpl entry Date: Sun, 05 Feb 2023 20:21:21 +0000 (UTC) Message-Id: <20230205202116.2891673-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230205202116.2891673-1-jonas@kwiboo.se> References: <20230205202116.2891673-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h3ONf+X8bFyr1spBu?= =?us-ascii?Q?GJkZcIu9cXNqlANtWR5zxFWaKDkOI=2FRhePDUXie?= =?us-ascii?Q?Rw=2F948c0fqah34JC0nr3hIKld8WBTN6wRkPI12N?= =?us-ascii?Q?nbpKnDNu0Wggp6dip8Xoxhl2LY=2F1uxr=2FJmGiU51?= =?us-ascii?Q?NxAn9fxEpoaKrLiX7mdK54yiZsPKV6V7X5=2Fw3A?= To: Simon Glass , Philipp Tomsich , Kever Yang , Joseph Chen , Alper Nebi Yasak Cc: Quentin Schulz , Jagan Teki , Heinrich Schuchardt , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The external-tpl entry can be used when an external TPL binary must be used instead of normal U-Boot TPL. Signed-off-by: Jonas Karlman --- tools/binman/entries.rst | 12 ++++++++++++ tools/binman/etype/external_tpl.py | 18 ++++++++++++++++++ tools/binman/ftest.py | 7 +++++++ tools/binman/test/277_external_tpl.dts | 16 ++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 tools/binman/etype/external_tpl.py create mode 100644 tools/binman/test/277_external_tpl.dts diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index 7a04a613992d..95317271bb74 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -468,6 +468,18 @@ updating the EC on startup via software sync. +.. _etype_external_tpl: + +Entry: external-tpl: External TPL binary +---------------------------------------- + +Properties / Entry arguments: + - external-tpl-path: Filename of file to read into the entry. + +This entry holds an external TPL binary. + + + .. _etype_fdtmap: Entry: fdtmap: An entry which contains an FDT map diff --git a/tools/binman/etype/external_tpl.py b/tools/binman/etype/external_tpl.py new file mode 100644 index 000000000000..50562914711e --- /dev/null +++ b/tools/binman/etype/external_tpl.py @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Entry-type module for external TPL binary +# + +from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg + +class Entry_external_tpl(Entry_blob_named_by_arg): + """External TPL binary + + Properties / Entry arguments: + - external-tpl-path: Filename of file to read into the entry. + + This entry holds an external TPL binary. + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node, 'external-tpl') + self.external = True diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 6b203dfb644f..2446122eea29 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -90,6 +90,7 @@ TEE_OS_DATA = b'this is some tee OS data' ATF_BL2U_DATA = b'bl2u' OPENSBI_DATA = b'opensbi' SCP_DATA = b'scp' +EXTERNAL_TPL_DATA = b'external-tpl' TEST_FDT1_DATA = b'fdt1' TEST_FDT2_DATA = b'test-fdt2' ENV_DATA = b'var1=1\nvar2="2"' @@ -205,6 +206,7 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('bl2u.bin', ATF_BL2U_DATA) TestFunctional._MakeInputFile('fw_dynamic.bin', OPENSBI_DATA) TestFunctional._MakeInputFile('scp.bin', SCP_DATA) + TestFunctional._MakeInputFile('external-tpl.bin', EXTERNAL_TPL_DATA) # Add a few .dtb files for testing TestFunctional._MakeInputFile('%s/test-fdt1.dtb' % TEST_FDT_SUBDIR, @@ -4103,6 +4105,11 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('172_scp.dts') self.assertEqual(SCP_DATA, data[:len(SCP_DATA)]) + def testPackExternalTpl(self): + """Test that an image with an external TPL binary can be created""" + data = self._DoReadFile('277_external_tpl.dts') + self.assertEqual(EXTERNAL_TPL_DATA, data[:len(EXTERNAL_TPL_DATA)]) + def testFitFdt(self): """Test an image with an FIT with multiple FDT images""" def _CheckFdt(seq, expected_data): diff --git a/tools/binman/test/277_external_tpl.dts b/tools/binman/test/277_external_tpl.dts new file mode 100644 index 000000000000..99899771ea7c --- /dev/null +++ b/tools/binman/test/277_external_tpl.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + external-tpl { + filename = "external-tpl.bin"; + }; + }; +}; -- 2.39.1