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