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 0A55CC6FD18 for ; Wed, 29 Mar 2023 13:02:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CF5DF85C95; Wed, 29 Mar 2023 15:02:28 +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="azFBZoh3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B8B885C96; Wed, 29 Mar 2023 15:02:26 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20611.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::611]) (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 9AEAF85C7B for ; Wed, 29 Mar 2023 15:02:20 +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=ZO7mYhff2l5p6f+LcqcnhXgLV8eV0YVXYFmNxXnzRB1LO9Hg4r+cT7ahgPKkKL0TcK8lB3AwEUwh73MnBG9iTQuTtkAoWitWq0LSZETyc+qzp2kQTP4HCjCOXega2FTVKEYduN4AV9P8uDShyO4NOg6wxoVGKNWeWvXsOdYIJj3BGXlmPBhEwB/FTgM9MMzmhdwRppKE9VcrQfcEgO3bYl8HvRYtjjsUyhvFWM/t6AO98s0JjPWuRSZ5e7dBN4jY3mQc4naO3yCaKTQtted2nRBr2r+kUCbNKHGcxUUvihDN0HksMBt9VIY7k2OMXFGYwr90IyQRBydFiTLgPZajOw== 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=nls/6YdQRNVBEiLtpLb8cI6BLhxlidSFavSARauMvoc=; b=fuWFIVRZ9qRTAp4MwVvzcf/qvFJl+u6JfoXayR15+204/UJ+2K84kF+AbzimCXi7xA7EZN5kTiqKPaRAdRzkA0rxfFsO1JTAmKI1DhP/rl/hBGRnLhEVxVe7jGl42pZ0d5NyexGxcj+XhoGp5Qq3iTILwL7schQsN/ocCVaAHMpMzsD7bW/m6Izsa4D0tGl+2viZxQVJJNgrdSxngFKVEMTi9QLtKKyGGDZ2403zCrP4gMdZ2LJacYD/1B9S4HUpIXVFr5T/v3CvmOu96CVT8k+kp+Zk2DiDW5H6v92RD5cpK9uWxHp60SljkzIuczJ/RSoh3JNfnQaYIMpCwrhVbA== 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=nls/6YdQRNVBEiLtpLb8cI6BLhxlidSFavSARauMvoc=; b=azFBZoh3kxKfkhSA/8MuevVGfYTOBPsjzIYQPLYYHsLobGXgG932nKA9uNdNpOt1kzCGbyacA5KPJkF7wNjpXyWN61DC7mvCa1scw/V5Im23mI7/RQVATPgCZ5CBPVxoFC3MuFIgoKDm3YqnlxmIBePeZw5qaSUmDGwsH8IrAuk= 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 IA1PR12MB8494.namprd12.prod.outlook.com (2603:10b6:208:44c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Wed, 29 Mar 2023 13:02:15 +0000 Received: from BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::4d07:7f52:c833:9603]) by BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::4d07:7f52:c833:9603%6]) with mapi id 15.20.6222.035; Wed, 29 Mar 2023 13:02:15 +0000 Message-ID: Date: Wed, 29 Mar 2023 15:01:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US To: jassisinghbrar@gmail.com, u-boot@lists.denx.de Cc: ilias.apalodimas@linaro.org, etienne.carriere@linaro.org, trini@konsulko.com, sjg@chromium.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de, takahiro.akashi@linaro.org, Jassi Brar References: <20230327211458.498879-1-jaswinder.singh@linaro.org> <20230327211640.499001-1-jaswinder.singh@linaro.org> From: Michal Simek Subject: Re: [PATCH v4 6/6] fwu: DeveloperBox: add support for FWU In-Reply-To: <20230327211640.499001-1-jaswinder.singh@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: VI1P190CA0037.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1bb::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_|IA1PR12MB8494:EE_ X-MS-Office365-Filtering-Correlation-Id: 8923a504-6748-404f-6daa-08db3055d165 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GeokH012JDqB8L4xniNGggMEszUKg5+rlz/73ip9eyol5Zoo7Eze1VJG6kwIyQ0C+vyVOXigZcySHMd+Q3NC7fJYUnOSfBgN4phYRnFm6BUY0pYNrhHI6I10nNV/VnuGs7Yo7Y+hRjgydbnG3U4ugvz6cA2J8ttfS01knekCDPn28qUtBszo3TbzP3qlNs6x32xbFRv9oPo2iy4HxVQYnPTt8bgDJwvYE70R3K98sbBlT/M6os+s23sTAHnXLn1DR8hafkmv2hXcwVM9UNTipXBO+ZRAVSJfH+3MQd0CRjDO5qHT9MKgUGX1AIUPk3ui7BXX9Jx0AFic1aLSZ0DxrXgJrdYuwO/lQVZMWbX0bPCLWY4y1xQe6tEXrXWq8cZTGwQCUpIFKZkTZKXIljz5rXS9+tKO90ExxgFoQmoKoqcG9eRHabZCEmvxXmzmJM+vFMYbThfFnpfdadR0QWqtIu09Ey3NERpl0ovHoaZ02n1k1foSLSErOJbML8qUsznKZWFXYp++ixm7/lpilXOVU7ZSOiqpu+HE1AXYhwZOh3qIkhL1k8Gy10jJohJ7AXiT04oAw76JE3uz17Rpue7RoJwE7JgL9BMTIRHF05RA0MRANe4nv7LggQQ5e2BrG6MOewyjp8xhQbf8FSK8GYMbgg== 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)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(83380400001)(31686004)(26005)(6666004)(53546011)(478600001)(316002)(7416002)(36756003)(8676002)(66476007)(66946007)(66556008)(41300700001)(31696002)(6506007)(86362001)(4326008)(2616005)(6512007)(966005)(38100700002)(6486002)(44832011)(30864003)(8936002)(5660300002)(2906002)(186003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TUluK3UxRFhCeVY0MFlCWmNhVHowOGxWTUhjeHdyaCtIb1RoMFYxeFMwS2ZY?= =?utf-8?B?SzJiU2dkYml1djRlYnM4L2UyRy9jK3Njc1NWS2dCU2psRTJWYW1GSzRUYTVW?= =?utf-8?B?R3NXaVIwSGJEWHo2WklIa2xjOUVvRS9HWGZmL3hFYXU0SjZoNXB2cFZYcThm?= =?utf-8?B?R0xkYTU3L3VtOTRPcXhiNU9KM2lucTRkdzJMOGdybEVlL1h6ODMvOGg1U0pa?= =?utf-8?B?NlpXKzN2ME5sMHdSU2dkSVhsU3dYVzQwWjRySmh6VGdKNHFGR2U0L2tYVDZy?= =?utf-8?B?SS9rR09nWFpxRG9ZY2cwTkdTU3poU0pUbWEzZy8wOE5yYzR2QWQrV25SYU4v?= =?utf-8?B?MHdXWlhpekZDaHh1QXBlRVJ0cEpId0NHYW5yM1lidUc2cVE5aHpKbDRscU9Y?= =?utf-8?B?UUdBTWRJOENwOW9wQjFpcXRVUStiaHFkRUtSUFgrZDA4bFJZa3B0S2kra1Zu?= =?utf-8?B?Sk53OWE0K1c0clcvdUMrZ2VqNjVCV1ViTHFoRDMwVDk2cWVqMG5Pa3VVeisz?= =?utf-8?B?SUdBV2RaZ0NBNjMzZkhzR0JqK3JUb1NQZSt5Mm4vQ0I1OW5xSTNzTHRxaW5z?= =?utf-8?B?Nnl2UThhcytaZDNTdWRqaFVIcXRkZ2VjNW11WnUzUTRLckJwUnlOanlEb2ZL?= =?utf-8?B?K3NGMjVBamxPaklyRW1pZ204eHJYT3UzN21Ud3VUdmgydlNDUDBYQVJ1WUha?= =?utf-8?B?aFVuN0tpU25LRVMzS29TOXg3cTdjQ3h5dHhRRGRaM0YvRStNM0paZWxkTFNj?= =?utf-8?B?ZlhkK09SeTBBakJVYzBkSzNDU29Id2pUL2xHQXNpUEpzeUVaV3V4NkJDUlpp?= =?utf-8?B?MFBCcjh2NmRGSE0wRlF5NE9Dbzg4YUdsaHcybnQ2ZXlMTm0rdVB1TlNORkZ6?= =?utf-8?B?Si9DRlVoWVhwbkFmcVFRM0d5Q0Vjcm9BUU1EVlZkaDJFTC8wbHBTZktDRjli?= =?utf-8?B?c1VkSGl3K3Y3ZDFScG5qT1JUUW1HcUd3ZDduY1JBQTNRZ0xMRXhCcFlxZGh1?= =?utf-8?B?NmlETU9ZT0V6TzJyWGROVDF2RzNlMXE0SFpGVzFrNnBJeFk5VFNCeFR2cnR4?= =?utf-8?B?RGpMamtaZ3BwUUwvd3hrWFQ4NTgva0JyaDlsZndhSkpCbXpjZjdDdFZOYm1N?= =?utf-8?B?RE82eVdaeUZNVG5zRUE1TzNKNUJlWkU2U0kreHlyMHlNT3dYTDhwQTJHb2Rl?= =?utf-8?B?WXF6UXdkZDRJWWw5WmZOa0FNd2Y3RkppUWdHSHpnanlmSG1KMmVTMXpFc09S?= =?utf-8?B?eWg3ZllvMnRvU3Zlc3VWTjhrQUdJdFNQeWVwUytsNC9XV3lCQjlMdnZxTTVk?= =?utf-8?B?WDZuclZ6aWdRc0lRNEgvZnphYWcrQlZRd295RXFlS09iL09oZ20xQXB6cXp1?= =?utf-8?B?NjdiRjJXTlRrS0FXaHR3NEE4TlBrUjlmd0FKei9kbUFFUzdTYksxcHp4dVpJ?= =?utf-8?B?YjNvaThyVU05WitRRk8zTkw1cG5yYnJpMktFa0JYZ3YwOXVrckJQOE10RzVE?= =?utf-8?B?OVozVjlQdTk5bmcyUXhTK2VmcTMwNnFqUGpBYVNtZE45OVJWM1V3cjJJNklv?= =?utf-8?B?K1JOdFYwdURXUWNvY3ZVc2s5bHlhbk5CblFuR3MrZVh3N2tjSGwyMStIMEwx?= =?utf-8?B?QWlKSTFIeUY0NVRqK2p1MGg0UytJYzJERTloU0NiRXIvdnlsU2dNY2xzOURm?= =?utf-8?B?QlFzMHlaaENNcURMYmIrOHEvVTNvQzN4WnpDaHZZS0MvcVlEMW5iSmIzenlW?= =?utf-8?B?NTN6L0I0NUxaUStuRFg0VS8vUWUwQ0dWM0xieEEvaWJTY25HRnQvWDNXUktT?= =?utf-8?B?UTJ3OFkzNmlSQXhxRWNYVUlzV3l6aGV0TWxQTHcxdU8xYzVyblNORm5PSmxm?= =?utf-8?B?bXNDUzM5N25Rd0tNNXhZTGhySHkwRDVPMjZUeitSSldOeDVNdkc1OHJ0bGpx?= =?utf-8?B?VW5UTGFvWmtVN2xZakowMUw0eHNwckJ1RTRXUGFGVUdGWHVqWlQ5WVdkaFZa?= =?utf-8?B?M3BSeTl0cEI5bU9ZN2xRbGtlUlVoZDgvdkpFNS9yT0RHSUhUNnl4dFBoVUVD?= =?utf-8?B?bHpaRE94aWhIWlM0RkhXdTV3ZnNVdU50SXNSTEhNcWJaQm80ZWtQSVN2R2tS?= =?utf-8?Q?9kqbKMuk+1K1ibzFzDnUHIRGI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8923a504-6748-404f-6daa-08db3055d165 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4758.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2023 13:02:14.9895 (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: pdCZ1UBjm5KdeLOP7vYxJGwbveGfrjbVoOUdIV075yqXuInYUnFoxOgx11HHvV2T X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8494 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 3/27/23 23:16, jassisinghbrar@gmail.com wrote: > From: Jassi Brar > > Add code to support FWU_MULTI_BANK_UPDATE. > The platform does not have gpt-partition storage for > Banks and MetaData, rather it used SPI-NOR backed > mtd regions for the purpose. > > Signed-off-by: Jassi Brar > --- > board/socionext/developerbox/Makefile | 1 + > board/socionext/developerbox/developerbox.c | 8 + > board/socionext/developerbox/fwu_plat.c | 57 +++++++ > configs/synquacer_developerbox_defconfig | 8 + > doc/board/socionext/developerbox.rst | 155 +++++++++++++++++++- > include/configs/synquacer.h | 10 ++ > 6 files changed, 233 insertions(+), 6 deletions(-) > create mode 100644 board/socionext/developerbox/fwu_plat.c > > diff --git a/board/socionext/developerbox/Makefile b/board/socionext/developerbox/Makefile > index 4a46de995a..1acd067a7e 100644 > --- a/board/socionext/developerbox/Makefile > +++ b/board/socionext/developerbox/Makefile > @@ -7,3 +7,4 @@ > # > > obj-y := developerbox.o > +obj-$(CONFIG_FWU_MDATA_MTD) += fwu_plat.o > diff --git a/board/socionext/developerbox/developerbox.c b/board/socionext/developerbox/developerbox.c > index 16e14d4f7f..ce2cccf4f0 100644 > --- a/board/socionext/developerbox/developerbox.c > +++ b/board/socionext/developerbox/developerbox.c > @@ -20,6 +20,13 @@ > > #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) > struct efi_fw_image fw_images[] = { > +#if CONFIG_IS_ENABLED(FWU_MULTI_BANK_UPDATE) > + { > + .image_type_id = DEVELOPERBOX_FIP_IMAGE_GUID, > + .fw_name = u"DEVELOPERBOX-FIP", > + .image_index = 1, > + }, > +#else > { > .image_type_id = DEVELOPERBOX_UBOOT_IMAGE_GUID, > .fw_name = u"DEVELOPERBOX-UBOOT", > @@ -35,6 +42,7 @@ struct efi_fw_image fw_images[] = { > .fw_name = u"DEVELOPERBOX-OPTEE", > .image_index = 3, > }, > +#endif > }; > > struct efi_capsule_update_info update_info = { > diff --git a/board/socionext/developerbox/fwu_plat.c b/board/socionext/developerbox/fwu_plat.c > new file mode 100644 > index 0000000000..29b258f86c > --- /dev/null > +++ b/board/socionext/developerbox/fwu_plat.c > @@ -0,0 +1,57 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Copyright (c) 2023, Linaro Limited > + */ > + > +#include > +#include > +#include > +#include > +#include > + > +#define DFU_ALT_BUF_LEN 256 > + > +/* Generate dfu_alt_info from partitions */ > +void set_dfu_alt_info(char *interface, char *devstr) > +{ > + int ret; > + struct mtd_info *mtd; > + > + ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN); > + memset(buf, 0, sizeof(buf)); > + > + mtd_probe_devices(); > + > + mtd = get_mtd_device_nm("nor1"); > + if (IS_ERR_OR_NULL(mtd)) > + return; > + > + ret = fwu_gen_alt_info_from_mtd(buf, DFU_ALT_BUF_LEN, mtd); > + if (ret < 0) { > + log_err("Error: Failed to generate dfu_alt_info. (%d)\n", ret); > + return; > + } > + log_debug("Make dfu_alt_info: '%s'\n", buf); > + > + env_set("dfu_alt_info", buf); > +} > + > +int fwu_plat_get_alt_num(struct udevice __always_unused *dev, > + efi_guid_t *image_id, u8 *alt_num) > +{ > + return fwu_mtd_get_alt_num(image_id, alt_num, "nor1"); > +} > + > +void fwu_plat_get_bootidx(uint *boot_idx) > +{ > + int ret; > + u32 active_idx; > + u32 *bootidx = boot_idx; > + > + ret = fwu_get_active_index(&active_idx); > + nit: remove this newline > + if (ret < 0) > + *bootidx = -1; > + > + *bootidx = active_idx; Is this logic here right? If fwu_get_active_index fails you setup bootidx to -1 and right after it you rewrite it to active_idx initialized in fwu_get_active_index() to mdata->active_index. It means why to do *bootidx = -1; at all? > +} > diff --git a/configs/synquacer_developerbox_defconfig b/configs/synquacer_developerbox_defconfig > index 09e12b739b..d09684153a 100644 > --- a/configs/synquacer_developerbox_defconfig > +++ b/configs/synquacer_developerbox_defconfig > @@ -97,3 +97,11 @@ CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y > CONFIG_EFI_CAPSULE_ON_DISK=y > CONFIG_EFI_IGNORE_OSINDICATIONS=y > CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y > +CONFIG_EFI_SECURE_BOOT=y > +CONFIG_FWU_MULTI_BANK_UPDATE=y > +CONFIG_FWU_MDATA=y > +CONFIG_FWU_MDATA_MTD=y > +CONFIG_FWU_NUM_BANKS=2 > +CONFIG_FWU_NUM_IMAGES_PER_BANK=1 > +CONFIG_CMD_FWU_METADATA=y > +CONFIG_TOOLS_MKFWUMDATA=y doesn't look like that it was created via savedefconfig. > diff --git a/doc/board/socionext/developerbox.rst b/doc/board/socionext/developerbox.rst > index 2d943c23be..908d3a7e6f 100644 > --- a/doc/board/socionext/developerbox.rst > +++ b/doc/board/socionext/developerbox.rst > @@ -57,14 +57,20 @@ Installation > > You can install the SNI_NOR_UBOOT.fd via NOR flash writer. > > -Flashing the U-Boot image on DeveloperBox requires a 96boards UART mezzanine or other mezzanine which can connect to LS-UART0 port. > -Connect USB cable from host to the LS-UART0 and set DSW2-7 to ON, and turn the board on again. The flash writer program will be started automatically; don’t forget to turn the DSW2-7 off again after flashing. > +Flashing the U-Boot image on DeveloperBox requires a 96boards UART mezzanine > +or other mezzanine which can connect to LS-UART0 port. > +Connect USB cable from host to the LS-UART0 and set DSW2-7 to ON, and turn the > +board on again. The flash writer program will be started automatically; > +don't forget to turn the DSW2-7 off again after flashing. > > -*!!CAUTION!! If you failed to write the U-Boot image on wrong address, the board can be bricked. See below page if you need to recover the bricked board. See the following page for more detail* > +*!!CAUTION!! If you write the U-Boot image on wrong address, the board can > +be bricked. See below page if you need to recover the bricked board. See > +the following page for more detail* > > https://www.96boards.org/documentation/enterprise/developerbox/installation/board-recovery.md.html > > -When the serial flasher is running correctly is will show the following boot messages shown via LS-UART0:: > +When the serial flasher is running correctly is will show the following boot > +messages shown via LS-UART0:: > > > /*------------------------------------------*/ > @@ -81,7 +87,144 @@ Once the flasher tool is running we are ready flash the UEFI image:: > flash rawwrite 200000 100000 > >> Send SPI_NOR_UBOOT.fd via XMODEM (Control-A S in minicom) << > > -*!!NOTE!! The flasher command parameter is different from the command for board recovery. U-Boot uses the offset 200000 (2-five-0, 2M in hex) and the size 100000 (1-five-0, 1M in hex).* > +*!!NOTE!! The flasher command parameter is different from the command for > +board recovery. U-Boot uses the offset 200000 (2-five-0, 2M in hex) and the > +size 100000 (1-five-0, 1M in hex).* > > -After transferring the SPI_NOR_UBOOT.fd, turn off the DSW2-7 and reset the board. > +After transferring the SPI_NOR_UBOOT.fd, turn off the DSW2-7 and > +reset the board. > > + > +Enable FWU Multi Bank Update > +============================ > + > +DeveloperBox supports the FWU Multi Bank Update. You *MUST* update both > +*SCP firmware* and *TF-A* for this feature. This will change the layout and > +the boot process but you can switch back to the normal one by changing > +the DSW 1-4 off. > + > +Configure U-Boot > +---------------- > + > +To enable the FWU Multi Bank Update on the DeveloperBox, you need to add > +following configurations to configs/synquacer_developerbox_defconfig :: > + > + CONFIG_FWU_MULTI_BANK_UPDATE=y > + CONFIG_FWU_MDATA=y > + CONFIG_FWU_MDATA_MTD=y > + CONFIG_FWU_NUM_BANKS=2 > + CONFIG_FWU_NUM_IMAGES_PER_BANK=1 > + CONFIG_CMD_FWU_METADATA=y > + > +And build it:: > + > + cd u-boot/ > + export ARCH=arm64 > + export CROSS_COMPILE=aarch64-linux-gnu- > + make synquacer_developerbox_defconfig > + make -j `noproc` > + cd ../ > + > +By default, the CONFIG_FWU_NUM_BANKS and CONFIG_FWU_NUM_IMAGES_PER_BANKS are > +set to 2 and 1 respectively. This uses FIP (Firmware Image Package) type image > +which contains TF-A, U-Boot and OP-TEE (the OP-TEE is optional.) > +You can use fiptool to compose the FIP image from those firmware images. > + > +Rebuild SCP firmware > +-------------------- > + > +Rebuild SCP firmware which supports FWU Multi Bank Update as below:: > + > + cd SCP-firmware/ > + OUT=./build/product/synquacer > + ROMFW_FILE=$OUT/scp_romfw/$SCP_BUILD_MODE/bin/scp_romfw.bin > + RAMFW_FILE=$OUT/scp_ramfw/$SCP_BUILD_MODE/bin/scp_ramfw.bin > + ROMRAMFW_FILE=scp_romramfw_release.bin > + > + make CC=arm-none-eabi-gcc PRODUCT=synquacer MODE=release > + tr "\000" "\377" < /dev/zero | dd of=${ROMRAMFW_FILE} bs=1 count=196608 > + dd if=${ROMFW_FILE} of=${ROMRAMFW_FILE} bs=1 conv=notrunc seek=0 > + dd if=${RAMFW_FILE} of=${ROMRAMFW_FILE} bs=1 seek=65536 > + cd ../ > + > +And you can get the `scp_romramfw_release.bin` file > + > +Rebuild OPTEE firmware > +---------------------- > + > +Rebuild OPTEE to use in new-layout fip as below:: > + > + cd optee_os/ > + make -j`nproc` PLATFORM=synquacer ARCH=arm \ > + CROSS_COMPILE64=aarch64-linux-gnu- CFG_ARM64_core=y \ > + CFG_CRYPTO_WITH_CE=y CFG_CORE_HEAP_SIZE=524288 CFG_CORE_DYN_SHM=y \ > + CFG_CORE_ARM64_PA_BITS=48 CFG_TEE_CORE_LOG_LEVEL=1 CFG_TEE_TA_LOG_LEVEL=1 > + cp out/arm-plat-synquacer/core/tee-pager_v2.bin ../arm-trusted-firmware/ > + > +The produced `tee-pager_v2.bin` is to be used while building TF-A next. > + > + > +Rebuild TF-A and FIP > +-------------------- > + > +Rebuild TF-A which supports FWU Multi Bank Update as below:: > + > + cd arm-trusted-firmware/ > + make CROSS_COMPILE=aarch64-linux-gnu- -j`nproc` PLAT=synquacer \ > + TRUSTED_BOARD_BOOT=1 SPD=opteed SQ_RESET_TO_BL2=1 GENERATE_COT=1 \ > + MBEDTLS_DIR=../mbedtls BL32=tee-pager_v2.bin \ > + BL33=../u-boot/u-boot.bin all fip fiptool > + > +And make a FIP image.:: > + > + cp build/synquacer/release/fip.bin SPI_NOR_NEWFIP.fd > + tools/fiptool/fiptool update --tb-fw build/synquacer/release/bl2.bin SPI_NOR_NEWFIP.fd > + > +UUIDs for the FWU Multi Bank Update > +----------------------------------- > + > +FWU multi-bank update requires some UUIDs. The DeveloperBox platform uses > +following UUIDs. > + > + - Location UUID for the FIP image: 17e86d77-41f9-4fd7-87ec-a55df9842de5 In past you have it listed at flash node in DT. I see you have removed it between v3 and v4 without any note about it. Is it still needed? And should it be listed in DT spec again? Thanks, Michal