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