]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi10.h
b463d6ff280b1280563f3c8937fed7aa7b171555
[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 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. 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 /// 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_ADDRESS_SPACE_DESCRIPTOR 0x8A
47 #define ACPI_END_TAG_DESCRIPTOR 0x79
48
49 //
50 // Resource Type
51 //
52 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
53 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
54 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
55
56 ///
57 /// Power Management Timer frequency is fixed at 3.579545MHz
58 ///
59 #define ACPI_TIMER_FREQUENCY 3579545
60
61 //
62 // Ensure proper structure formats
63 //
64 #pragma pack(1)
65
66 ///
67 /// The commond definition of QWORD, DWORD, and WORD
68 /// Address Space Descriptors
69 ///
70 typedef PACKED struct {
71 UINT8 Desc;
72 UINT16 Len;
73 UINT8 ResType;
74 UINT8 GenFlag;
75 UINT8 SpecificFlag;
76 UINT64 AddrSpaceGranularity;
77 UINT64 AddrRangeMin;
78 UINT64 AddrRangeMax;
79 UINT64 AddrTranslationOffset;
80 UINT64 AddrLen;
81 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
82
83 #pragma pack()
84
85 ///
86 /// the End tag identifies an end of resource data.
87 ///
88 typedef struct {
89 UINT8 Desc;
90 UINT8 Checksum;
91 } EFI_ACPI_END_TAG_DESCRIPTOR;
92
93 //
94 // General use definitions
95 //
96 #define EFI_ACPI_RESERVED_BYTE 0x00
97 #define EFI_ACPI_RESERVED_WORD 0x0000
98 #define EFI_ACPI_RESERVED_DWORD 0x00000000
99 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
100
101 //
102 // Resource Type Specific Flags
103 // Ref ACPI specification 6.4.3.5.5
104 //
105 // Bit [0] : Write Status, _RW
106 //
107 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
108 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
109 //
110 // Bit [2:1] : Memory Attributes, _MEM
111 //
112 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
113 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
114 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
115 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
116 //
117 // Bit [4:3] : Memory Attributes, _MTP
118 //
119 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
120 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
121 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
122 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
123 //
124 // Bit [5] : Memory to I/O Translation, _TTP
125 //
126 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
127 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
128
129 //
130 // Ensure proper structure formats
131 //
132 #pragma pack(1)
133 //
134 // ACPI 1.0b table structures
135 //
136
137 ///
138 /// Root System Description Pointer Structure
139 ///
140 typedef struct {
141 UINT64 Signature;
142 UINT8 Checksum;
143 UINT8 OemId[6];
144 UINT8 Reserved;
145 UINT32 RsdtAddress;
146 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
147
148 //
149 // Root System Description Table
150 // No definition needed as it is a common description table header, the same with
151 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
152 //
153
154 ///
155 /// RSDT Revision (as defined in ACPI 1.0b spec.)
156 ///
157 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
158
159 ///
160 /// Fixed ACPI Description Table Structure (FADT)
161 ///
162 typedef struct {
163 EFI_ACPI_DESCRIPTION_HEADER Header;
164 UINT32 FirmwareCtrl;
165 UINT32 Dsdt;
166 UINT8 IntModel;
167 UINT8 Reserved1;
168 UINT16 SciInt;
169 UINT32 SmiCmd;
170 UINT8 AcpiEnable;
171 UINT8 AcpiDisable;
172 UINT8 S4BiosReq;
173 UINT8 Reserved2;
174 UINT32 Pm1aEvtBlk;
175 UINT32 Pm1bEvtBlk;
176 UINT32 Pm1aCntBlk;
177 UINT32 Pm1bCntBlk;
178 UINT32 Pm2CntBlk;
179 UINT32 PmTmrBlk;
180 UINT32 Gpe0Blk;
181 UINT32 Gpe1Blk;
182 UINT8 Pm1EvtLen;
183 UINT8 Pm1CntLen;
184 UINT8 Pm2CntLen;
185 UINT8 PmTmLen;
186 UINT8 Gpe0BlkLen;
187 UINT8 Gpe1BlkLen;
188 UINT8 Gpe1Base;
189 UINT8 Reserved3;
190 UINT16 PLvl2Lat;
191 UINT16 PLvl3Lat;
192 UINT16 FlushSize;
193 UINT16 FlushStride;
194 UINT8 DutyOffset;
195 UINT8 DutyWidth;
196 UINT8 DayAlrm;
197 UINT8 MonAlrm;
198 UINT8 Century;
199 UINT8 Reserved4;
200 UINT8 Reserved5;
201 UINT8 Reserved6;
202 UINT32 Flags;
203 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
204
205 ///
206 /// FADT Version (as defined in ACPI 1.0b spec.)
207 ///
208 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
209
210 //
211 // Fixed ACPI Description Table Fixed Feature Flags
212 // All other bits are reserved and must be set to 0.
213 //
214 #define EFI_ACPI_1_0_WBINVD BIT0
215 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
216 #define EFI_ACPI_1_0_PROC_C1 BIT2
217 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
218 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
219 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
220 #define EFI_ACPI_1_0_FIX_RTC BIT6
221 #define EFI_ACPI_1_0_RTC_S4 BIT7
222 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
223 #define EFI_ACPI_1_0_DCK_CAP BIT9
224
225 ///
226 /// Firmware ACPI Control Structure
227 ///
228 typedef struct {
229 UINT32 Signature;
230 UINT32 Length;
231 UINT32 HardwareSignature;
232 UINT32 FirmwareWakingVector;
233 UINT32 GlobalLock;
234 UINT32 Flags;
235 UINT8 Reserved[40];
236 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
237
238 ///
239 /// Firmware Control Structure Feature Flags
240 /// All other bits are reserved and must be set to 0.
241 ///
242 #define EFI_ACPI_1_0_S4BIOS_F BIT0
243
244 ///
245 /// Multiple APIC Description Table header definition. The rest of the table
246 /// must be defined in a platform specific manner.
247 ///
248 typedef struct {
249 EFI_ACPI_DESCRIPTION_HEADER Header;
250 UINT32 LocalApicAddress;
251 UINT32 Flags;
252 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
253
254 ///
255 /// MADT Revision (as defined in ACPI 1.0b spec.)
256 ///
257 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
258
259 ///
260 /// Multiple APIC Flags
261 /// All other bits are reserved and must be set to 0.
262 ///
263 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
264
265 //
266 // Multiple APIC Description Table APIC structure types
267 // All other values between 0x05 an 0xFF are reserved and
268 // will be ignored by OSPM.
269 //
270 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
271 #define EFI_ACPI_1_0_IO_APIC 0x01
272 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
273 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
274 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
275
276 //
277 // APIC Structure Definitions
278 //
279
280 ///
281 /// Processor Local APIC Structure Definition
282 ///
283 typedef struct {
284 UINT8 Type;
285 UINT8 Length;
286 UINT8 AcpiProcessorId;
287 UINT8 ApicId;
288 UINT32 Flags;
289 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
290
291 ///
292 /// Local APIC Flags. All other bits are reserved and must be 0.
293 ///
294 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
295
296 ///
297 /// IO APIC Structure
298 ///
299 typedef struct {
300 UINT8 Type;
301 UINT8 Length;
302 UINT8 IoApicId;
303 UINT8 Reserved;
304 UINT32 IoApicAddress;
305 UINT32 SystemVectorBase;
306 } EFI_ACPI_1_0_IO_APIC_STRUCTURE;
307
308 ///
309 /// Interrupt Source Override Structure
310 ///
311 typedef struct {
312 UINT8 Type;
313 UINT8 Length;
314 UINT8 Bus;
315 UINT8 Source;
316 UINT32 GlobalSystemInterruptVector;
317 UINT16 Flags;
318 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
319
320 ///
321 /// Non-Maskable Interrupt Source Structure
322 ///
323 typedef struct {
324 UINT8 Type;
325 UINT8 Length;
326 UINT16 Flags;
327 UINT32 GlobalSystemInterruptVector;
328 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
329
330 ///
331 /// Local APIC NMI Structure
332 ///
333 typedef struct {
334 UINT8 Type;
335 UINT8 Length;
336 UINT8 AcpiProcessorId;
337 UINT16 Flags;
338 UINT8 LocalApicInti;
339 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
340
341 ///
342 /// Smart Battery Description Table (SBST)
343 ///
344 typedef struct {
345 EFI_ACPI_DESCRIPTION_HEADER Header;
346 UINT32 WarningEnergyLevel;
347 UINT32 LowEnergyLevel;
348 UINT32 CriticalEnergyLevel;
349 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
350
351 //
352 // Known table signatures
353 //
354
355 ///
356 /// "RSD PTR " Root System Description Pointer
357 ///
358 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
359
360 ///
361 /// "APIC" Multiple APIC Description Table
362 ///
363 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
364
365 ///
366 /// "DSDT" Differentiated System Description Table
367 ///
368 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
369
370 ///
371 /// "FACS" Firmware ACPI Control Structure
372 ///
373 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
374
375 ///
376 /// "FACP" Fixed ACPI Description Table
377 ///
378 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
379
380 ///
381 /// "PSDT" Persistent System Description Table
382 ///
383 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
384
385 ///
386 /// "RSDT" Root System Description Table
387 ///
388 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
389
390 ///
391 /// "SBST" Smart Battery Specification Table
392 ///
393 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
394
395 ///
396 /// "SSDT" Secondary System Description Table
397 ///
398 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
399
400 #pragma pack()
401
402 #endif