public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
To: Neha Malcom Francis <n-francis@ti.com>
Cc: u-boot@lists.denx.de, afd@ti.com, trini@konsulko.com,
	rogerq@kernel.org, a-govindraju@ti.com, vigneshr@ti.com
Subject: Re: [PATCH RFC v3 03/11] ti: etype: sysfw: Add entry type for sysfw
Date: Fri, 1 Jul 2022 22:07:28 +0300	[thread overview]
Message-ID: <59bce5ab-1973-32e8-4e46-7f15386d1003@gmail.com> (raw)
In-Reply-To: <20220615064804.29553-4-n-francis@ti.com>

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 <t-sahu@ti.com>
> [n-francis@ti.com: added tests for addition of etype]
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
>  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 <alpernebiyasak@gmail.com>

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";
> +		};
> +	};
> +};

  parent reply	other threads:[~2022-07-01 19:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  6:47 [PATCH RFC v3 00/11] Integration of tiboot3.bin, sysfw.itb and Neha Malcom Francis
2022-06-15  6:47 ` [PATCH RFC v3 01/11] j721e_evm: schema: yaml: Add general schema and J721E board config files Neha Malcom Francis
2022-06-15  6:47 ` [PATCH RFC v3 02/11] ti: tools: config: Add board config class to generate config binaries Neha Malcom Francis
2022-07-01 19:07   ` Alper Nebi Yasak
2022-06-15  6:47 ` [PATCH RFC v3 03/11] ti: etype: sysfw: Add entry type for sysfw Neha Malcom Francis
2022-06-15 15:37   ` Andrew Davis
2022-06-16 11:23     ` Neha Malcom Francis
2022-07-01 19:07   ` Alper Nebi Yasak [this message]
2022-06-15  6:47 ` [PATCH RFC v3 04/11] ti: etype: dm: Add entry type for TI DM Neha Malcom Francis
2022-07-01 19:07   ` Alper Nebi Yasak
2022-06-15  6:47 ` [PATCH RFC v3 05/11] ti: etype: x509: Add etype for x509 certificate for K3 devices Neha Malcom Francis
2022-07-01 19:07   ` Alper Nebi Yasak
2022-06-15  6:47 ` [PATCH RFC v3 06/11] ti: sysfw: Add support for packaging sysfw.itb Neha Malcom Francis
2022-06-15  6:48 ` [PATCH RFC v3 07/11] ti: j721e: Exclude makefile tiboot3.bin target for J721E Neha Malcom Francis
2022-06-15  6:48 ` [PATCH RFC v3 08/11] ti: j721e: Exclude makefile tispl.bin " Neha Malcom Francis
2022-06-15 13:44   ` Roger Quadros
2022-06-16 11:09     ` Neha Malcom Francis
2022-06-15  6:48 ` [PATCH RFC v3 09/11] ti: dtsi: j721e: Use binman to package sysfw.itb and tiboot3.bin Neha Malcom Francis
2022-07-01 19:07   ` Alper Nebi Yasak
2022-06-15  6:48 ` [PATCH RFC v3 10/11] ti: dtsi: j721e: Use binman to package tispl.bin Neha Malcom Francis
2022-06-15 14:25   ` Roger Quadros
2022-06-15 14:29   ` Roger Quadros
2022-07-01 19:08   ` Alper Nebi Yasak
2022-06-15  6:48 ` [PATCH RFC v3 11/11] ci: world_build: test: Add requirements.txt Neha Malcom Francis
2022-07-01 19:09   ` Alper Nebi Yasak
2022-07-01 19:07 ` [PATCH RFC v3 00/11] Integration of tiboot3.bin, sysfw.itb and Alper Nebi Yasak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59bce5ab-1973-32e8-4e46-7f15386d1003@gmail.com \
    --to=alpernebiyasak@gmail.com \
    --cc=a-govindraju@ti.com \
    --cc=afd@ti.com \
    --cc=n-francis@ti.com \
    --cc=rogerq@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox