From 0fc588ddd2780d236cbadcfe1dfbf41778e3e12f Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 1 Apr 2026 20:33:05 +0800 Subject: [PATCH] OvmfPkg/LoongArchVirt: Enable FPDT for LoongArch OVMF platform This change adds dependent libraries and drivers to LoongArch OVMF package to enable firmware performance support. Signed-off-by: Zixing Liu --- OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc | 15 +++++++++++++++ OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc index 97b80fa5f1..7ac999b05e 100644 --- a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc +++ b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc @@ -205,6 +205,7 @@ PlatformBootManagerCommonLib |OvmfPkg/Library/PlatformBootManagerCommonLib/PlatformBootManagerCommonLib.inf QemuFwCfgSimpleParserLib | OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf QemuLoadImageLib | OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf + LockBoxLib | MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf # # Virtio Support @@ -239,12 +240,14 @@ PeCoffGetEntryPointLib | MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPeiLib.inf PlatformHookLib | OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf + PerformanceLib | MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf [LibraryClasses.common.PEIM] HobLib | MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib | MdePkg/Library/PeiServicesTablePointerLibKs0/PeiServicesTablePointerLibKs0.inf MemoryAllocationLib | MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeimEntryPoint | MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + PerformanceLib | MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf ReportStatusCodeLib | MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf OemHookStatusCodeLib | MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf PeCoffGetEntryPointLib | MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf @@ -265,6 +268,7 @@ ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf PciPcdProducerLib | OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf CpuExceptionHandlerLib | UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf + PerformanceLib | MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf [LibraryClasses.common.DXE_RUNTIME_DRIVER] PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -290,6 +294,7 @@ PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf DxeCoreEntryPoint | MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf + PerformanceLib | MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf UefiScsiLib | MdePkg/Library/UefiScsiLib/UefiScsiLib.inf @@ -300,6 +305,7 @@ [LibraryClasses.common.DXE_DRIVER] PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf + PerformanceLib | MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf UefiScsiLib | MdePkg/Library/UefiScsiLib/UefiScsiLib.inf @@ -314,6 +320,7 @@ [LibraryClasses.common.UEFI_APPLICATION] PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf + PerformanceLib | MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf ExtractGuidedSectionLib | MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf PciPcdProducerLib | OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf @@ -362,6 +369,7 @@ !endif gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize | 0x8000 gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress | 0x0 + gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask | 0x07 # Use MMIO for accessing Serial port registers. @@ -723,3 +731,10 @@ # UEFI application (Shell Embedded Boot Loader) # !include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc + + MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf + MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf + ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + } diff --git a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf index dc8e377b2e..b5b2795b71 100644 --- a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf +++ b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.fdf @@ -207,6 +207,10 @@ INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf # INF ShellPkg/Application/Shell/Shell.inf +INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf +INF MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf +INF ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf + ##################################################################################################### [FV.FVMAIN_COMPACT] FvNameGuid = af8c3fe8-9ce8-4548-884a-e3f4dd91f040