aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/actbl1.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/actbl1.h')
-rw-r--r--include/acpi/actbl1.h568
1 files changed, 320 insertions, 248 deletions
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 745a6445a4f9..4e5d3ca53a8e 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,7 @@
61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ 61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ 62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ 63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
64#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
64#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
65#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ 66#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
66#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 67#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
@@ -73,12 +74,6 @@
73#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ 74#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
74#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 75#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
75 76
76/* Legacy names */
77
78#define APIC_SIG "APIC" /* Multiple APIC Description Table */
79#define BOOT_SIG "BOOT" /* Simple Boot Flag Table */
80#define SBST_SIG "SBST" /* Smart Battery Specification Table */
81
82/* 77/*
83 * All tables must be byte-packed to match the ACPI specification, since 78 * All tables must be byte-packed to match the ACPI specification, since
84 * the tables are provided by the system BIOS. 79 * the tables are provided by the system BIOS.
@@ -91,31 +86,43 @@
91 * portable, so do not use any other bitfield types. 86 * portable, so do not use any other bitfield types.
92 */ 87 */
93 88
89/* Common Sub-table header (used in MADT, SRAT, etc.) */
90
91struct acpi_subtable_header {
92 u8 type;
93 u8 length;
94};
95
94/******************************************************************************* 96/*******************************************************************************
95 * 97 *
96 * ASF - Alert Standard Format table (Signature "ASF!") 98 * ASF - Alert Standard Format table (Signature "ASF!")
97 * 99 *
100 * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
101 *
98 ******************************************************************************/ 102 ******************************************************************************/
99 103
100struct acpi_table_asf { 104struct acpi_table_asf {
101ACPI_TABLE_HEADER_DEF}; 105 struct acpi_table_header header; /* Common ACPI table header */
106};
102 107
103#define ACPI_ASF_HEADER_DEF \ 108/* ASF subtable header */
104 u8 type; \
105 u8 reserved; \
106 u16 length;
107 109
108struct acpi_asf_header { 110struct acpi_asf_header {
109ACPI_ASF_HEADER_DEF}; 111 u8 type;
112 u8 reserved;
113 u16 length;
114};
110 115
111/* Values for Type field */ 116/* Values for Type field above */
112 117
113#define ASF_INFO 0 118enum acpi_asf_type {
114#define ASF_ALERT 1 119 ACPI_ASF_TYPE_INFO = 0,
115#define ASF_CONTROL 2 120 ACPI_ASF_TYPE_ALERT = 1,
116#define ASF_BOOT 3 121 ACPI_ASF_TYPE_CONTROL = 2,
117#define ASF_ADDRESS 4 122 ACPI_ASF_TYPE_BOOT = 3,
118#define ASF_RESERVED 5 123 ACPI_ASF_TYPE_ADDRESS = 4,
124 ACPI_ASF_TYPE_RESERVED = 5
125};
119 126
120/* 127/*
121 * ASF subtables 128 * ASF subtables
@@ -124,7 +131,8 @@ ACPI_ASF_HEADER_DEF};
124/* 0: ASF Information */ 131/* 0: ASF Information */
125 132
126struct acpi_asf_info { 133struct acpi_asf_info {
127 ACPI_ASF_HEADER_DEF u8 min_reset_value; 134 struct acpi_asf_header header;
135 u8 min_reset_value;
128 u8 min_poll_interval; 136 u8 min_poll_interval;
129 u16 system_id; 137 u16 system_id;
130 u32 mfg_id; 138 u32 mfg_id;
@@ -135,26 +143,49 @@ struct acpi_asf_info {
135/* 1: ASF Alerts */ 143/* 1: ASF Alerts */
136 144
137struct acpi_asf_alert { 145struct acpi_asf_alert {
138 ACPI_ASF_HEADER_DEF u8 assert_mask; 146 struct acpi_asf_header header;
147 u8 assert_mask;
139 u8 deassert_mask; 148 u8 deassert_mask;
140 u8 alerts; 149 u8 alerts;
141 u8 data_length; 150 u8 data_length;
142 u8 array[1]; 151};
152
153struct acpi_asf_alert_data {
154 u8 address;
155 u8 command;
156 u8 mask;
157 u8 value;
158 u8 sensor_type;
159 u8 type;
160 u8 offset;
161 u8 source_type;
162 u8 severity;
163 u8 sensor_number;
164 u8 entity;
165 u8 instance;
143}; 166};
144 167
145/* 2: ASF Remote Control */ 168/* 2: ASF Remote Control */
146 169
147struct acpi_asf_remote { 170struct acpi_asf_remote {
148 ACPI_ASF_HEADER_DEF u8 controls; 171 struct acpi_asf_header header;
172 u8 controls;
149 u8 data_length; 173 u8 data_length;
150 u16 reserved2; 174 u16 reserved2;
151 u8 array[1]; 175};
176
177struct acpi_asf_control_data {
178 u8 function;
179 u8 address;
180 u8 command;
181 u8 value;
152}; 182};
153 183
154/* 3: ASF RMCP Boot Options */ 184/* 3: ASF RMCP Boot Options */
155 185
156struct acpi_asf_rmcp { 186struct acpi_asf_rmcp {
157 ACPI_ASF_HEADER_DEF u8 capabilities[7]; 187 struct acpi_asf_header header;
188 u8 capabilities[7];
158 u8 completion_code; 189 u8 completion_code;
159 u32 enterprise_id; 190 u32 enterprise_id;
160 u8 command; 191 u8 command;
@@ -166,9 +197,9 @@ struct acpi_asf_rmcp {
166/* 4: ASF Address */ 197/* 4: ASF Address */
167 198
168struct acpi_asf_address { 199struct acpi_asf_address {
169 ACPI_ASF_HEADER_DEF u8 eprom_address; 200 struct acpi_asf_header header;
201 u8 eprom_address;
170 u8 devices; 202 u8 devices;
171 u8 smbus_addresses[1];
172}; 203};
173 204
174/******************************************************************************* 205/*******************************************************************************
@@ -178,7 +209,8 @@ struct acpi_asf_address {
178 ******************************************************************************/ 209 ******************************************************************************/
179 210
180struct acpi_table_boot { 211struct acpi_table_boot {
181 ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */ 212 struct acpi_table_header header; /* Common ACPI table header */
213 u8 cmos_index; /* Index in CMOS RAM for the boot register */
182 u8 reserved[3]; 214 u8 reserved[3];
183}; 215};
184 216
@@ -189,7 +221,8 @@ struct acpi_table_boot {
189 ******************************************************************************/ 221 ******************************************************************************/
190 222
191struct acpi_table_cpep { 223struct acpi_table_cpep {
192 ACPI_TABLE_HEADER_DEF u64 reserved; 224 struct acpi_table_header header; /* Common ACPI table header */
225 u64 reserved;
193}; 226};
194 227
195/* Subtable */ 228/* Subtable */
@@ -197,9 +230,9 @@ struct acpi_table_cpep {
197struct acpi_cpep_polling { 230struct acpi_cpep_polling {
198 u8 type; 231 u8 type;
199 u8 length; 232 u8 length;
200 u8 processor_id; /* Processor ID */ 233 u8 id; /* Processor ID */
201 u8 processor_eid; /* Processor EID */ 234 u8 eid; /* Processor EID */
202 u32 polling_interval; /* Polling interval (msec) */ 235 u32 interval; /* Polling interval (msec) */
203}; 236};
204 237
205/******************************************************************************* 238/*******************************************************************************
@@ -209,196 +242,281 @@ struct acpi_cpep_polling {
209 ******************************************************************************/ 242 ******************************************************************************/
210 243
211struct acpi_table_dbgp { 244struct acpi_table_dbgp {
212 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ 245 struct acpi_table_header header; /* Common ACPI table header */
246 u8 type; /* 0=full 16550, 1=subset of 16550 */
213 u8 reserved[3]; 247 u8 reserved[3];
214 struct acpi_generic_address debug_port; 248 struct acpi_generic_address debug_port;
215}; 249};
216 250
217/******************************************************************************* 251/*******************************************************************************
218 * 252 *
219 * ECDT - Embedded Controller Boot Resources Table 253 * DMAR - DMA Remapping table
220 * 254 *
221 ******************************************************************************/ 255 ******************************************************************************/
222 256
223struct ec_boot_resources { 257struct acpi_table_dmar {
224 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ 258 struct acpi_table_header header; /* Common ACPI table header */
225 struct acpi_generic_address ec_data; /* Address of EC data register */ 259 u8 width; /* Host Address Width */
226 u32 uid; /* Unique ID - must be same as the EC _UID method */ 260 u8 reserved[11];
227 u8 gpe_bit; /* The GPE for the EC */ 261};
228 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ 262
263/* DMAR subtable header */
264
265struct acpi_dmar_header {
266 u16 type;
267 u16 length;
268 u8 flags;
269 u8 reserved[3];
270};
271
272/* Values for subtable type in struct acpi_dmar_header */
273
274enum acpi_dmar_type {
275 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
276 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
277 ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */
278};
279
280struct acpi_dmar_device_scope {
281 u8 entry_type;
282 u8 length;
283 u8 segment;
284 u8 bus;
285};
286
287/* Values for entry_type in struct acpi_dmar_device_scope */
288
289enum acpi_dmar_scope_type {
290 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
291 ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
292 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
293 ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */
294};
295
296/*
297 * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
298 */
299
300/* 0: Hardware Unit Definition */
301
302struct acpi_dmar_hardware_unit {
303 struct acpi_dmar_header header;
304 u64 address; /* Register Base Address */
305};
306
307/* Flags */
308
309#define ACPI_DMAR_INCLUDE_ALL (1)
310
311/* 1: Reserved Memory Defininition */
312
313struct acpi_dmar_reserved_memory {
314 struct acpi_dmar_header header;
315 u64 address; /* 4_k aligned base address */
316 u64 end_address; /* 4_k aligned limit address */
229}; 317};
230 318
319/* Flags */
320
321#define ACPI_DMAR_ALLOW_ALL (1)
322
231/******************************************************************************* 323/*******************************************************************************
232 * 324 *
233 * HPET - High Precision Event Timer table 325 * ECDT - Embedded Controller Boot Resources Table
234 * 326 *
235 ******************************************************************************/ 327 ******************************************************************************/
236 328
237struct acpi_hpet_table { 329struct acpi_table_ecdt {
238 ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */ 330 struct acpi_table_header header; /* Common ACPI table header */
239 struct acpi_generic_address base_address; /* Address of event timer block */ 331 struct acpi_generic_address control; /* Address of EC command/status register */
240 u8 hpet_number; /* HPET sequence number */ 332 struct acpi_generic_address data; /* Address of EC data register */
241 u16 clock_tick; /* Main counter min tick, periodic mode */ 333 u32 uid; /* Unique ID - must be same as the EC _UID method */
242 u8 attributes; 334 u8 gpe; /* The GPE for the EC */
335 u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
243}; 336};
244 337
245#if 0 /* HPET flags to be converted to macros */
246struct { /* Flags (8 bits) */
247 u8 page_protect:1; /* 00: No page protection */
248 u8 page_protect4:1; /* 01: 4_kB page protected */
249 u8 page_protect64:1; /* 02: 64_kB page protected */
250 u8:5; /* 03-07: Reserved, must be zero */
251} flags;
252#endif
253
254/******************************************************************************* 338/*******************************************************************************
255 * 339 *
256 * MADT - Multiple APIC Description Table 340 * HPET - High Precision Event Timer table
257 * 341 *
258 ******************************************************************************/ 342 ******************************************************************************/
259 343
260struct multiple_apic_table { 344struct acpi_table_hpet {
261 ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */ 345 struct acpi_table_header header; /* Common ACPI table header */
262 346 u32 id; /* Hardware ID of event timer block */
263 /* Flags (32 bits) */ 347 struct acpi_generic_address address; /* Address of event timer block */
264 348 u8 sequence; /* HPET sequence number */
265 u8 PCATcompat:1; /* 00: System also has dual 8259s */ 349 u16 minimum_tick; /* Main counter min tick, periodic mode */
266 u8:7; /* 01-07: Reserved, must be zero */ 350 u8 flags;
267 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
268}; 351};
269 352
270/* Values for MADT PCATCompat */ 353/*! Flags */
271 354
272#define DUAL_PIC 0 355#define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */
273#define MULTIPLE_APIC 1 356#define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */
357#define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */
274 358
275/* Common MADT Sub-table header */ 359/*! [End] no source code translation !*/
276 360
277#define APIC_HEADER_DEF \ 361/*******************************************************************************
278 u8 type; \ 362 *
279 u8 length; 363 * MADT - Multiple APIC Description Table
280 364 *
281struct apic_header { 365 ******************************************************************************/
282APIC_HEADER_DEF};
283
284/* Values for Type in struct apic_header */
285 366
286#define APIC_PROCESSOR 0 367struct acpi_table_madt {
287#define APIC_IO 1 368 struct acpi_table_header header; /* Common ACPI table header */
288#define APIC_XRUPT_OVERRIDE 2 369 u32 address; /* Physical address of local APIC */
289#define APIC_NMI 3 370 u32 flags;
290#define APIC_LOCAL_NMI 4 371};
291#define APIC_ADDRESS_OVERRIDE 5
292#define APIC_IO_SAPIC 6
293#define APIC_LOCAL_SAPIC 7
294#define APIC_XRUPT_SOURCE 8
295#define APIC_RESERVED 9 /* 9 and greater are reserved */
296 372
297/* Flag definitions for MADT sub-tables */ 373/* Flags */
298 374
299#define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \ 375#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
300 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
301 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
302 u8 : 4; /* 04-07: Reserved, must be zero */\
303 u8 reserved1; /* 08-15: Reserved, must be zero */
304 376
305#define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \ 377/* Values for PCATCompat flag */
306 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
307 u8 : 7; /* 01-07: Reserved, must be zero */\
308 u8 reserved2[3]; /* 08-31: Reserved, must be zero */
309 378
310/* Values for MPS INTI flags */ 379#define ACPI_MADT_DUAL_PIC 0
380#define ACPI_MADT_MULTIPLE_APIC 1
311 381
312#define POLARITY_CONFORMS 0 382/* Values for subtable type in struct acpi_subtable_header */
313#define POLARITY_ACTIVE_HIGH 1
314#define POLARITY_RESERVED 2
315#define POLARITY_ACTIVE_LOW 3
316 383
317#define TRIGGER_CONFORMS 0 384enum acpi_madt_type {
318#define TRIGGER_EDGE 1 385 ACPI_MADT_TYPE_LOCAL_APIC = 0,
319#define TRIGGER_RESERVED 2 386 ACPI_MADT_TYPE_IO_APIC = 1,
320#define TRIGGER_LEVEL 3 387 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
388 ACPI_MADT_TYPE_NMI_SOURCE = 3,
389 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
390 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
391 ACPI_MADT_TYPE_IO_SAPIC = 6,
392 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
393 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
394 ACPI_MADT_TYPE_RESERVED = 9 /* 9 and greater are reserved */
395};
321 396
322/* 397/*
323 * MADT Sub-tables, correspond to Type in struct apic_header 398 * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
324 */ 399 */
325 400
326/* 0: processor APIC */ 401/* 0: Processor Local APIC */
327 402
328struct madt_processor_apic { 403struct acpi_madt_local_apic {
329 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 404 struct acpi_subtable_header header;
330 u8 local_apic_id; /* Processor's local APIC id */ 405 u8 processor_id; /* ACPI processor id */
331 ACPI_MADT_LFLAGS}; 406 u8 id; /* Processor's local APIC id */
407 u32 lapic_flags;
408};
332 409
333/* 1: IO APIC */ 410/* 1: IO APIC */
334 411
335struct madt_io_apic { 412struct acpi_madt_io_apic {
336 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ 413 struct acpi_subtable_header header;
414 u8 id; /* I/O APIC ID */
337 u8 reserved; /* Reserved - must be zero */ 415 u8 reserved; /* Reserved - must be zero */
338 u32 address; /* APIC physical address */ 416 u32 address; /* APIC physical address */
339 u32 interrupt; /* Global system interrupt where INTI lines start */ 417 u32 global_irq_base; /* Global system interrupt where INTI lines start */
340}; 418};
341 419
342/* 2: Interrupt Override */ 420/* 2: Interrupt Override */
343 421
344struct madt_interrupt_override { 422struct acpi_madt_interrupt_override {
345 APIC_HEADER_DEF u8 bus; /* 0 - ISA */ 423 struct acpi_subtable_header header;
346 u8 source; /* Interrupt source (IRQ) */ 424 u8 bus; /* 0 - ISA */
347 u32 interrupt; /* Global system interrupt */ 425 u8 source_irq; /* Interrupt source (IRQ) */
348 ACPI_MADT_IFLAGS}; 426 u32 global_irq; /* Global system interrupt */
427 u16 inti_flags;
428};
349 429
350/* 3: NMI Sources */ 430/* 3: NMI Source */
351 431
352struct madt_nmi_source { 432struct acpi_madt_nmi_source {
353 APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */ 433 struct acpi_subtable_header header;
434 u16 inti_flags;
435 u32 global_irq; /* Global system interrupt */
354}; 436};
355 437
356/* 4: Local APIC NMI */ 438/* 4: Local APIC NMI */
357 439
358struct madt_local_apic_nmi { 440struct acpi_madt_local_apic_nmi {
359 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 441 struct acpi_subtable_header header;
360 ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */ 442 u8 processor_id; /* ACPI processor id */
443 u16 inti_flags;
444 u8 lint; /* LINTn to which NMI is connected */
361}; 445};
362 446
363/* 5: Address Override */ 447/* 5: Address Override */
364 448
365struct madt_address_override { 449struct acpi_madt_local_apic_override {
366 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ 450 struct acpi_subtable_header header;
451 u16 reserved; /* Reserved, must be zero */
367 u64 address; /* APIC physical address */ 452 u64 address; /* APIC physical address */
368}; 453};
369 454
370/* 6: I/O Sapic */ 455/* 6: I/O Sapic */
371 456
372struct madt_io_sapic { 457struct acpi_madt_io_sapic {
373 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ 458 struct acpi_subtable_header header;
459 u8 id; /* I/O SAPIC ID */
374 u8 reserved; /* Reserved, must be zero */ 460 u8 reserved; /* Reserved, must be zero */
375 u32 interrupt_base; /* Glocal interrupt for SAPIC start */ 461 u32 global_irq_base; /* Global interrupt for SAPIC start */
376 u64 address; /* SAPIC physical address */ 462 u64 address; /* SAPIC physical address */
377}; 463};
378 464
379/* 7: Local Sapic */ 465/* 7: Local Sapic */
380 466
381struct madt_local_sapic { 467struct acpi_madt_local_sapic {
382 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 468 struct acpi_subtable_header header;
383 u8 local_sapic_id; /* SAPIC ID */ 469 u8 processor_id; /* ACPI processor id */
384 u8 local_sapic_eid; /* SAPIC EID */ 470 u8 id; /* SAPIC ID */
471 u8 eid; /* SAPIC EID */
385 u8 reserved[3]; /* Reserved, must be zero */ 472 u8 reserved[3]; /* Reserved, must be zero */
386 ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 473 u32 lapic_flags;
387 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 474 u32 uid; /* Numeric UID - ACPI 3.0 */
475 char uid_string[1]; /* String UID - ACPI 3.0 */
388}; 476};
389 477
390/* 8: Platform Interrupt Source */ 478/* 8: Platform Interrupt Source */
391 479
392struct madt_interrupt_source { 480struct acpi_madt_interrupt_source {
393 APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ 481 struct acpi_subtable_header header;
394 u8 processor_id; /* Processor ID */ 482 u16 inti_flags;
395 u8 processor_eid; /* Processor EID */ 483 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
484 u8 id; /* Processor ID */
485 u8 eid; /* Processor EID */
396 u8 io_sapic_vector; /* Vector value for PMI interrupts */ 486 u8 io_sapic_vector; /* Vector value for PMI interrupts */
397 u32 interrupt; /* Global system interrupt */ 487 u32 global_irq; /* Global system interrupt */
398 u32 flags; /* Interrupt Source Flags */ 488 u32 flags; /* Interrupt Source Flags */
399}; 489};
400 490
401#ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H 491/* Flags field above */
492
493#define ACPI_MADT_CPEI_OVERRIDE (1)
494
495/*
496 * Common flags fields for MADT subtables
497 */
498
499/* MADT Local APIC flags (lapic_flags) */
500
501#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
502
503/* MADT MPS INTI flags (inti_flags) */
504
505#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
506#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
507
508/* Values for MPS INTI flags */
509
510#define ACPI_MADT_POLARITY_CONFORMS 0
511#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
512#define ACPI_MADT_POLARITY_RESERVED 2
513#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
514
515#define ACPI_MADT_TRIGGER_CONFORMS (0)
516#define ACPI_MADT_TRIGGER_EDGE (1<<2)
517#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
518#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
519
402/******************************************************************************* 520/*******************************************************************************
403 * 521 *
404 * MCFG - PCI Memory Mapped Configuration table and sub-table 522 * MCFG - PCI Memory Mapped Configuration table and sub-table
@@ -406,17 +524,19 @@ struct madt_interrupt_source {
406 ******************************************************************************/ 524 ******************************************************************************/
407 525
408struct acpi_table_mcfg { 526struct acpi_table_mcfg {
409 ACPI_TABLE_HEADER_DEF u8 reserved[8]; 527 struct acpi_table_header header; /* Common ACPI table header */
528 u8 reserved[8];
410}; 529};
411 530
531/* Subtable */
532
412struct acpi_mcfg_allocation { 533struct acpi_mcfg_allocation {
413 u64 base_address; /* Base address, processor-relative */ 534 u64 address; /* Base address, processor-relative */
414 u16 pci_segment; /* PCI segment group number */ 535 u16 pci_segment; /* PCI segment group number */
415 u8 start_bus_number; /* Starting PCI Bus number */ 536 u8 start_bus_number; /* Starting PCI Bus number */
416 u8 end_bus_number; /* Final PCI Bus number */ 537 u8 end_bus_number; /* Final PCI Bus number */
417 u32 reserved; 538 u32 reserved;
418}; 539};
419#endif
420 540
421/******************************************************************************* 541/*******************************************************************************
422 * 542 *
@@ -424,8 +544,9 @@ struct acpi_mcfg_allocation {
424 * 544 *
425 ******************************************************************************/ 545 ******************************************************************************/
426 546
427struct smart_battery_table { 547struct acpi_table_sbst {
428 ACPI_TABLE_HEADER_DEF u32 warning_level; 548 struct acpi_table_header header; /* Common ACPI table header */
549 u32 warning_level;
429 u32 low_level; 550 u32 low_level;
430 u32 critical_level; 551 u32 critical_level;
431}; 552};
@@ -436,9 +557,10 @@ struct smart_battery_table {
436 * 557 *
437 ******************************************************************************/ 558 ******************************************************************************/
438 559
439struct system_locality_info { 560struct acpi_table_slit {
440 ACPI_TABLE_HEADER_DEF u64 locality_count; 561 struct acpi_table_header header; /* Common ACPI table header */
441 u8 entry[1][1]; 562 u64 locality_count;
563 u8 entry[1]; /* Real size = localities^2 */
442}; 564};
443 565
444/******************************************************************************* 566/*******************************************************************************
@@ -448,7 +570,8 @@ struct system_locality_info {
448 ******************************************************************************/ 570 ******************************************************************************/
449 571
450struct acpi_table_spcr { 572struct acpi_table_spcr {
451 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ 573 struct acpi_table_header header; /* Common ACPI table header */
574 u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
452 u8 reserved[3]; 575 u8 reserved[3];
453 struct acpi_generic_address serial_port; 576 struct acpi_generic_address serial_port;
454 u8 interrupt_type; 577 u8 interrupt_type;
@@ -459,7 +582,7 @@ struct acpi_table_spcr {
459 u8 stop_bits; 582 u8 stop_bits;
460 u8 flow_control; 583 u8 flow_control;
461 u8 terminal_type; 584 u8 terminal_type;
462 u8 reserved2; 585 u8 reserved1;
463 u16 pci_device_id; 586 u16 pci_device_id;
464 u16 pci_vendor_id; 587 u16 pci_vendor_id;
465 u8 pci_bus; 588 u8 pci_bus;
@@ -467,7 +590,7 @@ struct acpi_table_spcr {
467 u8 pci_function; 590 u8 pci_function;
468 u32 pci_flags; 591 u32 pci_flags;
469 u8 pci_segment; 592 u8 pci_segment;
470 u32 reserved3; 593 u32 reserved2;
471}; 594};
472 595
473/******************************************************************************* 596/*******************************************************************************
@@ -477,12 +600,13 @@ struct acpi_table_spcr {
477 ******************************************************************************/ 600 ******************************************************************************/
478 601
479struct acpi_table_spmi { 602struct acpi_table_spmi {
480 ACPI_TABLE_HEADER_DEF u8 reserved; 603 struct acpi_table_header header; /* Common ACPI table header */
604 u8 reserved;
481 u8 interface_type; 605 u8 interface_type;
482 u16 spec_revision; /* Version of IPMI */ 606 u16 spec_revision; /* Version of IPMI */
483 u8 interrupt_type; 607 u8 interrupt_type;
484 u8 gpe_number; /* GPE assigned */ 608 u8 gpe_number; /* GPE assigned */
485 u8 reserved2; 609 u8 reserved1;
486 u8 pci_device_flag; 610 u8 pci_device_flag;
487 u32 interrupt; 611 u32 interrupt;
488 struct acpi_generic_address ipmi_register; 612 struct acpi_generic_address ipmi_register;
@@ -498,58 +622,53 @@ struct acpi_table_spmi {
498 * 622 *
499 ******************************************************************************/ 623 ******************************************************************************/
500 624
501struct system_resource_affinity { 625struct acpi_table_srat {
502 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ 626 struct acpi_table_header header; /* Common ACPI table header */
503 u64 reserved2; /* Reserved, must be zero */ 627 u32 table_revision; /* Must be value '1' */
628 u64 reserved; /* Reserved, must be zero */
504}; 629};
505 630
506/* SRAT common sub-table header */ 631/* Values for subtable type in struct acpi_subtable_header */
507 632
508#define SRAT_SUBTABLE_HEADER \ 633enum acpi_srat_type {
509 u8 type; \ 634 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
510 u8 length; 635 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
511 636 ACPI_SRAT_TYPE_RESERVED = 2
512/* Values for Type above */ 637};
513
514#define SRAT_CPU_AFFINITY 0
515#define SRAT_MEMORY_AFFINITY 1
516#define SRAT_RESERVED 2
517 638
518/* SRAT sub-tables */ 639/* SRAT sub-tables */
519 640
520struct static_resource_alloc { 641struct acpi_srat_cpu_affinity {
521 SRAT_SUBTABLE_HEADER u8 proximity_domain_lo; 642 struct acpi_subtable_header header;
643 u8 proximity_domain_lo;
522 u8 apic_id; 644 u8 apic_id;
523 645 u32 flags;
524 /* Flags (32 bits) */
525
526 u8 enabled:1; /* 00: Use affinity structure */
527 u8:7; /* 01-07: Reserved, must be zero */
528 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
529
530 u8 local_sapic_eid; 646 u8 local_sapic_eid;
531 u8 proximity_domain_hi[3]; 647 u8 proximity_domain_hi[3];
532 u32 reserved4; /* Reserved, must be zero */ 648 u32 reserved; /* Reserved, must be zero */
533}; 649};
534 650
535struct memory_affinity { 651/* Flags */
536 SRAT_SUBTABLE_HEADER u32 proximity_domain;
537 u16 reserved3;
538 u64 base_address;
539 u64 address_length;
540 u32 reserved4;
541
542 /* Flags (32 bits) */
543 652
544 u8 enabled:1; /* 00: Use affinity structure */ 653#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
545 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
546 u8 non_volatile:1; /* 02: Memory is non-volatile */
547 u8:5; /* 03-07: Reserved, must be zero */
548 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
549 654
550 u64 reserved6; /* Reserved, must be zero */ 655struct acpi_srat_mem_affinity {
656 struct acpi_subtable_header header;
657 u32 proximity_domain;
658 u16 reserved; /* Reserved, must be zero */
659 u64 base_address;
660 u64 length;
661 u32 memory_type; /* See acpi_address_range_id */
662 u32 flags;
663 u64 reserved1; /* Reserved, must be zero */
551}; 664};
552 665
666/* Flags */
667
668#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
669#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
670#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
671
553/******************************************************************************* 672/*******************************************************************************
554 * 673 *
555 * TCPA - Trusted Computing Platform Alliance table 674 * TCPA - Trusted Computing Platform Alliance table
@@ -557,7 +676,8 @@ struct memory_affinity {
557 ******************************************************************************/ 676 ******************************************************************************/
558 677
559struct acpi_table_tcpa { 678struct acpi_table_tcpa {
560 ACPI_TABLE_HEADER_DEF u16 reserved; 679 struct acpi_table_header header; /* Common ACPI table header */
680 u16 reserved;
561 u32 max_log_length; /* Maximum length for the event log area */ 681 u32 max_log_length; /* Maximum length for the event log area */
562 u64 log_address; /* Address of the event log area */ 682 u64 log_address; /* Address of the event log area */
563}; 683};
@@ -569,7 +689,8 @@ struct acpi_table_tcpa {
569 ******************************************************************************/ 689 ******************************************************************************/
570 690
571struct acpi_table_wdrt { 691struct acpi_table_wdrt {
572 ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */ 692 struct acpi_table_header header; /* Common ACPI table header */
693 u32 header_length; /* Watchdog Header Length */
573 u8 pci_segment; /* PCI Segment number */ 694 u8 pci_segment; /* PCI Segment number */
574 u8 pci_bus; /* PCI Bus number */ 695 u8 pci_bus; /* PCI Bus number */
575 u8 pci_device; /* PCI Device number */ 696 u8 pci_device; /* PCI Device number */
@@ -582,58 +703,9 @@ struct acpi_table_wdrt {
582 u32 entries; /* Number of watchdog entries that follow */ 703 u32 entries; /* Number of watchdog entries that follow */
583}; 704};
584 705
585#if 0 /* Flags, will be converted to macros */ 706/* Flags */
586u8 enabled:1; /* 00: Timer enabled */ 707
587u8:6; /* 01-06: Reserved */ 708#define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */
588u8 sleep_stop:1; /* 07: Timer stopped in sleep state */
589#endif
590
591/* Macros used to generate offsets to specific table fields */
592
593#define ACPI_ASF0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_info,f)
594#define ACPI_ASF1_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_alert,f)
595#define ACPI_ASF2_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_remote,f)
596#define ACPI_ASF3_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_rmcp,f)
597#define ACPI_ASF4_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_address,f)
598#define ACPI_BOOT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_boot,f)
599#define ACPI_CPEP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_cpep,f)
600#define ACPI_CPEP0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_cpep_polling,f)
601#define ACPI_DBGP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_dbgp,f)
602#define ACPI_ECDT_OFFSET(f) (u8) ACPI_OFFSET (struct ec_boot_resources,f)
603#define ACPI_HPET_OFFSET(f) (u8) ACPI_OFFSET (struct hpet_table,f)
604#define ACPI_MADT_OFFSET(f) (u8) ACPI_OFFSET (struct multiple_apic_table,f)
605#define ACPI_MADT0_OFFSET(f) (u8) ACPI_OFFSET (struct madt_processor_apic,f)
606#define ACPI_MADT1_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_apic,f)
607#define ACPI_MADT2_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_override,f)
608#define ACPI_MADT3_OFFSET(f) (u8) ACPI_OFFSET (struct madt_nmi_source,f)
609#define ACPI_MADT4_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_apic_nmi,f)
610#define ACPI_MADT5_OFFSET(f) (u8) ACPI_OFFSET (struct madt_address_override,f)
611#define ACPI_MADT6_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_sapic,f)
612#define ACPI_MADT7_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_sapic,f)
613#define ACPI_MADT8_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_source,f)
614#define ACPI_MADTH_OFFSET(f) (u8) ACPI_OFFSET (struct apic_header,f)
615#define ACPI_MCFG_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_mcfg,f)
616#define ACPI_MCFG0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_mcfg_allocation,f)
617#define ACPI_SBST_OFFSET(f) (u8) ACPI_OFFSET (struct smart_battery_table,f)
618#define ACPI_SLIT_OFFSET(f) (u8) ACPI_OFFSET (struct system_locality_info,f)
619#define ACPI_SPCR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spcr,f)
620#define ACPI_SPMI_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spmi,f)
621#define ACPI_SRAT_OFFSET(f) (u8) ACPI_OFFSET (struct system_resource_affinity,f)
622#define ACPI_SRAT0_OFFSET(f) (u8) ACPI_OFFSET (struct static_resource_alloc,f)
623#define ACPI_SRAT1_OFFSET(f) (u8) ACPI_OFFSET (struct memory_affinity,f)
624#define ACPI_TCPA_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_tcpa,f)
625#define ACPI_WDRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_wdrt,f)
626
627#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct hpet_table,f,o)
628#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct static_resource_alloc,f,o)
629#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct memory_affinity,f,o)
630#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct multiple_apic_table,f,o)
631#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_processor_apic,f,o)
632#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_override,f,o)
633#define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_nmi_source,f,o)
634#define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_apic_nmi,f,o)
635#define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_sapic,f,o)
636#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_source,f,o)
637 709
638/* Reset to default packing */ 710/* Reset to default packing */
639 711