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 AF19FC433EF for ; Tue, 8 Feb 2022 14:28:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 826CC83841; Tue, 8 Feb 2022 15:28:05 +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="Vzagjblg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E29638009D; Tue, 8 Feb 2022 15:28:03 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20617.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::617]) (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 0E31483CF4 for ; Tue, 8 Feb 2022 15:27:59 +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=OHazlumhDQuVOGuLB1KDDWKn3PYyLbBn7uBhlnbczEL5S1lo0Y3dLNxlJ4g1uewBBqEz32FEdK/sxqbDVfXJyAFHrYavx4BykOxZmBiaXyHTQr9X1Mu8n4KKrsvoWI9DemtAkzjSdv3l2DQbIvfCntFqz7hLWWcD4xin9isslNGdpErzNULUxvWB5R4vKTdZtElBcRJMUdrXnobLk4gccHnjEoRnMwBGDJsYm/xP6btlQz5/DxppQs/1cyBN5J63PjdsHAn4OBiWVtXlKlKlO1+0veri8uF/xMG9nFWZAoVhrm7h8+fp5NrvmSQh9CSdjSw005Yn8hb9pNhQ8pl60g== 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=ym4I4+/ecGVRSczy2LwdJNbJeDgxacfyk3PtJa16zRY=; b=EqQh1oSrfShyiUMV71fJ8QFho+R9+du5aabV4ISlqH7m/1aJotNmn3vqrktDuAPNyUoltOjOB9ZhWSsHxPqzH5YtU9OPa1KKmxA+5EFZ/J8kEHvnlRPkbA+Q7y20cBuSj4clAjME9zub8dC2J4gguiOLxOBcuTCf7slMO4E3rioF7iWckThA3FkDYJ5SYbxkhKvEnfO4JboWQQthKLj+/olq1F0cWm5qRF69dyTIkZEZffHdtjWNdTN3/SfDNP2EyUziPQ2Hne1zQ7apNcFeeVUHHEhQuxylB0kWqruQG7i3nhwyL/YvKL5BM1fMUKfMgi8oc2T7rCLEC1rQeifgtA== 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=ym4I4+/ecGVRSczy2LwdJNbJeDgxacfyk3PtJa16zRY=; b=Vzagjblg5OsCTB8ctXbpq012LDo1UMTuA0G037b1ocbeQbreS0+MsQkS8pJZ4jq90HWFwfZ21lGK/QuH8Fwb7VXOsMMsFYYxcjrW9uACUqWsrP4WJMrxgr3qwRTjrjnUx6Dutv9P5/wsbqD75x7LpY09u4/QHguFXlFfJojzeBA= Received: from DM5PR1401CA0005.namprd14.prod.outlook.com (2603:10b6:4:4a::15) by SJ0PR02MB7485.namprd02.prod.outlook.com (2603:10b6:a03:290::9) 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 14:27:55 +0000 Received: from DM3NAM02FT008.eop-nam02.prod.protection.outlook.com (2603:10b6:4:4a:cafe::ff) by DM5PR1401CA0005.outlook.office365.com (2603:10b6:4:4a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 14:27:55 +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-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT008.mail.protection.outlook.com (10.13.5.14) 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 14:27:55 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) 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 06:27:54 -0800 Received: from smtp.xilinx.com (172.19.127.95) 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 06:27:54 -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=50856) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nHRTG-0004WC-2j; Tue, 08 Feb 2022 06:27:54 -0800 Message-ID: Date: Tue, 8 Feb 2022 15:27:49 +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: c5fcf593-4262-460c-2a8c-08d9eb0f3267 X-MS-TrafficTypeDiagnostic: SJ0PR02MB7485:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zoAQykKyPqH1sfQNWvhdTldcpYTj8X5gAZiedbS0x6SwLdQcIWp/jKQ8wmChVm4GbXDjask+dnDBKVxXGSgf26MoqIOLWVRXsLvjhbKasDpvlEb6M4Ee83kE7ECd2LL/7ZeNLABJtDRdDehFuOobIJljel+HAsrESeFrWXH2BGu4tRskDQzflF0Pz0vcVg7/M12AmnFL8NK8h9tz0OQ3alEI7GE83ZRbBaAKrw1JbBum7GczkgnpVDyDhtnANgcrk5ZEfwqJokyEMie/rV7pLnX+/40QIofvckeqJyRgtjKSWmmmlWD3FbVxi0MsHv0Q9VsHcVkj3+UF27yQc/d66Lfk52YvGyyIRW3R1vmrJw97zn61z7LUqkB/kEdgHEZZnwzO/frZVOBeeS0M+vth27WrO8FrzyTuyiVKywYtTasp06F9jCbVDjT3mSmUJdZVF6reiBCsECesSootvJXITdRmjMIP2CR/mgnVhVOKpXAq3S/EqSjufK2xIalXYXsnmdqIVZhSC0+0EcY/a2k9tLy6Z6PcVnYyFP9YJLtMUQovzT+Tw2fY1qHMViHSlbMB/R/mrG5LWkuq+lpAICXSV80rTFuJCiVflgY8fhGZUGlkLdfw/9VFaCmh2CJCuomziwfxsEp4XgNWP3m8HZSolbQ8saSnndYiOKw024qxmNQdLZdOlkeW9KnD10iwjbjjbeLWZCNCVpw9Sqb5nijLG/jt/RHg/YdiFQnyWF0WeqU= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(336012)(9786002)(36860700001)(53546011)(2906002)(47076005)(66574015)(40460700003)(110136005)(2616005)(5660300002)(54906003)(186003)(82310400004)(26005)(7416002)(36756003)(44832011)(31696002)(356005)(8936002)(31686004)(8676002)(6666004)(7636003)(70586007)(316002)(70206006)(508600001)(83380400001)(426003)(4326008)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 14:27:55.1357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5fcf593-4262-460c-2a8c-08d9eb0f3267 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-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT008.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7485 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 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. 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. Thanks, Michal