]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / C / Include / IndustryStandard / Acpi2_0.h
1 /** @file
2 ACPI 2.0 definitions from the ACPI Specification, revision 2.0
3
4 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _ACPI_2_0_H_
11 #define _ACPI_2_0_H_
12
13 #include "IndustryStandard/Acpi.h"
14
15 //
16 // Ensure proper structure formats
17 //
18 #pragma pack(1)
19 //
20 // ACPI Specification Revision
21 //
22 #define EFI_ACPI_2_0_REVISION 0x02
23
24 //
25 // BUGBUG: OEM values need to be moved somewhere else, probably read from data hub
26 // and produced by a platform specific driver.
27 //
28 //
29 // ACPI OEM ID
30 //
31 #define EFI_ACPI_2_0_OEM_ID "INTEL "
32 #define EFI_ACPI_2_0_OEM_TABLE_ID 0x5034303738543245 // "E2T8704P"
33 //
34 // ACPI OEM Revision
35 //
36 #define EFI_ACPI_2_0_OEM_REVISION 0x00000002
37
38 //
39 // ACPI table creator ID
40 //
41 #define EFI_ACPI_2_0_CREATOR_ID 0x5446534D // TBD "MSFT"
42 //
43 // ACPI table creator revision
44 //
45 #define EFI_ACPI_2_0_CREATOR_REVISION 0x01000013 // TBD
46 //
47 // ACPI 2.0 Generic Address Space definition
48 //
49 typedef struct {
50 UINT8 AddressSpaceId;
51 UINT8 RegisterBitWidth;
52 UINT8 RegisterBitOffset;
53 UINT8 Reserved;
54 UINT64 Address;
55 } EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
56
57 //
58 // Generic Address Space Address IDs
59 //
60 #define EFI_ACPI_2_0_SYSTEM_MEMORY 0
61 #define EFI_ACPI_2_0_SYSTEM_IO 1
62 #define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
63 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
64 #define EFI_ACPI_2_0_SMBUS 4
65 #define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
66
67 //
68 // ACPI 2.0 table structures
69 //
70 //
71 // Root System Description Pointer Structure
72 //
73 typedef struct {
74 UINT64 Signature;
75 UINT8 Checksum;
76 UINT8 OemId[6];
77 UINT8 Revision;
78 UINT32 RsdtAddress;
79 UINT32 Length;
80 UINT64 XsdtAddress;
81 UINT8 ExtendedChecksum;
82 UINT8 Reserved[3];
83 } EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
84
85 //
86 // RSD_PTR Revision (as defined in ACPI 2.0 spec.)
87 //
88 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
89
90 //
91 // Common table header, this prefaces all ACPI tables, including FACS, but
92 // excluding the RSD PTR structure
93 //
94 typedef struct {
95 UINT32 Signature;
96 UINT32 Length;
97 } EFI_ACPI_2_0_COMMON_HEADER;
98
99 //
100 // Root System Description Table
101 // No definition needed as it is a common description table header followed by a
102 // variable number of UINT32 table pointers.
103 //
104 //
105 // RSDT Revision (as defined in ACPI 2.0 spec.)
106 //
107 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
108
109 //
110 // Extended System Description Table
111 // No definition needed as it is a common description table header followed by a
112 // variable number of UINT64 table pointers.
113 //
114 //
115 // XSDT Revision (as defined in ACPI 2.0 spec.)
116 //
117 #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
118
119 //
120 // Fixed ACPI Description Table Structure (FADT)
121 //
122 typedef struct {
123 EFI_ACPI_DESCRIPTION_HEADER Header;
124 UINT32 FirmwareCtrl;
125 UINT32 Dsdt;
126 UINT8 Reserved0;
127 UINT8 PreferredPmProfile;
128 UINT16 SciInt;
129 UINT32 SmiCmd;
130 UINT8 AcpiEnable;
131 UINT8 AcpiDisable;
132 UINT8 S4BiosReq;
133 UINT8 PstateCnt;
134 UINT32 Pm1aEvtBlk;
135 UINT32 Pm1bEvtBlk;
136 UINT32 Pm1aCntBlk;
137 UINT32 Pm1bCntBlk;
138 UINT32 Pm2CntBlk;
139 UINT32 PmTmrBlk;
140 UINT32 Gpe0Blk;
141 UINT32 Gpe1Blk;
142 UINT8 Pm1EvtLen;
143 UINT8 Pm1CntLen;
144 UINT8 Pm2CntLen;
145 UINT8 PmTmrLen;
146 UINT8 Gpe0BlkLen;
147 UINT8 Gpe1BlkLen;
148 UINT8 Gpe1Base;
149 UINT8 CstCnt;
150 UINT16 PLvl2Lat;
151 UINT16 PLvl3Lat;
152 UINT16 FlushSize;
153 UINT16 FlushStride;
154 UINT8 DutyOffset;
155 UINT8 DutyWidth;
156 UINT8 DayAlrm;
157 UINT8 MonAlrm;
158 UINT8 Century;
159 UINT16 IaPcBootArch;
160 UINT8 Reserved1;
161 UINT32 Flags;
162 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
163 UINT8 ResetValue;
164 UINT8 Reserved2[3];
165 UINT64 XFirmwareCtrl;
166 UINT64 XDsdt;
167 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
168 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
169 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
170 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
171 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
172 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
173 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
174 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
175 } EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
176
177 //
178 // FADT Version (as defined in ACPI 2.0 spec.)
179 //
180 #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
181
182 //
183 // Fixed ACPI Description Table Boot Architecture Flags
184 // All other bits are reserved and must be set to 0.
185 //
186 #define EFI_ACPI_2_0_LEGACY_DEVICES (1 << 0)
187 #define EFI_ACPI_2_0_8042 (1 << 1)
188
189 //
190 // Fixed ACPI Description Table Fixed Feature Flags
191 // All other bits are reserved and must be set to 0.
192 //
193 #define EFI_ACPI_2_0_WBINVD (1 << 0)
194 #define EFI_ACPI_2_0_WBINVD_FLUSH (1 << 1)
195 #define EFI_ACPI_2_0_PROC_C1 (1 << 2)
196 #define EFI_ACPI_2_0_P_LVL2_UP (1 << 3)
197 #define EFI_ACPI_2_0_PWR_BUTTON (1 << 4)
198 #define EFI_ACPI_2_0_SLP_BUTTON (1 << 5)
199 #define EFI_ACPI_2_0_FIX_RTC (1 << 6)
200 #define EFI_ACPI_2_0_RTC_S4 (1 << 7)
201 #define EFI_ACPI_2_0_TMR_VAL_EXT (1 << 8)
202 #define EFI_ACPI_2_0_DCK_CAP (1 << 9)
203 #define EFI_ACPI_2_0_RESET_REG_SUP (1 << 10)
204 #define EFI_ACPI_2_0_SEALED_CASE (1 << 11)
205 #define EFI_ACPI_2_0_HEADLESS (1 << 12)
206 #define EFI_ACPI_2_0_CPU_SW_SLP (1 << 13)
207
208 //
209 // Firmware ACPI Control Structure
210 //
211 typedef struct {
212 UINT32 Signature;
213 UINT32 Length;
214 UINT32 HardwareSignature;
215 UINT32 FirmwareWakingVector;
216 UINT32 GlobalLock;
217 UINT32 Flags;
218 UINT64 XFirmwareWakingVector;
219 UINT8 Version;
220 UINT8 Reserved[31];
221 } EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
222
223 //
224 // FACS Version (as defined in ACPI 2.0 spec.)
225 //
226 #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
227
228 //
229 // Firmware Control Structure Feature Flags
230 // All other bits are reserved and must be set to 0.
231 //
232 #define EFI_ACPI_2_0_S4BIOS_F (1 << 0)
233
234 //
235 // Multiple APIC Description Table header definition. The rest of the table
236 // must be defined in a platform specific manner.
237 //
238 typedef struct {
239 EFI_ACPI_DESCRIPTION_HEADER Header;
240 UINT32 LocalApicAddress;
241 UINT32 Flags;
242 } EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
243
244 //
245 // MADT Revision (as defined in ACPI 2.0 spec.)
246 //
247 #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
248
249 //
250 // Multiple APIC Flags
251 // All other bits are reserved and must be set to 0.
252 //
253 #define EFI_ACPI_2_0_PCAT_COMPAT (1 << 0)
254
255 //
256 // Multiple APIC Description Table APIC structure types
257 // All other values between 0x09 an 0xFF are reserved and
258 // will be ignored by OSPM.
259 //
260 #define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
261 #define EFI_ACPI_2_0_IO_APIC 0x01
262 #define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
263 #define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
264 #define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
265 #define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
266 #define EFI_ACPI_2_0_IO_SAPIC 0x06
267 #define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
268 #define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
269
270 //
271 // APIC Structure Definitions
272 //
273 //
274 // Processor Local APIC Structure Definition
275 //
276 typedef struct {
277 UINT8 Type;
278 UINT8 Length;
279 UINT8 AcpiProcessorId;
280 UINT8 ApicId;
281 UINT32 Flags;
282 } EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
283
284 //
285 // Local APIC Flags. All other bits are reserved and must be 0.
286 //
287 #define EFI_ACPI_2_0_LOCAL_APIC_ENABLED (1 << 0)
288
289 //
290 // IO APIC Structure
291 //
292 typedef struct {
293 UINT8 Type;
294 UINT8 Length;
295 UINT8 IoApicId;
296 UINT8 Reserved;
297 UINT32 IoApicAddress;
298 UINT32 GlobalSystemInterruptBase;
299 } EFI_ACPI_2_0_IO_APIC_STRUCTURE;
300
301 //
302 // Interrupt Source Override Structure
303 //
304 typedef struct {
305 UINT8 Type;
306 UINT8 Length;
307 UINT8 Bus;
308 UINT8 Source;
309 UINT32 GlobalSystemInterrupt;
310 UINT16 Flags;
311 } EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
312
313 //
314 // Non-Maskable Interrupt Source Structure
315 //
316 typedef struct {
317 UINT8 Type;
318 UINT8 Length;
319 UINT16 Flags;
320 UINT32 GlobalSystemInterrupt;
321 } EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
322
323 //
324 // Local APIC NMI Structure
325 //
326 typedef struct {
327 UINT8 Type;
328 UINT8 Length;
329 UINT8 AcpiProcessorId;
330 UINT16 Flags;
331 UINT8 LocalApicLint;
332 } EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
333
334 //
335 // Local APIC Address Override Structure
336 //
337 typedef struct {
338 UINT8 Type;
339 UINT8 Length;
340 UINT16 Reserved;
341 UINT64 LocalApicAddress;
342 } EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
343
344 //
345 // IO SAPIC Structure
346 //
347 typedef struct {
348 UINT8 Type;
349 UINT8 Length;
350 UINT8 IoApicId;
351 UINT8 Reserved;
352 UINT32 GlobalSystemInterruptBase;
353 UINT64 IoSapicAddress;
354 } EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
355
356 //
357 // Local SAPIC Structure
358 //
359 typedef struct {
360 UINT8 Type;
361 UINT8 Length;
362 UINT8 AcpiProcessorId;
363 UINT8 LocalSapicId;
364 UINT8 LocalSapicEid;
365 UINT8 Reserved[3];
366 UINT32 Flags;
367 } EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
368
369 //
370 // Platform Interrupt Sources Structure
371 //
372 typedef struct {
373 UINT8 Type;
374 UINT8 Length;
375 UINT16 Flags;
376 UINT8 InterruptType;
377 UINT8 ProcessorId;
378 UINT8 ProcessorEid;
379 UINT8 IoSapicVector;
380 UINT32 GlobalSystemInterrupt;
381 UINT32 Reserved;
382 } EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
383
384 //
385 // Smart Battery Description Table (SBST)
386 //
387 typedef struct {
388 EFI_ACPI_DESCRIPTION_HEADER Header;
389 UINT32 WarningEnergyLevel;
390 UINT32 LowEnergyLevel;
391 UINT32 CriticalEnergyLevel;
392 } EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
393
394 //
395 // SBST Version (as defined in ACPI 2.0 spec.)
396 //
397 #define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
398
399 //
400 // Embedded Controller Boot Resources Table (ECDT)
401 // The table is followed by a null terminated ASCII string that contains
402 // a fully qualified reference to the name space object.
403 //
404 typedef struct {
405 EFI_ACPI_DESCRIPTION_HEADER Header;
406 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
407 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
408 UINT32 Uid;
409 UINT8 GpeBit;
410 } EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
411
412 //
413 // ECDT Version (as defined in ACPI 2.0 spec.)
414 //
415 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
416
417 //
418 // Known table signatures
419 //
420 //
421 // "RSD PTR " Root System Description Pointer
422 //
423 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352
424
425 //
426 // "SPIC" Multiple SAPIC Description Table
427 //
428 // BUGBUG: Don't know where this came from except SR870BN4 uses it.
429 // #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
430 //
431 #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
432
433 //
434 // "BOOT" MS Simple Boot Spec
435 //
436 #define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
437
438 //
439 // "DBGP" MS Bebug Port Spec
440 //
441 #define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
442
443 //
444 // "DSDT" Differentiated System Description Table
445 //
446 #define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
447
448 //
449 // "ECDT" Embedded Controller Boot Resources Table
450 //
451 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
452
453 //
454 // "ETDT" Event Timer Description Table
455 //
456 #define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
457
458 //
459 // "FACS" Firmware ACPI Control Structure
460 //
461 #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
462
463 //
464 // "FACP" Fixed ACPI Description Table
465 //
466 #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
467
468 //
469 // "APIC" Multiple APIC Description Table
470 //
471 #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
472
473 //
474 // "PSDT" Persistent System Description Table
475 //
476 #define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
477
478 //
479 // "RSDT" Root System Description Table
480 //
481 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
482
483 //
484 // "SBST" Smart Battery Specification Table
485 //
486 #define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
487
488 //
489 // "SLIT" System Locality Information Table
490 //
491 #define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
492
493 //
494 // "SPCR" Serial Port Console Redirection Table
495 //
496 #define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
497
498 //
499 // "SRAT" Static Resource Affinity Table
500 //
501 #define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
502
503 //
504 // "SSDT" Secondary System Description Table
505 //
506 #define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
507
508 //
509 // "SPMI" Server Platform Management Interface Table
510 //
511 #define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE 0x494D5053
512
513 //
514 // "XSDT" Extended System Description Table
515 //
516 #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
517
518 #pragma pack()
519
520 #endif