Root/
| |
---|---|
Source at commit 2744 created 8 years 11 months ago. By ifabio, Removing old RLE/Clut data | |
1 | /*␊ |
2 | Copyright (c) 2010, Intel Corporation␊ |
3 | All rights reserved.␊ |
4 | ␊ |
5 | Redistribution and use in source and binary forms, with or without␊ |
6 | modification, are permitted provided that the following conditions are met:␊ |
7 | ␊ |
8 | * Redistributions of source code must retain the above copyright notice,␊ |
9 | this list of conditions and the following disclaimer.␊ |
10 | * Redistributions in binary form must reproduce the above copyright notice,␊ |
11 | this list of conditions and the following disclaimer in the documentation␊ |
12 | and/or other materials provided with the distribution.␊ |
13 | * Neither the name of Intel Corporation nor the names of its contributors␊ |
14 | may be used to endorse or promote products derived from this software␊ |
15 | without specific prior written permission.␊ |
16 | ␊ |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND␊ |
18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED␊ |
19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE␊ |
20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR␊ |
21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES␊ |
22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;␊ |
23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON␊ |
24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT␊ |
25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS␊ |
26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.␊ |
27 | */␊ |
28 | ␊ |
29 | #ifndef ppmsetup_h␊ |
30 | #define ppmsetup_h␊ |
31 | ␊ |
32 | #include "datatype.h"␊ |
33 | ␊ |
34 | #define CURRENT_PPM_RCM_INTERFACE_SPECIFICATION 11␊ |
35 | ␊ |
36 | #ifndef nameseg_defined␊ |
37 | #define nameseg_defined␊ |
38 | #define NAMESEG(s) (((U32)(s[0]) << 0) \␊ |
39 | |((U32)(s[1]) << 8) \␊ |
40 | |((U32)(s[2]) << 16) \␊ |
41 | |((U32)(s[3]) << 24))␊ |
42 | #endif␊ |
43 | ␊ |
44 | typedef enum ssdt_loc_flag {␊ |
45 | // Flag indicating the SSDT ACPI structure should be built in a stack-based␊ |
46 | // buffer. If the SSDT is successfully created, then the following occurs:␊ |
47 | // (1) the RSDT ACPI structure is moved lower in memory and updated to␊ |
48 | // include a pointer to the new SSDT.␊ |
49 | // (2) the SSDT APCI structure is copied into memory just above the moved␊ |
50 | // RSDT structure␊ |
51 | // (3) the RSD ACPI structure is updated to included the new location of␊ |
52 | // the just moved RSDT ACPI structure␊ |
53 | // Note: The XSDT is not updated!␊ |
54 | //␊ |
55 | // NOTE: THIS OPTION WILL DEPRECATED AND REMOVED␊ |
56 | // IN A FUTURE VERSION OF THIS SPECIFICATION.␊ |
57 | SSDT_LOC_FLAG_ACPI_RECLAIM = 0,␊ |
58 | ␊ |
59 | // Flag indicating the SSDT should be built directly in the memory region␊ |
60 | // provided by the ssdt_mem_addr option parameter.␊ |
61 | // If the SSDT is successfully created, then the following occurs:␊ |
62 | // (1) the RSDT ACPI structure is moved lower in memory and updated to␊ |
63 | // include a pointer to the new SSDT.␊ |
64 | // (2) the RSD ACPI structure is updated to include the new location of the␊ |
65 | // RSDT ACPI structure.␊ |
66 | // Note: The XSDT is not updated!␊ |
67 | //␊ |
68 | // NOTE: THIS OPTION WILL DEPRECATED AND REMOVED␊ |
69 | // IN A FUTURE VERSION OF THIS SPECIFICATION.␊ |
70 | SSDT_LOC_FLAG_ADDR_PROVIDED = 1,␊ |
71 | ␊ |
72 | // Flag indicating the SSDT should be built directly in the memory region␊ |
73 | // provided by the ssdt_mem_addr option parameter.␊ |
74 | // After SSDT is successfully created, no further processing occurs.␊ |
75 | SSDT_LOC_FLAG_ADDR_PROVIDED_NO_INSERT = 2,␊ |
76 | ␊ |
77 | // Flag indicating the SSDT should be built directly in the memory region␊ |
78 | // provided by the ssdt_mem_addr option parameter.␊ |
79 | // After SSDT is successfully created, then the following occurs:␊ |
80 | // (1) the RSDT ACPI structure is not moved but is updated to␊ |
81 | // include a 32-bit pointer to the new SSDT.␊ |
82 | // (2) If the XSDT exists, it is not moved but is updated to␊ |
83 | // include a 64-bit pointer to the new SSDT.␊ |
84 | SSDT_LOC_FLAG_ADDR_PROVIDED_INSERT = 3,␊ |
85 | } SSDT_LOC_FLAG;␊ |
86 | ␊ |
87 | typedef enum exit_code {␊ |
88 | // PPM RCM completed all initialization successfully␊ |
89 | EXIT_CODE_PPM_COMPLETED = 1,␊ |
90 | ␊ |
91 | // Failed building P-state table␊ |
92 | EXIT_CODE_FAILED_BUILD_PSTATES = 2,␊ |
93 | ␊ |
94 | EXIT_CODE_PPM_EIST_DISABLED = 3,␊ |
95 | ␊ |
96 | // Failed to find ACPI tables␊ |
97 | EXIT_CODE_FAILED_FIND_ACPI_TABLES = 4,␊ |
98 | ␊ |
99 | // Failed to process the ACPI MADT structure␊ |
100 | EXIT_CODE_FAILED_PROCESS_MADT = 5,␊ |
101 | ␊ |
102 | // Failed to resolve ACPI MADT structure against available logical␊ |
103 | // processors␊ |
104 | EXIT_CODE_FAILED_PROCESS_MADT_INFO = 6,␊ |
105 | ␊ |
106 | // Failed to build ACPI SSDT structure␊ |
107 | EXIT_CODE_FAILED_PROCESS_SSDT = 7,␊ |
108 | ␊ |
109 | // Failed to build and intialize HOST structure␊ |
110 | EXIT_CODE_FAILED_HOST_INIT = 8,␊ |
111 | ␊ |
112 | // Failed during wake of all NBSP to gather processor information␊ |
113 | EXIT_CODE_FAILED_COLLECT_SOCKET_INFO = 9,␊ |
114 | ␊ |
115 | // Failed to resolve target configuration between desired options and␊ |
116 | // processor features␊ |
117 | EXIT_CODE_FAILED_DETERMINE_CONFIGURATION = 0x0a,␊ |
118 | ␊ |
119 | // No SSDT ACPI struture was created␊ |
120 | EXIT_CODE_NO_SSDT_CREATED = 0x0b,␊ |
121 | ␊ |
122 | // Failed to build Cstates correctly␊ |
123 | EXIT_CODE_FAILED_BUILD_CSTATES = 0x0c,␊ |
124 | ␊ |
125 | // Failed to build Tstates correctly␊ |
126 | EXIT_CODE_FAILED_BUILD_TSTATES = 0x0d,␊ |
127 | ␊ |
128 | // Failed to find package index of logical processor listed in MADT ACPI table␊ |
129 | EXIT_CODE_FAILED_FIND_PKG_INDEX_FROM_LAPIC = 0x0e,␊ |
130 | ␊ |
131 | // Failed with invalid input provided for SSDT location flag␊ |
132 | EXIT_CODE_FAILED_INVALID_SSDT_LOCATION_FLAG = 0x0f,␊ |
133 | ␊ |
134 | // Failed with no logical processors found in MADT␊ |
135 | EXIT_CODE_FAILED_NO_LAPIC_FOUND_IN_MADT = 0x10,␊ |
136 | ␊ |
137 | // Failed with SSDT size exceeded during SSDT creation␊ |
138 | EXIT_CODE_FAILED_SSDT_SIZE_EXCEEDED = 0x11,␊ |
139 | ␊ |
140 | // Failed to build ACPI SSDT structure␊ |
141 | EXIT_CODE_FAILED_BUILD_SSDT = 0x12,␊ |
142 | ␊ |
143 | // Failed with core index of logical processor listed in MADT ACPI table exceeding max␊ |
144 | EXIT_CODE_MAX_CORES_EXCEEDED = 0x13,␊ |
145 | ␊ |
146 | // Failed to find CPU Scope from array of ACPI processor number to ACPI CPU NameSeg structures␊ |
147 | EXIT_CODE_FAILED_FIND_CPU_SCOPE_NAME_SEG = 0x14,␊ |
148 | ␊ |
149 | // Failed to update FADT␊ |
150 | EXIT_CODE_FAILED_UPDATE_FADT = 0x15,␊ |
151 | ␊ |
152 | // GPF detected␊ |
153 | EXIT_CODE_GPF_DETECTED = 0x16,␊ |
154 | ␊ |
155 | // Failed with invalid SSDT buffer address␊ |
156 | EXIT_CODE_INVALID_SSDT_ADDR = 0x17,␊ |
157 | ␊ |
158 | // Failed with invalid SSDT buffer length␊ |
159 | EXIT_CODE_INVALID_SSDT_LEN = 0x18,␊ |
160 | } EXIT_CODE;␊ |
161 | ␊ |
162 | typedef struct exit_state {␊ |
163 | // 1 = success, 0 = failure␊ |
164 | U32 return_status;␊ |
165 | ␊ |
166 | // Number of Failure or Informative codes included in the buffer␊ |
167 | U32 error_code_count;␊ |
168 | ␊ |
169 | // Buffer of Failure or Informative codes␊ |
170 | U32 error_codes[10];␊ |
171 | ␊ |
172 | // This 32-bit physical memory address specifies the final location for the␊ |
173 | // SSDT ACPI structure built by the PPM RC.␊ |
174 | U32 ssdt_mem_addr;␊ |
175 | ␊ |
176 | // This value specifies the final size of the SSDT ACPI structure for the␊ |
177 | // SSDT ACPI structure built by the PPM RC.␊ |
178 | U32 ssdt_mem_size;␊ |
179 | ␊ |
180 | // The final state for the P-state initialization␊ |
181 | // 1=enabled; 0=disabled␊ |
182 | U32 pstates_enabled;␊ |
183 | ␊ |
184 | // The final state for the Turbo feature initialization␊ |
185 | // 1=enabled; 0=disabled␊ |
186 | U32 turbo_enabled;␊ |
187 | ␊ |
188 | // The final state for the C-state initialization␊ |
189 | // 1=enabled; 0=disabled␊ |
190 | U32 cstates_enabled;␊ |
191 | ␊ |
192 | // The final state for the T-state initialization␊ |
193 | // 1=enabled; 0=disabled␊ |
194 | U32 tstates_enabled;␊ |
195 | } EXIT_STATE;␊ |
196 | ␊ |
197 | typedef enum cpu_namespace_flag {␊ |
198 | // Flag indicating the SSDT ACPI structure should be built␊ |
199 | // using ACPI 1.0 compliant processor namespace "_PR"␊ |
200 | CPU_NAMESPACE_PR = 0,␊ |
201 | ␊ |
202 | // Flag indicating the SSDT ACPI structure should be built␊ |
203 | // using ACPI 2.0+ compliant processor namespace "_SB"␊ |
204 | CPU_NAMESPACE_SB = 1,␊ |
205 | } CPU_NAMESPACE_FLAG;␊ |
206 | ␊ |
207 | // Define the total number of required NameSegs to reach the DSDT processor␊ |
208 | // device or object declarations␊ |
209 | #define MAX_SUPPORTED_CPU_NAMESEGS 3␊ |
210 | ␊ |
211 | typedef struct processor_number_to_nameseg {␊ |
212 | // Contains one of the ACPI processor ID values used in a␊ |
213 | // ACPI Declare Processor statement in the DSDT or XSDT␊ |
214 | U32 acpi_processor_number;␊ |
215 | ␊ |
216 | // Number of NameSpace segments in NamePath to processor devices/objects␊ |
217 | U32 seg_count;␊ |
218 | ␊ |
219 | // Contains the corresponding ACPI Name Scope in the form␊ |
220 | // of a series of NameSegs constituting the NamePath to a␊ |
221 | // processor device or object declaration␊ |
222 | U32 nameseg[MAX_SUPPORTED_CPU_NAMESEGS];␊ |
223 | } PROCESSOR_NUMBER_TO_NAMESEG;␊ |
224 | ␊ |
225 | typedef struct ppm_setup_options {␊ |
226 | // This 32-bit physical memory address specifies a read-write memory region␊ |
227 | // below 1MB. Minimum size is 8KB. This memory is used by the callback as␊ |
228 | // the SIPI target and stack for each AP. This region is not required to be␊ |
229 | // cacheable.␊ |
230 | U32 mem_region_below_1M;␊ |
231 | ␊ |
232 | // Number of CPU sockets which exist on the platform␊ |
233 | U32 num_sockets;␊ |
234 | ␊ |
235 | // Desired state for the P-state initialization␊ |
236 | // 1=enabled; 0=disabled␊ |
237 | U32 pstates_enabled;␊ |
238 | ␊ |
239 | // Desired state for the P-state hardware coordination␊ |
240 | // ACPI_PSD_COORD_TYPE_SW_ALL = 0xFC␊ |
241 | // ACPI_PSD_COORD_TYPE_SW_ANY = 0xFD␊ |
242 | // ACPI_PSD_COORD_TYPE_HW_ALL = 0xFE␊ |
243 | U32 pstate_coordination;␊ |
244 | ␊ |
245 | // Desired state for the Turbo state initialization␊ |
246 | // 1=enabled; 0=disabled␊ |
247 | U32 turbo_enabled;␊ |
248 | ␊ |
249 | // Desired state for the C-state initialization␊ |
250 | // 1=enabled; 0=disabled␊ |
251 | U32 cstates_enabled;␊ |
252 | ␊ |
253 | // Desired state for the C1E initialization␊ |
254 | // 1=enabled; 0=disabled␊ |
255 | U32 c1e_enabled;␊ |
256 | ␊ |
257 | // Desired state for the processor core C3 state included in the _CST␊ |
258 | // 0= processor core C3 cannot be used as an ACPI C state␊ |
259 | // 2= processor core C3 can be used as an ACPI C2 state␊ |
260 | // 3= processor core C3 can be used as an ACPI C3 state␊ |
261 | // 4= processor core C3 can be used as an ACPI C2 state␊ |
262 | // if Invariant APIC Timer detected, else not used as ACPI C state␊ |
263 | // 5= processor core C3 can be used as an ACPI C2 state␊ |
264 | // if Invariant APIC Timer detected, else APIC C3 state␊ |
265 | U32 c3_enabled;␊ |
266 | ␊ |
267 | // Desired state for the processor core C6 state included in the _CST as an␊ |
268 | // ACPI C3 state.␊ |
269 | // 1= processor core C6 can be used as an ACPI C3 state␊ |
270 | // 0= processor core C6 cannot be used as an ACPI C3 state␊ |
271 | U32 c6_enabled;␊ |
272 | ␊ |
273 | // Desired state for the processor core C7 state included in the _CST as an␊ |
274 | // ACPI C3 state.␊ |
275 | // 1= processor core C7 can be used as an ACPI C7 state␊ |
276 | // 0= processor core C7 cannot be used as an ACPI C7 state␊ |
277 | U32 c7_enabled;␊ |
278 | ␊ |
279 | // Desired state for providing alternate ACPI _CST structure using MWAIT␊ |
280 | // extensions␊ |
281 | // 1= Alternate _CST using MWAIT extension is enabled for OSPM use␊ |
282 | // 0= Alternate _CST using MWAIT extension is disabled for OSPM use␊ |
283 | U32 mwait_enabled;␊ |
284 | ␊ |
285 | // Power management base address used for processors␊ |
286 | U32 pmbase;␊ |
287 | ␊ |
288 | // Desired state for the C-state package limit.␊ |
289 | // Note: The C-state package limit may be further limited by the␊ |
290 | // capabilities of the processor␊ |
291 | // 000b = C0 (No package C-state support)␊ |
292 | // 001b = C1 (Behavior is the same as 000b)␊ |
293 | // 010b = C3␊ |
294 | // 011b = C6␊ |
295 | // 100b = C7␊ |
296 | // 111b = No package C-state limit␊ |
297 | U32 package_cstate_limit;␊ |
298 | ␊ |
299 | // Desired state for the T-state initialization␊ |
300 | // 1=enabled; 0=disabled␊ |
301 | U32 tstates_enabled;␊ |
302 | ␊ |
303 | // This 32-bit physical memory address specifies a read-write memory region␊ |
304 | // for the SSDT ACPI structure built by the PPM RC. Minimum size is 16KB.␊ |
305 | U32 ssdt_mem_addr;␊ |
306 | ␊ |
307 | // This value specifies the size of the SSDT memory region. Minimum size is␊ |
308 | // 16KB.␊ |
309 | U32 ssdt_mem_size;␊ |
310 | ␊ |
311 | // This value specifies the PPM RCM behavior related to creation and␊ |
312 | // incorporation of the new SSDT ACPI structure. See definition of the␊ |
313 | // SSDT_LOC_FLAG for acceptable values.␊ |
314 | U32 ssdt_loc_flag;␊ |
315 | ␊ |
316 | // This value specifies the PPM RCM behavior related to creation and␊ |
317 | // incorporation of the new SSDT ACPI structure. If all power management␊ |
318 | // features are disabled by input options, the SSDT can still be created␊ |
319 | // for debug review.␊ |
320 | // 1 = Create SSDT even if all power management features are disabled␊ |
321 | // 0 = Do not create SSDT if all power management features are disabled␊ |
322 | U32 ssdt_force_creation;␊ |
323 | ␊ |
324 | // Exit structure intended to convey state to the caller and/or subsequent␊ |
325 | // init code␊ |
326 | EXIT_STATE exit_state;␊ |
327 | ␊ |
328 | // Flag indicating the processor namespace that should be used in the␊ |
329 | // SSDT ACPI structure for each CPU.␊ |
330 | // See definition of the CPU_NAMESPACE_FLAG for acceptable values.␊ |
331 | U32 cpu_namespace_flag;␊ |
332 | ␊ |
333 | // This version number identifies the PPM RCM specification.␊ |
334 | // Specifically denotes the version of this structure definition is compliant␊ |
335 | // with with file nehalem-ppm-rcm-vX.txt where X is the version number.␊ |
336 | // PPMSETUP.C should always use the version definition from the top of␊ |
337 | // this file called CURRENT_PPM_RCM_INTERFACE_SPECIFICATION.␊ |
338 | U32 ppm_rcm_interface_specification;␊ |
339 | ␊ |
340 | // This flag indicates whether or not after all AP Wakes are completed,␊ |
341 | // that the AP should be forced to jump to the real mode address specified␊ |
342 | // in the realmode_callback_address field below.␊ |
343 | // realmode_callback = 0 means leave AP in INIT or Wait For SIPI (WFS) state␊ |
344 | // realmode_callback = 1 means AP should jump to real mode address specified below␊ |
345 | U32 realmode_callback_flag;␊ |
346 | ␊ |
347 | // This file contains the real mode callback address which AP must jump to after␊ |
348 | // INIT_SIPI_SIPI sequences used to force AP initalization for PPM.␊ |
349 | // Upper 16-bits specify target real mode segment for a far 16-bit jump instruction␊ |
350 | // Lower 16-bits specify target real mode offset for a far 16-bit jump instruction␊ |
351 | U32 realmode_callback_address;␊ |
352 | ␊ |
353 | // Number of ACPI processor number to ACPI CPU NameSeg structures␊ |
354 | U32 cpu_map_count;␊ |
355 | ␊ |
356 | // Array of ACPI processor number to ACPI CPU NameSeg structures␊ |
357 | PROCESSOR_NUMBER_TO_NAMESEG *cpu_map;␊ |
358 | ␊ |
359 | // This flag indicates whether or not PPM RC should update an existing ACPI FADT.␊ |
360 | // modify_fadt_flag = 0 means do not modify existing ACPI FADT structure␊ |
361 | // modify_fadt_flag = 1 means do check and if needed, modify existing ACPI FADT structure␊ |
362 | U32 modify_fadt_flag;␊ |
363 | ␊ |
364 | // Desired state for the performance_per_watt optimizations␊ |
365 | // performance_per_watt = 2 means "Low Power"␊ |
366 | // performance_per_watt = 1 means "Power Optimized or Power Balanced"␊ |
367 | // performance_per_watt = 0 means "Traditional or Max Performance"␊ |
368 | U32 performance_per_watt;␊ |
369 | } PPM_SETUP_OPTIONS;␊ |
370 | ␊ |
371 | #endif // ppmsetup_h␊ |
372 |