\r
Copyright (C) 2014, Gabriel L. Somlo <somlo@cmu.edu>\r
\r
- This program and the accompanying materials are licensed and made\r
- available under the terms and conditions of the BSD License which\r
- accompanies this distribution. The full text of the license may\r
- be found at http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
\r
#include <Library/DebugLib.h>\r
#include <Library/PciLib.h>\r
#include <OvmfPlatforms.h>\r
\r
-//\r
-// Power Management PCI Configuration Register fields\r
-//\r
-#define PMBA_RTE BIT0\r
-\r
-//\r
-// Offset in the Power Management Base Address to the ACPI Timer\r
-//\r
-#define ACPI_TIMER_OFFSET 0x8\r
-\r
//\r
// Cached ACPI Timer IO Address\r
//\r
-STATIC UINT32 mAcpiTimerIoAddr;\r
+STATIC UINT32 mAcpiTimerIoAddr;\r
\r
/**\r
The constructor function caches the ACPI tick counter address\r
VOID\r
)\r
{\r
- UINT16 HostBridgeDevId;\r
- UINTN Pmba;\r
+ UINT16 HostBridgeDevId;\r
+ UINTN Pmba;\r
\r
//\r
// Query Host Bridge DID to determine platform type\r
HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);\r
switch (HostBridgeDevId) {\r
case INTEL_82441_DEVICE_ID:\r
- Pmba = POWER_MGMT_REGISTER_PIIX4 (0x40);\r
+ Pmba = POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);\r
break;\r
case INTEL_Q35_MCH_DEVICE_ID:\r
- Pmba = POWER_MGMT_REGISTER_Q35 (0x40);\r
+ Pmba = POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE);\r
break;\r
default:\r
- DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n",\r
- __FUNCTION__, HostBridgeDevId));\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "%a: Unknown Host Bridge Device ID: 0x%04x\n",\r
+ __FUNCTION__,\r
+ HostBridgeDevId\r
+ ));\r
ASSERT (FALSE);\r
return RETURN_UNSUPPORTED;\r
}\r