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 2DDE5C25B50 for ; Fri, 20 Jan 2023 10:19:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38753856BE; Fri, 20 Jan 2023 11:19:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="c5GE+98F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D670B85695; Fri, 20 Jan 2023 11:19:25 +0100 (CET) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 DFBAB85677 for ; Fri, 20 Jan 2023 11:19:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-francis@ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30KAJECx115292; Fri, 20 Jan 2023 04:19:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674209954; bh=orZImOXkYBwQjHaE6nf9GgmpIa57wBTjF2rKx56KNr0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=c5GE+98F2NRN6txYp3BneEb5RjKEYYCujVQpMJjjhrWwhlLrCZmRTAms9Ri548YUU EPnLTU6ayVrFMXvshXBVOPwySNMOCaKAl3cSWawi89dsMONqrf/osRvCoM2v0yXLJz G84C/LRq5iVVT/3alQFEKpeO7hlCDEAS/tB8IFLs= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30KAJEA8007957 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Jan 2023 04:19:14 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Fri, 20 Jan 2023 04:19:13 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Fri, 20 Jan 2023 04:19:13 -0600 Received: from ula0497641.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30KAJ494026221; Fri, 20 Jan 2023 04:19:11 -0600 From: Neha Malcom Francis To: , , , , , CC: , , , Subject: [PATCH 02/21] tools: sysfw: Add script for generating configuration blobs Date: Fri, 20 Jan 2023 15:48:44 +0530 Message-ID: <20230120101903.179959-3-n-francis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230120101903.179959-1-n-francis@ti.com> References: <20230120101903.179959-1-n-francis@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 Certain devices in the K3 architecture such as AM64x require board configuration binaries packed along with their descriptions into a sysfw_data binary. The final binary is required to be packed into the final system firmware images. Signed-off-by: Neha Malcom Francis --- tools/k3_sysfw_boardcfg_blob_creator.py | 116 ++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100755 tools/k3_sysfw_boardcfg_blob_creator.py diff --git a/tools/k3_sysfw_boardcfg_blob_creator.py b/tools/k3_sysfw_boardcfg_blob_creator.py new file mode 100755 index 0000000000..da99808521 --- /dev/null +++ b/tools/k3_sysfw_boardcfg_blob_creator.py @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ +# +# TI Script for Board Configuration Packaging +# + +import argparse +import logging +import os +import struct +import tempfile +from shutil import copyfileobj +from shutil import rmtree + +BOARDCFG = 0xB +BOARDCFG_SEC = 0xD +BOARDCFG_PM = 0xE +BOARDCFG_RM = 0xC +BOARDCFG_NUM_ELEMS = 4 + +class BoardCfgDesc(): + """Get board config descriptor for a given file """ + + fmt = ' device, sw_rev, boardcfg, security boardcfg, pm boardcfg, rm boardcfg, output file + +# parser for mandatory arguments +pp = argparse.ArgumentParser(add_help=False) +pp.add_argument('-l', '--log-level', type=str, default="INFO", choices=["INFO", "DEBUG"]) +pp.add_argument('--sw-rev', type=int, default=1) +pp.add_argument('-o', '--output-file', type=argparse.FileType('wb'), default="./sysfw-data.bin") +pp.add_argument('-d', '--devgrp', type=int, default=0) +pp.add_argument('-b', '--boardcfg', type=argparse.FileType('rb')) +pp.add_argument('-s', '--boardcfg-sec', type=argparse.FileType('rb')) +pp.add_argument('-p', '--boardcfg-pm', type=argparse.FileType('rb')) +pp.add_argument('-r', '--boardcfg-rm', type=argparse.FileType('rb')) + +args = pp.parse_args() +logging.getLogger().setLevel(args.log_level) +logging.debug(args) +create_sysfw_blob(args) -- 2.34.1