@@ -75,11 +75,11 @@ [PcdsFixedAtBuild]
## This flag is used to control the destination port for PlatformDebugLibIoPort
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
+ gUefiOvmfPkgTokenSpaceGuid.PcdPiix4AcpiPmBaseAddress|0xB000|UINT16|5
## When VirtioScsiDxe is instantiated for a HBA, the numbers of targets and
# LUNs are retrieved from the host during virtio-scsi setup.
# MdeModulePkg/Bus/Scsi/ScsiBusDxe then scans all MaxTarget * MaxLun
# possible devices. This can take extremely long, for example with
@@ -29,12 +29,12 @@ [Sources]
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
-[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
+[FixedPcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdPiix4AcpiPmBaseAddress
[LibraryClasses]
BaseLib
PciLib
IoLib
@@ -28,12 +28,12 @@ [Sources]
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
-[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
+[FixedPcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdPiix4AcpiPmBaseAddress
[LibraryClasses]
BaseLib
PciLib
IoLib
@@ -36,7 +36,7 @@ [Packages]
[LibraryClasses]
DebugLib
IoLib
TimerLib
-[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
\ No newline at end of file
+[FixedPcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdPiix4AcpiPmBaseAddress
@@ -63,11 +63,10 @@ [LibraryClasses]
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
- gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
gUefiOvmfPkgTokenSpaceGuid.PcdS3AcpiReservedMemoryBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize
@@ -97,10 +96,11 @@ [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable
gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
+ gUefiOvmfPkgTokenSpaceGuid.PcdPiix4AcpiPmBaseAddress
[FeaturePcd]
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
[Ppis]
@@ -71,11 +71,12 @@ 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.
//
- PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PcdGet16 (PcdAcpiPmBaseAddress));
+ PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0,
+ FixedPcdGet16 (PcdPiix4AcpiPmBaseAddress));
//
// Enable PMBA I/O port decodes
//
PciOr8 (AcpiCtlReg, AcpiEnBit);
@@ -67,11 +67,12 @@ 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.
//
- PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PcdGet16 (PcdAcpiPmBaseAddress));
+ PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0,
+ FixedPcdGet16 (PcdPiix4AcpiPmBaseAddress));
//
// Enable PMBA I/O port decodes
//
PciOr8 (AcpiCtlReg, AcpiEnBit);
@@ -25,12 +25,13 @@ AcpiPmControl (
UINTN SuspendType
)
{
ASSERT (SuspendType < 6);
- IoBitFieldWrite16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, (UINT16) SuspendType);
- IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13);
+ IoBitFieldWrite16 (FixedPcdGet16 (PcdPiix4AcpiPmBaseAddress) + 4, 10, 13,
+ (UINT16) SuspendType);
+ IoOr16 (FixedPcdGet16 (PcdPiix4AcpiPmBaseAddress) + 4, BIT13);
CpuDeadLoop ();
}
/**
Calling this function causes a system-wide reset. This sets
@@ -410,11 +410,12 @@ MiscInitialization (
if ((PciRead8 (AcpiCtlReg) & AcpiEnBit) == 0) {
//
// The PEI phase should be exited with fully accessibe ACPI PM IO space:
// 1. set PMBA
//
- PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PcdGet16 (PcdAcpiPmBaseAddress));
+ PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0,
+ FixedPcdGet16 (PcdPiix4AcpiPmBaseAddress));
//
// 2. set PCICMD/IOSE
//
PciOr8 (PmCmd, EFI_PCI_COMMAND_IO_SPACE);
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 PCD in BaseRomAcpiTimerLib too (which cannot access RAM and dynamic PCDs), it must remain a fixed PCD. We will introduce its Q35 counterpart PCD later. (We only need these PCDs to enable build-time configuration, and symbolic references in the code. Introducing macros under "OvmfPkg/Include/IndustryStandard/" is not a good choice, because the values that the firmware programs are not standardized.) As first step, rename the PCD so it says "Piix4" in the name, plus update all client code to fetch it explicitly with FixedPcdGet16(). 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> --- OvmfPkg/OvmfPkg.dec | 2 +- OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf | 4 ++-- OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf | 4 ++-- OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf | 4 ++-- OvmfPkg/PlatformPei/PlatformPei.inf | 2 +- OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c | 3 ++- OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c | 3 ++- OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c | 5 +++-- OvmfPkg/PlatformPei/Platform.c | 3 ++- 9 files changed, 17 insertions(+), 13 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel