summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@zytor.com>2015-06-09 15:28:09 +0000
committerjljusten <jljusten@Edk2>2015-06-09 15:28:09 +0000
commit589756c7a6c7ad5238f9c47dc11ada1e5cb313db (patch)
treec56e3682e296dad2bc973b5efd6c41817bc76fb5 /OvmfPkg/PlatformPei
parent071586ee476b0c1325a008c6535dd4d2064252ab (diff)
downloadedk2-589756c7a6c7ad5238f9c47dc11ada1e5cb313db.tar.gz
edk2-589756c7a6c7ad5238f9c47dc11ada1e5cb313db.tar.bz2
edk2-589756c7a6c7ad5238f9c47dc11ada1e5cb313db.zip
OvmfPkg/PlatformPei: Query Host Bridge DID only once
Make HostBridgeDevId global so MemMapInitialization() can also use it to conditionally add RCRB MMIO address to HOB. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17600 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r--OvmfPkg/PlatformPei/Platform.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 1126c6529a..0e41d305c7 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -61,6 +61,8 @@ EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] = {
};
+UINT16 mHostBridgeDevId;
+
EFI_BOOT_MODE mBootMode = BOOT_WITH_FULL_CONFIGURATION;
BOOLEAN mS3Supported = FALSE;
@@ -229,7 +231,6 @@ MiscInitialization (
VOID
)
{
- UINT16 HostBridgeDevId;
UINTN PmCmd;
UINTN Pmba;
UINTN AcpiCtlReg;
@@ -246,10 +247,9 @@ MiscInitialization (
BuildCpuHob (36, 16);
//
- // Query Host Bridge DID to determine platform type and save to PCD
+ // Determine platform type and save Host Bridge DID to PCD
//
- HostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);
- switch (HostBridgeDevId) {
+ switch (mHostBridgeDevId) {
case INTEL_82441_DEVICE_ID:
PmCmd = POWER_MGMT_REGISTER_PIIX4 (PCI_COMMAND_OFFSET);
Pmba = POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);
@@ -264,11 +264,11 @@ MiscInitialization (
break;
default:
DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n",
- __FUNCTION__, HostBridgeDevId));
+ __FUNCTION__, mHostBridgeDevId));
ASSERT (FALSE);
return;
}
- PcdSet16 (PcdOvmfHostBridgePciDevId, HostBridgeDevId);
+ PcdSet16 (PcdOvmfHostBridgePciDevId, mHostBridgeDevId);
//
// If the appropriate IOspace enable bit is set, assume the ACPI PMBA
@@ -400,6 +400,11 @@ InitializePlatform (
InitializeXen ();
}
+ //
+ // Query Host Bridge DID
+ //
+ mHostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);
+
if (mBootMode != BOOT_ON_S3_RESUME) {
ReserveEmuVariableNvStore ();