]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiPayloadPkg/UefiPayloadPkg.dsc
UefiPayloadPkg: Change some configuration of the payload
[mirror_edk2.git] / UefiPayloadPkg / UefiPayloadPkg.dsc
index 9319422efe4b993fe1c757debb912b5e681edbd0..ab6e1a8c6a29f9a632294c227cf2f2673499ac30 100644 (file)
   DEFINE RAM_DISK_ENABLE              = FALSE\r
   DEFINE SIO_BUS_ENABLE               = FALSE\r
   DEFINE UNIVERSAL_PAYLOAD            = FALSE\r
-\r
+  DEFINE SECURITY_STUB_ENABLE         = TRUE\r
+  DEFINE SMM_SUPPORT                  = FALSE\r
+  DEFINE PLATFORM_BOOT_TIMEOUT        = 3\r
+  DEFINE ABOVE_4G_MEMORY              = TRUE\r
+  DEFINE BOOT_MANAGER_ESCAPE          = FALSE\r
+  DEFINE SD_MMC_TIMEOUT               = 1000000\r
   #\r
   # SBL:      UEFI payload for Slim Bootloader\r
   # COREBOOT: UEFI payload for coreboot\r
   #\r
-  DEFINE   BOOTLOADER = SBL\r
+  DEFINE   BOOTLOADER                 = SBL\r
 \r
   #\r
   # CPU options\r
@@ -57,7 +62,6 @@
   DEFINE SERIAL_HARDWARE_FLOW_CONTROL = FALSE\r
   DEFINE SERIAL_DETECT_CABLE          = FALSE\r
   DEFINE SERIAL_FIFO_CONTROL          = 7 # Enable FIFO\r
-  DEFINE SERIAL_EXTENDED_TX_FIFO_SIZE = 16\r
   DEFINE UART_DEFAULT_BAUD_RATE       = $(BAUD_RATE)\r
   DEFINE UART_DEFAULT_DATA_BITS       = 8\r
   DEFINE UART_DEFAULT_PARITY          = 1\r
   #\r
   DEFINE SHELL_TYPE                   = BUILD_SHELL\r
 \r
-  DEFINE EMU_VARIABLE_ENABLE   = TRUE\r
+  #\r
+  # EMU:      UEFI payload with EMU variable\r
+  # SPI:      UEFI payload with SPI NV variable support\r
+  # NONE:     UEFI payload with no variable modules\r
+  #\r
+  DEFINE VARIABLE_SUPPORT      = EMU\r
+\r
   DEFINE DISABLE_RESET_SYSTEM  = FALSE\r
   DEFINE NETWORK_DRIVER_ENABLE = FALSE\r
 \r
   DEFINE RTC_TARGET_REGISTER = 0x71\r
 \r
   DEFINE SERIAL_DRIVER_ENABLE = TRUE\r
+  DEFINE PERFORMANCE_MEASUREMENT_ENABLE  = FALSE\r
+\r
+  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter Frequence.\r
+  # This is how BaseCpuTimerLib works, and a recommended way to get Frequence, so set the default value as TRUE.\r
+  # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE\r
+  DEFINE CPU_TIMER_LIB_ENABLE  = TRUE\r
 \r
 [BuildOptions]\r
   *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES\r
   #\r
   # Platform\r
   #\r
+!if $(CPU_TIMER_LIB_ENABLE) == TRUE && $(UNIVERSAL_PAYLOAD) == TRUE\r
+  TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf\r
+!else\r
   TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf\r
+!endif\r
   ResetSystemLib|UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
   SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf\r
   PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf\r
   !endif\r
 !endif\r
 \r
-  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf\r
+  DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf\r
   AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf\r
+!if $(VARIABLE_SUPPORT) == "EMU"\r
   TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf\r
+!elseif $(VARIABLE_SUPPORT) == "SPI"\r
+  PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf\r
+  TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf\r
+  S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf\r
+  MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf\r
+!endif\r
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf\r
   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf\r
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf\r
+  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf\r
+  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 \r
 [LibraryClasses.common.SEC]\r
   HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf\r
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf\r
+  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf\r
 \r
 [LibraryClasses.common.DXE_CORE]\r
   DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf\r
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf\r
 !endif\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf\r
