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 00254C433F5 for ; Wed, 9 Feb 2022 07:21:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 52F8283BDE; Wed, 9 Feb 2022 08:21:21 +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="WDgBtFKF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FCB381F6B; Wed, 9 Feb 2022 08:21:18 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20619.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::619]) (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 494C083D52 for ; Wed, 9 Feb 2022 08:21:14 +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=W4a/orscIPH9fSnTZzUxX4Oq7bvJBt9/VZbhQg0N0y4Kq7XqfVYLiQlZ9obalMvimi2LhE3jGG4cG2o72IrFjm+eYyDf+5oBhYfNEy1qJBQR5C+8YWccv3SaSxjS0PucvpB22trbVN4AwUKL36K+YWSJJ0lL6O61ilrRC/q18uUaEjzZ/Zol43IqEESAmmEjyN/EiVjb7pescmq0i9x7umZk8MBjy5GNadwe2PMkr8v/CGtKNeNzz1O2DslM4vqgd6+bFkcX51gJLAT9mS6LM9PWEAuoS8R6w+YvsV78rLFsTVxMu4kShM1Qr9QwM012C8hEgEPVJpdJ8uxqfv0WlQ== 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=Yfignc8+L1RgV4IEdO5SVtPrja9Gnx9XQCUnSYGqgTU=; b=KDKJPUbNuxB9EcmFhvw5VswKCMB4MqTmR10yo9lOjo15ClKXDTXz4htzJ/e2/NNOrvkE5OuqGGvmLzp9vBYLQG9S9Eeoc6YbZ15Ybh1vmLbJavcKfbkKQUVwX4Bq+A5UX0CkF/WfDKVezj8RG65Hivl3KDN0/glyTTByPT4eiQNhCv8b09IK7txPRVVDI7auGOrlJ56cQo69e2MeHr8V+yeLQb0TIpxpZh7QQLCMQ2hkDL+I2Sy8DXvE8KVFrXYB53RgLTVWqi3KXG1mDiMtV3xax6yUfAK7PdbnMfyMnu7qR8cIkW+vXW8QWCsbWmenmY3kHkhEj2dOhit8w6fPeg== 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=Yfignc8+L1RgV4IEdO5SVtPrja9Gnx9XQCUnSYGqgTU=; b=WDgBtFKFCaSgHzbXmXUn84S5/xJt4G2FY/b2uLmTkAKIgsQl8IpvzMPXfI4i0mn+ymyuFtHUZ3irvGMJfjxbZ4POoEI+lNP54Lzry3Ggru5v4H4GYPQNtN6xb/1VRO91g9mR+w9r2iD1/a0Vy46F35Pki6gC1w9H9bkE1Su7aks= Received: from DM3PR08CA0006.namprd08.prod.outlook.com (2603:10b6:0:52::16) by BN8PR02MB6433.namprd02.prod.outlook.com (2603:10b6:408:ad::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Wed, 9 Feb 2022 07:21:10 +0000 Received: from DM3NAM02FT026.eop-nam02.prod.protection.outlook.com (2603:10b6:0:52:cafe::18) by DM3PR08CA0006.outlook.office365.com (2603:10b6:0:52::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Wed, 9 Feb 2022 07:21:10 +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 DM3NAM02FT026.mail.protection.outlook.com (10.13.5.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Wed, 9 Feb 2022 07:21:09 +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 23:21:05 -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 23:21:05 -0800 Envelope-to: masami.hiramatsu@linaro.org, sughosh.ganu@linaro.org, monstr@monstr.eu, u-boot@lists.denx.de, xypron.glpk@gmx.de, 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=56560) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nHhHl-00047M-HD; Tue, 08 Feb 2022 23:21:05 -0800 Message-ID: Date: Wed, 9 Feb 2022 08:21:00 +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: Masami Hiramatsu , Michal Simek CC: Sughosh Ganu , Michal Simek , U-Boot , Heinrich Schuchardt , Patrick Delaunay , Patrice Chotard , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere References: <20220207182001.31270-1-sughosh.ganu@linaro.org> <20220207182001.31270-2-sughosh.ganu@linaro.org> <65f6245e-3122-60da-8aad-2e85e90370ae@xilinx.com> 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: e449d43b-350c-4222-f61f-08d9eb9cbea8 X-MS-TrafficTypeDiagnostic: BN8PR02MB6433:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tx1mdZwLKiUKb/VV+H8EQfw8TbvnlQXXlsnB01lG40RK+WY5yz7LjxP7MLMg4LcZgDrguQ69okA8RbjlDdZG9/k5o/OiHX+4YPOlLeKCocBi4dWRMlJ9INy4yNdbNGu7sWphu8r85NK3SS2c4Ppe2ZOXDbSIYxWKO/AbRyjE8sNCxXaC4RoWWGu1o2DYyIpcTikVkBrwoqWxYEePeslh2ScowMf24PaiDfpmkDZtZrQ7tHLZJghhm4g2ACD2Li0a5xdfFPGIn7zabS/7YcnGtl+hNJ/4Z6g/yLPo2ypnRqFxv28dZ/g3adyxCss0wPqf+BIQi5eo4PqIkbaRid6dlqcFuZODEVnqwk3yOuyKolbfy1GuD62hY94fxCDePsPwHwGIeBLGphsjxlJSzxtxS+pTeb632Jpwd7FfL/MWiyBQAwxAP9mDjXcopMPUnkaFpsx+sCkW/4MLqYc9QBecO75GL/VDbKBsunLEoIp7uKqbis4Gsg2anSVLb7JUMYuRocroC5Je94gyZXIatNJpz0tm5l6B3GPedUorFQGovS4nRewuW7BYQTt1LAkfQLRsc3iGPn/EFVXAFa4qMbfQROJp3sKhXChbABIUQ1Et9R+1zMGBcFm2HX6VPxBkaW5NxQ/MrZeYaVowoVuFuVNLliu6SARKo7hmjRCd5pxZlwboMYlG4rMHT0TOVaqFs1pFKwgpsphecAWVufWnbyb/jg== 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)(36840700001)(46966006)(8936002)(36756003)(7416002)(8676002)(2906002)(4326008)(31696002)(508600001)(356005)(44832011)(47076005)(66574015)(26005)(186003)(336012)(426003)(7636003)(82310400004)(2616005)(53546011)(6666004)(31686004)(54906003)(5660300002)(70206006)(70586007)(9786002)(110136005)(36860700001)(83380400001)(316002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2022 07:21:09.4868 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e449d43b-350c-4222-f61f-08d9eb9cbea8 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: DM3NAM02FT026.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR02MB6433 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 Hi, On 2/9/22 00:39, Masami Hiramatsu wrote: > Hi Michal, > > 2022年2月8日(火) 23:27 Michal Simek : >> >> >> >> On 2/8/22 15:14, Masami Hiramatsu wrote: >>> 2022年2月8日(火) 22:45 Michal Simek : >>>> >>>> >>>> >>>> On 2/8/22 14:36, Masami Hiramatsu wrote: >>>>> 2022年2月8日(火) 20:35 Sughosh Ganu : >>>>>> >>>>>> 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. >>>>> >>>>> Yes, I would like to define new compatible for sf backend, e.g. >>>>> "u-boot,fwu-mdata-sf". >>>> >>>> backend is fine. What does this compatible string have to do with it? >>>> I didn't see any fwu-mdata-gpt in this series. >>> >>> Sughosh made it "fwu-mdata" but I think it should be "fwu-mdata-gpt" >>> if the required parameters are different. >>> >>>> >>>>> It will have the fwu-mdata-store to point the SPI flash device, and >>>>> will have a list of offset information for the metadata. >>>> >>>> Can you describe it? >>>> >>>> Something like for raw accesses? >>>> fwu-mdta-store = <&qspi 0 XXXX>; >>> >>> I'm still not sure what is the best way. What I thought was, >>> >>> fwu-mdata-store = <&spi-flash>; >>> fwu-mdata-offsets = <500000, 520000>; >> >> as I said. Before this is applied I think we should work on generic proposal how >> to describe it. Because the same way can be used for u-boot variables and maybe >> others. > > Agreed. This also reminds me the dfu_alt_info. Currently the dfu_alt_info > is passed via u-boot variables, but this should be a (important) part of > firmware information. I think it should be defined in the devicetree too. > (actually, stm32 builds dfu_alt_info from the device information already) yes that capsule update via dfu_alt_info and upgrading all that structure should be also the part of it. I am not saying in this series. On the top of this one should be fine but it should be clear how this is supposed to work. >> Definitely I would prefer to ask Rob for helping with this and get this to yaml >> to be able to use the whole infrastructure to check it. > > Yeah, and at first we should define what information should be in the > devicetree. yes. Thanks, Michal