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 84929C433F5 for ; Tue, 8 Feb 2022 11:40:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D83EC83C86; Tue, 8 Feb 2022 12:40:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.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=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="JsLtyavf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A1DFB83C8D; Tue, 8 Feb 2022 12:40:02 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20616.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::616]) (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 4FC3E83C51 for ; Tue, 8 Feb 2022 12:39:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9Y0B4av5164CQrIIV/79RxI3litC1PFr+O2JM7TBDbF2S09NV4+RvnMUu8qn5ZJqQEhyC7bgfO9lqxZT4LoKloIzrxwLC94Sc4cADzCIACsFV8XzEOiiuH8nxaouJRpwXhMUWJoS7SAl5dGB+xO8v6O1Z0OJaWZdp0e3b89DmGS4Z496pK6R7uoRPgsh97jG/JhkYuaJ2KpUumGpx7WckzRV3uR3gKsg+ZlX0+uvCoBb5ORX4q4NUy4rIBBeLgFMTpEcn2PKBe1AzbPLJjRPyHaTH1G0wx49i0M1KH+JEYhG7InKe7AkY8QKrIQQEut7MUOh2RB5imck3PktU9/IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nTQoG0Ae31huYRKvbBWWCmBRkxnPlWON7PzkKDi7T54=; b=IvB41lnSZXwwiEmi3IvmMWcaM4MEHW+f+8WM0yBmDDn4hH/I+qqkBRvLM/eQV0JEsLiCiaEKNxFi6s/aBchh2ukUJ7tGhWrbJsnLK0LOu6AKnpma9fuKOMMqIzxl9TCBH8UVCIaVT5HyF71qpG8MQeFrHg/kgltwYY4ubCIscdNZrb0vkezbyp2I4YDmstgyO52y+hLtbvaVvlClt0P7FVFLROLH/aylMia0pVTFW90e2y7MpIj7Epa5YSuXzgyEs6sJgnRKvA6Sf0rsDBiD3Nckx+Lo/wn27gTVSpbE5Jf9ad0k/ofm1SAjVCFtsowQYI5kAxxsMdeC4DczY+4gEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=linaro.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nTQoG0Ae31huYRKvbBWWCmBRkxnPlWON7PzkKDi7T54=; b=JsLtyavfaFgL61R1o5wmuCmRUS85LciqBiFCWX0cbmr9cHiEmFRlw9sPNByLJxc3fcUJ+kKyJaStO4nSrdIlZPZg34fbz4w1Hh4YYCpPW9ZLqogn4yl+8Kdcng7pXznFPYl1TAZE8XKOR54WZU78nmU7wyzvg96jOYSvzfOYGNg= Received: from DM5PR19CA0017.namprd19.prod.outlook.com (2603:10b6:3:151::27) by SJ0PR02MB8687.namprd02.prod.outlook.com (2603:10b6:a03:3f3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Tue, 8 Feb 2022 11:39:53 +0000 Received: from DM3NAM02FT022.eop-nam02.prod.protection.outlook.com (2603:10b6:3:151:cafe::f0) by DM5PR19CA0017.outlook.office365.com (2603:10b6:3:151::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Tue, 8 Feb 2022 11:39:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT022.mail.protection.outlook.com (10.13.5.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 11:39:53 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 8 Feb 2022 03:39:52 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 8 Feb 2022 03:39:52 -0800 Envelope-to: sughosh.ganu@linaro.org, monstr@monstr.eu, u-boot@lists.denx.de, xypron.glpk@gmx.de, masami.hiramatsu@linaro.org, patrick.delaunay@foss.st.com, patrice.chotard@foss.st.com, agraf@csgraf.de, takahiro.akashi@linaro.org, sjg@chromium.org, bmeng.cn@gmail.com, ilias.apalodimas@linaro.org, jose.marinho@arm.com, grant.likely@arm.com, trini@konsulko.com, etienne.carriere@linaro.org Received: from [10.254.241.49] (port=36510) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nHOqe-0006Of-0s; Tue, 08 Feb 2022 03:39:52 -0800 Message-ID: <97f2bb63-c014-6ee9-19b6-aa43269a1b76@xilinx.com> Date: Tue, 8 Feb 2022 12:39:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v4 01/11] FWU: Add FWU metadata structure and driver for accessing metadata Content-Language: en-US To: Sughosh Ganu , Michal Simek CC: U-Boot , Heinrich Schuchardt , Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Michal Simek References: <20220207182001.31270-1-sughosh.ganu@linaro.org> <20220207182001.31270-2-sughosh.ganu@linaro.org> From: Michal Simek In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d212c75d-88ef-4fcc-25b7-08d9eaf7b92e X-MS-TrafficTypeDiagnostic: SJ0PR02MB8687:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RSjD15w25rBwffagBL9c8HKUNiAuPB5DhVXueRX1UTDhqmSPLzbylHvAGS4JrEckX0qfpejxt+qsXk8cFf91BKqxOh9bGkslZT7ti1qrj8UNkaNXHRIukQuIOPdQevlai5vX1JNJamDcRXBoN/bzSXvY6rmOA0LUVzIjwOquM5Ng2wFBZg6RL4I3gPVlyLPMFc3qV2Fj2lNI/Zgjagu2oDuZzVazmUfxZa4v5gHuouPGSoTfPMO36EEfGV3uf9Uee6oxvko3VpUVUv8qXDeL+t8sjYkwYdWPampJLQN7BA+QFPlLvqriWa6w6Kdu3ZslFOFCUzg7X+gMLYnap83xodVvzdqsXS2/DHP3OQaqaaXDVtyJtlbp9L54NtkbuKHd2agsqGsogrVQ/5EuWVXOpL9OShgaIOTpE3l34nRuTqN0VQRVg4iIr6Lmpk1z/5yb6HffKSmM4OVP/aCCJ9lMGxRuvdSws+fNEcPBWI/xvV0ojAa+GxMCU9mYRB3oJdOlZBUO2kRcn37PFS3AXtTL9vHV7tMHW2mxaxOnHg1U9npcJ55g50fVz0lF1PGnv+ABfzY03n0vkXrEQeK1yA0OkRL5ubl4wgiKtwQFr+LZkQBGGmj/Vh06BA1YaHDAW3skwEZI7pCP8sSrhaqeQp5NHbCdMA+oJ839ebESvGnXrxZUeG7QmcPGkbCWD0LK1yOT7NbMxOeW5AyntcPt3PVbzArQF68HDlE2etviaAL7JxA= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(40460700003)(2906002)(7636003)(31696002)(36860700001)(82310400004)(66574015)(356005)(508600001)(47076005)(31686004)(53546011)(5660300002)(7416002)(6666004)(110136005)(26005)(186003)(426003)(336012)(70586007)(70206006)(36756003)(316002)(54906003)(9786002)(83380400001)(2616005)(4326008)(8936002)(8676002)(107886003)(44832011)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 11:39:53.3329 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d212c75d-88ef-4fcc-25b7-08d9eaf7b92e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT022.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB8687 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 2/8/22 12:35, Sughosh Ganu wrote: > On Tue, 8 Feb 2022 at 16:26, Michal Simek wrote: >> >> po 7. 2. 2022 v 19:21 odesílatel Sughosh Ganu napsal: >>> >>> In the FWU Multi Bank Update feature, the information about the >>> updatable images is stored as part of the metadata, which is stored on >>> a dedicated partition. Add the metadata structure, and a driver model >>> uclass which provides functions to access the metadata. These are >>> generic API's, and implementations can be added based on parameters >>> like how the metadata partition is accessed and what type of storage >>> device houses the metadata. >>> >>> A device tree node fwu-mdata has been added, which is used for >>> pointing to the storage device which contains the FWU metadata. The >>> fwu-mdata node is u-boot specific, and can be added the platform's >>> u-boot dtsi file. >>> >>> Signed-off-by: Sughosh Ganu >>> --- >>> >>> Changes since V3: >>> * Move the FWU metadata access to driver model >>> * Get the storage device containing the metadata from a device tree >>> property instead of a platform helper function >>> >>> arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi | 7 + >>> .../firmware/fwu-mdata.txt | 18 + >>> drivers/Kconfig | 2 + >>> drivers/Makefile | 1 + >>> drivers/fwu-mdata/Kconfig | 7 + >>> drivers/fwu-mdata/Makefile | 6 + >>> drivers/fwu-mdata/fwu-mdata-uclass.c | 434 ++++++++++++++++++ >>> include/dm/uclass-id.h | 1 + >>> include/fwu.h | 51 ++ >>> include/fwu_mdata.h | 67 +++ >>> 10 files changed, 594 insertions(+) >>> create mode 100644 doc/device-tree-bindings/firmware/fwu-mdata.txt >>> create mode 100644 drivers/fwu-mdata/Kconfig >>> create mode 100644 drivers/fwu-mdata/Makefile >>> create mode 100644 drivers/fwu-mdata/fwu-mdata-uclass.c >>> create mode 100644 include/fwu.h >>> create mode 100644 include/fwu_mdata.h >>> >>> diff --git a/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi b/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi >>> index 06ef3a4095..3bec6107f7 100644 >>> --- a/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi >>> +++ b/arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi >>> @@ -4,3 +4,10 @@ >>> */ >>> >>> #include "stm32mp157a-dk1-u-boot.dtsi" >>> + >>> +/ { >>> + fwu-mdata { >>> + compatible = "u-boot,fwu-mdata"; >>> + fwu-mdata-store = <&sdmmc1>; >>> + }; >>> +}; >>> diff --git a/doc/device-tree-bindings/firmware/fwu-mdata.txt b/doc/device-tree-bindings/firmware/fwu-mdata.txt >>> new file mode 100644 >>> index 0000000000..c766b595ef >>> --- /dev/null >>> +++ b/doc/device-tree-bindings/firmware/fwu-mdata.txt >>> @@ -0,0 +1,18 @@ >>> +FWU Metadata Access Devicetree Binding >>> + >>> +The FWU Multi Bank Update feature uses a metadata structure, stored on >>> +a separate partition for keeping information on the set of updatable >>> +images. The device tree node provides information on the storage >>> +device that contains the FWU metadata. >>> + >>> +Required properties : >>> + >>> +- compatible : "u-boot,fwu-mdata"; >>> +- fwu-mdata-store : should point to the storage device which contains >>> + the FWU metadata partition. >> >> In 0/11 you are describing GPT partitions but I don't think this >> binding is generic enough to describe >> other cases. It is saying device but not where exactly it is. >> I didn't read the whole series yet but arm spec recommends GPT but dt >> binding should be generic enough to describe >> also other cases. >> We are saving this structure to qspi for example but current binding >> can't be used for it. > > I would wait to see Masami's implementation of this feature. If I am > not wrong, his platform too is enabling this feature with a spi as the > storage device. Maybe we can instead put a list of > tuples which can then list the device and partition number of the > metadata partitions. I think you should list all possible devices which can be used to have generic description for it. It is sort of the same list of devices which could be used for storing u-boot internal variables. That's why the same description can be used for it too. Thanks, Michal