From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.57375.1675699425672446010 for ; Mon, 06 Feb 2023 08:03:45 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JjU+k+sW; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: andrei.warkentin@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675699425; x=1707235425; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gxMA//wbgd9+lU3u85WdMvLn10syhOrLEzMKpyRtvcQ=; b=JjU+k+sWlODvAgcNOXt1gy4ta4fOGVspnfOIDi7gyavX/6LO/i2IS5M9 dE3FSBOMxkV669G0bbm0xDAMWGJwjR6a+HlpE7gQo0IONzUp9MWNYnThE afY+JjN/GKHB4Ow4f33dXYIiHZGldlC3inr49oK9XcZZPRthflFJCxWjy Tuu0AxhabJU/9gVUGNMdr/V1y1Id8ezX6P3m2zFhapkXmWNmUQI+hdGh6 m8ZaQ8SObm/Pjso6wjn17MS3BQv6SOqvWsl3uD3J90hc2oGflyaBeTmMt VvubzMAhprjDqOl6VRd0fHFmR24pqA4YL6uu6d2YxqsMlOEyxR6OLwCyh Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="317248955" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="317248955" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 08:02:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="755282916" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="755282916" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by FMSMGA003.fm.intel.com with ESMTP; 06 Feb 2023 08:02:23 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 6 Feb 2023 08:02:23 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 6 Feb 2023 08:02:23 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 6 Feb 2023 08:02:23 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 6 Feb 2023 08:02:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fcGzQSxeA12+P6pGQLSDs+eUlAR/UHDxzG2nNlxsYQ2cE1iEJNia7HNhsuIv7IGbtMqWLI81RyYwxqI6OXFw+rRJkLIbFwgBnp7CNBydo3tCwtXav0yx1+MRHNCCOrvLSOOnZNnze/3Sh95IXPzlXTbESo1UDaZf7Sshn4KU5EdB9lsoIV2aVYK7rhLvhEtUN2KlHRfJ1jzaOPvQnPeMouMg9MdsUc1JTdpwK7mZ8F3p/lKS0iKe8BcrBv00HiG/VMfbFhd0iSlFaA+PkPcmLxBoh0cei+bRMwd/SspPaVF2BL3wU0hARhDTFOBgU1AR+Yeadt3AumDS0NUYzKtwLA== 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=/zYFYGRD9ohnpLt25P2U9PxPKBM7kpy0vcqepFRuVyg=; b=ar+H6E+XInXrIdMGQzzCkJuEoAkY84dZUPw7gIDMfCJiVP9/PG0gjoTILZTGQ/XV4cg9AAOwLYk8TrM2sDbjQrJ+h1X6F0YBU3NrxR02U2d3IpnnlEmAOPpiTDQnfYCSyl4BWhCK98QxMt8y3byQ/wQ7Ou62Qt1llUh/KMF6WCNDEQm+rb3fIoHVIKtcezoyV+4L6UxoQzvPds1F2fVLmgqHt2WibRcTgpxui9U1uohWZyuKirIWh8xRx2FOyCHeh0Q0Gxqru7eJtRB1HgZhzoAGtIazsVCI1+7ywwT80giC+r/3NVaQiMMd7h9hNgwEqrd2kY19pEgujTnWY/n7YA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH8PR11MB6856.namprd11.prod.outlook.com (2603:10b6:510:22b::7) by CH3PR11MB7938.namprd11.prod.outlook.com (2603:10b6:610:12f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 16:02:20 +0000 Received: from PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::9dba:633a:320c:87b]) by PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::9dba:633a:320c:87b%5]) with mapi id 15.20.6064.032; Mon, 6 Feb 2023 16:02:20 +0000 From: "Andrei Warkentin" To: "devel@edk2.groups.io" , "sunilvl@ventanamicro.com" CC: Ard Biesheuvel , "Yao, Jiewen" , "Justen, Jordan L" , "Gerd Hoffmann" , Abner Chang Subject: Re: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V7 16/20] OvmfPkg/RiscVVirt: Add VirtNorFlashPlatformLib library Thread-Topic: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V7 16/20] OvmfPkg/RiscVVirt: Add VirtNorFlashPlatformLib library Thread-Index: AQHZM01jEGXahu1z4EeZSSldTYex967CIirw Date: Mon, 6 Feb 2023 16:02:19 +0000 Message-ID: References: <20230128191807.2080547-1-sunilvl@ventanamicro.com> <20230128191807.2080547-17-sunilvl@ventanamicro.com> In-Reply-To: <20230128191807.2080547-17-sunilvl@ventanamicro.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6856:EE_|CH3PR11MB7938:EE_ x-ms-office365-filtering-correlation-id: c742af3f-9af5-4fdb-fd55-08db085b86d4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jY5Fyehkl4hwmWV4x9JuBjCEaaeqM5jtokpaLyop/MMoQVCranaaElVOnGazNsb0dd3wirTehPx3MrMrMSPJMmb1exh2vjKvzVF6/ZmT96we6ZZaV8Ewlp+HeN+r7Cbr498aI42Zfhj6cEo/xgsVxLDyU9oe7yqoZlylpB8vPEDkVKQDwlFu1HQoLApnNE0uSaG3u6P5vL3qkBAtOvpi9DSj+1MMzk8HbUbttqult67MmT8rN3GZaXDTdsPsrY/QD2PUNLLi7//3B+SXSnN6bffY4oYckXHVDIGu6k74zxKQK5h+zNxsEYsabtUeRzFTQqSS17MCd6btZjfu3TCaha8sSBFhFr5j1cai5nOFYeWZc5IAA/wKiPidH14q/XJtEFLOIKwgtvBvKHeTZ0l/oiLxT5gsp4Qbr3rFJkAP2JiSunEoSP1J7/imrP/po0UiGQ2sTjRvUYCPJS2g3AVznTFMcyE0VAz4Jk2FQpqWhvWSBEvIu0sJfSC0/p1I3u1MQ4bih/PX6Xp75zvp3ZzyBQk2jKTXGXW4xY/eX7TlK4iQEg4UkKWZYAQHOZruhRSTaSdCvJggAchmdQK6sHmb9cGczLWcvB7QrxpcO3/xXAXdOYl4A4u/1+1z5Fiv6NcNta3oRjNwqbtRzAUjZ2qFhjz5wx5HbIWUcEzQt1raOv9QK0TrgT2iLU3CfIQ+lU/DKBSCcOp7n0ajC/caMfr7Zxf3QzkwbtOA8T8NI31UZYFdxtFxaz4rVnFMisHKEqqlr3r2AXCMQaKZ8z0Om0vpjOfsGjUik8DTwLTamSSbXPA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB6856.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(366004)(346002)(136003)(39860400002)(396003)(376002)(451199018)(66899018)(478600001)(52536014)(33656002)(86362001)(8936002)(41300700001)(66556008)(66446008)(64756008)(76116006)(66476007)(8676002)(66946007)(5660300002)(4326008)(2906002)(82960400001)(38100700002)(38070700005)(122000001)(316002)(7696005)(71200400001)(966005)(53546011)(54906003)(55016003)(110136005)(6506007)(186003)(9686003)(26005)(83380400001)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?z+BibEqShYX2UndGoJ5HPglImccwAun6Hr9lK631an3zxgNQR9/EwEowxQE8?= =?us-ascii?Q?nBXnKhdflE5x3uH97eV5FWT2FsmZ/kuuEKAqDSh0C+fiRdO7vdLA+/aaDAaE?= =?us-ascii?Q?8bA5DUcQ+jien/lNKWyckYb08TzW/1EHiqf1tocV/30u/tdh4DsDzra6OKa9?= =?us-ascii?Q?rnk0EjZg82DRx6hFTD8RD+cuTlpbukBAmKnuuD1pSyNifG2a9x5iOyVtCthC?= =?us-ascii?Q?bDAfWnhYK89TsR9J0zYhdcLAxEk1FcgNmXabUHb/TF0u6iwiL507vlFocMtp?= =?us-ascii?Q?cfqmrwK5NxJJsu+OUiDD/tsblHbAkvFGalTBFSDf3ZYVR+cXbONiPiyBT1o6?= =?us-ascii?Q?FuqZ0Tq0Zw6Afgh95xtowB2ImoPJA63WVKsaNlPL56H5odQJgl/iRnVzs5te?= =?us-ascii?Q?gwOsAMOnPapcfpEuJVYWbQCOfjOEcLEGnRlVE69rt7eX4UismxeTmujFyZYo?= =?us-ascii?Q?4l4YSVhi4kqNaWGNRQiX0a4XYfYsn60d8J13I9ehehBiJO0n0IF4ygAniV+W?= =?us-ascii?Q?AdgMgweoojRBi5Nypzy0SZmVWuxloprrhimoRANLpaKnZDP/uBEUoaZQcfpO?= =?us-ascii?Q?RV/bwJ7i5zcbxlLWQhB32VQccMcxp4OsPetVfFQqAJEDNaiv8IHH93//lSPR?= =?us-ascii?Q?wwQQUmKDy9C9IL8gR7DbtuixX+rQrQz7PFhtilIEfr/YReuptTdCypFwzrk+?= =?us-ascii?Q?lI0UQzhLrjnFI7wh2U1n6r9uqrsRXHULyIzCH8ty8LUT4iHNQi2eJIwboZKR?= =?us-ascii?Q?vJOg/cvXtaz7EcgmruJyvUE7EIzoktE4ijgbn3tb+0BLd/QsyFNwOLWIoJgo?= =?us-ascii?Q?G0n3vs93loi0DYSGggBhL3oHdvIQnaT21y/EJKhCC8gp9FVFMxq/E725lpRE?= =?us-ascii?Q?mA8anM0NR9Nu5ogQqvuCWuFUU0he4UFcCZAcmoPE0bR699GoY8rx86j0aPid?= =?us-ascii?Q?uEK74y5mKQAl08CiMKFBRIdOa35XvRzrvHkFZXBzbnhYas5Kxnkcqem/e+1q?= =?us-ascii?Q?M/oaUD/s0zUqlSYGvsGTvr3azNrrrKqBd8Twv202eO3GEaxiBgqFZp0N7szS?= =?us-ascii?Q?69MjBY/VAbDN/NPSA1w0NFjp+0+2hVizBgivBq6zj0zS8NIu7BSGKwJoaqe0?= =?us-ascii?Q?CNvZ0DyAH8MOGJjbp2cdj7qzTQwpGDBU367sVGBtEU0x/HFns1O0EUvds8JK?= =?us-ascii?Q?JMwUGQThIn+duou1jtHR5SObTcGaro8C80kK0xxZ0YouFZfLB97u3SgKT1Tz?= =?us-ascii?Q?Lnh/TFRH8Mjj/nxB6dHc7KwcjMEueXUCDJ4B4+ecXTrZQ5AARNs/cyJ/TEjj?= =?us-ascii?Q?dG4Z0M6AuqtFU5p2HTbKqBWOoOBofRq02ZGvNc2snG78gWguHkYJC5NIXovX?= =?us-ascii?Q?M6QYohdg7/2dHlcFi56EvhiNm6gagoqLU63Uw2hPWSs07EhLsIENi+aLmCds?= =?us-ascii?Q?uE2qv6TL0Rbz1iO+cSiFyDADbfwvBgxZ6Pev8t98NFnA0lRV8ChQaC3KtBVG?= =?us-ascii?Q?cSZvpWSjH1+zNxEtGHXdzan+/PE/5/uPe2pgkOSpb/WNWFxz6iKMKey5v8Z0?= =?us-ascii?Q?rKcGaJYEfLnmnJhMU+7DjU0riX588yyMBvXJ1yBD2QJfJ/DqSVAoAoznGJ+s?= =?us-ascii?Q?Hg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB6856.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c742af3f-9af5-4fdb-fd55-08db085b86d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2023 16:02:19.9896 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wDjtz5Nnj6XEgqOA2yYMmVSj80nbZpYjXVBV5tXjIP7Ng0B6gdFkZohUPBHgIzuQcP921UQiN8jNIOPNtVAl1vgSQwxEFak/mr5EPwdQcfE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7938 Return-Path: andrei.warkentin@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Andrei Warkentin -----Original Message----- From: devel@edk2.groups.io On Behalf Of Sunil V L Sent: Saturday, January 28, 2023 1:18 PM To: devel@edk2.groups.io Cc: Ard Biesheuvel ; Yao, Jiewen ; Justen, Jordan L ; Gerd Hoffmann ; Abner Chang Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V7 16/20] OvmfPkg= /RiscVVirt: Add VirtNorFlashPlatformLib library Qemu NOR flash driver needs this library. Add this library for RISC-V lever= aged from SbsaQemu. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Sunil V L Acked-by: Abner Chang --- OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.in= f | 30 +++++++++++++++ OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.c = | 40 ++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlash= StaticLib.inf b/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFl= ashStaticLib.inf new file mode 100644 index 000000000000..4e87bd437380 --- /dev/null +++ b/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlashStat +++ icLib.inf @@ -0,0 +1,30 @@ +#/** @file +# +# Component description file for VirtNorFlashStaticLib module # # =20 +Copyright (c) 2014, Linaro Ltd. All rights reserved.
# # =20 +SPDX-License-Identifier: BSD-2-Clause-Patent # #**/ + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D VirtNorFlashStaticLib + FILE_GUID =3D 064742F1-E531-4D7D-A154-22315889CC23 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D VirtNorFlashPlatformLib + +[Sources.common] + VirtNorFlashStaticLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + OvmfPkg/OvmfPkg.dec + +[Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase diff --git a/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlash= StaticLib.c b/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlas= hStaticLib.c new file mode 100644 index 000000000000..fdc2ccb6294e --- /dev/null +++ b/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib/VirtNorFlashStat +++ icLib.c @@ -0,0 +1,40 @@ +/** @file + + Copyright (c) 2019, Linaro Ltd. All rights reserved + + SPDX-License-Identifier: BSD-2-Clause-Patent + + **/ + +#include +#include +#include + +#define QEMU_NOR_BLOCK_SIZE SIZE_256KB + +EFI_STATUS +VirtNorFlashPlatformInitialization ( + VOID + ) +{ + return EFI_SUCCESS; +} + +VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevice =3D { + FixedPcdGet32 (PcdOvmfFdBaseAddress), + FixedPcdGet64 (PcdFlashNvStorageVariableBase), + FixedPcdGet32 (PcdOvmfFirmwareFdSize), + QEMU_NOR_BLOCK_SIZE +}; + +EFI_STATUS +VirtNorFlashPlatformGetDevices ( + OUT VIRT_NOR_FLASH_DESCRIPTION **NorFlashDescriptions, + OUT UINT32 *Count + ) +{ + *NorFlashDescriptions =3D &mNorFlashDevice; + *Count =3D 1; + return EFI_SUCCESS; +} -- 2.38.0