summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-05-09 19:26:37 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-05-17 20:48:33 +0200
commitb2f4da3956debf656279a0836500b6989a85e276 (patch)
tree286832ac9505ae93df53d6b1e127d8a866fb55b1 /OvmfPkg/Library
parentac759060e6272c3e451808c9ba40927d76890f26 (diff)
downloadedk2-platforms-b2f4da3956debf656279a0836500b6989a85e276.tar.xz
OvmfPkg: replace PcdAcpiPmBaseAddress with PIIX4_PMBA_VALUE
In the next patches, we'll differentiate the PMBA IO port address that we program on PIIX4 vs. Q35. Normally we'd just turn PcdAcpiPmBaseAddress into a dynamic PCD. However, because we need this value in BaseRomAcpiTimerLib too (which cannot access RAM and dynamic PCDs), it must remain a build time constant. We will introduce its Q35 counterpart later. As first step, replace the PCD with a new macro in "OvmfPlatforms.h"; Jordan prefers the latter to fixed PCDs in this instance. Cc: Gabriel Somlo <somlo@cmu.edu> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1333238 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Gabriel Somlo <somlo@cmu.edu>
Diffstat (limited to 'OvmfPkg/Library')
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c5
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf3
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c5
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf3
-rw-r--r--OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c7
-rw-r--r--OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf3
6 files changed, 8 insertions, 18 deletions
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
index 7144d75c73..109b267cf4 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
@@ -15,7 +15,6 @@
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/PciLib.h>
-#include <Library/PcdLib.h>
#include <OvmfPlatforms.h>
//
@@ -69,9 +68,9 @@ AcpiTimerLibConstructor (
if ((PciRead8 (AcpiCtlReg) & AcpiEnBit) == 0) {
//
// If the Power Management Base Address is not programmed,
- // then program the Power Management Base Address from a PCD.
+ // then program it now.
//
- PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PcdGet16 (PcdAcpiPmBaseAddress));
+ PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PIIX4_PMBA_VALUE);
//
// Enable PMBA I/O port decodes
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
index 4c0e615955..04df609220 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
@@ -31,9 +31,6 @@
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
-[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
-
[LibraryClasses]
BaseLib
PciLib
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
index 5164769f60..c46055a09b 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
@@ -16,7 +16,6 @@
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/PciLib.h>
-#include <Library/PcdLib.h>
#include <OvmfPlatforms.h>
/**
@@ -67,9 +66,9 @@ AcpiTimerLibConstructor (
if ((PciRead8 (AcpiCtlReg) & AcpiEnBit) == 0) {
//
// If the Power Management Base Address is not programmed,
- // then program the Power Management Base Address from a PCD.
+ // then program it now.
//
- PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PcdGet16 (PcdAcpiPmBaseAddress));
+ PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PIIX4_PMBA_VALUE);
//
// Enable PMBA I/O port decodes
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf
index d5e50aef61..946292c181 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf
@@ -30,9 +30,6 @@
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
-[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
-
[LibraryClasses]
BaseLib
PciLib
diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
index 6d149e84c2..308a600214 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -17,9 +17,10 @@
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
-#include <Library/PcdLib.h>
#include <Library/TimerLib.h>
+#include <OvmfPlatforms.h>
+
VOID
AcpiPmControl (
UINTN SuspendType
@@ -27,8 +28,8 @@ AcpiPmControl (
{
ASSERT (SuspendType < 6);
- IoBitFieldWrite16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, (UINT16) SuspendType);
- IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13);
+ IoBitFieldWrite16 (PIIX4_PMBA_VALUE + 4, 10, 13, (UINT16) SuspendType);
+ IoOr16 (PIIX4_PMBA_VALUE + 4, BIT13);
CpuDeadLoop ();
}
diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
index b6a3ffe772..ecd462ba7d 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -37,6 +37,3 @@
DebugLib
IoLib
TimerLib
-
-[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress \ No newline at end of file