summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/AcpiTimerLib
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Library/AcpiTimerLib')
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c5
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf4
2 files changed, 8 insertions, 1 deletions
diff --git a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
index 72620ba5fd..027912e0f7 100644
--- a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
@@ -20,11 +20,12 @@
#include <Library/IoLib.h>
#include <Library/PciLib.h>
#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
//
// PIIX4 Power Management Base Address
//
-UINT32 mPmba = 0xb000;
+STATIC UINT32 mPmba;
#define PCI_BAR_IO 0x1
#define ACPI_TIMER_FREQUENCY 3579545
@@ -56,6 +57,8 @@ AcpiTimerLibConstructor (
ASSERT (mPmba & PCI_BAR_IO);
mPmba &= ~PCI_BAR_IO;
} else {
+ mPmba = PcdGet16 (PcdAcpiPmBaseAddress);
+
PciAndThenOr32 (PCI_LIB_ADDRESS (0,Device,3,0x40),
(UINT32) ~0xfc0, mPmba);
PciOr8 (PCI_LIB_ADDRESS (0,Device,3,0x04), 0x01);
diff --git a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
index 4fcce6e6d5..da886680bf 100644
--- a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
+++ b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
@@ -33,6 +33,10 @@
[Packages]
MdePkg/MdePkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[Pcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
[LibraryClasses]
BaseLib