OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size

The size should be for single region, not the whole firmware FD.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
This commit is contained in:
Tuan Phan 2023-07-14 12:08:20 -07:00 committed by mergify[bot]
parent fbec9aec00
commit a9fc9bb466
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,8 @@ VIRT_NOR_FLASH_DESCRIPTION mNorFlashDevice =
{
FixedPcdGet32 (PcdOvmfFdBaseAddress),
FixedPcdGet64 (PcdFlashNvStorageVariableBase),
FixedPcdGet32 (PcdOvmfFirmwareFdSize),
FixedPcdGet32 (PcdOvmfFirmwareFdSize) -
(FixedPcdGet64 (PcdFlashNvStorageVariableBase) - FixedPcdGet32 (PcdOvmfFdBaseAddress)),
QEMU_NOR_BLOCK_SIZE
};