[PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default


Zhiguang Liu
 

Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib
is used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU.
Meanwhile, Universal Payload are only aimed to work with recent CPU.
Therefore, for Universal Payload, use the BaseCpuTimerLib by default

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>
Signed-off-by: Zhiguang Liu <zhiguang.liu@...>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload=
Pkg.dsc
index 65c1bd610e..1ce96a51c1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,10 +111,10 @@
DEFINE SERIAL_DRIVER_ENABLE =3D TRUE=0D
DEFINE PERFORMANCE_MEASUREMENT_ENABLE =3D FALSE=0D
=0D
- # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Coun=
ter.=0D
- # This is recommended way to get the time, and also how BaseCpuTimerLib =
works.=0D
- # However, some CPU doesn't support this feature, so disable it by defau=
lt.=0D
- DEFINE CPU_TIMER_LIB_ENABLE =3D FALSE=0D
+ # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Coun=
ter Frequence.=0D
+ # This is how BaseCpuTimerLib works, and a recommended way to get Freque=
nce, so set the default value as TRUE.=0D
+ # Note: for emulation platform such as QEMU, this may not work and shoul=
d set it as FALSE=0D
+ DEFINE CPU_TIMER_LIB_ENABLE =3D TRUE=0D
=0D
[BuildOptions]=0D
*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=
=0D
@@ -222,7 +222,7 @@
#=0D
# Platform=0D
#=0D
-!if $(CPU_TIMER_LIB_ENABLE) =3D=3D TRUE=0D
+!if $(CPU_TIMER_LIB_ENABLE) =3D=3D TRUE && $(UNIVERSAL_PAYLOAD) =3D=3D TRU=
E=0D
TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf=0D
!else=0D
TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf=0D
--=20
2.32.0.windows.2

Join devel@edk2.groups.io to automatically receive all group messages.