]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
SecurityPkg/OpalPassword: Fix "Enable Feature" Menu disappear issue
[mirror_edk2.git] / Vlv2TbltDevicePkg / AcpiPlatform / AcpiPlatform.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9
10 Module Name:
11
12 AcpiPlatform.h
13
14 Abstract:
15
16 This is an implementation of the ACPI platform driver. Requirements for
17 this driver are defined in the Tiano ACPI External Product Specification,
18 revision 0.3.6.
19
20
21 --*/
22
23 #ifndef _ACPI_PLATFORM_H_
24 #define _ACPI_PLATFORM_H_
25
26 //
27 // Statements that include other header files.
28 //
29 #include <FrameworkDxe.h>
30 #include <PiDxe.h>
31 #include <Base.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>
52 #include <PchRegs.h>
53 #include <Library/PchPlatformLib.h>
54 //
55 // Global variables.
56 //
57 extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
58
59 //
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
64
65 #define WPCN381U_CONFIG_INDEX 0x2E
66 #define WPCN381U_CONFIG_DATA 0x2F
67 #define WPCN381U_CHIP_ID 0xF4
68 #define WDCP376_CHIP_ID 0xF1
69
70 #define MOBILE_PLATFORM 1
71 #define DESKTOP_PLATFORM 2
72
73 //
74 // Define macros to build data structure signatures from characters.
75 //
76 #ifndef EFI_SIGNATURE_16
77 #define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
78 #endif
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))
81 #endif
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))
85 #endif
86
87
88 #define GV3_SSDT_OEM_TABLE_IDBASE 0x4000
89
90 //
91 // Private Driver Data.
92 //
93 //
94 // Define Union of IO APIC & Local APIC structure.
95 //
96 typedef union {
97 EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE AcpiLocalApic;
98 EFI_ACPI_2_0_IO_APIC_STRUCTURE AcpiIoApic;
99 struct {
100 UINT8 Type;
101 UINT8 Length;
102 } AcpiApicCommon;
103 } ACPI_APIC_STRUCTURE_PTR;
104
105 //
106 // Protocol private structure definition.
107 //
108
109 /**
110 Entry point of the ACPI platform driver.
111
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.
114
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.
118
119 **/
120 EFI_STATUS
121 InstallAcpiPlatform (
122 IN EFI_HANDLE ImageHandle,
123 IN EFI_SYSTEM_TABLE *SystemTable
124 );
125
126 /**
127 Get Acpi Table Version.
128
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.
131
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.
135
136 --*/
137 EFI_ACPI_TABLE_VERSION
138 GetAcpiTableVersion (
139 VOID
140 );
141
142 /**
143 The funtion returns Oem specific information of Acpi Platform.
144
145 @param[in] OemId OemId returned.
146 @param[in] OemTableId OemTableId returned.
147 @param[in] OemRevision OemRevision returned.
148
149 @retval EFI_STATUS Status of function execution.
150
151 **/
152 EFI_STATUS
153 AcpiPlatformGetOemFields (
154 OUT UINT8 *OemId,
155 OUT UINT64 *OemTableId,
156 OUT UINT32 *OemRevision
157 );
158
159 /**
160 The function returns Acpi table version.
161
162 @param[in]
163
164 @retval EFI_ACPI_TABLE_VERSION Acpi table version encoded as a UINT32.
165
166 **/
167 EFI_ACPI_TABLE_VERSION
168 AcpiPlatformGetAcpiSetting (
169 VOID
170 );
171
172 /**
173 Entry point for Acpi platform driver.
174
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.
177
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.
181
182 **/
183 EFI_STATUS
184 EFIAPI
185 AcpiPlatformEntryPoint (
186 IN EFI_HANDLE ImageHandle,
187 IN EFI_SYSTEM_TABLE *SystemTable
188 );
189
190 UINT8
191 ReadCmosBank1Byte (
192 IN UINT8 Index
193 );
194
195 VOID
196 WriteCmosBank1Byte (
197 IN UINT8 Index,
198 IN UINT8 Data
199 );
200
201 VOID
202 SelectNFCDevice (
203 IN VOID
204 );
205
206 VOID
207 SettingI2CTouchAddress (
208 IN VOID
209 );
210
211 extern
212 EFI_STATUS
213 EFIAPI
214 IsctDxeEntryPoint (
215 IN EFI_HANDLE ImageHandle,
216 IN EFI_SYSTEM_TABLE *SystemTable
217 );
218
219 #endif