diff options
author | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-09-12 07:18:35 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-09-12 07:18:35 +0000 |
commit | 830067bfa29358963dda22df935fefe7323f60b0 (patch) | |
tree | 4afb1baea22c1d6434c825343b5144f61f0b89dc /OvmfPkg/Library/AcpiTimerLib | |
parent | 67164dcd2e0856cb5aa0f9affe18e2dc99638a16 (diff) | |
download | edk2-830067bfa29358963dda22df935fefe7323f60b0.zip edk2-830067bfa29358963dda22df935fefe7323f60b0.tar.gz edk2-830067bfa29358963dda22df935fefe7323f60b0.tar.bz2 |
OvmfPkg: extract the PBMA used in AcpiTimerLib into a PCD
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13719 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Library/AcpiTimerLib')
-rw-r--r-- | OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c | 5 | ||||
-rw-r--r-- | OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.inf | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c index 72620ba..027912e 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 4fcce6e..da88668 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
|