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 8CE94C636CC for ; Thu, 16 Feb 2023 07:51:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AC1F685AC9; Thu, 16 Feb 2023 08:51:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id F3E5985AC9; Thu, 16 Feb 2023 08:51:04 +0100 (CET) Received: from mail-m11874.qiye.163.com (mail-m11874.qiye.163.com [115.236.118.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5953285AC2 for ; Thu, 16 Feb 2023 08:51:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [172.16.12.93] (unknown [58.22.7.114]) by mail-m11874.qiye.163.com (Hmail) with ESMTPA id A3DD23C021F; Thu, 16 Feb 2023 15:50:45 +0800 (CST) Message-ID: <133f1466-1766-a2f0-be91-53dc539856e6@rock-chips.com> Date: Thu, 16 Feb 2023 15:50:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2 1/6] binman: Add support for a rockchip-tpl entry Content-Language: en-US To: Jonas Karlman , Simon Glass , Philipp Tomsich , Joseph Chen , Alper Nebi Yasak Cc: Quentin Schulz , Jagan Teki , Heinrich Schuchardt , u-boot@lists.denx.de References: <20230205202116.2891673-1-jonas@kwiboo.se> <20230214103300.690542-1-jonas@kwiboo.se> <20230214103300.690542-2-jonas@kwiboo.se> From: Kever Yang In-Reply-To: <20230214103300.690542-2-jonas@kwiboo.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQk0eSlZIGUtIS00YGh8dQx1VEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSkpLSEpMVUpLS1VLWQ Y+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Ogw6SAw*AT0RLhESNy8iD09K PwoKCTdVSlVKTUxNTkhIQ09NTUtCVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFMT05LNwY+ X-HM-Tid: 0a8659344f942eb0kusna3dd23c021f 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 On 2023/2/14 18:33, Jonas Karlman wrote: > The rockchip-tpl entry can be used when an external TPL binary should be > used instead of the normal U-Boot TPL. > > Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang Thanks, - Kever > --- > v2: > - rename external-tpl to rockchip-tpl > - missing message moved to this patch > > tools/binman/entries.rst | 14 ++++++++++++++ > tools/binman/etype/rockchip_tpl.py | 20 ++++++++++++++++++++ > tools/binman/ftest.py | 7 +++++++ > tools/binman/missing-blob-help | 5 +++++ > tools/binman/test/277_rockchip_tpl.dts | 16 ++++++++++++++++ > 5 files changed, 62 insertions(+) > create mode 100644 tools/binman/etype/rockchip_tpl.py > create mode 100644 tools/binman/test/277_rockchip_tpl.dts > > diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst > index 7a04a613992d..e177860a6a82 100644 > --- a/tools/binman/entries.rst > +++ b/tools/binman/entries.rst > @@ -1386,6 +1386,20 @@ For example, this creates an image with a pre-load header and a binary:: > > > > +.. _etype_rockchip_tpl: > + > +Entry: rockchip-tpl: Rockchip TPL binary > +---------------------------------------- > + > +Properties / Entry arguments: > + - rockchip-tpl-path: Filename of file to read into the entry, > + typically _ddr_.bin > + > +This entry holds an external TPL binary used by some Rockchip SoCs > +instead of normal U-Boot TPL, typically to initialize DRAM. > + > + > + > .. _etype_scp: > > Entry: scp: System Control Processor (SCP) firmware blob > diff --git a/tools/binman/etype/rockchip_tpl.py b/tools/binman/etype/rockchip_tpl.py > new file mode 100644 > index 000000000000..74f58ba8570c > --- /dev/null > +++ b/tools/binman/etype/rockchip_tpl.py > @@ -0,0 +1,20 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# > +# Entry-type module for Rockchip TPL binary > +# > + > +from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg > + > +class Entry_rockchip_tpl(Entry_blob_named_by_arg): > + """Rockchip TPL binary > + > + Properties / Entry arguments: > + - rockchip-tpl-path: Filename of file to read into the entry, > + typically _ddr_.bin > + > + This entry holds an external TPL binary used by some Rockchip SoCs > + instead of normal U-Boot TPL, typically to initialize DRAM. > + """ > + def __init__(self, section, etype, node): > + super().__init__(section, etype, node, 'rockchip-tpl') > + self.external = True > diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py > index 062f54adb0ed..ed4b5c987557 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' > +ROCKCHIP_TPL_DATA = b'rockchip-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('rockchip-tpl.bin', ROCKCHIP_TPL_DATA) > > # Add a few .dtb files for testing > TestFunctional._MakeInputFile('%s/test-fdt1.dtb' % TEST_FDT_SUBDIR, > @@ -4097,6 +4099,11 @@ class TestFunctional(unittest.TestCase): > data = self._DoReadFile('172_scp.dts') > self.assertEqual(SCP_DATA, data[:len(SCP_DATA)]) > > + def testPackRockchipTpl(self): > + """Test that an image with a Rockchip TPL binary can be created""" > + data = self._DoReadFile('277_rockchip_tpl.dts') > + self.assertEqual(ROCKCHIP_TPL_DATA, data[:len(ROCKCHIP_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/missing-blob-help b/tools/binman/missing-blob-help > index c61ca02a35ee..e8c991206fe5 100644 > --- a/tools/binman/missing-blob-help > +++ b/tools/binman/missing-blob-help > @@ -34,6 +34,11 @@ If CONFIG_WDT_K3_RTI_LOAD_FW is enabled, a firmware image is needed for > the R5F core(s) to trigger the system reset. One possible source is > https://github.com/siemens/k3-rti-wdt. > > +rockchip-tpl: > +An external TPL is required to initialize DRAM. Get the external TPL > +binary and build with ROCKCHIP_TPL=/path/to/ddr.bin. One possible source > +for the external TPL binary is https://github.com/rockchip-linux/rkbin. > + > tee-os: > See the documentation for your board. You may need to build Open Portable > Trusted Execution Environment (OP-TEE) with TEE=/path/to/tee.bin > diff --git a/tools/binman/test/277_rockchip_tpl.dts b/tools/binman/test/277_rockchip_tpl.dts > new file mode 100644 > index 000000000000..269f56e2545c > --- /dev/null > +++ b/tools/binman/test/277_rockchip_tpl.dts > @@ -0,0 +1,16 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/dts-v1/; > + > +/ { > + #address-cells = <1>; > + #size-cells = <1>; > + > + binman { > + size = <16>; > + > + rockchip-tpl { > + filename = "rockchip-tpl.bin"; > + }; > + }; > +};