From 1399565a93a7457db262ae2cb81431062fcc30c4 Mon Sep 17 00:00:00 2001 From: Maurice Ma Date: Thu, 27 Oct 2016 09:12:26 -0700 Subject: [PATCH] CorebootPayloadPkg: Add an option to use HPET timer driver The current CorebootPayloadPkg will use the legacy 8254 timer driver as the default. However, on some platforms legacy timer might not exist anymore. This patch adds HPET timer driver as a build option. Cc: Prince Agyeman Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Maurice Ma Reviewed-by : Prince Agyeman --- CorebootPayloadPkg/CorebootPayloadPkg.fdf | 4 ++++ CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 10 ++++++++++ CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf b/CorebootPayloadPkg/CorebootPayloadPkg.fdf index 3807923f60..34c8f7feac 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf +++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf @@ -91,7 +91,11 @@ INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF UefiCpuPkg/CpuDxe/CpuDxe.inf INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf INF MdeModulePkg/Application/UiApp/UiApp.inf +!if $(USE_HPET_TIMER) == TRUE +INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf +!else INF PcAtChipsetPkg/8254TimerDxe/8254Timer.inf +!endif INF MdeModulePkg/Universal/Metronome/Metronome.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc index cc29af5371..ad1a6dcf60 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc +++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc @@ -77,6 +77,11 @@ # [Vendor] [Device] [----ClockRate---] [------------Offset-----------] [Bar] [Stride] [RxFifo] [TxFifo] [Rsvd] [Vendor] DEFINE PCI_SERIAL_PARAMETERS = {0xff,0xff, 0x00,0x00, 0x0,0x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0,0x0, 0x0,0x0, 0xff,0xff} + # + # Chipset options + # + DEFINE USE_HPET_TIMER = FALSE + # # Shell options: [BUILD_SHELL, FULL_BIN, MIN_BIN, NONE, UEFI] # @@ -174,6 +179,7 @@ SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf + IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf # @@ -392,7 +398,11 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } +!if $(USE_HPET_TIMER) == TRUE + PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf +!else PcAtChipsetPkg/8254TimerDxe/8254Timer.inf +!endif MdeModulePkg/Universal/Metronome/Metronome.inf MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc index a22e576465..c06cccbf88 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc +++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc @@ -77,6 +77,11 @@ # [Vendor] [Device] [----ClockRate---] [------------Offset-----------] [Bar] [Stride] [RxFifo] [TxFifo] [Rsvd] [Vendor] DEFINE PCI_SERIAL_PARAMETERS = {0xff,0xff, 0x00,0x00, 0x0,0x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0,0x0, 0x0,0x0, 0xff,0xff} + # + # Chipset options + # + DEFINE USE_HPET_TIMER = FALSE + # # Shell options: [BUILD_SHELL, FULL_BIN, MIN_BIN, NONE, UEFI] # @@ -176,6 +181,7 @@ SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf + IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf # @@ -395,7 +401,11 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } +!if $(USE_HPET_TIMER) == TRUE + PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf +!else PcAtChipsetPkg/8254TimerDxe/8254Timer.inf +!endif MdeModulePkg/Universal/Metronome/Metronome.inf MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf