diff options
author | Guo Mang <mang.guo@intel.com> | 2017-08-02 09:54:47 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-09-05 19:45:08 +0800 |
commit | 6c128c65b5ec0e5b8b5a0ccb165f3afd29e485f8 (patch) | |
tree | 444372d92a0ae8991fe4d15eb3937df43690dfda /OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c | |
parent | b207c6434d7a5a4502975d322312e07017e8a8cb (diff) | |
download | edk2-platforms-6c128c65b5ec0e5b8b5a0ccb165f3afd29e485f8.tar.xz |
Remove core packages since we can get them from edk2 repository
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang <mang.guo@intel.com>
Diffstat (limited to 'OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c')
-rw-r--r-- | OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c deleted file mode 100644 index c3c50c05d3..0000000000 --- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c +++ /dev/null @@ -1,105 +0,0 @@ -/** @file
- Provide constructor and GetTick for Base instance of ACPI Timer Library
-
- Copyright (C) 2014, Gabriel L. Somlo <somlo@cmu.edu>
-
- This program and the accompanying materials are licensed and made
- available under the terms and conditions of the BSD License which
- accompanies this distribution. The full text of the license may
- be found at http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
-#include <Library/PciLib.h>
-#include <Library/PcdLib.h>
-#include <OvmfPlatforms.h>
-
-//
-// Cached ACPI Timer IO Address
-//
-STATIC UINT32 mAcpiTimerIoAddr;
-
-/**
- The constructor function caches the ACPI tick counter address, and,
- if necessary, enables ACPI IO space.
-
- @retval EFI_SUCCESS The constructor always returns RETURN_SUCCESS.
-
-**/
-RETURN_STATUS
-EFIAPI
-AcpiTimerLibConstructor (
- VOID
- )
-{
- UINT16 HostBridgeDevId;
- UINTN Pmba;
- UINTN AcpiCtlReg;
- UINT8 AcpiEnBit;
-
- //
- // Query Host Bridge DID to determine platform type
- //
- HostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);
- switch (HostBridgeDevId) {
- case INTEL_82441_DEVICE_ID:
- Pmba = POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);
- AcpiCtlReg = POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMREGMISC);
- AcpiEnBit = PIIX4_PMREGMISC_PMIOSE;
- break;
- case INTEL_Q35_MCH_DEVICE_ID:
- 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",
- __FUNCTION__, HostBridgeDevId));
- ASSERT (FALSE);
- return RETURN_UNSUPPORTED;
- }
-
- mAcpiTimerIoAddr = (PciRead32 (Pmba) & ~PMBA_RTE) + ACPI_TIMER_OFFSET;
-
- //
- // Check to see if the Power Management Base Address is already enabled
- //
- 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));
-
- //
- // Enable PMBA I/O port decodes
- //
- PciOr8 (AcpiCtlReg, AcpiEnBit);
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Internal function to read the current tick counter of ACPI.
-
- Read the current ACPI tick counter using the counter address cached
- by this instance's constructor.
-
- @return The tick counter read.
-
-**/
-UINT32
-InternalAcpiGetTimerTick (
- VOID
- )
-{
- //
- // Return the current ACPI timer value.
- //
- return IoRead32 (mAcpiTimerIoAddr);
-}
|