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 29E5BC433F5 for ; Mon, 18 Apr 2022 19:58:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF81283B9E; Mon, 18 Apr 2022 21:58:54 +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="joz78NWw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2CB5083B2F; Mon, 18 Apr 2022 21:58:40 +0200 (CEST) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 DB90683B34 for ; Mon, 18 Apr 2022 21:58: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=alpernebiyasak@gmail.com Received: by mail-ed1-x532.google.com with SMTP id b24so18618193edu.10 for ; Mon, 18 Apr 2022 12:58:35 -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=wNUiiYi5SJn3Tt87/DqvvTEO3fsgN2bE/qOsH4k3frk=; b=joz78NWwMVZdcNEmZvIKuLpaebzLT3ZfUNHxWJ2GJ5n+hKDZEkHZZiRk2u7FSMLpJA e2ZOblUXqHUJ1HlH7HKuA6qrm7fuK1g8WsgheJOYXEHCw6MyJFovBEbf/+klhkd3Mja1 UdMpS78MVfxxQ5LBcuOj3SvyZmF09HUFvY4964iI0sMmOGexd+glW28BWLQrrlYTuhfl sNrMpJr4u4NIQhNz0fgy4w0S1b4X74ntxBOcS/Nwo2H1CPMlB6gKHeOeE8NCyOkAUwQ+ wMdChR9W9Ub+mv3JL8RgD7YNMgtdjhs+P2CUHWoKuX4bLcWGlN0dz5NMjCJ8pbfdBK2a wNyw== 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=wNUiiYi5SJn3Tt87/DqvvTEO3fsgN2bE/qOsH4k3frk=; b=jQRipQDV7m5MoLWlhhFv/GjDTGi3YsUdgJMb7/iJTDK7/neELgBL6uos9z7OYqfNwg hWdRO1ZRPaEHMhTEwgjG7xQUIsCaK6Idss/R0fQlaIWZIl0OOtovA0osR95Wggoq7Pbo /MFrbKhlFMOXMfibB40lT+eKEWV+sHMMkIPbSK8mLeXoFSJxRE3CxM30HA7QmTOLqDNX d14wqbCZGqvoI5Om4SPIsejrPsuj9qoyZDDtRbJa71nXuqC8ekAgIhnfYissZfQRd/jv L4NNcWQK86B3fIxZuI5yzAXusWGg5jp/c+9Q/ZO7LvA1k9Ae2Ky1Emcm46tyeEW9RGZh Ulxg== X-Gm-Message-State: AOAM533bk2V/M2cnMDetywV+2RMoF1L26MgD02X7PiVbjjEiosa+kyMC iia1UFoxNLNMz/1xlUBpudE= X-Google-Smtp-Source: ABdhPJwYehyQWXQJg8TccP/3SuXQA3tNTthM7ASUnghePcu1sMDk4DJ0rYLWFxRyDZihro7CGJncGw== X-Received: by 2002:aa7:d0c9:0:b0:41d:9137:fcea with SMTP id u9-20020aa7d0c9000000b0041d9137fceamr14083758edo.110.1650311915477; Mon, 18 Apr 2022 12:58:35 -0700 (PDT) Received: from [192.168.0.74] ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id c3-20020a17090654c300b006e4e1a3e9d5sm4986222ejp.144.2022.04.18.12.58.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Apr 2022 12:58:35 -0700 (PDT) Message-ID: <38adacd6-2fba-516d-0b40-15e41f4fcc1a@gmail.com> Date: Mon, 18 Apr 2022 22:56:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 From: Alper Nebi Yasak Subject: Re: [RESEND, RFC 7/8] binman: etype: dm: Add entry type for TI DM To: Neha Malcom Francis Cc: sjg@chromium.org, marek.behun@nic.cz, xypron.glpk@gmx.de, vigneshr@ti.com, a-govindraju@ti.com, kristo@kernel.org, s-anna@ti.com, kishon@ti.com, joel.peshkin@broadcom.com, patrick.delaunay@foss.st.com, mr.nuke.me@gmail.com, nm@ti.com, u-boot@lists.denx.de References: <20220406122919.6104-1-n-francis@ti.com> <20220406122919.6104-8-n-francis@ti.com> Content-Language: en-US In-Reply-To: <20220406122919.6104-8-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.5 at phobos.denx.de X-Virus-Status: Clean On 06/04/2022 15:29, Neha Malcom Francis wrote: > K3 devices introduces the concept of centralized power, resource and > security management to System Firmware. This is to overcome challenges > by the traditional approach that implements system control functions on > each of the processing units. > > The software interface for System Firmware is split into TIFS and DM. DM > (Device Manager) is responsible for resource and power management from > secure and non-secure hosts. This additional binary is necessary for > specific platforms' ROM boot images and is to be packaged into tispl.bin > > Add an entry for DM. The entry can be used for the packaging of > tispl.bin by binman along with ATF and TEE. > > Signed-off-by: Neha Malcom Francis > --- > Makefile | 1 + > tools/binman/entries.rst | 10 ++++++++++ > tools/binman/etype/ti_dm.py | 22 ++++++++++++++++++++++ > tools/binman/ftest.py | 7 +++++++ > tools/binman/test/225_ti_dm.dts | 13 +++++++++++++ > 5 files changed, 53 insertions(+) > create mode 100644 tools/binman/etype/ti_dm.py > create mode 100644 tools/binman/test/225_ti_dm.dts > > diff --git a/Makefile b/Makefile > index 4672147318..dd3403f912 100644 > --- a/Makefile > +++ b/Makefile > @@ -1328,6 +1328,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > -a atf-bl31-path=${BL31} \ > -a tee-os-path=${TEE} \ > + -a ti-dm-path=${DM} \ > -a opensbi-path=${OPENSBI} \ > -a default-dt=$(default_dt) \ > -a scp-path=$(SCP) \ > diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst > index 7c95bbfbec..cf392b6e32 100644 > --- a/tools/binman/entries.rst > +++ b/tools/binman/entries.rst > @@ -1030,6 +1030,16 @@ devices. > > > > +Entry: ti-dm: Texas Instruments Device Manager (DM) blob > +----------------------------------------------------------------- Run `binman entry-docs` for this as well, but copy this title to the docstring below. > + > +Properties / Entry arguments: > + - ti-dm-path: Filename of file to read into the entry, typically dm.bin > + > +This entry holds the device manager responsible for resource and power management in K3 devices. > + > + > + > Entry: section: Entry that contains other entries > ------------------------------------------------- > > diff --git a/tools/binman/etype/ti_dm.py b/tools/binman/etype/ti_dm.py > new file mode 100644 > index 0000000000..f44ee21777 > --- /dev/null > +++ b/tools/binman/etype/ti_dm.py > @@ -0,0 +1,22 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ > +# > +# Entry type for TI Device Manager > + > +from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg > +import os Put 'os' before 'binman', and an empty line between them. > + > + > +class Entry_ti_dm(Entry_blob_named_by_arg): > + """Entry containing a Device Manager (DM) > + > + Properties / Entry arguments: > + - ti-dm-path: Filename of file to read into the entry, typically dm.bin > + > + This entry holds the device manager responsible for resource and power management > + in K3 devices. > + """ > + > + def __init__(self, section, etype, node): > + super().__init__(section, etype, node, 'ti-dm') > + self.external = True > diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py > index 7c12058fe4..52bfbe792c 100644 > --- a/tools/binman/ftest.py > +++ b/tools/binman/ftest.py > @@ -85,6 +85,7 @@ FSP_S_DATA = b'fsp_s' > FSP_T_DATA = b'fsp_t' > ATF_BL31_DATA = b'bl31' > TEE_OS_DATA = b'this is some tee OS data' > +TI_DM_DATA = b'tidmtidm' > ATF_BL2U_DATA = b'bl2u' > OPENSBI_DATA = b'opensbi' > SYSFW_DATA = b'sysfw' > @@ -191,6 +192,7 @@ class TestFunctional(unittest.TestCase): > TestFunctional._MakeInputFile('compress_big', COMPRESS_DATA_BIG) > TestFunctional._MakeInputFile('bl31.bin', ATF_BL31_DATA) > TestFunctional._MakeInputFile('tee-pager.bin', TEE_OS_DATA) > + TestFunctional._MakeInputFile('dm.bin', TI_DM_DATA) > TestFunctional._MakeInputFile('bl2u.bin', ATF_BL2U_DATA) > TestFunctional._MakeInputFile('fw_dynamic.bin', OPENSBI_DATA) > TestFunctional._MakeInputFile('sysfw.bin', SYSFW_DATA) > @@ -5305,6 +5307,11 @@ fdt fdtmap Extract the devicetree blob from the fdtmap > data = self._DoReadFile('222_tee_os.dts') > self.assertEqual(TEE_OS_DATA, data[:len(TEE_OS_DATA)]) > > + def testPackTiDm(self): > + """Test that an image with a TI DM binary can be created""" > + data = self._DoReadFile('225_ti_dm.dts') > + self.assertEqual(TI_DM_DATA, data[:len(TI_DM_DATA)]) > + > def testFitFdtOper(self): > """Check handling of a specified FIT operation""" > entry_args = { > diff --git a/tools/binman/test/225_ti_dm.dts b/tools/binman/test/225_ti_dm.dts > new file mode 100644 > index 0000000000..3ab754131e > --- /dev/null > +++ b/tools/binman/test/225_ti_dm.dts > @@ -0,0 +1,13 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/dts-v1/; > + > +/ { > + #address-cells = <1>; > + #size-cells = <1>; > + binman { > + ti-dm { > + filename = "dm.bin"; > + }; > + }; > +};