From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 95D137803E4 for ; Thu, 7 Dec 2023 12:01:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dnIZ62finIK9UPvMwr+Aw1GG8g8B0LFZVb2URdBCUio=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:nodisclaimer:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1701950480; v=1; b=gjbJLIfgsOXlnGisAKS5nc0o6TOIL3FurWM7Fq3brK/0jrrVTgpTToIVggs9cIs2S4tePo5I 64jC1LrzkFJj/PbcfIRKziFdGdmfgTdZThCwe5Bl5HEZ0G1kLkeidHkQlYJ398iz2wOM8fnbYPI PwHzCXMaKE7eyyLssXVCj9vY= X-Received: by 127.0.0.2 with SMTP id 68BzYY7687511xYQX7AX9J0k; Thu, 07 Dec 2023 04:01:20 -0800 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.77]) by mx.groups.io with SMTP id smtpd.web10.82301.1701950478471270406 for ; Thu, 07 Dec 2023 04:01:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NcrMrlDvFpeEGFHhvCdz2HT19ULbwDo90a0l//5RJD6ng/m9G/If7Bqz9ZeFfVIlIbGBGxhugFxkMKX26oSFiBj0EsEJ1Il5ESO6RLod22gFz3R0Oq5hV9H3JqMjc2618K2EgYl4f1o7ksTQFgdjKGFsjtmfWFvZd/rkKimI2tXfNtmPR+nq334TxlBe/BpeoICnx0QRBGvkKHDatowm4OGsE3tFjkEYZYYqxRHJ6Tn8HmPoR+GMuzWnue7UeKjokW4UOICwxD9HsDJ/bMXyrY/gDS82TMhlIFJ5IsBQcZmE4Lw0Kf52heAH+Kxt11Amqgm06tAOKbpc3J2nFFt2/g== 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=GJZBc2lcls0kdaXnwIQ/bjkPtd67KO0Gu0v4MFwIiCs=; b=CEnktwfhqxkjnaUPDFOqz1jBF6fusOdlXQZi4IPIW7gvRov/R8sajdKqsSrOvl14R5ux6ZZ+lnmfi0GnHjvREOl/cX5Ikk1TIB2nKzowaKHu7lT5rfDOY/mWToH/eDYgnL/gd6MRJYV+QToiNLf7sTeZbjHhdQ/Ul6NtqielRZ7BoFW6QDhPcvlKVIMgn4aLW7f5uaMUauXELc9ii0dk5PcCYXT32tUQy+YlNLoF4246b14zVieGdIPZ9wtyZsZRYf9fCj7WxfJtma75pFyRBhmliyzPWyL2iJT7TSlZTdqD3j4OQndAnxISOdtI2PcQuHgbYfSVh36K+WOQyMm//g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none X-Received: from DB4PR08MB7934.eurprd08.prod.outlook.com (2603:10a6:10:37a::11) by DU0PR08MB9773.eurprd08.prod.outlook.com (2603:10a6:10:446::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.26; Thu, 7 Dec 2023 12:01:14 +0000 X-Received: from DB4PR08MB7934.eurprd08.prod.outlook.com ([fe80::51a9:3f29:6df3:c82]) by DB4PR08MB7934.eurprd08.prod.outlook.com ([fe80::51a9:3f29:6df3:c82%4]) with mapi id 15.20.7046.034; Thu, 7 Dec 2023 12:01:14 +0000 From: "Thomas Abraham" To: "devel@edk2.groups.io" , Sahil Kaushal CC: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Chandni Cherukuri , nd Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 2/5] Silicon/ARM/NeoverseN1Soc: NOR flash library for N1Sdp Thread-Topic: [edk2-devel] [edk2-platforms][PATCH V1 2/5] Silicon/ARM/NeoverseN1Soc: NOR flash library for N1Sdp Thread-Index: AQHaGIKjCXj0jFN0dUa0Hj8FqkkxZLCd1TMw Date: Thu, 7 Dec 2023 12:01:14 +0000 Message-ID: References: <20231116114554.4055517-1-sahil@arm.com> <20231116114554.4055517-3-sahil@arm.com> In-Reply-To: <20231116114554.4055517-3-sahil@arm.com> Accept-Language: en-IN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: F2EC0C1E5725F2469CE450D42144024E.0 x-checkrecipientchecked: true x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB4PR08MB7934:EE_|DU0PR08MB9773:EE_ x-ms-office365-filtering-correlation-id: cc3e6487-bb2a-4352-ef5e-08dbf71c3660 nodisclaimer: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: Gwggor66nh7nBPeu2mpVHMqJl9FQEZygRR98pAxwpLt7sQiz0ReC6jj177esazb8kczqypp8OT0ri08ZsITFRIjDp5mMys12t+K0dC/KLspHWdQtV4wLAgsXMjF4jdAokAmpBSZkOBPcbkQqxuKpGHjthMADolPAqO+0c93GsFmuHnfPONwNl/g4Z0KBk36qmFxiJLxarKhnp7AWfJoC/WjWy1j6TP/vJKHZGVd/e02IGUb5S0FABq7fev+gMB78+rL0wHjFgpZ3Pqf3SMuSGvbaCGFejcpGLDHBv3kJIRgzT7QNWp2bdksjYV85rz6npzEVSBefvpT1V0L9N8R8KC81dkARgXBFAr1PUAua2Cwmyv+3/6Lk3RDwm4thJNlq2cPng8g18wbiYvAdBvGhGLRv9buq52v1xB34p+B8TJuY/yN//I8GbktDj394hDIAhhnnWH+AWDZhIWlsjhq0BMkBFn2Ag0YzgAHt7s/IUOqfd+ZXrk0iEah6MNzLdGFz10c84bfPhLQfGBBsFx7Gqkr83KFES23KxQBrjcBvkpDm70E+0EEpJjHxetdONPZdbiCHewq7b5Dszst9ASJhHP6Rq7CZBxYvuSzelwUBTSXmm/f+/OtNIsJ5IFmoCgS46P9fMCUW+JXgxMMbsV4c3A== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HNACXsMQO4GDtBkFqLMTY3YBVmEz5zRmT0yBljCi7FN8qLyb67KS/6Qdr7Mj?= =?us-ascii?Q?FlGAxykkQ2gZ/QhWbW8eMiBxuQau+fN4PquMksz/WVxm9rpW7cuJZVKE7U7n?= =?us-ascii?Q?aZJBkx7epl4HDMRqvFePzQPQ3XdhiqVBFZ0Q2MpcHJatacyMlr73N0fVmO5e?= =?us-ascii?Q?lBTndATd5pnMHXKokG8yBRPg8b8FY5/vG1zHwRnaQyn162Q8rnlUSL78sTV7?= =?us-ascii?Q?/QXTGZIi/dsl/UqHPJNs75yhUqYZxKxhRg7PDkm9oVlFvBCYOz0x+kt2baZ9?= =?us-ascii?Q?4ySin8TZLFZfoz1QjniyKrTej9xO+MEMY2FUNBesu6GT1n5fHRUlZYP7Dimn?= =?us-ascii?Q?WFFpYZlyrxQpYtay27Z2JbEoB3g/H9PXmboFwxc2Ccx21ZmyCzWdKwvoHGez?= =?us-ascii?Q?gX+Mhdwxy+l+re4obdWlbtzpk1wqkQOVR+zCt5x6Ulr2SXPnDyWZWAjI2sUR?= =?us-ascii?Q?eIXA7qp/cHKzTCb+fE9kP8r1FhdLnmUtzwwAlhZUe17BzMo1AHF+VmL+LJNV?= =?us-ascii?Q?KJdazS1orl70c6arRT3MpK6NXUJ4ejJJ1ExbFEmd48D0c117hz2t7KUyGH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M9RFXLC0vtoDtsJzscLigvnCmuiLgRe?= =?us-ascii?Q?30sp09lzWVP3JT00adKG9/wA45o7h7qUvoa6mMzRzMh7jdAinh0/B7R2I31d?= =?us-ascii?Q?KVs2mSDkPAkf/Ddlpo6Xz5NJ0ylyERA6SKngVN9UQyRkHWM97SkGHVUxMcSn?= =?us-ascii?Q?UDYWpCBQfdkxjPQnh9XYYM+L+oPr4nW1H/+2at/8OxEW?= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB4PR08MB7934.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc3e6487-bb2a-4352-ef5e-08dbf71c3660 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2023 12:01:14.6193 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9Z4+g1w1EPHqS7Cdwe56Gj8tHIFHGTXmW+iuQ1T3BN3RZjyMb/Ag0gqmo+3luwqWyKZy362dFSp0HEhSlv8JJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9773 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 Reply-To: devel@edk2.groups.io,thomas.abraham@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 04GmCYZ7QBP4JPBxDNNKKOxYx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=gjbJLIfg; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Sahil, > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of sahil via > groups.io > Sent: Thursday, November 16, 2023 11:46 AM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; Leif Lindholm > ; Sami Mujawar ; > Sahil Kaushal > Subject: [edk2-devel] [edk2-platforms][PATCH V1 2/5] > Silicon/ARM/NeoverseN1Soc: NOR flash library for N1Sdp >=20 > Add NOR flash library, this library provides APIs for getting the list > of NOR flash devices on the platform. >=20 > Signed-off-by: sahil > --- > Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.inf | 36 > ++++++++++++++ > Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c | 52 > ++++++++++++++++++++ > 2 files changed, 88 insertions(+) >=20 > diff --git a/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.in= f > b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.inf > new file mode 100644 > index 000000000000..14f81125c4e1 > --- /dev/null > +++ b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.inf > @@ -0,0 +1,36 @@ > +## @file >=20 > +# NOR flash lib for ARM Neoverse N1 platform. >=20 > +# >=20 > +# Copyright (c) 2023, ARM Limited. All rights reserved.
>=20 > +# >=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x0001001B >=20 > + BASE_NAME =3D NorFlashNeoverseN1SocLib >=20 > + FILE_GUID =3D 7006fcf1-a585-4272-92e3-b286b1dff5b= b >=20 > + MODULE_TYPE =3D DXE_DRIVER >=20 > + VERSION_STRING =3D 1.0 >=20 > + LIBRARY_CLASS =3D NorFlashPlatformLib >=20 > + >=20 > +[Sources.common] >=20 > + NorFlashLib.c >=20 > + >=20 > +[Packages] >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > + MdePkg/MdePkg.dec >=20 > + Platform/ARM/ARM.dec >=20 > + Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec >=20 > + >=20 > +[LibraryClasses] >=20 > + BaseLib >=20 > + DebugLib >=20 > + IoLib >=20 > + >=20 > +[FixedPcd] >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase >=20 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize >=20 > diff --git a/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c > b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c > new file mode 100644 > index 000000000000..a508d7d77373 > --- /dev/null > +++ b/Silicon/ARM/NeoverseN1Soc/Library/NorFlashLib/NorFlashLib.c > @@ -0,0 +1,52 @@ > +/** @file >=20 > +* NOR flash lib for ARM Neoverse N1 platform >=20 > +* >=20 > +* Copyright (c) 2023, ARM Limited. All rights reserved.
>=20 > +* >=20 > +* SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +* >=20 > +**/ >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#define FW_ENV_REGION_BASE FixedPcdGet32 > (PcdFlashNvStorageVariableBase) >=20 > +#define FW_ENV_REGION_SIZE (FixedPcdGet32 > (PcdFlashNvStorageVariableSize) + \ >=20 > + FixedPcdGet32 (PcdFlashNvStorageFt= wWorkingSize) + \ >=20 > + FixedPcdGet32 (PcdFlashNvStorageFt= wSpareSize)) Why is FtwWorkingSize and FtwSpareSize included in the calculation of the s= ize? Are these not offsets inside a flash region? >=20 > + >=20 > +STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] =3D { >=20 > + { >=20 > + /// Environment variable region >=20 > + NEOVERSEN1SOC_SCP_QSPI_AHB_BASE, ///< device base >=20 > + FW_ENV_REGION_BASE, ///< region base >=20 > + FW_ENV_REGION_SIZE, ///< region size >=20 > + SIZE_4KB, ///< block size >=20 > + }, >=20 > +}; >=20 > + >=20 > +/** >=20 > + Get NOR flash region info >=20 > + >=20 > + @param[out] NorFlashDevices NOR flash regions info. >=20 > + @param[out] Count number of flash instance. >=20 > + >=20 > + @retval EFI_SUCCESS Success. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +NorFlashPlatformGetDevices ( >=20 > + OUT NOR_FLASH_DESCRIPTION **NorFlashDevices, >=20 > + OUT UINT32 *Count >=20 > + ) >=20 > +{ >=20 > + if ((NorFlashDevices =3D=3D NULL) || (Count =3D=3D NULL)) { >=20 > + return EFI_INVALID_PARAMETER; >=20 > + } >=20 > + >=20 > + *NorFlashDevices =3D mNorFlashDevices; >=20 > + *Count =3D ARRAY_SIZE (mNorFlashDevices); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > -- > 2.25.1 -=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 (#112184): https://edk2.groups.io/g/devel/message/112184 Mute This Topic: https://groups.io/mt/102625034/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-