summaryrefslogtreecommitdiff
path: root/BraswellPlatformPkg/Common/Acpi/AcpiPlatform/AcpiPlatform.h
diff options
context:
space:
mode:
Diffstat (limited to 'BraswellPlatformPkg/Common/Acpi/AcpiPlatform/AcpiPlatform.h')
-rw-r--r--BraswellPlatformPkg/Common/Acpi/AcpiPlatform/AcpiPlatform.h302
1 files changed, 302 insertions, 0 deletions
diff --git a/BraswellPlatformPkg/Common/Acpi/AcpiPlatform/AcpiPlatform.h b/BraswellPlatformPkg/Common/Acpi/AcpiPlatform/AcpiPlatform.h
new file mode 100644
index 0000000000..14a31c30e5
--- /dev/null
+++ b/BraswellPlatformPkg/Common/Acpi/AcpiPlatform/AcpiPlatform.h
@@ -0,0 +1,302 @@
+/** @file
+ Implementation of the ACPI platform driver.Requirements for
+ this driver are defined in the Tiano ACPI External Product Specification,
+ revision 0.3.6.
+
+ Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+
+ 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.
+
+**/
+
+#ifndef _ACPI_PLATFORM_H_
+#define _ACPI_PLATFORM_H_
+
+//
+// Statements that include other header files.
+//
+#include <FrameworkDxe.h>
+#include <PiDxe.h>
+#include <Protocol/CpuPlatformPolicyProtocol.h>
+#include <Base.h>
+#include <Library/UefiLib.h>
+#include <Library/BaseLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/DebugLib.h>
+#include <Protocol/FirmwareVolume2.h>
+#include <Library/PcdLib.h>
+#include <IndustryStandard/HighPrecisionEventTimerTable.h>
+#include <IndustryStandard/Acpi.h>
+#include <Protocol/AcpiSystemDescriptionTable.h>
+#include <Protocol/MpService.h>
+#include <Protocol/CpuIo2.h>
+#include <IndustryStandard/Acpi30.h>
+#include <IndustryStandard/Acpi20.h>
+#include <Library/HobLib.h>
+#include <Guid/SetupVariable.h>
+#include <Protocol/GlobalNvsArea.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <PchRegs.h>
+#include <Library/PchPlatformLib.h>
+#include <Protocol/Spi.h>
+
+//
+// Global variables
+//
+EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
+
+//
+// ACPI table information used to initialize tables.
+//
+// SLP 2.0 equates
+#define SLP20_MAGIC_NUMBER 0x00000001
+#define SLP20_VERIFIED_INDICATOR 0x91827364
+#define EFI_ACPI_OEM_REVISION 0x00000003
+#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('C', 'H', 'V', ' ')
+#define EFI_ACPI_CREATOR_REVISION 0x0100000D
+
+#define WPCN381U_CONFIG_INDEX 0x2E
+#define WPCN381U_CONFIG_DATA 0x2F
+#define WPCN381U_CHIP_ID 0xF4
+#define WDCP376_CHIP_ID 0xF1
+
+#define MOBILE_PLATFORM 1
+#define DESKTOP_PLATFORM 2
+
+#define PCAT_RTC_ADDRESS_REGISTER 0x74
+#define PCAT_RTC_DATA_REGISTER 0x75
+#define RTC_ADDRESS_REGISTER_D 0x0D
+
+//
+// Define macros to build data structure signatures from characters.
+//
+#ifndef EFI_SIGNATURE_16
+#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
+#endif
+#ifndef EFI_SIGNATURE_32
+#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
+#endif
+#ifndef EFI_SIGNATURE_64
+#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
+ (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
+#endif
+//
+// +++++++++++++++++++++++++++++++++++++++++++++++++++
+// ESS - GV3 Definitions
+// +++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+#pragma pack(1)
+
+typedef struct {
+ UINT32 PlatformId;
+ UINT8 IoApicEnable;
+ UINT8 NMEN; // Node Manager Enable (aka NPTM)
+ UINT8 TpmEnable :1;
+ UINT8 CStateEnable :1;
+ UINT8 OSC2Report :1;
+ UINT8 C6Enable :1;
+ UINT8 C7Enable :1;
+ UINT8 MonitorMwaitEnable :1;
+ UINT8 PStateEnable :1;
+ UINT8 Rsvd :1;
+ UINT8 PSDT :2; // P-State Dependency Type
+ UINT8 StandbyToS1 :1;
+ UINT8 KBPresent :1;
+ UINT8 MousePresent :1;
+ UINT8 DualIohPresent :1;
+ UINT8 DummyBits :2;
+ UINT32 CpuIdInfo; // Used in PciCrs.asl to determine Havendale/Lynnfield Processor
+ UINT32 Tolm; // Used in PciCrs.asl
+ UINT16 OsSelect; // O/S Type. This is for ASL only.
+ UINT32 IgdOpRegionAddress; // IGD OpRegion Starting Address
+ UINT8 IgdBootType; // IGD Boot Display Device
+ UINT8 IgdPanelType; // IGD Panel Type CMOs option
+ UINT8 IgdTvFormat; // IGD TV Format CMOS option
+ UINT8 IgdTvMinor; // IGD TV Minor Format CMOS option
+ UINT8 IgdPanelScaling; // IGD Panel Scaling
+ UINT8 IgdBlcConfig; // IGD BLC Configuration
+ UINT8 IgdBiaConfig; // IGD BIA Configuration
+ UINT8 IgdSscConfig; // IGD SSC Configuration
+ UINT8 IgdDvmtMemSize; // IGD DVMT Memory Size
+ UINT8 IgdFunc1Enable; // IGD Function 1 Enable
+ UINT8 IgdHpllVco; // HPLL VCO
+ UINT8 IgdSciSmiMode; // GMCH SMI/SCI mode (0=SCI)
+ UINT8 IgdPAVP; // IGD PAVP data
+} BIOS_ACPI_PARAM;
+
+typedef struct _AML_GV3_STATE_PACKAGE {
+ UINT8 PkgOp; // 0x12
+ UINT8 PkgLeadByte;
+ UINT8 NoData;
+ UINT8 DWPrefix0;
+ UINT32 CoreFreq;
+ UINT8 DWPrefix1;
+ UINT32 PowerConsumption;
+ UINT8 DWPrefix2;
+ UINT32 TransactionLatency;
+ UINT8 DWPrefix3;
+ UINT32 BusMasterLatency;
+ UINT8 DWPrefix4;
+ UINT32 ControlValue;
+ UINT8 DWPrefix5;
+ UINT32 StatusValue;
+} AML_GV3_STATE_PACKAGE;
+
+typedef struct _AML_PSS_PACKAGE {
+ UINT8 NameOp; // 0x08
+ UINT8 Sign[4];
+ UINT8 PkgOp; // 0x12
+ UINT8 Res1[2];
+ UINT8 NoOfGV3Packages;
+ AML_GV3_STATE_PACKAGE Pstates[16];
+} AML_PSS_PACKAGE;
+
+typedef struct _SMM_APICID_MAP {
+ UINT32 ApicID;
+ UINT16 PhysicalCpuNumber;
+ UINT16 CpuNumber;
+ UINT16 Version;
+} SMM_APICID_MAP;
+
+typedef struct _SMM_GV3_FVID {
+ UINT16 VidValue : 8;
+ UINT16 FreqRatio : 8;
+ UINT16 SystemBusFreq : 16;
+} SMM_GV3_FVID;
+
+#pragma pack()
+
+//
+// Private Driver Data.
+//
+//
+// Define Union of IO APIC & Local APIC structure.
+//
+typedef union {
+ EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE AcpiLocalApic;
+ EFI_ACPI_2_0_IO_APIC_STRUCTURE AcpiIoApic;
+ struct {
+ UINT8 Type;
+ UINT8 Length;
+ } AcpiApicCommon;
+} ACPI_APIC_STRUCTURE_PTR;
+
+//
+// Protocol private structure definition.
+//
+
+/**
+ Entry point of the ACPI platform driver.
+
+ @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
+ @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
+
+ @retval EFI_SUCCESS Driver initialized successfully.
+ @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
+
+**/
+EFI_STATUS
+InstallAcpiPlatform (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+/**
+ Get Acpi Table Version.
+
+ @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
+ @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
+
+ @retval EFI_SUCCESS: Driver initialized successfully.
+ @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded.
+ @retval EFI_OUT_OF_RESOURCES: Could not allocate needed resources.
+
+**/
+EFI_ACPI_TABLE_VERSION
+GetAcpiTableVersion (
+ VOID
+ );
+
+/**
+ The funtion returns Oem specific information of Acpi Platform.
+
+ @param[in] OemId OemId returned.
+ @param[in] OemTableId OemTableId returned.
+ @param[in] OemRevision OemRevision returned.
+
+ @retval EFI_STATUS Status of function execution.
+
+**/
+EFI_STATUS
+AcpiPlatformGetOemFields (
+ OUT UINT8 *OemId,
+ OUT UINT64 *OemTableId,
+ OUT UINT32 *OemRevision
+ );
+
+/**
+ The function returns Acpi table version.
+
+ @param[in]
+
+ @retval EFI_ACPI_TABLE_VERSION Acpi table version encoded as a UINT32.
+
+**/
+EFI_ACPI_TABLE_VERSION
+AcpiPlatformGetAcpiSetting (
+ VOID
+ );
+
+/**
+ Entry point for Acpi platform driver.
+
+ @param[in] ImageHandle A handle for the image that is initializing this driver.
+ @param[in] SystemTable A pointer to the EFI system table.
+
+ @retval EFI_SUCCESS Driver initialized successfully.
+ @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
+ @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
+
+**/
+EFI_STATUS
+EFIAPI
+AcpiPlatformEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+VOID
+SelectNFCDevice (
+ IN VOID
+ );
+
+VOID
+SettingI2CTouchAddress (
+ IN VOID
+ );
+
+/**
+ Event Notification during exit boot service to enabel ACPI mode
+
+ @param[in] Event EFI Event Handle
+ @param[in] Context Pointer to Notify Context
+
+ @return
+
+**/
+VOID
+EnableAcpiCallback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
+#endif