From patchwork Sat Sep 12 21:35:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1362926 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.a=rsa-sha256 header.s=fm3 header.b=jumRZ3Eg; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=ir0uIX33; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BpmD31cyKz9sSP for ; Sun, 13 Sep 2020 07:36:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7AB9782323; Sat, 12 Sep 2020 23:35:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org 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=sholland.org header.i=@sholland.org header.b="jumRZ3Eg"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ir0uIX33"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 77129822FB; Sat, 12 Sep 2020 23:35:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D5799822D7 for ; Sat, 12 Sep 2020 23:35:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9BC2F5C0100; Sat, 12 Sep 2020 17:35:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 12 Sep 2020 17:35:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=07PtDvK3mZb8U Mps7Mt0AIo6cHewGfYNoZi0FMDAUnQ=; b=jumRZ3Eg1xtsZ0LejJhUe7JI1D2zu aaYRQlp/MvvLq2IvrBKYJMZdEFqj7Asn/D/V5JOKC+Ms3ca/N6mR8O4DXf6Un4/U 9pn+itXKXlA+4WSnIAxNwWexZz+1v+gYEfNXX6mXtQnD5ZJ1gps2UYyRLaIeRKWK 855i8fHwY+zlr2QooW+8SOdowZf8ePZSr8xwvTyj6DBYsUQ2rYkGJpb6EPkH3IVg IMJIqTDN2k6YuHER04d9bUdhNYrnUp8+XpH3bJiXP/SvzepQ6Qmk9sY21t+pObju 7WYk6pxZwsWqFE9+OgQQ1zCtSLzhwIz9BAzGk4Dg/SP2kVgkBRHezZDOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=07PtDvK3mZb8UMps7Mt0AIo6cHewGfYNoZi0FMDAUnQ=; b=ir0uIX33 xm1sZGDRgsabvZJw1xHyZDez7foSL5FI4Ccht5xtig0JYONXkmxp6trTfWQvZzBK ql1a1ddPjXP7p46KtWSTtuTtSrnGdBebtPkwuOaaImBqsTibByqLpY9RZomuKIUN L+ez8LIFQ/r+2stnczim8HoehFAbAgPPbz2fSqR6AeF8sYii6WFAGQ/aDUqA5cYC dicEseNxWDpvcBM/Hmi/QLJVijSwI0fba39R1nTGajKndjiOMT5Z5xkk25cO1q2F GBaGH8WsqYm4g7rOzrWgnUHXLdYWnSlT4NBRxdYh0fjMPFwk7PQ2ZVzcJQLJrq1x AHHG8kUPHeUjZQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeiuddgudeigecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheej vdfgjeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgr nhgurdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 12772328005A; Sat, 12 Sep 2020 17:35:49 -0400 (EDT) From: Samuel Holland To: Simon Glass , Jagan Teki , Maxime Ripard , Hans de Goede , Bin Meng , Kever Yang , Heinrich Schuchardt , Andre Przywara Cc: u-boot@lists.denx.de, Samuel Holland Subject: [PATCH v4 8/9] binman: Add support for SCP firmware Date: Sat, 12 Sep 2020 16:35:44 -0500 Message-Id: <20200912213545.64376-9-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200912213545.64376-1-samuel@sholland.org> References: <20200912213545.64376-1-samuel@sholland.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Add an entry type for a firmware blob for a Sytem Control Processor, given by an entry arg. This firmware is a raw binary blob. Signed-off-by: Samuel Holland Reviewed-by: Simon Glass --- Makefile | 2 +- tools/binman/etype/scp.py | 19 +++++++++++++++++++ tools/binman/ftest.py | 7 +++++++ tools/binman/test/172_scp.dts | 16 ++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tools/binman/etype/scp.py create mode 100644 tools/binman/test/172_scp.dts diff --git a/Makefile b/Makefile index d5aa8605c0a..5a6681f129e 100644 --- a/Makefile +++ b/Makefile @@ -1328,7 +1328,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ build -u -d u-boot.dtb -O . -m --allow-missing \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \ - -a atf-bl31-path=${BL31} \ + -a atf-bl31-path=${BL31} -a scp-path=${SCP} \ $(BINMAN_$(@F)) OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex diff --git a/tools/binman/etype/scp.py b/tools/binman/etype/scp.py new file mode 100644 index 00000000000..93f8787d2d7 --- /dev/null +++ b/tools/binman/etype/scp.py @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2020 Samuel Holland +# +# Entry-type module for System Control Processor (SCP) firmware blob +# + +from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg + +class Entry_scp(Entry_blob_named_by_arg): + """Entry containing a System Control Processor (SCP) firmware blob + + Properties / Entry arguments: + - scp-path: Filename of file to read into the entry, typically scp.bin + + This entry holds firmware for an external platform-specific coprocessor. + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node, 'scp') + self.external = True diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 78d0e9c2b93..72e738913eb 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -75,6 +75,7 @@ FSP_M_DATA = b'fsp_m' FSP_S_DATA = b'fsp_s' FSP_T_DATA = b'fsp_t' ATF_BL31_DATA = b'bl31' +SCP_DATA = b'scp' TEST_FDT1_DATA = b'fdt1' TEST_FDT2_DATA = b'test-fdt2' @@ -174,6 +175,7 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('compress', COMPRESS_DATA) TestFunctional._MakeInputFile('bl31.bin', ATF_BL31_DATA) + TestFunctional._MakeInputFile('scp.bin', SCP_DATA) # Add a few .dtb files for testing TestFunctional._MakeInputFile('%s/test-fdt1.dtb' % TEST_FDT_SUBDIR, @@ -3575,6 +3577,11 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('169_atf_bl31.dts') self.assertEqual(ATF_BL31_DATA, data[:len(ATF_BL31_DATA)]) + def testPackScp(self): + """Test that an image with an SCP binary can be created""" + data = self._DoReadFile('172_scp.dts') + self.assertEqual(SCP_DATA, data[:len(SCP_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/172_scp.dts b/tools/binman/test/172_scp.dts new file mode 100644 index 00000000000..354e4ef17df --- /dev/null +++ b/tools/binman/test/172_scp.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + scp { + filename = "scp.bin"; + }; + }; +};