]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2TbltDevicePkg / AcpiPlatform / AcpiPlatform.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13
14
15 Module Name:
16
17 AcpiPlatform.h
18
19 Abstract:
20
21 This is an implementation of the ACPI platform driver. Requirements for
22 this driver are defined in the Tiano ACPI External Product Specification,
23 revision 0.3.6.
24
25
26 --*/
27
28 #ifndef _ACPI_PLATFORM_H_
29 #define _ACPI_PLATFORM_H_
30
31 //
32 // Statements that include other header files.
33 //
34 #include <FrameworkDxe.h>
35 #include <PiDxe.h>
36 #include <Base.h>
37 #include <Library/UefiLib.h>
38 #include <Library/BaseLib.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/UefiRuntimeServicesTableLib.h>
41 #include <Library/DebugLib.h>
42 #include <Protocol/FirmwareVolume.h>
43 #include <Library/PcdLib.h>
44 #include <IndustryStandard/HighPrecisionEventTimerTable.h>
45 #include <IndustryStandard/Acpi.h>
46 #include <Protocol/AcpiSystemDescriptionTable.h>
47 #include <Protocol/MpService.h>
48 #include <Protocol/CpuIo.h>
49 #include <IndustryStandard/Acpi30.h>
50 #include <IndustryStandard/Acpi20.h>
51 #include <Library/HobLib.h>
52 #include <AlertStandardFormatTable.h>
53 #include <Guid/SetupVariable.h>
54 #include <Protocol/GlobalNvsArea.h>
55 #include <Library/BaseMemoryLib.h>
56 #include <Library/MemoryAllocationLib.h>
57 #include <PchRegs.h>
58 #include <Library/PchPlatformLib.h>
59 //
60 // Global variables.
61 //
62 EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
63
64 //
65 // ACPI table information used to initialize tables.
66 #define EFI_ACPI_OEM_REVISION 0x00000003
67 #define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('V', 'L', 'V', '2')
68 #define EFI_ACPI_CREATOR_REVISION 0x0100000D
69
70 #define WPCN381U_CONFIG_INDEX 0x2E
71 #define WPCN381U_CONFIG_DATA 0x2F
72 #define WPCN381U_CHIP_ID 0xF4
73 #define WDCP376_CHIP_ID 0xF1
74
75 #define MOBILE_PLATFORM 1
76 #define DESKTOP_PLATFORM 2
77
78 //
79 // Define macros to build data structure signatures from characters.
80 //
81 #ifndef EFI_SIGNATURE_16
82 #define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
83 #endif
84 #ifndef EFI_SIGNATURE_32
85 #define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
86 #endif
87 #ifndef EFI_SIGNATURE_64
88 #define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
89 (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
90 #endif
91
92
93 #define GV3_SSDT_OEM_TABLE_IDBASE 0x4000
94
95 //
96 // Private Driver Data.
97 //
98 //
99 // Define Union of IO APIC & Local APIC structure.
100 //
101 typedef union {
102 EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE AcpiLocalApic;
103 EFI_ACPI_2_0_IO_APIC_STRUCTURE AcpiIoApic;
104 struct {
105 UINT8 Type;
106 UINT8 Length;
107 } AcpiApicCommon;
108 } ACPI_APIC_STRUCTURE_PTR;
109
110 //
111 // Protocol private structure definition.
112 //
113
114 /**
115 Entry point of the ACPI platform driver.
116
117 @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
118 @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
119
120 @retval EFI_SUCCESS Driver initialized successfully.
121 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
122 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
123
124 **/
125 EFI_STATUS
126 InstallAcpiPlatform (
127 IN EFI_HANDLE ImageHandle,
128 IN EFI_SYSTEM_TABLE *SystemTable
129 );
130
131 /**
132 Get Acpi Table Version.
133
134 @param[in] ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver.
135 @param[in] SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table.
136
137 @retval EFI_SUCCESS: Driver initialized successfully.
138 @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded.
139 @retval EFI_OUT_OF_RESOURCES: Could not allocate needed resources.
140
141 --*/
142 EFI_ACPI_TABLE_VERSION
143 GetAcpiTableVersion (
144 VOID
145 );
146
147 /**
148 The funtion returns Oem specific information of Acpi Platform.
149
150 @param[in] OemId OemId returned.
151 @param[in] OemTableId OemTableId returned.
152 @param[in] OemRevision OemRevision returned.
153
154 @retval EFI_STATUS Status of function execution.
155
156 **/
157 EFI_STATUS
158 AcpiPlatformGetOemFields (
159 OUT UINT8 *OemId,
160 OUT UINT64 *OemTableId,
161 OUT UINT32 *OemRevision
162 );
163
164 /**
165 The function returns Acpi table version.
166
167 @param[in]
168
169 @retval EFI_ACPI_TABLE_VERSION Acpi table version encoded as a UINT32.
170
171 **/
172 EFI_ACPI_TABLE_VERSION
173 AcpiPlatformGetAcpiSetting (
174 VOID
175 );
176
177 /**
178 Entry point for Acpi platform driver.
179
180 @param[in] ImageHandle A handle for the image that is initializing this driver.
181 @param[in] SystemTable A pointer to the EFI system table.
182
183 @retval EFI_SUCCESS Driver initialized successfully.
184 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded.
185 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
186
187 **/
188 EFI_STATUS
189 EFIAPI
190 AcpiPlatformEntryPoint (
191 IN EFI_HANDLE ImageHandle,
192 IN EFI_SYSTEM_TABLE *SystemTable
193 );
194
195 UINT8
196 ReadCmosBank1Byte (
197 IN UINT8 Index
198 );
199
200 VOID
201 WriteCmosBank1Byte (
202 IN UINT8 Index,
203 IN UINT8 Data
204 );
205
206 VOID
207 SelectNFCDevice (
208 IN VOID
209 );
210
211 VOID
212 SettingI2CTouchAddress (
213 IN VOID
214 );
215
216 extern
217 EFI_STATUS
218 EFIAPI
219 IsctDxeEntryPoint (
220 IN EFI_HANDLE ImageHandle,
221 IN EFI_SYSTEM_TABLE *SystemTable
222 );
223
224 #endif