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 8B264EB64DB for ; Tue, 20 Jun 2023 14:20:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 582698623B; Tue, 20 Jun 2023 16:20:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.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=amd.com header.i=@amd.com header.b="mwRn85IQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3951861F6; Tue, 20 Jun 2023 16:20:53 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::600]) (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 244788623B for ; Tue, 20 Jun 2023 16:20:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=michal.simek@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oSU+ZZLD9iWNKOZaG9qdIYZJa+xgpFlMld35Mym7fgKUG3or0VBcGtmdDIGwaBpDtsy6V3MIqnfXTGOonmh5rtUXFscYq2SH6a16EL9t8/sxRGNj3y9HTR5qQxq4rEi8a2//s+X/Ypmer6XoGWWxgroNSjXfRAZQTZ0mb6rSdLhs0PnHzC1757FZhv/hj2E6HRpvkHFBFM1r2D2oeNMVrlevYRUz0E865bc5PVuRlB91gXWNNk85kw2YSyDjl4Wit9UNr26Tl5jVTpCEkwJBvH6DF4vfjZh3bQfo5zulz/fKbQcWsQ0p9zYYHrYq6a8UCEgqxMfrd79vEKzBDHUyhw== 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=z1t/bIwFnlXFqrMGA5YeL8jopOHAf22hr85RKEFIICQ=; b=gkh+kVJkUnN6OsHJcko1FZpkPzes6HkCGkj9yUTSvZ49UAcIdq4spGYN2zHc1lqYOCDbMi6gf9RLGOqoamrQ5WxhNyi+Ptjm5E29wLruXMCd7X+E44slZb9PMSu0GPkS7V7d9WKRyceXxvncopvddJObK9KuwTLY3FpQIMtOmUy9A68u+R7st36rKmQ3dAXwKIZ9G3B02pZDZFqLY+QnpZX12YgRzZfTHMeldzvPVk7I5QllkdhPLTBdaujbQqDfgu+wru1Ma4qHi2vAvsW4iXoOPSIl6A7Wqa+qIncNLducvnn35M0Pk/9AeZ/d2U2O/0VO93shS3MYaRB1CQQqhw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z1t/bIwFnlXFqrMGA5YeL8jopOHAf22hr85RKEFIICQ=; b=mwRn85IQCcaMiR6khGqxaV/0D07Se54itqOQPkx+rQi0I8MTtoqMNUsrLdgp5jvNL4AsMYvck1pCmWlX3ZO46ACW8yK3pRD15U2C4YKfseYjkaU8ZAkdt/GXXlN3Ap/X/v0ium4PECyIhqy0s7lmT7p/mlwAfinns7bnNPNZ0kU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB4758.namprd12.prod.outlook.com (2603:10b6:a03:a5::28) by CYYPR12MB8871.namprd12.prod.outlook.com (2603:10b6:930:c2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.35; Tue, 20 Jun 2023 14:20:28 +0000 Received: from BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::6ad5:3607:d622:669]) by BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::6ad5:3607:d622:669%3]) with mapi id 15.20.6521.020; Tue, 20 Jun 2023 14:20:28 +0000 Message-ID: <6f45cd80-b2b6-4428-22b0-af70985aff07@amd.com> Date: Tue, 20 Jun 2023 16:20:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v6 0/6] FWU: Add support for mtd backed feature on DeveloperBox Content-Language: en-US To: Jassi Brar , Ilias Apalodimas Cc: Jose.Marinho@arm.com, u-boot@lists.denx.de, etienne.carriere@linaro.org, trini@konsulko.com, sjg@chromium.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de, takahiro.akashi@linaro.org References: <20230531052804.21871-1-jaswinder.singh@linaro.org> <02a6c970-9b1b-6361-f5e9-cf908cef19d1@amd.com> From: Michal Simek In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0189.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::12) To BYAPR12MB4758.namprd12.prod.outlook.com (2603:10b6:a03:a5::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB4758:EE_|CYYPR12MB8871:EE_ X-MS-Office365-Filtering-Correlation-Id: 4551cbd7-d076-4f29-d4c1-08db71997f0d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hYe80f15TJwbM24NRkZKIoyloyzKxUp6pL3im1hsJOpJxpYACr2RYyGMsHNm9rplH4rXofmrezaANcQEf6aQy07TAUeOdKOHO0SjG+DkygFa2IbBahebKxOKEFA3lFogcKYgz+U4lU+y79+o9HRoJs3ygbYJJF8o5S1ChD5FpML5ErsERWylbvlTXxnjINgMgFBw7T5S1dp12zWHyDW4MV6h7kBpm/9KybrWCcHGd2TIP1LgU2knwV2hdUV5NBK+DaOeiRjvZj/CUl5+UKYegZ1iOFesEunQqcR+v5ROhB3y5sCpqrcMmISPr0TgUG8HDFZ0c0Hp3jorFHt848Ph/srFF+EowlWXfLGNI2bWtXGQOz2wj88Zzi31LvkwEAcuM5mX/bq19VDfdEhC/89rdZJot3OiPh4cQaydHh1Qjb9RMmUTb9jhafVzKf65tWfJ/SIJPgDZjIlFd+bNYmI535DvJXoBOaoCz2XVVoEh+eYpzOcerGISQWiQ97XqO1IpgKvvoL577tyJzU7M8qSImJsQkcTKle+5LeV6gT1+WcFXNYO5I2aS+dEiQCoYsxEQXo37wSkgH+N8ROwXCUvLXWHQ/yP1Xht40Sl3gw1FcAACvD2TBUN07bE8NQbtSPVqVOtkf4YZxjkyMBUY5Hortw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR12MB4758.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(396003)(366004)(451199021)(478600001)(5660300002)(44832011)(7416002)(66476007)(4326008)(2906002)(66556008)(31686004)(110136005)(41300700001)(66946007)(316002)(53546011)(6666004)(6486002)(8676002)(8936002)(6506007)(6512007)(186003)(26005)(83380400001)(2616005)(66899021)(38100700002)(31696002)(36756003)(966005)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bEtsdEY1S2cyTzFhVzRKYWNBaGVqKzBvNnlTWkJkRHVuMG5ibVJkMld5b1Nq?= =?utf-8?B?TnM0NmE1QS92RDhTbDM1MnJvYytzVnFpWlcvVCtiNmJic1FJdjFZSkhhVkJu?= =?utf-8?B?SWlmdmF6OEMvYm80MkRVb1BXQ1RjNkJxbzhBWm1HMHJTNzNZNlBrZ3Q3Y01V?= =?utf-8?B?M3BXWGx3bkNXNER3Vm9JblJoK2RSbWJrR2piNkFYN2tnU0lSbFRYbDNuQmxE?= =?utf-8?B?bHFnZ3pydlVlait5R3NPMU1FSE1UUUVweDlSZG5BUnVtdWdQaVJTK3VsL3Vl?= =?utf-8?B?KzJnT2dDNXZRN1l6QWpXYjJiWDJEa3FDdXNnQ205QTc1RU9vSmU3QUd5dmlI?= =?utf-8?B?RFRZWUJkTER4QWlvcHpodnhCRmdDK0htOU8xeTdaREtKUDNxUXpyRkgrR2dx?= =?utf-8?B?K25xenZRZmdWWUVsa0t4ZkNZVlMxMnorN2tZSHpldGJrdmhiWUtTd1J2cTBH?= =?utf-8?B?dmJVTWkwc21vNUpkbGRSc3lFenVzNTJzZERBRHBnMTdWNDdzMmhURUU4dG9M?= =?utf-8?B?R3JGQUZwWUlCelhTVERTd01xa2d4RHIxa0x4SytxcE9XK2tHVnVXa2pGdjNm?= =?utf-8?B?eUdHUGtuejdiSnpxQzM3U2N4Mmd3L08zbkVOME5CNUJGdHZ3d0ZJUDRtNFN2?= =?utf-8?B?a3hQcHEzZ2pDRlhwRUhESUFBWDIwUnRnUEM4YnNZRlhweUtqQVpTQ0dNVUxC?= =?utf-8?B?V0hFSXNhL21kNm55T0tVRkp4KzI2bFF6NGtqL1I5Q09kYjFuR3kwNnBYWkcz?= =?utf-8?B?cURORHFB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utf-8?B?NmhPREZnbkZVT3h4QldHTndybVhWdjhsNk5BcDQxZytBakNuV2ZBeFBwOXRz?= =?utf-8?B?TGhMbG9sK3Uwd212RE1IQndBQjJCOUZ3UVgxVk9VWmE5ZjBjVkZBaENuVXhE?= =?utf-8?B?N0J3ZlRuTDdkRE9DbjY5UmpodStaMVVBajFiZEY3b21VY2FRYlc0R1VPaXdG?= =?utf-8?B?eWs0QTR6VURhd3lwaEdDaWdSM05GQ1pSK08zdENydlNTVzIvdkpuR1FpTlhB?= =?utf-8?B?KzFXNzZkRmZzZ0RSeDBoTVY2b1BLZFU0MnhMRGVoSWs3c2s4aFlDRHNtRXUv?= =?utf-8?B?dEZ6d1drZFA3VDFGbmtkQzhPNTFiNnA0d0R2dk9mYW1IbEZuNVJyN3lTY0dj?= =?utf-8?B?NFdhTzZxUHBvMldCakR0WnpkU2RzR0FVVkRDQkgxNHcreTNyVnZkaEk0N2hG?= =?utf-8?Q?ih7kbU3taMSGOSLvWM2gkAD5B?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4551cbd7-d076-4f29-d4c1-08db71997f0d X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4758.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 14:20:28.1009 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YUK5oB+zj4xVzXVUYCAuKxmIx2C8mAm8VVTpfm8kR/7y1lU8TbQ5BemjB0pYwCly X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8871 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.8 at phobos.denx.de X-Virus-Status: Clean On 6/20/23 16:14, Jassi Brar wrote: > On Tue, 20 Jun 2023 at 05:05, Ilias Apalodimas > wrote: >> >> Sorry for being late to the party, >> >> +cc Jose who maintains DEN0118 >> >> On Mon, Jun 19, 2023 at 11:16:53AM -0500, Jassi Brar wrote: >>> Hi Michal, >>> >>> On Mon, 19 Jun 2023 at 10:02, Michal Simek wrote: >>>> >>>> Hi Jassi, >>>> >>>> On 5/31/23 07:28, jaswinder.singh@linaro.org wrote: >>>>> From: Jassi Brar >>>>> >>>>> Introduce support for mtd backed storage for FWU feature and enable it on >>>>> Synquacer platform based DeveloperBox. >>>>> >>>>> This revision is rebased onto patchset that trims the FWU api >>>>> https://lore.kernel.org/u-boot/20230306231747.1888513-1-jassisinghbrar@gmail.com/ >>>>> >>> ..... >>> >>>> Firstly I can generate 2 images per one bank which should be pretty much regular >>>> capsule update for 2 images. I would expect this should still work. >>>> >>>> And then I tried 2 banks with 2 images and fwu_gen_alt_info_from_mtd() generated >>>> this description for DFU >>>> >>>> mtd nor0=bank0 raw 2320000 80000;bank1 raw 27a0000 8000&mtd nor0=bank0 raw >>>> 23a0000 4000000;bank1 raw 2820000 4000000 >>>> >>>> If you look at size in second entry you will see that it is 8000 instead of >>>> 80000 because it is the same image. That's why curious if you have tested any >>>> scenario like this. >>>> >>> I had, and have, strong doubts about the practicality of 2 >>> images/bank. There aren't enough specification details to explain how >>> only 1-out-of-N images could be updated. And if we always update all >>> images in a bank together, we might as well have them as one composite >>> image. I never got satisfactory clarification from designers and >>> implementers. So, sorry, I can't defend that scenario with my limited >>> knowledge. >> >> This is intentionally left out, as we consider it a platform policy. >> For example you could update a single bank and copy over the remaining >> firmware images from a different ban. There's nothing on the spec that >> prohibits you from doing so, but I personally think it's a bad idea. >> > Me too. > >> Keep in mind there's a document hosted here[0] which explains the update >> flow and documents what we have as code in U-Boot. >> >> As far as individual firmware components go now, do you have any useful >> usecase? >> > No. And I don't think current A/B update implementation in u-boot > even has helpers for platforms to implement multiple images per bank. > Which is fine, except we pretend we do by having NUM_IMAGES_PER_BANK > config -- which will always be set to 1 I predict ;) Actually support is there but it requires one thing to patch. I will send that patch when I clean my repo. And I have tested it on our platform. > >> The general guidance of [0] is construct a firmware >> image, only update the components you want while leaving the rest on the >> same revisions and update the entire firmware. The reason is that firmware >> >> Updating a single image of another bank is not as easy as it sounds. >> > exactly. > >> Firmware components nowadays, whether we like it or not, depend on each other. >> Since firmware updates are not so often and fast, we didn't see any gains from >> over complicating the spec and explicitly describe that case, while dealing >> with firmware component compatibility at the same time. >> > Totally. As I said, I don't believe in the practicality of more than > 1 image/bank. > So we are on the same page. > >>> >>>> Next part which I want to take a look is practicality of CONFIG_FWU_NUM_BANKS >>>> and CONFIG_FWU_NUM_IMAGES_PER_BANK because it pretty much enforcing number of >>>> banks and images for every platform and prevent creating one u-boot which works >>>> on different boards and just use information from mdata. >>>> DEN0118 doesn't show any field with this information but do you think that would >>>> be possible to extract that information from there based on for example reserved >>>> or accepted field? >>>> >>> Unfortunately the DEN0118 spec doesn't leave any 'don't care' bits in >>> 'accepted' or 'reserved' fields, all unused bits Must-Be-Zero. If we >>> use any bit, we'll be in violation of the spec. >> >> Yes this is unfortunate. We did have similar concerns on when drafting the >> spec, however we never had a solid usecase to justify this. Arm and >> Linaro and working on a v2 (which we try to make compatible with v1) which >> addresses this shortcoming. Maybe Jose can chime in. >> Another way would be to simply decode this information directly from DT fwu-mdata node. Because from that node it is clear how many banks and how many images that particular bank has. Thanks, Michal