mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
67164dcd2e
commit
830067bfa2
|
@ -20,11 +20,12 @@
|
||||||
#include <Library/IoLib.h>
|
#include <Library/IoLib.h>
|
||||||
#include <Library/PciLib.h>
|
#include <Library/PciLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// PIIX4 Power Management Base Address
|
// PIIX4 Power Management Base Address
|
||||||
//
|
//
|
||||||
UINT32 mPmba = 0xb000;
|
STATIC UINT32 mPmba;
|
||||||
|
|
||||||
#define PCI_BAR_IO 0x1
|
#define PCI_BAR_IO 0x1
|
||||||
#define ACPI_TIMER_FREQUENCY 3579545
|
#define ACPI_TIMER_FREQUENCY 3579545
|
||||||
|
@ -56,6 +57,8 @@ AcpiTimerLibConstructor (
|
||||||
ASSERT (mPmba & PCI_BAR_IO);
|
ASSERT (mPmba & PCI_BAR_IO);
|
||||||
mPmba &= ~PCI_BAR_IO;
|
mPmba &= ~PCI_BAR_IO;
|
||||||
} else {
|
} else {
|
||||||
|
mPmba = PcdGet16 (PcdAcpiPmBaseAddress);
|
||||||
|
|
||||||
PciAndThenOr32 (PCI_LIB_ADDRESS (0,Device,3,0x40),
|
PciAndThenOr32 (PCI_LIB_ADDRESS (0,Device,3,0x40),
|
||||||
(UINT32) ~0xfc0, mPmba);
|
(UINT32) ~0xfc0, mPmba);
|
||||||
PciOr8 (PCI_LIB_ADDRESS (0,Device,3,0x04), 0x01);
|
PciOr8 (PCI_LIB_ADDRESS (0,Device,3,0x04), 0x01);
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
OvmfPkg/OvmfPkg.dec
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib
|
BaseLib
|
||||||
|
|
|
@ -49,6 +49,10 @@
|
||||||
## This flag is used to control the destination port for PlatformDebugLibIoPort
|
## This flag is used to control the destination port for PlatformDebugLibIoPort
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort|0x402|UINT16|4
|
gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort|0x402|UINT16|4
|
||||||
|
|
||||||
|
## This flag determines the Power Management Base Address of choice, written
|
||||||
|
# to PIIX4 function 3 offset 0x40-0x43 bits [15:6].
|
||||||
|
gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress|0xB000|UINT16|5
|
||||||
|
|
||||||
[PcdsDynamic, PcdsDynamicEx]
|
[PcdsDynamic, PcdsDynamicEx]
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2
|
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue