From nobody Mon Feb 9 08:56:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+99241+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99241+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1674933537; cv=none; d=zohomail.com; s=zohoarc; b=a9NdGeWUVmbcQuIU1EBIXu/iJ0JPmsFWictuiP/syS3CnniHzuEgNu0GytCpPPLpiB3QRos2dTn+2L6Y32wm6gQY+SpOQw6aN2LMxLHX6T1M7X8daW7kSRrDNKRemirHNFELlltqSXQ6ZtnEdW4Qj09Q+wPzshYQjTrNMbgYHvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674933537; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=woK7kFOvcKlRVA83pRvE4l9GJlgC/kBYJZ0g85q2Oq8=; b=UpNNnCH1RVPXoWb4sY2nY9lJ9VP/XjKXybafWzKlb/UQCOGdT/KnWKB5uEq8Ut+0h4x0z4mJe8ZWHNuPAc72BL+EmN/mpo4dsp0Gr2W74CBZ9jWXxo/SITgfsjQM80NkMOBOVzffM/lMg46UtqfF/S8ouWBmC1YosKnWmnkZPu4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99241+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16749335376861009.0463369948671; Sat, 28 Jan 2023 11:18:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id yYxWYY1788612xo0iMeAF4EJ; Sat, 28 Jan 2023 11:18:57 -0800 X-Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web10.1519.1674933511987673378 for ; Sat, 28 Jan 2023 11:18:56 -0800 X-Received: by mail-pl1-f169.google.com with SMTP id r8so1140197pls.2 for ; Sat, 28 Jan 2023 11:18:56 -0800 (PST) X-Gm-Message-State: ROmcdm3O7trZNMnLTKCE5H33x1787277AA= X-Google-Smtp-Source: AK7set+Egn2FmHlWVdQFZuD4c05/xfIqU2vHR4S0urbnNqfAkRnuuPnmTdSQMjtvAvvBKSf+fpb3+Q== X-Received: by 2002:a17:902:d2c9:b0:196:5484:a064 with SMTP id n9-20020a170902d2c900b001965484a064mr9493933plc.35.1674933536369; Sat, 28 Jan 2023 11:18:56 -0800 (PST) X-Received: from kerodipc.Dlink ([49.206.11.246]) by smtp.gmail.com with ESMTPSA id n9-20020a1709026a8900b00192d9258532sm139923plk.150.2023.01.28.11.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 11:18:56 -0800 (PST) From: "Sunil V L" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Abner Chang Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V7 16/20] OvmfPkg/RiscVVirt: Add VirtNorFlashPlatformLib library Date: Sun, 29 Jan 2023 00:48:03 +0530 Message-Id: <20230128191807.2080547-17-sunilvl@ventanamicro.com> In-Reply-To: <20230128191807.2080547-1-sunilvl@ventanamicro.com> References: <20230128191807.2080547-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,sunilvl@ventanamicro.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1674933537; bh=fOCFYOlH4MpJxtkOoqlrF+OtTmxBXl/DTUghivZJgaQ=; h=Cc:Date:From:Reply-To:Subject:To; b=hK4rNUpiKBNF1hfvBbWga021uRjFmABSkoNsBScxPPKOPQ4LIRk06BkW40baxf6ccpL ilXaZ/Tk/+JtnS/xm5V1p9jfQF3je6V2HKXScqJSTzFuRN5Lbgv9r1qn/FVdrJkNIaMCM VGtjqeUM0PR54kUqrEY8nz0CBfEVunqwvFA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674933539124100001 Content-Type: text/plain; charset="utf-8" Qemu NOR flash driver needs this library. Add this library for RISC-V leveraged from SbsaQemu. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Sunil V L Acked-by: Abner Chang Reviewed-by: Andrei Warkentin --- 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/VirtNorFlashStaticL= ib.inf @@ -0,0 +1,30 @@ +#/** @file +# +# Component description file for VirtNorFlashStaticLib module +# +# Copyright (c) 2014, Linaro Ltd. All rights reserved.
+# +# 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/VirtNorFlashStaticL= ib.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; +} --=20 2.38.0 -=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 (#99241): https://edk2.groups.io/g/devel/message/99241 Mute This Topic: https://groups.io/mt/96593518/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-