[edk2-devel] [edk2-platforms][PATCH V5 14/15] Platform/Loongson: Support Dxe

Chao Li lichao at loongson.cn
Fri Nov 11 09:50:09 UTC 2022


Reviewed-by: Chao Li <lichao at loongson.cn>

Thanks,
Chao
--------

On 11月 11 2022, at 5:12 下午, xianglai li <lixianglai at loongson.cn> wrote:
> Support Dxe for LoogArch.
>
>
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4054
>
>
> Cc: Bibo Mao <maobibo at loongson.cn>
> Cc: Chao Li <lichao at loongson.cn>
> Cc: Leif Lindholm <quic_llindhol at quicinc.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Signed-off-by: xianglai li <lixianglai at loongson.cn>
> ---
> .../Loongson/LoongArchQemuPkg/Loongson.dec | 13 +
> .../Loongson/LoongArchQemuPkg/Loongson.dsc | 421 ++++++++++++++++++
> .../Loongson/LoongArchQemuPkg/Loongson.fdf | 245 ++++++++++
> .../LoongArchQemuPkg/Loongson.fdf.inc | 42 ++
> 4 files changed, 721 insertions(+)
>
>
> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dec b/Platform/Loongson/LoongArchQemuPkg/Loongson.dec
> index aeae75a678..54a50738ec 100644
> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dec
> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dec
> @@ -27,13 +27,21 @@
>
>
> [Guids]
> gLoongArchQemuPkgTokenSpaceGuid = { 0x0e0383ce, 0x0151, 0x4d01, { 0x80, 0x0e, 0x3f, 0xef, 0x8b, 0x27, 0x6d, 0x52 } }
> + gEfiLoongsonBootparamsTableGuid = { 0x4660f721, 0x2ec5, 0x416a, { 0x89, 0x9a, 0x43, 0x18, 0x02, 0x50, 0xa0, 0xc9 } }
> +
> +[Protocols]
>
>
> ## In the PcdsFixedAtBuild and PcdsDynamic areas, numbers start at 0x0.
> [PcdsFixedAtBuild, PcdsDynamic]
> gLoongArchQemuPkgTokenSpaceGuid.PcdFlashPeiFvBase|0x0|UINT64|0x00000000
> gLoongArchQemuPkgTokenSpaceGuid.PcdFlashPeiFvSize|0x0|UINT32|0x00000001
> + gLoongArchQemuPkgTokenSpaceGuid.PcdFlashDxeFvOffset|0x0|UINT64|0x00000002
> gLoongArchQemuPkgTokenSpaceGuid.PcdFlashDxeFvBase|0x0|UINT64|0x00000003
> gLoongArchQemuPkgTokenSpaceGuid.PcdFlashDxeFvSize|0x0|UINT32|0x00000004
> + gLoongArchQemuPkgTokenSpaceGuid.PcdFlashSecModuleBase|0x0|UINT64|0x00000005
> + gLoongArchQemuPkgTokenSpaceGuid.PcdFlashSecModuleSize|0x0|UINT32|0x00000006
> + gLoongArchQemuPkgTokenSpaceGuid.PcdFlashEventLogBase|0x0|UINT64|0x00000007
> + gLoongArchQemuPkgTokenSpaceGuid.PcdFlashEventLogSize|0x0|UINT32|0x00000008
> gLoongArchQemuPkgTokenSpaceGuid.PcdDeviceTreeBase|0x0|UINT64|0x00000009
> gLoongArchQemuPkgTokenSpaceGuid.PcdDeviceTreePadding|256|UINT32|0x0000000a
>
>
> @@ -48,6 +56,8 @@
> [PcdsFixedAtBuild.LOONGARCH64]
> gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|32|UINT8|0x00010000
> gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0|UINT8|0x00010001
> + gLoongArchQemuPkgTokenSpaceGuid.PcdDeviceSpaceStartAddress|0x10000000|UINT32|0x00010002
> + gLoongArchQemuPkgTokenSpaceGuid.PcdDeviceSpaceLength|0x80000000|UINT32|0x00010003
>
>
> ## In the PcdsDynamic area, numbers start at 0x20000.
> [PcdsDynamic]
> @@ -59,3 +69,6 @@
> gLoongArchQemuPkgTokenSpaceGuid.PcdInvalidPud|0x0|UINT64|0x00020005
> gLoongArchQemuPkgTokenSpaceGuid.PcdInvalidPmd|0x0|UINT64|0x00020006
> gLoongArchQemuPkgTokenSpaceGuid.PcdInvalidPte|0x0|UINT64|0x00020007
> +
> +## In the PcdsFeatureFlag area, numbers start at 0x30000.
> +[PcdsFeatureFlag]
> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> index b78a7e3b49..6f71280c4d 100644
> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> @@ -24,6 +24,25 @@
> FLASH_DEFINITION = Platform/Loongson/LoongArchQemuPkg/Loongson.fdf
> TTY_TERMINAL = FALSE
>
>
> + #
> + # Defines for default states. These can be changed on the command line.
> + # -D FLAG=VALUE
> + DEFINE TTY_TERMINAL = FALSE
> + DEFINE SECURE_BOOT_ENABLE = FALSE
> + DEFINE TPM2_ENABLE = FALSE
> + DEFINE TPM2_CONFIG_ENABLE = FALSE
> +
> + #
> + # Network definition
> + #
> + DEFINE NETWORK_IP6_ENABLE = FALSE
> + DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
> + DEFINE NETWORK_SNP_ENABLE = FALSE
> + DEFINE NETWORK_TLS_ENABLE = FALSE
> + DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
> + DEFINE NETWORK_ISCSI_ENABLE = FALSE
> +
> +!include NetworkPkg/NetworkDefines.dsc.inc
> ############################################################################
> #
> # Defines for default states. These can be changed on the command line.
> @@ -37,6 +56,8 @@
> #
> GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
>
>
> +!include NetworkPkg/NetworkBuildOptions.dsc.inc
> +
> [BuildOptions.LOONGARCH64.EDKII.SEC]
> *_*_*_CC_FLAGS =
>
>
> @@ -46,6 +67,14 @@
> [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> GCC:*_*_LOONGARCH64_DLINK_FLAGS = -z common-page-size=0x10000
>
>
> +################################################################################
> +#
> +# SKU Identification section - list of all SKU IDs supported by this Platform.
> +#
> +################################################################################
> +[SkuIds]
> + 0|DEFAULT
> +
> ################################################################################
> #
> # Library Class section - list of all Library Classes needed by this Platform.
> @@ -59,19 +88,93 @@
> TimerLib | Platform/Loongson/LoongArchQemuPkg/Library/StableTimerLib/TimerLib.inf
> PrintLib | MdePkg/Library/BasePrintLib/BasePrintLib.inf
> BaseMemoryLib | MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +
> + # Networking Requirements
> +!include NetworkPkg/NetworkLibs.dsc.inc
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> + TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
> +!endif
> +
> BaseLib | MdePkg/Library/BaseLib/BaseLib.inf
> + SafeIntLib | MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
> + TimeBaseLib | EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
> + BmpSupportLib | MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
> + SynchronizationLib | MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> + CpuLib | MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
> PerformanceLib | MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
> PeCoffLib | MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
> CacheMaintenanceLib | MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
> UefiDecompressLib | MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
> + UefiHiiServicesLib | MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
> + HiiLib | MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
> + CapsuleLib | MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> + DxeServicesLib | MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> + DxeServicesTableLib | MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
> PeCoffGetEntryPointLib | MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
> + PciLib | MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
> + PciExpressLib | OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
> + PciCapLib | OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
> + PciCapPciSegmentLib | OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
> + PciCapPciIoLib | OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
> + DxeHardwareInfoLib | OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
> IoLib | MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> SerialPortLib | Platform/Loongson/LoongArchQemuPkg/Library/SerialPortLib/SerialPortLib.inf
> + EfiResetSystemLib | Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGedLib.inf
> + ResetSystemLib | Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/BaseResetSystemAcpiGedLib.inf
> +
> + UefiLib | MdePkg/Library/UefiLib/UefiLib.inf
> + UefiBootServicesTableLib | MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
> + UefiRuntimeServicesTableLib | MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
> + UefiDriverEntryPoint | MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
> + UefiApplicationEntryPoint | MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
> + DevicePathLib | MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf
> + FileHandleLib | MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
> + SecurityManagementLib | MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
> + UefiUsbLib | MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
> + SerializeVariablesLib | OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
> + CustomizedDisplayLib | MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
> DebugPrintErrorLevelLib | MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
> + TpmMeasurementLib | MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
> + AuthVariableLib | MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
> + VarCheckLib | MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> + VariablePolicyLib | MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
> + VariablePolicyHelperLib | MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
> + SortLib | MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
> FdtLib | EmbeddedPkg/Library/FdtLib/FdtLib.inf
> + PciPcdProducerLib | OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
> + PciSegmentLib | MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
> + PciHostBridgeLib | OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
> + PciHostBridgeUtilityLib | OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
> + MmuLib | Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBaseLib.inf
> + FileExplorerLib | MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
> +
> +!if $(HTTP_BOOT_ENABLE) == TRUE
> + HttpLib | MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
> +!endif
> + UefiBootManagerLib | MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> + OrderedCollectionLib | MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> + ReportStatusCodeLib | MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
> +
> + PeCoffGetEntryPointLib | MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
> PeCoffExtraActionLib | MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
> DebugAgentLib | MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
> + CpuExceptionHandlerLib | MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
> +
> + PlatformBootManagerLib | Platform/Loongson/LoongArchQemuPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> + BootLogoLib | MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
> + QemuBootOrderLib | OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
> + QemuFwCfgSimpleParserLib | OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
> + QemuLoadImageLib | OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
> +
> + #
> + # Virtio Support
> + #
> + VirtioLib | OvmfPkg/Library/VirtioLib/VirtioLib.inf
> + FrameBufferBltLib | MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
> + QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
> + DebugLib | MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
> PeiServicesLib | MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
> + VariableFlashInfoLib | MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
>
>
> [LibraryClasses.common.SEC]
> ReportStatusCodeLib | MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
> @@ -104,17 +207,88 @@
> QemuFwCfgLib | Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf
> MmuLib | Platform/Loongson/LoongArchQemuPkg/Library/MmuLib/MmuBaseLibPei.inf
>
>
> +[LibraryClasses.common.DXE_CORE]
> + HobLib | MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
> + DxeCoreEntryPoint | MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
> + MemoryAllocationLib | MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
> + ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
> +
> +[LibraryClasses.common.DXE_RUNTIME_DRIVER]
> + PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf
> + HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf
> + DxeCoreEntryPoint | MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
> + MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
> + ReportStatusCodeLib | MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
> + UefiRuntimeLib | MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
> + ExtractGuidedSectionLib | MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
> + QemuFwCfgS3Lib | OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
> + RealTimeClockLib | Platform/Loongson/LoongArchQemuPkg/Library/LsRealTimeClockLib/LsRealTimeClockLib.inf
> + VariablePolicyLib | MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
> + QemuFwCfgLib | Platform/Loongson/LoongArchQemuPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf
> + EfiResetSystemLib | Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGedLib.inf
> + ResetSystemLib | Platform/Loongson/LoongArchQemuPkg/Library/ResetSystemAcpiLib/DxeResetSystemAcpiGedLib.inf
> +!if $(TARGET) != RELEASE
> + DebugLib | MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
> +!endif
> +
> +[LibraryClasses.common.UEFI_DRIVER]
> + PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf
> + HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf
> + DxeCoreEntryPoint | MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
> + MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
> + ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
> + UefiScsiLib | MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
> + ExtractGuidedSectionLib | MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
> + QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
> +
> +[LibraryClasses.common.DXE_DRIVER]
> + PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf
> + HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf
> + MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
> + ReportStatusCodeLib | MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
> + UefiScsiLib | MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
> + CpuExceptionHandlerLib | UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
> + ExtractGuidedSectionLib | MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
> + QemuFwCfgS3Lib | OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
> + QemuFwCfgLib | OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf
> +
> +[LibraryClasses.common.UEFI_APPLICATION]
> + PcdLib | MdePkg/Library/DxePcdLib/DxePcdLib.inf
> + HobLib | MdePkg/Library/DxeHobLib/DxeHobLib.inf
> + MemoryAllocationLib | MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
> + ExtractGuidedSectionLib | MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
> +
> ################################################################################
> #
> # Pcd Section - list of all EDK II PCD Entries defined by this Platform.
> #
> ################################################################################
> +[PcdsFeatureFlag]
> + gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport | FALSE
> +# gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial | TRUE
> +# gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory | TRUE
> + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress | TRUE
> + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport | TRUE
> + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport | FALSE
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport | FALSE
> + gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation | TRUE
> + gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation | TRUE
> [PcdsFixedAtBuild]
> ## BaseLib ##
> gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength | 1000000
> gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength | 1000000
> gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength | 1000000
> + gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout | 10000000
>
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize | 1
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange | FALSE
> + gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler | 0x10
> + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize | 0x2000
> + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize | 0x8000
> + gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress | 0x0
> + gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize | 48
> + gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize | 32
> + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask | 0x07
> gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel | 0x8000004F
> # DEBUG_INIT 0x00000001 // Initialization
> # DEBUG_WARN 0x00000002 // Warnings
> @@ -158,6 +332,60 @@
> # 0x90000000 - 0xA0000000
> #
> gLoongArchQemuPkgTokenSpaceGuid.PcdUefiRamTop | 0x10000000
> + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions | 0x06
> +
> + gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile | { 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
> +
> + #
> + # Network Pcds
> + #
> +!include NetworkPkg/NetworkPcds.dsc.inc
> +################################################################################
> +#
> +# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
> +#
> +################################################################################
> +[PcdsDynamicDefault]
> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase | 0
> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 | 0
> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 | 0
> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase | 0
> + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 | 0
> + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved | 0
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration | FALSE
> + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution | 800
> + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution | 600
> + gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut | 2
> +
> + # Set video resolution for text setup.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution | 640
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution | 480
> +
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion | 0x0300
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev | 0x0
> +
> + gLoongArchQemuPkgTokenSpaceGuid.PcdRamSize | 0x40000000
> +
> + ## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI
> + # enumeration to complete before installing ACPI tables.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration |TRUE
> + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation |0x0
> + # set PcdPciExpressBaseAddress to MAX_UINT64, which signifies that this
> + # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
> + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress |0xFFFFFFFFFFFFFFFF
> +
> + #
> + # IPv4 and IPv6 PXE Boot support.
> + #
> + gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport | 0x01
> + gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport | 0x01
> +
> + #
> + # SMBIOS entry point version
> + #
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0300
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
> + gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|TRUE
>
>
> [Components]
>
>
> @@ -184,3 +412,196 @@
> <LibraryClasses>
> PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> }
> +
> + #
> + # DXE Phase modules
> + #
> + MdeModulePkg/Core/Dxe/DxeMain.inf {
> + <LibraryClasses>
> + NULL | MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
> + DevicePathLib | MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> + ExtractGuidedSectionLib | MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
> + }
> +
> + MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
> + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
> + MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {
> + <LibraryClasses>
> + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> + }
> +
> + MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
> + Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.inf
> + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
> + MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> + MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> + Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerDxe/TimerDxe.inf
> + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> + MdeModulePkg/Universal/Metronome/Metronome.inf
> + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> +
> + #
> + # Variable
> + #
> +
> + OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf {
> + <LibraryClasses>
> + PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.inf
> + }
> + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
> + <LibraryClasses>
> + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> + }
> +
> + #
> + # Platform Driver
> + #
> + OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> + OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
> + OvmfPkg/VirtioRngDxe/VirtioRng.inf
> +
> + #
> + # File system
> + #
> + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
> + MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> + MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
> + FatPkg/EnhancedFatDxe/Fat.inf
> + MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
> + OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
> +
> + #
> + #BDS
> + #
> + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> + <LibraryClasses>
> + DevicePathLib | MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> + PcdLib | MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> + }
> + MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
> + MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
> + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> + MdeModulePkg/Logo/LogoDxe.inf
> + MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
> + MdeModulePkg/Application/UiApp/UiApp.inf {
> + <LibraryClasses>
> + NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
> + NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
> + NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
> + }
> +
> + OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf {
> + <LibraryClasses>
> + NULL|OvmfPkg/Library/BlobVerifierLibNull/BlobVerifierLibNull.inf
> + }
> +
> + #
> + # Network Support
> + #
> +#!include NetworkPkg/NetworkComponents.dsc.inc
> +
> +# NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf {
> +# <LibraryClasses>
> +# NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
> +# }
> +
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> + NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
> + <LibraryClasses>
> + NULL|OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf
> + }
> +!endif
> + OvmfPkg/VirtioNetDxe/VirtioNet.inf
> +
> + #
> + # IDE/SCSI
> + #
> + OvmfPkg/SataControllerDxe/SataControllerDxe.inf
> + MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
> + MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
> + MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
> + MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> +
> + #
> + # SMBIOS Support
> + #
> + MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf {
> + <LibraryClasses>
> + NULL | OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf
> + }
> + OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> +
> + #
> + # PCI
> + #
> + Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf
> + EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> + OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> + OvmfPkg/Virtio10Dxe/Virtio10.inf
> +
> + #
> + # Console
> + #
> + MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> + MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
> + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> + MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf {
> + <LibraryClasses>
> + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> + }
> +
> + #
> + # Video
> + #
> + OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
> + OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
> + OvmfPkg/PlatformDxe/Platform.inf
> +
> + #
> + # Usb Support
> + #
> + MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
> + MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
> + MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
> + MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
> + MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
> + MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
> +
> + #
> + # ACPI Support
> + #
> + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> + MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
> + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
> +
> + #
> + #app
> + #
> + ShellPkg/Application/Shell/Shell.inf {
> + <LibraryClasses>
> + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
> + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
> + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
> + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
> + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
> + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
> + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
> + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
> + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
> + SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
> + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
> +<PcdsFixedAtBuild>
> + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
> + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> + gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> + }
> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf
> index 8e257f2392..34bcdf0d9c 100644
> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf
> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf
> @@ -22,6 +22,14 @@ $(SECFV_OFFSET)|$(SECFV_SIZE)
> gLoongArchQemuPkgTokenSpaceGuid.PcdFlashSecFvBase|gLoongArchQemuPkgTokenSpaceGuid.PcdFlashSecFvSize
> FV = SECFV
>
>
> +$(PEIFV_OFFSET)|$(PEIFV_SIZE)
> +gLoongArchQemuPkgTokenSpaceGuid.PcdFlashPeiFvBase|gLoongArchQemuPkgTokenSpaceGuid.PcdFlashPeiFvSize
> +FV = PEIFV
> +
> +$(DXEFV_OFFSET)|$(DXEFV_SIZE)
> +gLoongArchQemuPkgTokenSpaceGuid.PcdFlashDxeFvBase|gLoongArchQemuPkgTokenSpaceGuid.PcdFlashDxeFvSize
> +FV = FVMAIN_COMPACT
> +
> #####################################################################################################
> [FV.SECFV]
> FvNameGuid = 587d4265-5e71-41da-9c35-4258551f1e22
> @@ -79,6 +87,181 @@ INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
> INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
> INF Platform/Loongson/LoongArchQemuPkg/PlatformPei/PlatformPei.inf
>
>
> +#####################################################################################################
> +[FV.DXEFV]
> +FvNameGuid = 5d19a5b3-130f-459b-a292-9270a9e6bc62
> +BlockSize = $(BLOCK_SIZE)
> +FvAlignment = 16
> +ERASE_POLARITY = 1
> +MEMORY_MAPPED = TRUE
> +STICKY_WRITE = TRUE
> +LOCK_CAP = TRUE
> +LOCK_STATUS = TRUE
> +READ_DISABLED_CAP = TRUE
> +READ_ENABLED_CAP = TRUE
> +READ_STATUS = TRUE
> +READ_LOCK_CAP = TRUE
> +READ_LOCK_STATUS = TRUE
> +WRITE_DISABLED_CAP = TRUE
> +WRITE_ENABLED_CAP = TRUE
> +WRITE_STATUS = TRUE
> +WRITE_LOCK_CAP = TRUE
> +WRITE_LOCK_STATUS = TRUE
> +
> +APRIORI DXE {
> + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
> + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> +}
> +
> +#
> +# DXE Phase modules
> +#
> +INF MdeModulePkg/Core/Dxe/DxeMain.inf
> +
> +INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
> +INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
> +INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> +INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
> +INF Platform/Loongson/LoongArchQemuPkg/Drivers/CpuDxe/CpuDxe.inf
> +INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> +INF Platform/Loongson/LoongArchQemuPkg/Drivers/StableTimerDxe/TimerDxe.inf
> +INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> +INF MdeModulePkg/Universal/Metronome/Metronome.inf
> +INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
> +INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> +INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> +INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> +
> +#
> +# Variable
> +#
> +INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
> +INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> +INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> +#
> +# PCI
> +#
> +INF Platform/Loongson/LoongArchQemuPkg/Drivers/PciCpuIo2Dxe/PciCpuIo2Dxe.inf
> +INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
> +INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
> +INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> +INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
> +INF OvmfPkg/Virtio10Dxe/Virtio10.inf
> +
> +#
> +# Platform Driver
> +#
> +INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> +INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
> +INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
> +INF OvmfPkg/VirtioNetDxe/VirtioNet.inf
> +
> +#
> +# Console
> +#
> +INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> +INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> +INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
> +INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> +INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
> +
> +#
> +#Video
> +#
> +INF OvmfPkg/QemuRamfbDxe/QemuRamfbDxe.inf
> +INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
> +INF OvmfPkg/PlatformDxe/Platform.inf
> +
> +#
> +# IDE
> +#
> +INF OvmfPkg/SataControllerDxe/SataControllerDxe.inf
> +INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
> +INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
> +INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
> +INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> +
> +#
> +# Usb Support
> +#
> +INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
> +INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
> +INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
> +INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
> +INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
> +INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
> +
> +#
> +#BDS
> +#
> +INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
> +INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
> +INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
> +INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
> +INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +INF MdeModulePkg/Logo/LogoDxe.inf
> +INF MdeModulePkg/Application/UiApp/UiApp.inf
> +INF OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf
> +
> +#
> +#Smbios
> +#
> +INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
> +INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
> +
> +#
> +#Acpi
> +#
> +INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> +INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
> +INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
> +
> +#
> +# Network modules
> +#!include NetworkPkg/Network.fdf.inc
> +
> +#
> +# File system
> +#
> +INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
> +INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
> +INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
> +INF FatPkg/EnhancedFatDxe/Fat.inf
> +INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
> +INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf
> +
> +#
> +#Boot OS
> +#
> +INF ShellPkg/Application/Shell/Shell.inf
> +
> +#####################################################################################################
> +[FV.FVMAIN_COMPACT]
> +FvNameGuid = af8c3fe8-9ce8-4548-884a-e3f4dd91f040
> +FvAlignment = 16
> +ERASE_POLARITY = 1
> +MEMORY_MAPPED = TRUE
> +STICKY_WRITE = TRUE
> +LOCK_CAP = TRUE
> +LOCK_STATUS = TRUE
> +WRITE_DISABLED_CAP = TRUE
> +WRITE_ENABLED_CAP = TRUE
> +WRITE_STATUS = TRUE
> +WRITE_LOCK_CAP = TRUE
> +WRITE_LOCK_STATUS = TRUE
> +READ_DISABLED_CAP = TRUE
> +READ_ENABLED_CAP = TRUE
> +READ_STATUS = TRUE
> +READ_LOCK_CAP = TRUE
> +READ_LOCK_STATUS = TRUE
> +
> +FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
> + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
> + SECTION FV_IMAGE = DXEFV
> + }
> + }
> +
> #####################################################################################################
> [Rule.Common.SEC]
> FILE SEC = $(NAMED_GUID) {
> @@ -102,3 +285,65 @@ INF Platform/Loongson/LoongArchQemuPkg/PlatformPei/PlatformPei.inf
> }
>
>
> #####################################################################################################
> +[Rule.Common.DXE_CORE]
> + FILE DXE_CORE = $(NAMED_GUID) {
> + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
> + UI STRING="$(MODULE_NAME)" Optional
> + }
> +
> +#####################################################################################################
> +[Rule.Common.DXE_DRIVER]
> + FILE DRIVER = $(NAMED_GUID) {
> + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
> + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
> + UI STRING="$(MODULE_NAME)" Optional
> + RAW ACPI Optional |.acpi
> + RAW ASL Optional |.aml
> + }
> +
> +#####################################################################################################
> +[Rule.Common.DXE_RUNTIME_DRIVER]
> + FILE DRIVER = $(NAMED_GUID) {
> + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
> + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
> + UI STRING="$(MODULE_NAME)" Optional
> + }
> +
> +#####################################################################################################
> +[Rule.Common.UEFI_DRIVER]
> + FILE DRIVER = $(NAMED_GUID) {
> + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
> + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
> + UI STRING="$(MODULE_NAME)" Optional
> + }
> +
> +#####################################################################################################
> +[Rule.Common.UEFI_DRIVER.BINARY]
> + FILE DRIVER = $(NAMED_GUID) {
> + DXE_DEPEX DXE_DEPEX Optional |.depex
> + PE32 PE32 |.efi
> + UI STRING="$(MODULE_NAME)" Optional
> + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
> + }
> +
> +#####################################################################################################
> +[Rule.Common.UEFI_APPLICATION]
> + FILE APPLICATION = $(NAMED_GUID) {
> + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
> + UI STRING="$(MODULE_NAME)" Optional
> + }
> +
> +#####################################################################################################
> +[Rule.Common.UEFI_APPLICATION.BINARY]
> + FILE APPLICATION = $(NAMED_GUID) {
> + PE32 PE32 |.efi
> + UI STRING="$(MODULE_NAME)" Optional
> + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
> + }
> +
> +#####################################################################################################
> +[Rule.Common.USER_DEFINED.ACPITABLE]
> + FILE FREEFORM = $(NAMED_GUID) {
> + RAW ACPI |.acpi
> + RAW ASL |.aml
> + }
> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc
> index 6f17909748..3530f90c67 100644
> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc
> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf.inc
> @@ -19,3 +19,45 @@ DEFINE FD_SIZE = 0x400000
> #Set Sec base address and size in flash
> DEFINE SECFV_OFFSET = 0x00000000
> DEFINE SECFV_SIZE = 0x00010000
> +
> +#Set Pei base address and size in flash
> +DEFINE PEIFV_OFFSET = 0x00010000
> +DEFINE PEIFV_SIZE = 0x00040000
> +
> +#Set Dxe base address and size in flash
> +DEFINE DXEFV_OFFSET = 0x00050000
> +DEFINE DXEFV_SIZE = 0x00350000
> +
> +#Set Var base address and size in flash
> +DEFINE VARIABLE_OFFSET = 0x003a0000
> +DEFINE VAR_ALL_SIZE = 0x60000
> +
> +############################################################################
> +#Set Var Flash layout
> +DEFINE VARIABLE_SIZE = 0x00010000
> +DEFINE VAR_ALL_BLOCKS = 0x60
> +
> +DEFINE RESERVE1_OFFSET = $(VARIABLE_OFFSET) + $(VARIABLE_SIZE)
> +DEFINE RESERVE1_SIZE = 0xB000
> +
> +DEFINE RESERVE2_OFFSET = $(RESERVE1_OFFSET) + $(RESERVE1_SIZE)
> +DEFINE RESERVE2_SIZE = 0x14000
> +
> +DEFINE SPARE_OFFSET = $(RESERVE2_OFFSET) + $(RESERVE2_SIZE)
> +DEFINE SPARE_SIZE = 0x20000
> +
> +DEFINE FWTWORKING_OFFSET = $(SPARE_OFFSET) + $(SPARE_SIZE)
> +DEFINE FWTWORKING_SIZE = 0x8000
> +
> +DEFINE EVENT_LOG_OFFSET = $(FWTWORKING_OFFSET) + $(FWTWORKING_SIZE)
> +DEFINE EVENT_LOG_SIZE = 0x8000
> +
> +# Set Variable
> +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 = 0
> +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize = $(VARIABLE_SIZE)
> +
> +# Set FtwSpare
> +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(SPARE_SIZE)
> +
> +# Set FtwWorking
> +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = $(FWTWORKING_SIZE)
> --
> 2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96300): https://edk2.groups.io/g/devel/message/96300
Mute This Topic: https://groups.io/mt/94955182/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20221111/0591f4db/attachment-0001.htm>


More information about the edk2-devel-archive mailing list