summaryrefslogtreecommitdiff
path: root/OvmfPkg
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2015-05-13 09:31:53 +0000
committerlersek <lersek@Edk2>2015-05-13 09:31:53 +0000
commitcc5e0aa9caa97d2cf0cac6ed929919f4283b5b98 (patch)
treed10feaa56e5f955c5ed7c8c0b653f6ad9c0d5171 /OvmfPkg
parentda372167684822ddd0cce01e5282502da28538a4 (diff)
downloadedk2-platforms-cc5e0aa9caa97d2cf0cac6ed929919f4283b5b98.tar.xz
OvmfPkg: extract some bits and port offsets common to Q35 and I440FX
The PMBA_RTE and ACPI_TIMER_OFFSET macros apply equally to both boards, plus they are triplicated between the various AcpiTimerLib instances. Define them centrally in "OvmfPlatforms.h". Cc: Gabriel Somlo <somlo@cmu.edu> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Gabriel Somlo <somlo@cmu.edu> Tested-by: Gabriel Somlo <somlo@cmu.edu> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17436 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/Include/OvmfPlatforms.h10
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c10
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c10
-rw-r--r--OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c10
4 files changed, 10 insertions, 30 deletions
diff --git a/OvmfPkg/Include/OvmfPlatforms.h b/OvmfPkg/Include/OvmfPlatforms.h
index 19f0adb897..43ab01d57c 100644
--- a/OvmfPkg/Include/OvmfPlatforms.h
+++ b/OvmfPkg/Include/OvmfPlatforms.h
@@ -27,4 +27,14 @@
#define OVMF_HOSTBRIDGE_DID \
PCI_LIB_ADDRESS (0, 0, 0, PCI_DEVICE_ID_OFFSET)
+//
+// Common bits in same-purpose registers
+//
+#define PMBA_RTE BIT0
+
+//
+// Common IO ports relative to the Power Management Base Address
+//
+#define ACPI_TIMER_OFFSET 0x8
+
#endif
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
index 490cf803be..c3c50c05d3 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
@@ -19,16 +19,6 @@
#include <OvmfPlatforms.h>
//
-// Power Management PCI Configuration Register fields
-//
-#define PMBA_RTE BIT0
-
-//
-// Offset in the Power Management Base Address to the ACPI Timer
-//
-#define ACPI_TIMER_OFFSET 0x8
-
-//
// Cached ACPI Timer IO Address
//
STATIC UINT32 mAcpiTimerIoAddr;
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
index 50a3391b75..5164769f60 100644
--- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
@@ -19,16 +19,6 @@
#include <Library/PcdLib.h>
#include <OvmfPlatforms.h>
-//
-// Power Management PCI Configuration Register fields
-//
-#define PMBA_RTE BIT0
-
-//
-// Offset in the Power Management Base Address to the ACPI Timer
-//
-#define ACPI_TIMER_OFFSET 0x8
-
/**
The constructor function enables ACPI IO space.
diff --git a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
index 0c42ed2c5c..e673434ae6 100644
--- a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
+++ b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
@@ -19,16 +19,6 @@
#include <OvmfPlatforms.h>
//
-// Power Management PCI Configuration Register fields
-//
-#define PMBA_RTE BIT0
-
-//
-// Offset in the Power Management Base Address to the ACPI Timer
-//
-#define ACPI_TIMER_OFFSET 0x8
-
-//
// Cached ACPI Timer IO Address
//
STATIC UINT32 mAcpiTimerIoAddr;