From bc9d05d6f2ba3267cbf2f339cecd59d2ebae4ffb Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 13 May 2015 09:31:44 +0000 Subject: OvmfPkg: consolidate POWER_MGMT_REGISTER_Q35() on "Q35MchIch9.h" macros All POWER_MGMT_REGISTER_Q35() macro invocations in OvmfPkg should use the macros in "Q35MchIch9.h" as arguments. Cc: Gabriel Somlo Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Acked-by: Gabriel Somlo Tested-by: Gabriel Somlo Reviewed-by: Jordan Justen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17434 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c | 7 +++---- OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c | 9 ++++----- OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c | 2 +- OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c | 2 +- OvmfPkg/PlatformPei/Platform.c | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c index 58938b5d8b..c20f299304 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c @@ -23,7 +23,6 @@ // #define PMBA_RTE BIT0 #define PIIX4_PMIOSE BIT0 -#define Q35_ACPI_EN BIT7 // // Offset in the Power Management Base Address to the ACPI Timer @@ -64,9 +63,9 @@ AcpiTimerLibConstructor ( AcpiEnBit = PIIX4_PMIOSE; break; case INTEL_Q35_MCH_DEVICE_ID: - Pmba = POWER_MGMT_REGISTER_Q35 (0x40); - AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (0x44); // ACPI_CNTL - AcpiEnBit = Q35_ACPI_EN; + Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); + AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); + AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; default: DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c index c9601d8e97..55f3572eef 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c @@ -24,7 +24,6 @@ // #define PMBA_RTE BIT0 #define PIIX4_PMIOSE BIT0 -#define Q35_ACPI_EN BIT7 // // Offset in the Power Management Base Address to the ACPI Timer @@ -62,9 +61,9 @@ AcpiTimerLibConstructor ( AcpiEnBit = PIIX4_PMIOSE; break; case INTEL_Q35_MCH_DEVICE_ID: - Pmba = POWER_MGMT_REGISTER_Q35 (0x40); - AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (0x44); // ACPI_CNTL - AcpiEnBit = Q35_ACPI_EN; + Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); + AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); + AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; default: DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", @@ -118,7 +117,7 @@ InternalAcpiGetTimerTick ( Pmba = POWER_MGMT_REGISTER_PIIX4 (0x40); break; case INTEL_Q35_MCH_DEVICE_ID: - Pmba = POWER_MGMT_REGISTER_Q35 (0x40); + Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); break; default: DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", diff --git a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c index 2be0793057..649b5c9a4d 100644 --- a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c @@ -64,7 +64,7 @@ AcpiTimerLibConstructor ( Pmba = POWER_MGMT_REGISTER_PIIX4 (0x40); break; case INTEL_Q35_MCH_DEVICE_ID: - Pmba = POWER_MGMT_REGISTER_Q35 (0x40); + Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); break; default: DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c index 1e87820e93..2521ea4e6a 100644 --- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c @@ -870,7 +870,7 @@ PciAcpiInitialization ( PciWrite8 (PCI_LIB_ADDRESS (0, 1, 0, 0x63), 0x0a); // D break; case INTEL_Q35_MCH_DEVICE_ID: - Pmba = POWER_MGMT_REGISTER_Q35 (0x40); + Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); // // 00:1f.0 LPC Bridge (Q35) LNK routing targets // diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 5ce0a9099a..4ce358ccbc 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -258,9 +258,9 @@ MiscInitialization ( break; case INTEL_Q35_MCH_DEVICE_ID: PmCmd = POWER_MGMT_REGISTER_Q35 (PCI_COMMAND_OFFSET); - Pmba = POWER_MGMT_REGISTER_Q35 (0x40); - AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (0x44); // ACPI_CNTL - AcpiEnBit = BIT7; // Q35_ACPI_EN + Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); + AcpiCtlReg = POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); + AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; default: DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", -- cgit v1.2.3