-  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf\r
+!endif\r
 \r
 [LibraryClasses.common.DXE_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
 !endif\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf\r
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf\r
-  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf\r
+!endif\r
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf\r
   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf\r
+!endif\r
 \r
 [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATION]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf\r
+!endif\r
+\r
+[LibraryClasses.common.SMM_CORE]\r
+!if $(SMM_SUPPORT) == TRUE\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf\r
+\r
+  MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf\r
+  SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
+  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf\r
+  ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  PerformanceLib|MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.inf\r
+!endif\r
+!endif\r
+\r
+[LibraryClasses.common.DXE_SMM_DRIVER]\r
+!if $(SMM_SUPPORT) == TRUE\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
+  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
+  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf\r
+  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf\r
+  MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf\r
+  DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
+  SmmCpuPlatformHookLib|UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf\r
+  SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf\r
+  CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf\r
+  ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  PerformanceLib|MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf\r
+!endif\r
+!endif\r
+!if $(VARIABLE_SUPPORT) == "SPI"\r
+  SpiFlashLib|UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf\r
+  FlashDeviceLib|UefiPayloadPkg/Library/FlashDeviceLib/FlashDeviceLib.inf\r
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf\r
+!endif\r
 \r
 ################################################################################\r
 #\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeResourceForOptionRom|FALSE\r
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE\r
 \r
 [PcdsFixedAtBuild]\r
+  gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x10000\r
-  #\r
-  # Make VariableRuntimeDxe work at emulated non-volatile variable mode.\r
-  #\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE\r
+!if $(VARIABLE_SUPPORT) == "EMU"\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable        |TRUE\r
+!else\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable        |FALSE\r
+!endif\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE\r
 !if $(SOURCE_DEBUG_ENABLE)\r
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2\r
 !endif\r
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdEdkiiFpdtStringRecordEnableOnly| TRUE\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask       | 0x1\r
+!endif\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|$(SD_MMC_TIMEOUT)\r
+\r
+  gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)\r
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)\r
 \r
 [PcdsPatchableInModule.X64]\r
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)\r
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER)\r
+!if $(NETWORK_DRIVER_ENABLE) == TRUE\r
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE\r
+!endif\r
 \r
 [PcdsPatchableInModule.common]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|$(SERIAL_HARDWARE_FLOW_CONTROL)\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|$(SERIAL_DETECT_CABLE)\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|$(SERIAL_FIFO_CONTROL)\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|$(SERIAL_EXTENDED_TX_FIFO_SIZE)\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|$(PCI_SERIAL_PARAMETERS)\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0\r
-  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3\r
+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|$(PLATFORM_BOOT_TIMEOUT)\r
+!if $(VARIABLE_SUPPORT) == "SPI"\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize  |0\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize  |0\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase  |0\r
+!endif\r
+  # Disable SMM S3 script\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable|FALSE\r
 \r
   ## This PCD defines the video horizontal resolution.\r
   #  This PCD could be set to 0 then video resolution could be at highest resolution.\r
 # UEFI network modules\r
 #\r
 !if $(NETWORK_DRIVER_ENABLE) == TRUE\r
+[Defines]\r
+  DEFINE PLATFORMX64_ENABLE = TRUE\r
   !include NetworkPkg/Network.dsc.inc\r
 !endif\r
 \r
   #\r
   # Components that produce the architectural protocols\r
   #\r
+!if $(SECURITY_STUB_ENABLE) == TRUE\r
   MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
+!endif\r
   UefiCpuPkg/CpuDxe/CpuDxe.inf\r
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf\r
   MdeModulePkg/Application/UiApp/UiApp.inf {\r
       NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf\r
       NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf\r
   }\r
-  MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf\r
-\r
+  MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf {\r
+    <LibraryClasses>\r
+      NULL|UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf\r
+  }\r
   PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf\r
   MdeModulePkg/Universal/Metronome/Metronome.inf\r
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
 !endif\r
   UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutputDxe.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf\r
+!endif\r
+  #\r
+  # SMM Support\r
+  #\r
+!if $(SMM_SUPPORT) == TRUE\r
+  UefiPayloadPkg/SmmAccessDxe/SmmAccessDxe.inf\r
+  UefiPayloadPkg/SmmControlRuntimeDxe/SmmControlRuntimeDxe.inf\r
+  UefiPayloadPkg/BlSupportSmm/BlSupportSmm.inf\r
+  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf\r
+  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf\r
+  UefiPayloadPkg/PchSmiDispatchSmm/PchSmiDispatchSmm.inf\r
+  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf\r
+  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf\r
+!if $(PERFORMANCE_MEASUREMENT_ENABLE)\r
+  MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceSmm.inf\r
+!endif\r
+!endif\r
+\r
+!if $(VARIABLE_SUPPORT) == "EMU"\r
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
+!elseif $(VARIABLE_SUPPORT) == "SPI"\r
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {\r
+    <LibraryClasses>\r
+      NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf\r
+      NULL|MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf\r
+      NULL|MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLib.inf\r
+      NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf\r
+  }\r
+\r
+  UefiPayloadPkg/FvbRuntimeDxe/FvbSmm.inf\r
+  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf\r
+  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf\r
+!endif\r
 \r
   #------------------------------\r
   #  Build the shell\r
     #------------------------------\r
 \r
     <LibraryClasses>\r
-      DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf\r
       DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
       HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf\r
       OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r