3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
16 This is an implementation of the ACPI platform driver. Requirements for
17 this driver are defined in the Tiano ACPI External Product Specification,
23 #ifndef _ACPI_PLATFORM_H_
24 #define _ACPI_PLATFORM_H_
27 // Statements that include other header files.
29 #include <FrameworkDxe.h>
32 #include <Library/UefiLib.h>
33 #include <Library/BaseLib.h>
34 #include <Library/UefiBootServicesTableLib.h>
35 #include <Library/UefiRuntimeServicesTableLib.h>
36 #include <Library/DebugLib.h>
37 #include <Protocol/FirmwareVolume.h>
38 #include <Library/PcdLib.h>
39 #include <IndustryStandard/HighPrecisionEventTimerTable.h>
40 #include <IndustryStandard/Acpi.h>
41 #include <Protocol/AcpiSystemDescriptionTable.h>
42 #include <Protocol/MpService.h>
43 #include <Protocol/CpuIo.h>
44 #include <IndustryStandard/Acpi30.h>
45 #include <IndustryStandard/Acpi20.h>
46 #include <Library/HobLib.h>
47 #include <AlertStandardFormatTable.h>
48 #include <Guid/SetupVariable.h>
49 #include <Protocol/GlobalNvsArea.h>
50 #include <Library/BaseMemoryLib.h>
51 #include <Library/MemoryAllocationLib.h>
53 #include <Library/PchPlatformLib.h>
57 extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea
;
60 // ACPI table information used to initialize tables.
61 #define EFI_ACPI_OEM_REVISION 0x00000003
62 #define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('V', 'L', 'V', '2')
63 #define EFI_ACPI_CREATOR_REVISION 0x0100000D
65 #define WPCN381U_CONFIG_INDEX 0x2E
66 #define WPCN381U_CONFIG_DATA 0x2F
67 #define WPCN381U_CHIP_ID 0xF4
68 #define WDCP376_CHIP_ID 0xF1
70 #define MOBILE_PLATFORM 1
71 #define DESKTOP_PLATFORM 2
74 // Define macros to build data structure signatures from characters.
76 #ifndef EFI_SIGNATURE_16
77 #define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
79 #ifndef EFI_SIGNATURE_32
80 #define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
82 #ifndef EFI_SIGNATURE_64
83 #define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
84 (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
88 #define GV3_SSDT_OEM_TABLE_IDBASE 0x4000
91 // Private Driver Data.
94 // Define Union of IO APIC & Local APIC structure.
97 EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE AcpiLocalApic
;
98 EFI_ACPI_2_0_IO_APIC_STRUCTURE AcpiIoApic
;
103 } ACPI_APIC_STRUCTURE_PTR
;
106 // Protocol private structure definition.
110 Entry point of the ACPI platform driver.
112 @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
113 @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
115 @retval EFI_SUCCESS Driver initialized successfully.
116 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
117 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
121 InstallAcpiPlatform (
122 IN EFI_HANDLE ImageHandle
,
123 IN EFI_SYSTEM_TABLE
*SystemTable
127 Get Acpi Table Version.
129 @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
130 @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
132 @retval EFI_SUCCESS: Driver initialized successfully.
133 @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded.
134 @retval EFI_OUT_OF_RESOURCES: Could not allocate needed resources.
137 EFI_ACPI_TABLE_VERSION
138 GetAcpiTableVersion (
143 The funtion returns Oem specific information of Acpi Platform.
145 @param[in] OemId OemId returned.
146 @param[in] OemTableId OemTableId returned.
147 @param[in] OemRevision OemRevision returned.
149 @retval EFI_STATUS Status of function execution.
153 AcpiPlatformGetOemFields (
155 OUT UINT64
*OemTableId
,
156 OUT UINT32
*OemRevision
160 The function returns Acpi table version.
164 @retval EFI_ACPI_TABLE_VERSION Acpi table version encoded as a UINT32.
167 EFI_ACPI_TABLE_VERSION
168 AcpiPlatformGetAcpiSetting (
173 Entry point for Acpi platform driver.
175 @param[in] ImageHandle A handle for the image that is initializing this driver.
176 @param[in] SystemTable A pointer to the EFI system table.
178 @retval EFI_SUCCESS Driver initialized successfully.
179 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
180 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
185 AcpiPlatformEntryPoint (
186 IN EFI_HANDLE ImageHandle
,
187 IN EFI_SYSTEM_TABLE
*SystemTable
207 SettingI2CTouchAddress (
215 IN EFI_HANDLE ImageHandle
,
216 IN EFI_SYSTEM_TABLE
*SystemTable