From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6B1D2D80C7F for ; Tue, 21 May 2024 13:00:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=I4phA1xHlgWqi146MsLwmFL8gfgFqJJEs+jq2vYam/8=; c=relaxed/simple; d=groups.io; h=Received-SPF:Authentication-Results-Original:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:NoDisclaimer:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1716296406; v=1; b=i9MfQbwPD7n6koqtBPaN0I7fBEufTlo0I4dseijYwnUKz7B8N6vmrHJEtT1EUSPoUDu+LhTg 3KbhSgBRloWYrCou820LxHZJnk/k+UzruhnNk/J6D810P5zOJR0Tc7qivxDn0Lk6vhARlYd6H74 J4gCseTn9LfUdhcfRjZtFn44uNN5kHd5W0kCZioDQQ6yn76LVNxMo7aTRp8Vr56mwuFYyfl+Kta w8loVKzz2d6ADIVSDWicOnkVtyJNPpAQIuUtAlikKHsgw0BKnZquuzCP2gMaPCp2/sNqgZEU6bp wzKbTSnNX3Gp+2NIORFGpaeEYDIF7LL1Xeja0uyg6fCaA== X-Received: by 127.0.0.2 with SMTP id qkelYY7687511x79q7nnkVJH; Tue, 21 May 2024 06:00:06 -0700 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.73]) by mx.groups.io with SMTP id smtpd.web10.18965.1716296400107305463 for ; Tue, 21 May 2024 06:00:00 -0700 X-Received: from AS9P250CA0017.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:532::16) by GV2PR08MB8028.eurprd08.prod.outlook.com (2603:10a6:150:79::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 12:59:56 +0000 X-Received: from AM3PEPF00009B9E.eurprd04.prod.outlook.com (2603:10a6:20b:532:cafe::69) by AS9P250CA0017.outlook.office365.com (2603:10a6:20b:532::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.28 via Frontend Transport; Tue, 21 May 2024 12:59:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM3PEPF00009B9E.mail.protection.outlook.com (10.167.16.23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7611.14 via Frontend Transport; Tue, 21 May 2024 12:59:51 +0000 X-Received: ("Tessian outbound daa456608199:v315"); Tue, 21 May 2024 12:59:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d99b799449d7e425 X-CR-MTA-TID: 64aa7808 X-Received: from 282b25f2458d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 34059EED-3EE1-42C3-BCDE-F3ABD9D8FE88.1; Tue, 21 May 2024 12:59:44 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 282b25f2458d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 21 May 2024 12:59:44 +0000 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AS8PR08MB6536.eurprd08.prod.outlook.com (2603:10a6:20b:31d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 12:59:41 +0000 X-Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::1e13:dc65:224e:219c]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::1e13:dc65:224e:219c%5]) with mapi id 15.20.7587.035; Tue, 21 May 2024 12:59:41 +0000 Message-ID: <0e04c53f-47fe-43c5-a11c-f00ea7202e1b@arm.com> Date: Tue, 21 May 2024 13:59:36 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH RESEND edk2-platforms][PATCH V2 11/14] Silicon/ARM/NeoverseN1Soc: NOR flash library for N1Sdp To: devel@edk2.groups.io, sahil@arm.com Cc: Sahil Kaushal , Ard Biesheuvel , Leif Lindholm , "nd@arm.com" References: <20240423055638.1271531-1-Sahil.Kaushal@arm.com> <20240423055638.1271531-12-Sahil.Kaushal@arm.com> <5c52b3a6-be91-497a-bea2-551188399602@arm.com> From: "Sami Mujawar" In-Reply-To: X-ClientProxiedBy: LO6P265CA0017.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ff::8) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|AS8PR08MB6536:EE_|AM3PEPF00009B9E:EE_|GV2PR08MB8028:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c7952d7-26c8-4e6a-2ee2-08dc7995e767 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info-Original: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WDVuYmZK?= =?utf-8?B?S2lMZ1hNZURXTTN4VHhnZE5hdFB3RFBpMmlQOFMyK3p6bjJ5M3dBR2Y5K3No?= =?utf-8?B?WE5DSW5Za09rNENncS9SUzNQMFp5cnlqM1RRR2VJMWR2aDBRRmFGK1JKaHQw?= =?utf-8?B?WVVoY3dhVlA4ajJMUXp6cmIyZ1JwY2RFcnhjbzhCMTR2STNRZlkrQTVHeGNt?= =?utf-8?B?VXNzMnNONHBaM1VFSjJYQW9Ld0d6czQwY1V4eE5sbFkzYnlQOXlBTjhaNnpY?= =?utf-8?B?YWNOL21pYnNpMTV4OERSTi81bjFkY2FtczRxTjFicTAvejg3dmpIREFvbU1B?= =?utf-8?B?V2d1WDFFenZRZFBUeENzQnFoSU9LdThZU1JKanVkUGZOaU5sdUVDUG9KZVMz?= =?utf-8?B?WVprS2FOaE5UbENhZmxicjlhU1R6RmtpS3N5eUduNkozM0t3K2xmS0dqT01o?= =?utf-8?B?TlkxVFV2TnpxWnV0U0dNMG9NSWQxZHVOSy9US20yN1RMTFg2LzUrVXEyaWNw?= =?utf-8?B?SXN5YTJBOFpNbHRZNzYydDQ2alRLeDVVTGtxM2lrWU9BRVl0ZWk1MWhuejdU?= =?utf-8?B?eHJzQzB5WXliOUtENjFSZVRyaXhjRjRSdWMwazRJWVoxZlpVWXRGTlEzWHBD?= =?utf-8?B?WkVKQlpFZjdnTWF6QWQ3NTdNT3dlaHBkRGwzbmdTN2I2YUpFWDBqUHN5WGNZ?= =?utf-8?B?TUpiVnV4QTJHMk9VVjJMbmNRcXl0UDFwSitsblRwdVpQajNVdTFoWmswL3g3?= =?utf-8?Q?AlNyhRqc7nmg/L7WkZxkPG5VP0AUQJZepAZgxgCLJ7g0=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6536 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF00009B9E.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 77bbe845-4bf4-46bc-d2be-08dc7995df22 X-Microsoft-Antispam-Message-Info: =?utf-8?B?MGVKcUxHelQ5aFBYVU9ma3RHNmlJcXRYZVBHVEsvU2hHNjNKeEMzSC9zYktG?= =?utf-8?B?ZjFnQTRWMXkvb2RsbFFFWjJLa2FGZEg4N0dyYkdONnRkOE1ZVzJ2YW1mdnhl?= =?utf-8?B?dUtFS0hRTmlnbHdxWndhRXcwTHhTNmovU2hnMGtxZUszTzdlTGV4M1RmZ1BQ?= =?utf-8?B?b2JlN2JPZUtCUDhNeXRwS0RKcG9xRWswZ1Y1bFk3Sk5EWE9COFNBQllPK05z?= =?utf-8?B?dERVTFluelVhYWZuQ1B0MzNrQmdySFRpL2kyc2NTa3JnWDB4blNXend0Q1JN?= =?utf-8?B?d1VLRUNEdCsrMEVFc3YyRXo5TEhydEJYTTJuQzZrKzhURW1KcExVQTZud2NU?= =?utf-8?B?MUtmam95ZXJqQ3RpaXE0SHZXUklNb3AzdGlpdVBNUWtENlRYQUVUaVk0WFlP?= =?utf-8?B?SElaZm45Kyt4L1lsUXFxYkQ4QTN4K0ZtRUF3bmVMb0VmWE83YWN2VitYSDZB?= =?utf-8?B?dW9vMmVBeUgzVzZzdzMrdURiZFJkaXRTcTZFMUxpYllucU9ESTl1UVFhcFR4?= =?utf-8?B?VURMNXpBS3BSdVpweDNzU3ovYitXQllWWDFsQ1hCZmRkcTRaT085M3Jzc3Ey?= =?utf-8?B?d2V0WWxCaXZVZXJKemR5bEtxQXdZTzdGekd1M0Z2aEVSQlFoZXBWeE1neXl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cXFWM3krTnZ3dU9TOEFWZFdP?= =?utf-8?B?Z0N3dUR3Yy9RL0tjajZzOS9RUHZqMXhLVFoyYVlzSTZlRFJJTlZjZEVjak1M?= =?utf-8?B?dmJPRGJqL1dwZXExUm84OTNNN29IcXl3M2ZGU2RqUW4vdnN1S2xnYXdESGZk?= =?utf-8?B?bG9SMzBIc1l6SUE5cFNUcHVQclBhYTJPa29jRWdqbDEzSHp2U2p2bEZ4RHhx?= =?utf-8?Q?Ah7G2KbGngVVBAa/HNRooX47qyj1s9ydkE1RYKa?= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 12:59:51.8529 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c7952d7-26c8-4e6a-2ee2-08dc7995e767 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF00009B9E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8028 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 21 May 2024 06:00:00 -0700 Resent-From: sami.mujawar@arm.com Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: wK21zqYBm1MlLRZYTFcmzldGx7686176AA= Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=i9MfQbwP; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Hi Sahil, Please see my response marked inline as [SAMI]. Regards, Sami Mujawar On 21/05/2024 10:24 am, sahil via groups.io wrote: > Hi Sami, > Thank you for reviewing the patches. > Please find my comments inline below marked as [SAHIL]. > > On Thu, 16 May 2024 at 20:54, Sami Mujawar via groups.io > wrote: >> Hi Sahil, >> >> Thank you for this patch. >> >> I have some suggestions marked inline below, otherwise this patch looks = good to me. >> >> With that fixed, >> >> Reviewed-by: Sami Mujawar >> >> Regards, >> >> Sami Mujawar >> >> On 23/04/2024 06:56 am, Sahil Kaushal wrote: >> >> From: sahil >> >> Add NOR flash library, this library provides APIs for getting the list >> of NOR flash devices on the platform. >> >> [SAMI] I think the information in the commit message of patch 10/14 woul= d be more useful here. >> >> Not mandatory, but it may be useful to have an ASCII diagram to explain = the flash partitioning. >> >> [/SAMI] > [SAHIL] > I will add more information to the commit message. > As for the ASCII diagram, as the size of the images can change, it > will not be possible to make an accurate diagram. > [/SAHIL] [SAMI] See if you can represent the layout, otherwise ignore my comment.=20 [/SAMI] > >> Signed-off-by: sahil >> --- >> Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.inf | 34 +++= +++++++ >> Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c | 65 +++= +++++++++++++++++ >> 2 files changed, 99 insertions(+) >> >> diff --git a/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.i= nf b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.inf >> new file mode 100644 >> index 000000000000..fad3bca79d3a >> --- /dev/null >> +++ b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.inf >> @@ -0,0 +1,34 @@ >> +## @file >> >> +# NOR flash lib for ARM Neoverse N1 platform. >> >> +# >> >> +# Copyright (c) 2024, ARM Limited. All rights reserved.
>> >> +# >> >> +# SPDX-License-Identifier: BSD-2-Clause-Patent >> >> +# >> >> +## >> >> + >> >> +[Defines] >> >> + INF_VERSION =3D 0x0001001B >> >> + BASE_NAME =3D NorFlashNeoverseN1SocLib >> >> + FILE_GUID =3D 7006fcf1-a585-4272-92e3-b286b1dff5= bb >> >> + MODULE_TYPE =3D DXE_DRIVER >> >> + VERSION_STRING =3D 1.0 >> >> + LIBRARY_CLASS =3D NorFlashPlatformLib >> >> + >> >> +[Sources.common] >> >> + NorFlashLib.c >> >> + >> >> +[Packages] >> >> + MdeModulePkg/MdeModulePkg.dec >> >> + MdePkg/MdePkg.dec >> >> + Platform/ARM/ARM.dec >> >> + Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec >> >> + >> >> +[LibraryClasses] >> >> + BaseLib >> >> + >> >> +[FixedPcd] >> >> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize >> >> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize >> >> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase >> >> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize >> >> diff --git a/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c= b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c >> new file mode 100644 >> index 000000000000..a48db9c74548 >> --- /dev/null >> +++ b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c >> @@ -0,0 +1,65 @@ >> +/** @file >> >> +* NOR flash lib for ARM Neoverse N1 platform >> >> +* >> >> +* Copyright (c) 2024, ARM Limited. All rights reserved.
>> >> +* >> >> +* SPDX-License-Identifier: BSD-2-Clause-Patent >> >> +* >> >> +**/ >> >> + >> >> +#include >> >> +#include >> >> +#include >> >> + >> >> +#define FW_ENV_REGION_BASE FixedPcdGet32 (PcdFlashNvStorageVariableBas= e) >> >> +#define FW_ENV_REGION_SIZE (FixedPcdGet32 (PcdFlashNvStorageVariableSi= ze) + \ >> >> + FixedPcdGet32 (PcdFlashNvStorageFtwWorkingS= ize) + \ >> >> + FixedPcdGet32 (PcdFlashNvStorageFtwSpareSiz= e)) >> >> [SAMI] Would it be an issue if someone were to increase the storage vari= able sizes above? >> >> How can you prevent someone overwriting the flash region used by the SCP= ? >> >> Would it make sense to add a check in NorFlashPlatformInitialization() ? >> >> [/SAMI] > [SAHIL] > With the current code, the firmware images take ~2.5MB and the > variable storage region starts at 15MB > offset from the base. The firmware image's size is unlikely to change muc= h. > Therefore, it is unlikely to cause any issue if someone tries to > increase the variable > region by decreasing the PcdFlashNvStorageVariableBase. > > If we still want to add a check, I can add an assert checking > PcdFlashNvStorageVariableBase offset is > not <=3D to a particular offset (maybe 8MB) in NorFlashPlatformInitializa= tion(). > Would this be fine? [SAMI] Yes, an assert at the appropriate place would be good. Also think=20 if it would make sense to add a check and return an error. [/SAMI] > [/SAHIL] > >> + >> >> +STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] =3D { >> >> + { >> >> + /// Environment variable region >> >> + NEOVERSEN1SOC_SCP_QSPI_AHB_BASE, ///< device bas= e >> >> + FW_ENV_REGION_BASE, ///< region bas= e >> >> + FW_ENV_REGION_SIZE, ///< region siz= e >> >> + SIZE_4KB, ///< block size >> >> + }, >> >> +}; >> >> + >> >> +/** >> >> + Dummy implementation of NorFlashPlatformInitialization to >> >> + comply with NorFlashPlatformLib structure. >> >> + >> >> + @retval EFI_SUCCESS Success. >> >> +**/ >> >> +EFI_STATUS >> >> +NorFlashPlatformInitialization ( >> >> + VOID >> >> + ) >> >> +{ >> >> + return EFI_SUCCESS; >> >> +} >> >> + >> >> +/** >> >> + Get NOR flash region info >> >> + >> >> + @param[out] NorFlashDevices NOR flash regions info. >> >> + @param[out] Count number of flash instance. >> >> + >> >> + @retval EFI_SUCCESS Success. >> >> + @retval EFI_INVALID_PARAMETER The parameters specified are no= t valid. >> >> +**/ >> >> +EFI_STATUS >> >> +NorFlashPlatformGetDevices ( >> >> + OUT NOR_FLASH_DESCRIPTION **NorFlashDevices, >> >> + OUT UINT32 *Count >> >> + ) >> >> +{ >> >> + if ((NorFlashDevices =3D=3D NULL) || (Count =3D=3D NULL)) { >> >> + return EFI_INVALID_PARAMETER; >> >> + } >> >> + >> >> + *NorFlashDevices =3D mNorFlashDevices; >> >> + *Count =3D ARRAY_SIZE (mNorFlashDevices); >> >> + return EFI_SUCCESS; >> >> +} >> >> > >=20 > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119102): https://edk2.groups.io/g/devel/message/119102 Mute This Topic: https://groups.io/mt/105690946/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-