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 84499C43334 for ; Fri, 1 Jul 2022 19:09:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38FAF8448C; Fri, 1 Jul 2022 21:09:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="NqRBBP5d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B68FF8448C; Fri, 1 Jul 2022 21:09:33 +0200 (CEST) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 AB3008449C for ; Fri, 1 Jul 2022 21:09:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ej1-x629.google.com with SMTP id o25so5685826ejm.3 for ; Fri, 01 Jul 2022 12:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=JHfalTScUC5AXanSwfmi0LbWUr/LYm7yBE6W2JkEjKw=; b=NqRBBP5dbjjavaxtmn05Nqw2u80ET9uWB1COm9UJgUDKEzUDda7WzYo40qR3ZqcnXf 9Z66F1SRMKT3Gfvp66eBYDs2SJ9jFOqBTRnRzSFDzVY8ZNmHYfsO6i/Y0nTkeyQDqxxB F+eaD3yawNSN5gtDlpeKyDM742hvkfDyeZWGnrJpccGZgSZHO3gWW7ZaEf7UVYY1foTu e2qwLs3sV8dFN792Cbkf+Sus2b20DkO/CZPKkjzKOeUkW596blIUV20dHa9Bhk9VxNzV Ycg8OvG2M3iQTpaHSy9XnXX3S9Y9EvszwwladE6hc5xHcLXfCJZ4A/56o6Qc6rP8LyV2 HnWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=JHfalTScUC5AXanSwfmi0LbWUr/LYm7yBE6W2JkEjKw=; b=a7Cch72hV1K4VtYg/tkehpntvGD3VgmmyU2lK5qIr0LbzBMnKdlamEDqMgn/Zkm74w qigoMoYkxDKTnIVu9Yer+NudntUglDJSu3qjTh3Oo41hRKVwfnmsVsQUT4OYhfiO+S/x 2ZKrFV6R4Do0aC24fwG+zzVSrv/fe9tDq8B6IIRMcpqH5wdy6/p8075oUe4JlB+Sil6p JtgiEOqZ03NRupgmELWMpTDDl0Jx+v+edhmK2/YHNAPVhbqYYpvhQK32Tip9GVIqYQaS E3D27VVMGkwPQIWGSAw2p089Pt2WSWEJbnR0wOkOc1G7yCGUdBnhsTQ53jjavGX9TXLW lpEA== X-Gm-Message-State: AJIora9yMis0kbYXX+MbKnXjJZS+FmYoFs0FQRE9iSM/Dc2+LRWfPM+1 y19AC2crEx//WtN1j9bqj1c= X-Google-Smtp-Source: AGRyM1tKbhfjKOooCxYh5llkyNE2c7WixNFg5OUcsJwjgGE75ZgMqE9amplVpHBqWPLAsAiWTaAQWw== X-Received: by 2002:a17:906:9755:b0:722:f1e3:ec1a with SMTP id o21-20020a170906975500b00722f1e3ec1amr15960184ejy.709.1656702570258; Fri, 01 Jul 2022 12:09:30 -0700 (PDT) Received: from [192.168.0.74] ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id k10-20020a170906970a00b006fea59ef3a5sm10796365ejx.32.2022.07.01.12.09.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jul 2022 12:09:29 -0700 (PDT) Message-ID: <59bce5ab-1973-32e8-4e46-7f15386d1003@gmail.com> Date: Fri, 1 Jul 2022 22:07:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 From: Alper Nebi Yasak Subject: Re: [PATCH RFC v3 03/11] ti: etype: sysfw: Add entry type for sysfw To: Neha Malcom Francis Cc: u-boot@lists.denx.de, afd@ti.com, trini@konsulko.com, rogerq@kernel.org, a-govindraju@ti.com, vigneshr@ti.com References: <20220615064804.29553-1-n-francis@ti.com> <20220615064804.29553-4-n-francis@ti.com> Content-Language: en-US In-Reply-To: <20220615064804.29553-4-n-francis@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 15/06/2022 09:47, Neha Malcom Francis wrote: > For K3 devices that require a sysfw image, add entry for SYSFW. It can > contain system firmware image that can be packaged into sysfw.itb by > binman. > > Signed-off-by: Tarun Sahu > [n-francis@ti.com: added tests for addition of etype] > Signed-off-by: Neha Malcom Francis > --- > Makefile | 1 + > tools/binman/entries.rst | 11 +++++++++++ > tools/binman/etype/ti_sysfw.py | 28 ++++++++++++++++++++++++++++ > tools/binman/ftest.py | 7 +++++++ > tools/binman/test/232_ti_sysfw.dts | 13 +++++++++++++ > 5 files changed, 60 insertions(+) > create mode 100644 tools/binman/etype/ti_sysfw.py > create mode 100644 tools/binman/test/232_ti_sysfw.dts Reviewed-by: Alper Nebi Yasak Minor points below. > diff --git a/Makefile b/Makefile > index 61927f8918..d20d264c53 100644 > --- a/Makefile > +++ b/Makefile > @@ -1345,6 +1345,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ > -a opensbi-path=${OPENSBI} \ > -a default-dt=$(default_dt) \ > -a scp-path=$(SCP) \ > + -a ti-sysfw-path=$(SYSFW) \ > -a spl-bss-pad=$(if $(CONFIG_SPL_SEPARATE_BSS),,1) \ > -a tpl-bss-pad=$(if $(CONFIG_TPL_SEPARATE_BSS),,1) \ > -a spl-dtb=$(CONFIG_SPL_OF_REAL) \ > diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst > index ae4305c99e..9fc5c48c35 100644 > --- a/tools/binman/entries.rst > +++ b/tools/binman/entries.rst > @@ -1203,6 +1203,17 @@ This entry holds firmware for an external platform-specific coprocessor. > > > > +Entry: ti-sysfw: Texas Instruments System Firmware (SYSFW) blob > +------------------------------------------------------------ > + > +Properties / Entry arguments: > + - ti-sysfw-path: Filename of file to read into the entry, typically sysfw.bin > + > +This entry contains system firmware necessary for booting of K3 architecture > +devices. > + > + > + Regenerate these with `binman entry-docs >tools/binman/entries.rst` for all your new entry types. > Entry: section: Entry that contains other entries > ------------------------------------------------- > > diff --git a/tools/binman/etype/ti_sysfw.py b/tools/binman/etype/ti_sysfw.py > new file mode 100644 > index 0000000000..5b5b307030 > --- /dev/null > +++ b/tools/binman/etype/ti_sysfw.py > @@ -0,0 +1,28 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ > +# > +# Entry type module for TI SYSFW binary blob > +# > + > +import os > +import struct > +import sys > +import zlib > + > +from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg > +from dtoc import fdt_util > +from patman import tools Remove unused imports. > + > + > +class Entry_ti_sysfw(Entry_blob_named_by_arg): > + """Entry containing Texas Instruments System Firmware (SYSFW) blob > + > + Properties / Entry arguments: > + - ti-sysfw-path: Filename of file to read into the entry, typically sysfw.bin > + > + This entry contains system firmware necessary for booting of K3 architecture devices. > + """ > + > + def __init__(self, section, etype, node): > + super().__init__(section, etype, node, 'ti-sysfw') > + self.external = True > diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py > index b5cf549703..671d083c54 100644 > --- a/tools/binman/ftest.py > +++ b/tools/binman/ftest.py > @@ -87,6 +87,7 @@ ATF_BL31_DATA = b'bl31' > TEE_OS_DATA = b'this is some tee OS data' > ATF_BL2U_DATA = b'bl2u' > OPENSBI_DATA = b'opensbi' > +TI_SYSFW_DATA = b'sysfw' > SCP_DATA = b'scp' > TEST_FDT1_DATA = b'fdt1' > TEST_FDT2_DATA = b'test-fdt2' > @@ -195,6 +196,7 @@ class TestFunctional(unittest.TestCase): > TestFunctional._MakeInputFile('tee-pager.bin', TEE_OS_DATA) > TestFunctional._MakeInputFile('bl2u.bin', ATF_BL2U_DATA) > TestFunctional._MakeInputFile('fw_dynamic.bin', OPENSBI_DATA) > + TestFunctional._MakeInputFile('sysfw.bin', TI_SYSFW_DATA) > TestFunctional._MakeInputFile('scp.bin', SCP_DATA) > > # Add a few .dtb files for testing > @@ -5529,6 +5531,11 @@ fdt fdtmap Extract the devicetree blob from the fdtmap > """Test an image with a pre-load header with an invalid key""" > with self.assertRaises(ValueError) as e: > data = self._DoReadFile('231_pre_load_invalid_key.dts') > + > + def testPackTiSysfw(self): > + """Test that an image with a SYSFW binary can be created""" > + data = self._DoReadFile('232_ti_sysfw.dts') > + self.assertEqual(TI_SYSFW_DATA, data[:len(TI_SYSFW_DATA)]) > Add new tests to the end of the file, renumber the dts files to be unique. > def _CheckSafeUniqueNames(self, *images): > """Check all entries of given images for unsafe unique names""" > diff --git a/tools/binman/test/232_ti_sysfw.dts b/tools/binman/test/232_ti_sysfw.dts > new file mode 100644 > index 0000000000..9e66cbe77b > --- /dev/null > +++ b/tools/binman/test/232_ti_sysfw.dts > @@ -0,0 +1,13 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/dts-v1/; > + > +/ { > + #address-cells = <1>; > + #size-cells = <1>; > + binman { > + ti-sysfw { > + filename = "sysfw.bin"; > + }; > + }; > +};