UefiPayloadPkg: Add macro to enable selection of timer

Add macro to enable selection of timer

- HPET:  UEFI Payload will use HPET timer
- LAPIC: UEFI Payload will use local APIC timer

Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Hua Ma <hua.ma@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
This commit is contained in:
Hua Ma 2024-01-05 10:45:30 +08:00 committed by mergify[bot]
parent ff1305c9fb
commit c3d865a4c2
2 changed files with 20 additions and 0 deletions

View File

@ -139,6 +139,12 @@
# Note: for emulation platform such as QEMU, this may not work and should set it as FALSE
DEFINE CPU_TIMER_LIB_ENABLE = TRUE
#
# HPET: UEFI Payload will use HPET timer
# LAPIC: UEFI Payload will use local APIC timer
#
DEFINE TIMER_SUPPORT = HPET
DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE
[BuildOptions]
@ -676,7 +682,17 @@
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
!if $(TIMER_SUPPORT) == "HPET"
PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
!elseif $(TIMER_SUPPORT) == "LAPIC"
OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf {
<LibraryClasses>
NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterruptTplLib.inf
}
!else
!error "Invalid TIMER_SUPPORT"
!endif
MdeModulePkg/Universal/Metronome/Metronome.inf
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

View File

@ -161,7 +161,11 @@ INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
!endif
INF UefiCpuPkg/CpuDxe/CpuDxe.inf
!if $(TIMER_SUPPORT) == "HPET"
INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
!elseif $(TIMER_SUPPORT) == "LAPIC"
INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf
!endif
INF MdeModulePkg/Universal/Metronome/Metronome.inf
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf