]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi10.h
ARM RVCT 3.1 compiler has issues with __packed structures containing anonymous struct...
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Acpi10.h
1 /** @file
2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
3
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 **/
13
14 #ifndef _ACPI_1_0_H_
15 #define _ACPI_1_0_H_
16
17 ///
18 /// Common table header, this prefaces all ACPI tables, including FACS, but
19 /// excluding the RSD PTR structure.
20 ///
21 typedef struct {
22 UINT32 Signature;
23 UINT32 Length;
24 } EFI_ACPI_COMMON_HEADER;
25
26 #pragma pack(1)
27 ///
28 /// The common ACPI description table header. This structure prefaces most ACPI tables.
29 ///
30 typedef struct {
31 UINT32 Signature;
32 UINT32 Length;
33 UINT8 Revision;
34 UINT8 Checksum;
35 UINT8 OemId[6];
36 UINT64 OemTableId;
37 UINT32 OemRevision;
38 UINT32 CreatorId;
39 UINT32 CreatorRevision;
40 } EFI_ACPI_DESCRIPTION_HEADER;
41 #pragma pack()
42
43 //
44 // Define for Desriptor
45 //
46 #define ACPI_DMA_DESCRIPTOR 0x2A
47 #define ACPI_IO_PORT_DESCRIPTOR 0x47
48 #define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
49 #define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
50 #define ACPI_IRQ_DESCRIPTOR 0x23
51 #define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
52 #define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
53 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
54 #define ACPI_END_TAG_DESCRIPTOR 0x79
55
56 //
57 // Resource Type
58 //
59 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
60 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
61 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
62
63 ///
64 /// Power Management Timer frequency is fixed at 3.579545MHz.
65 ///
66 #define ACPI_TIMER_FREQUENCY 3579545
67
68 //
69 // Ensure proper structure formats
70 //
71 #pragma pack(1)
72
73 ///
74 /// The commond definition of QWORD, DWORD, and WORD
75 /// Address Space Descriptors.
76 ///
77 typedef PACKED struct {
78 UINT8 Desc;
79 UINT16 Len;
80 UINT8 ResType;
81 UINT8 GenFlag;
82 UINT8 SpecificFlag;
83 UINT64 AddrSpaceGranularity;
84 UINT64 AddrRangeMin;
85 UINT64 AddrRangeMax;
86 UINT64 AddrTranslationOffset;
87 UINT64 AddrLen;
88 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
89
90 typedef PACKED union {
91 UINT8 Byte;
92 PACKED struct {
93 UINT8 Length : 3;
94 UINT8 Name : 4;
95 UINT8 Type : 1;
96 } Bits;
97 } ACPI_SMALL_RESOURCE_HEADER;
98
99 typedef PACKED struct {
100 PACKED union {
101 UINT8 Byte;
102 PACKED struct {
103 UINT8 Name : 7;
104 UINT8 Type : 1;
105 }Bits;
106 } Header;
107 UINT16 Length;
108 } ACPI_LARGE_RESOURCE_HEADER;
109
110 ///
111 /// IRQ Descriptor.
112 ///
113 typedef PACKED struct {
114 ACPI_SMALL_RESOURCE_HEADER Header;
115 UINT16 Mask;
116 } EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR;
117
118 ///
119 /// IRQ Descriptor.
120 ///
121 typedef PACKED struct {
122 ACPI_SMALL_RESOURCE_HEADER Header;
123 UINT16 Mask;
124 UINT8 Information;
125 } EFI_ACPI_IRQ_DESCRIPTOR;
126
127 ///
128 /// DMA Descriptor.
129 ///
130 typedef PACKED struct {
131 ACPI_SMALL_RESOURCE_HEADER Header;
132 UINT8 ChannelMask;
133 UINT8 Information;
134 } EFI_ACPI_DMA_DESCRIPTOR;
135
136 ///
137 /// I/O Port Descriptor
138 ///
139 typedef PACKED struct {
140 ACPI_SMALL_RESOURCE_HEADER Header;
141 UINT8 Information;
142 UINT16 BaseAddressMin;
143 UINT16 BaseAddressMax;
144 UINT8 Alignment;
145 UINT8 Length;
146 } EFI_ACPI_IO_PORT_DESCRIPTOR;
147
148 ///
149 /// Fixed Location I/O Port Descriptor.
150 ///
151 typedef PACKED struct {
152 ACPI_SMALL_RESOURCE_HEADER Header;
153 UINT16 BaseAddress;
154 UINT8 Length;
155 } EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR;
156
157 ///
158 /// 32-Bit Memory Range Descriptor
159 ///
160 typedef PACKED struct {
161 ACPI_LARGE_RESOURCE_HEADER Header;
162 UINT8 Information;
163 UINT32 BaseAddressMin;
164 UINT32 BaseAddressMax;
165 UINT32 Alignment;
166 UINT32 Length;
167 } EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR;
168
169 ///
170 /// Fixed 32-Bit Fixed Memory Range Descriptor
171 ///
172 typedef PACKED struct {
173 ACPI_LARGE_RESOURCE_HEADER Header;
174 UINT8 Information;
175 UINT32 BaseAddress;
176 UINT32 Length;
177 } EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR;
178 #pragma pack()
179
180 ///
181 /// The End tag identifies an end of resource data.
182 ///
183 typedef struct {
184 UINT8 Desc;
185 UINT8 Checksum;
186 } EFI_ACPI_END_TAG_DESCRIPTOR;
187
188 //
189 // General use definitions
190 //
191 #define EFI_ACPI_RESERVED_BYTE 0x00
192 #define EFI_ACPI_RESERVED_WORD 0x0000
193 #define EFI_ACPI_RESERVED_DWORD 0x00000000
194 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
195
196 //
197 // Resource Type Specific Flags
198 // Ref ACPI specification 6.4.3.5.5
199 //
200 // Bit [0] : Write Status, _RW
201 //
202 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
203 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
204 //
205 // Bit [2:1] : Memory Attributes, _MEM
206 //
207 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
208 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
209 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
210 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
211 //
212 // Bit [4:3] : Memory Attributes, _MTP
213 //
214 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
215 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
216 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
217 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
218 //
219 // Bit [5] : Memory to I/O Translation, _TTP
220 //
221 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
222 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
223
224 //
225 // IRQ Information
226 // Ref ACPI specification 6.4.2.1
227 //
228 #define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
229 #define EFI_ACPI_IRQ_SHARABLE 0x10
230
231 #define EFI_ACPI_IRQ_POLARITY_MASK 0x08
232 #define EFI_ACPI_IRQ_HIGH_TRUE 0x00
233 #define EFI_ACPI_IRQ_LOW_FALSE 0x08
234
235 #define EFI_ACPI_IRQ_MODE 0x01
236 #define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
237 #define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
238
239 //
240 // DMA Information
241 // Ref ACPI specification 6.4.2.2
242 //
243 #define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
244 #define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
245 #define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
246 #define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
247 #define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
248
249 #define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
250 #define EFI_ACPI_DMA_BUS_MASTER 0x04
251
252 #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
253 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
254 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
255 #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10
256
257 //
258 // IO Information
259 // Ref ACPI specification 6.4.2.5
260 //
261 #define EFI_ACPI_IO_DECODE_MASK 0x01
262 #define EFI_ACPI_IO_DECODE_16_BIT 0x01
263 #define EFI_ACPI_IO_DECODE_10_BIT 0x00
264
265 //
266 // Memory Information
267 // Ref ACPI specification 6.4.3.4
268 //
269 #define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
270 #define EFI_ACPI_MEMORY_WRITABLE 0x01
271 #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
272
273 //
274 // Ensure proper structure formats
275 //
276 #pragma pack(1)
277 //
278 // ACPI 1.0b table structures
279 //
280
281 ///
282 /// Root System Description Pointer Structure.
283 ///
284 typedef struct {
285 UINT64 Signature;
286 UINT8 Checksum;
287 UINT8 OemId[6];
288 UINT8 Reserved;
289 UINT32 RsdtAddress;
290 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
291
292 //
293 // Root System Description Table
294 // No definition needed as it is a common description table header, the same with
295 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
296 //
297
298 ///
299 /// RSDT Revision (as defined in ACPI 1.0b specification).
300 ///
301 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
302
303 ///
304 /// Fixed ACPI Description Table Structure (FADT).
305 ///
306 typedef struct {
307 EFI_ACPI_DESCRIPTION_HEADER Header;
308 UINT32 FirmwareCtrl;
309 UINT32 Dsdt;
310 UINT8 IntModel;
311 UINT8 Reserved1;
312 UINT16 SciInt;
313 UINT32 SmiCmd;
314 UINT8 AcpiEnable;
315 UINT8 AcpiDisable;
316 UINT8 S4BiosReq;
317 UINT8 Reserved2;
318 UINT32 Pm1aEvtBlk;
319 UINT32 Pm1bEvtBlk;
320 UINT32 Pm1aCntBlk;
321 UINT32 Pm1bCntBlk;
322 UINT32 Pm2CntBlk;
323 UINT32 PmTmrBlk;
324 UINT32 Gpe0Blk;
325 UINT32 Gpe1Blk;
326 UINT8 Pm1EvtLen;
327 UINT8 Pm1CntLen;
328 UINT8 Pm2CntLen;
329 UINT8 PmTmLen;
330 UINT8 Gpe0BlkLen;
331 UINT8 Gpe1BlkLen;
332 UINT8 Gpe1Base;
333 UINT8 Reserved3;
334 UINT16 PLvl2Lat;
335 UINT16 PLvl3Lat;
336 UINT16 FlushSize;
337 UINT16 FlushStride;
338 UINT8 DutyOffset;
339 UINT8 DutyWidth;
340 UINT8 DayAlrm;
341 UINT8 MonAlrm;
342 UINT8 Century;
343 UINT8 Reserved4;
344 UINT8 Reserved5;
345 UINT8 Reserved6;
346 UINT32 Flags;
347 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
348
349 ///
350 /// FADT Version (as defined in ACPI 1.0b specification).
351 ///
352 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
353
354 //
355 // Fixed ACPI Description Table Fixed Feature Flags
356 // All other bits are reserved and must be set to 0.
357 //
358 #define EFI_ACPI_1_0_WBINVD BIT0
359 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
360 #define EFI_ACPI_1_0_PROC_C1 BIT2
361 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
362 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
363 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
364 #define EFI_ACPI_1_0_FIX_RTC BIT6
365 #define EFI_ACPI_1_0_RTC_S4 BIT7
366 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
367 #define EFI_ACPI_1_0_DCK_CAP BIT9
368
369 ///
370 /// Firmware ACPI Control Structure.
371 ///
372 typedef struct {
373 UINT32 Signature;
374 UINT32 Length;
375 UINT32 HardwareSignature;
376 UINT32 FirmwareWakingVector;
377 UINT32 GlobalLock;
378 UINT32 Flags;
379 UINT8 Reserved[40];
380 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
381
382 ///
383 /// Firmware Control Structure Feature Flags.
384 /// All other bits are reserved and must be set to 0.
385 ///
386 #define EFI_ACPI_1_0_S4BIOS_F BIT0
387
388 ///
389 /// Multiple APIC Description Table header definition. The rest of the table
390 /// must be defined in a platform-specific manner.
391 ///
392 typedef struct {
393 EFI_ACPI_DESCRIPTION_HEADER Header;
394 UINT32 LocalApicAddress;
395 UINT32 Flags;
396 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
397
398 ///
399 /// MADT Revision (as defined in ACPI 1.0b specification).
400 ///
401 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
402
403 ///
404 /// Multiple APIC Flags
405 /// All other bits are reserved and must be set to 0.
406 ///
407 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
408
409 //
410 // Multiple APIC Description Table APIC structure types
411 // All other values between 0x05 an 0xFF are reserved and
412 // will be ignored by OSPM.
413 //
414 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
415 #define EFI_ACPI_1_0_IO_APIC 0x01
416 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
417 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
418 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
419
420 //
421 // APIC Structure Definitions
422 //
423
424 ///
425 /// Processor Local APIC Structure Definition.
426 ///
427 typedef struct {
428 UINT8 Type;
429 UINT8 Length;
430 UINT8 AcpiProcessorId;
431 UINT8 ApicId;
432 UINT32 Flags;
433 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
434
435 ///
436 /// Local APIC Flags. All other bits are reserved and must be 0.
437 ///
438 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
439
440 ///
441 /// IO APIC Structure.
442 ///
443 typedef struct {
444 UINT8 Type;
445 UINT8 Length;
446 UINT8 IoApicId;
447 UINT8 Reserved;
448 UINT32 IoApicAddress;
449 UINT32 SystemVectorBase;
450 } EFI_ACPI_1_0_IO_APIC_STRUCTURE;
451
452 ///
453 /// Interrupt Source Override Structure.
454 ///
455 typedef struct {
456 UINT8 Type;
457 UINT8 Length;
458 UINT8 Bus;
459 UINT8 Source;
460 UINT32 GlobalSystemInterruptVector;
461 UINT16 Flags;
462 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
463
464 ///
465 /// Non-Maskable Interrupt Source Structure.
466 ///
467 typedef struct {
468 UINT8 Type;
469 UINT8 Length;
470 UINT16 Flags;
471 UINT32 GlobalSystemInterruptVector;
472 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
473
474 ///
475 /// Local APIC NMI Structure.
476 ///
477 typedef struct {
478 UINT8 Type;
479 UINT8 Length;
480 UINT8 AcpiProcessorId;
481 UINT16 Flags;
482 UINT8 LocalApicInti;
483 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
484
485 ///
486 /// Smart Battery Description Table (SBST)
487 ///
488 typedef struct {
489 EFI_ACPI_DESCRIPTION_HEADER Header;
490 UINT32 WarningEnergyLevel;
491 UINT32 LowEnergyLevel;
492 UINT32 CriticalEnergyLevel;
493 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
494
495 //
496 // Known table signatures
497 //
498
499 ///
500 /// "RSD PTR " Root System Description Pointer.
501 ///
502 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
503
504 ///
505 /// "APIC" Multiple APIC Description Table.
506 ///
507 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
508
509 ///
510 /// "DSDT" Differentiated System Description Table.
511 ///
512 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
513
514 ///
515 /// "FACS" Firmware ACPI Control Structure.
516 ///
517 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
518
519 ///
520 /// "FACP" Fixed ACPI Description Table.
521 ///
522 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
523
524 ///
525 /// "PSDT" Persistent System Description Table.
526 ///
527 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
528
529 ///
530 /// "RSDT" Root System Description Table.
531 ///
532 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
533
534 ///
535 /// "SBST" Smart Battery Specification Table.
536 ///
537 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
538
539 ///
540 /// "SSDT" Secondary System Description Table.
541 ///
542 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
543
544 #pragma pack()
545
546 #endif