]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/acpi/actbl1.h
ACPICA: Include file support for new ACPI tables
[linux-2.6-omap-h63xx.git] / include / acpi / actbl1.h
1 /******************************************************************************
2  *
3  * Name: actbl1.h - Additional ACPI table definitions
4  *
5  *****************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2007, R. Byron Moore
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43
44 #ifndef __ACTBL1_H__
45 #define __ACTBL1_H__
46
47 /*******************************************************************************
48  *
49  * Additional ACPI Tables
50  *
51  * These tables are not consumed directly by the ACPICA subsystem, but are
52  * included here to support device drivers and the AML disassembler.
53  *
54  ******************************************************************************/
55
56 /*
57  * Values for description table header signatures. Useful because they make
58  * it more difficult to inadvertently type in the wrong signature.
59  */
60 #define ACPI_SIG_ASF            "ASF!"  /* Alert Standard Format table */
61 #define ACPI_SIG_BERT           "BERT"  /* Boot Error Record Table */
62 #define ACPI_SIG_BOOT           "BOOT"  /* Simple Boot Flag Table */
63 #define ACPI_SIG_CPEP           "CPEP"  /* Corrected Platform Error Polling table */
64 #define ACPI_SIG_DBGP           "DBGP"  /* Debug Port table */
65 #define ACPI_SIG_DMAR           "DMAR"  /* DMA Remapping table */
66 #define ACPI_SIG_ECDT           "ECDT"  /* Embedded Controller Boot Resources Table */
67 #define ACPI_SIG_EINJ           "EINJ"  /* Error Injection table */
68 #define ACPI_SIG_ERST           "ERST"  /* Error Record Serialization Table */
69 #define ACPI_SIG_HEST           "HEST"  /* Hardware Error Source Table */
70 #define ACPI_SIG_HPET           "HPET"  /* High Precision Event Timer table */
71 #define ACPI_SIG_IBFT           "IBFT"  /* i_sCSI Boot Firmware Table */
72 #define ACPI_SIG_MADT           "APIC"  /* Multiple APIC Description Table */
73 #define ACPI_SIG_MCFG           "MCFG"  /* PCI Memory Mapped Configuration table */
74 #define ACPI_SIG_SBST           "SBST"  /* Smart Battery Specification Table */
75 #define ACPI_SIG_SLIC           "SLIC"  /* Software Licensing Description Table */
76 #define ACPI_SIG_SLIT           "SLIT"  /* System Locality Distance Information Table */
77 #define ACPI_SIG_SPCR           "SPCR"  /* Serial Port Console Redirection table */
78 #define ACPI_SIG_SPMI           "SPMI"  /* Server Platform Management Interface table */
79 #define ACPI_SIG_SRAT           "SRAT"  /* System Resource Affinity Table */
80 #define ACPI_SIG_TCPA           "TCPA"  /* Trusted Computing Platform Alliance table */
81 #define ACPI_SIG_UEFI           "UEFI"  /* Uefi Boot Optimization Table */
82 #define ACPI_SIG_WDAT           "WDAT"  /* Watchdog Action Table */
83 #define ACPI_SIG_WDRT           "WDRT"  /* Watchdog Resource Table */
84
85 /*
86  * All tables must be byte-packed to match the ACPI specification, since
87  * the tables are provided by the system BIOS.
88  */
89 #pragma pack(1)
90
91 /*
92  * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
93  * This is the only type that is even remotely portable. Anything else is not
94  * portable, so do not use any other bitfield types.
95  */
96
97 /* Common Subtable header (used in MADT, SRAT, etc.) */
98
99 struct acpi_subtable_header {
100         u8 type;
101         u8 length;
102 };
103
104 /* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */
105
106 struct acpi_whea_header {
107         u8 action;
108         u8 instruction;
109         u8 flags;
110         u8 reserved;
111         struct acpi_generic_address register_region;
112         u32 value;              /* Value used with Read/Write register */
113         u32 mask;               /* Bitmask required for this register instruction */
114 };
115
116 /*******************************************************************************
117  *
118  * ASF - Alert Standard Format table (Signature "ASF!")
119  *
120  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
121  *
122  ******************************************************************************/
123
124 struct acpi_table_asf {
125         struct acpi_table_header header;        /* Common ACPI table header */
126 };
127
128 /* ASF subtable header */
129
130 struct acpi_asf_header {
131         u8 type;
132         u8 reserved;
133         u16 length;
134 };
135
136 /* Values for Type field above */
137
138 enum acpi_asf_type {
139         ACPI_ASF_TYPE_INFO = 0,
140         ACPI_ASF_TYPE_ALERT = 1,
141         ACPI_ASF_TYPE_CONTROL = 2,
142         ACPI_ASF_TYPE_BOOT = 3,
143         ACPI_ASF_TYPE_ADDRESS = 4,
144         ACPI_ASF_TYPE_RESERVED = 5
145 };
146
147 /*
148  * ASF subtables
149  */
150
151 /* 0: ASF Information */
152
153 struct acpi_asf_info {
154         struct acpi_asf_header header;
155         u8 min_reset_value;
156         u8 min_poll_interval;
157         u16 system_id;
158         u32 mfg_id;
159         u8 flags;
160         u8 reserved2[3];
161 };
162
163 /* 1: ASF Alerts */
164
165 struct acpi_asf_alert {
166         struct acpi_asf_header header;
167         u8 assert_mask;
168         u8 deassert_mask;
169         u8 alerts;
170         u8 data_length;
171 };
172
173 struct acpi_asf_alert_data {
174         u8 address;
175         u8 command;
176         u8 mask;
177         u8 value;
178         u8 sensor_type;
179         u8 type;
180         u8 offset;
181         u8 source_type;
182         u8 severity;
183         u8 sensor_number;
184         u8 entity;
185         u8 instance;
186 };
187
188 /* 2: ASF Remote Control */
189
190 struct acpi_asf_remote {
191         struct acpi_asf_header header;
192         u8 controls;
193         u8 data_length;
194         u16 reserved2;
195 };
196
197 struct acpi_asf_control_data {
198         u8 function;
199         u8 address;
200         u8 command;
201         u8 value;
202 };
203
204 /* 3: ASF RMCP Boot Options */
205
206 struct acpi_asf_rmcp {
207         struct acpi_asf_header header;
208         u8 capabilities[7];
209         u8 completion_code;
210         u32 enterprise_id;
211         u8 command;
212         u16 parameter;
213         u16 boot_options;
214         u16 oem_parameters;
215 };
216
217 /* 4: ASF Address */
218
219 struct acpi_asf_address {
220         struct acpi_asf_header header;
221         u8 eprom_address;
222         u8 devices;
223 };
224
225 /*******************************************************************************
226  *
227  * BERT - Boot Error Record Table
228  *
229  ******************************************************************************/
230
231 struct acpi_table_bert {
232         struct acpi_table_header header;        /* Common ACPI table header */
233         u32 region_length;      /* Length of the boot error region */
234         u64 address;            /* Physical addresss of the error region */
235 };
236
237 struct acpi_bert_region {
238         u32 block_status;
239         u32 raw_data_offset;
240         u32 raw_data_length;
241         u32 data_length;
242         u32 error_severity;
243         u8 error_data[1];
244 };
245
246 /* block_status Flags */
247
248 #define ACPI_BERT_UNCORRECTABLE             (1)
249 #define ACPI_BERT_CORRECTABLE               (2)
250 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (4)
251 #define ACPI_BERT_MULTIPLE_CORRECTABLE      (8)
252
253 /*******************************************************************************
254  *
255  * BOOT - Simple Boot Flag Table
256  *
257  ******************************************************************************/
258
259 struct acpi_table_boot {
260         struct acpi_table_header header;        /* Common ACPI table header */
261         u8 cmos_index;          /* Index in CMOS RAM for the boot register */
262         u8 reserved[3];
263 };
264
265 /*******************************************************************************
266  *
267  * CPEP - Corrected Platform Error Polling table
268  *
269  ******************************************************************************/
270
271 struct acpi_table_cpep {
272         struct acpi_table_header header;        /* Common ACPI table header */
273         u64 reserved;
274 };
275
276 /* Subtable */
277
278 struct acpi_cpep_polling {
279         u8 type;
280         u8 length;
281         u8 id;                  /* Processor ID */
282         u8 eid;                 /* Processor EID */
283         u32 interval;           /* Polling interval (msec) */
284 };
285
286 /*******************************************************************************
287  *
288  * DBGP - Debug Port table
289  *
290  ******************************************************************************/
291
292 struct acpi_table_dbgp {
293         struct acpi_table_header header;        /* Common ACPI table header */
294         u8 type;                /* 0=full 16550, 1=subset of 16550 */
295         u8 reserved[3];
296         struct acpi_generic_address debug_port;
297 };
298
299 /*******************************************************************************
300  *
301  * DMAR - DMA Remapping table
302  *
303  ******************************************************************************/
304
305 struct acpi_table_dmar {
306         struct acpi_table_header header;        /* Common ACPI table header */
307         u8 width;               /* Host Address Width */
308         u8 flags;
309         u8 reserved[10];
310 };
311
312 /* DMAR subtable header */
313
314 struct acpi_dmar_header {
315         u16 type;
316         u16 length;
317 };
318
319 /* Values for subtable type in struct acpi_dmar_header */
320
321 enum acpi_dmar_type {
322         ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
323         ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
324         ACPI_DMAR_TYPE_ATSR = 2,
325         ACPI_DMAR_TYPE_RESERVED = 3     /* 3 and greater are reserved */
326 };
327
328 struct acpi_dmar_device_scope {
329         u8 entry_type;
330         u8 length;
331         u16 reserved;
332         u8 enumeration_id;
333         u8 bus;
334 };
335
336 /* Values for entry_type in struct acpi_dmar_device_scope */
337
338 enum acpi_dmar_scope_type {
339         ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
340         ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
341         ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
342         ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
343         ACPI_DMAR_SCOPE_TYPE_HPET = 4,
344         ACPI_DMAR_SCOPE_TYPE_RESERVED = 5       /* 5 and greater are reserved */
345 };
346
347 struct acpi_dmar_pci_path {
348         u8 dev;
349         u8 fn;
350 };
351
352 /*
353  * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
354  */
355
356 /* 0: Hardware Unit Definition */
357
358 struct acpi_dmar_hardware_unit {
359         struct acpi_dmar_header header;
360         u8 flags;
361         u8 reserved;
362         u16 segment;
363         u64 address;            /* Register Base Address */
364 };
365
366 /* Flags */
367
368 #define ACPI_DMAR_INCLUDE_ALL       (1)
369
370 /* 1: Reserved Memory Defininition */
371
372 struct acpi_dmar_reserved_memory {
373         struct acpi_dmar_header header;
374         u16 reserved;
375         u16 segment;
376         u64 base_address;               /* 4_k aligned base address */
377         u64 end_address;        /* 4_k aligned limit address */
378 };
379
380 /* Flags */
381
382 #define ACPI_DMAR_ALLOW_ALL         (1)
383
384 /*******************************************************************************
385  *
386  * ECDT - Embedded Controller Boot Resources Table
387  *
388  ******************************************************************************/
389
390 struct acpi_table_ecdt {
391         struct acpi_table_header header;        /* Common ACPI table header */
392         struct acpi_generic_address control;    /* Address of EC command/status register */
393         struct acpi_generic_address data;       /* Address of EC data register */
394         u32 uid;                /* Unique ID - must be same as the EC _UID method */
395         u8 gpe;                 /* The GPE for the EC */
396         u8 id[1];               /* Full namepath of the EC in the ACPI namespace */
397 };
398
399 /*******************************************************************************
400  *
401  * EINJ - Error Injection Table
402  *
403  ******************************************************************************/
404
405 struct acpi_table_einj {
406         struct acpi_table_header header;        /* Common ACPI table header */
407         u32 header_length;
408         u32 reserved;
409         u32 entries;
410 };
411
412 /* EINJ Injection Instruction Entries (actions) */
413
414 struct acpi_einj_entry {
415         struct acpi_whea_header whea_header;    /* Common header for WHEA tables */
416 };
417
418 /* Values for Action field above */
419
420 enum acpi_einj_actions {
421         ACPI_EINJ_BEGIN_OPERATION = 0,
422         ACPI_EINJ_GET_TRIGGER_TABLE = 1,
423         ACPI_EINJ_SET_ERROR_TYPE = 2,
424         ACPI_EINJ_GET_ERROR_TYPE = 3,
425         ACPI_EINJ_END_OPERATION = 4,
426         ACPI_EINJ_EXECUTE_OPERATION = 5,
427         ACPI_EINJ_CHECK_BUSY_STATUS = 6,
428         ACPI_EINJ_GET_COMMAND_STATUS = 7,
429         ACPI_EINJ_ACTION_RESERVED = 8,  /* 8 and greater are reserved */
430         ACPI_EINJ_TRIGGER_ERROR = 0xFF  /* Except for this value */
431 };
432
433 /* Values for Instruction field above */
434
435 enum acpi_einj_instructions {
436         ACPI_EINJ_READ_REGISTER = 0,
437         ACPI_EINJ_READ_REGISTER_VALUE = 1,
438         ACPI_EINJ_WRITE_REGISTER = 2,
439         ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
440         ACPI_EINJ_NOOP = 4,
441         ACPI_EINJ_INSTRUCTION_RESERVED = 5      /* 5 and greater are reserved */
442 };
443
444 /*******************************************************************************
445  *
446  * ERST - Error Record Serialization Table
447  *
448  ******************************************************************************/
449
450 struct acpi_table_erst {
451         struct acpi_table_header header;        /* Common ACPI table header */
452         u32 header_length;
453         u32 reserved;
454         u32 entries;
455 };
456
457 /* ERST Serialization Entries (actions) */
458
459 struct acpi_erst_entry {
460         struct acpi_whea_header whea_header;    /* Common header for WHEA tables */
461 };
462
463 /* Values for Action field above */
464
465 enum acpi_erst_actions {
466         ACPI_ERST_BEGIN_WRITE_OPERATION = 0,
467         ACPI_ERST_BEGIN_READ_OPERATION = 1,
468         ACPI_ERST_BETGIN_CLEAR_OPERATION = 2,
469         ACPI_ERST_END_OPERATION = 3,
470         ACPI_ERST_SET_RECORD_OFFSET = 4,
471         ACPI_ERST_EXECUTE_OPERATION = 5,
472         ACPI_ERST_CHECK_BUSY_STATUS = 6,
473         ACPI_ERST_GET_COMMAND_STATUS = 7,
474         ACPI_ERST_GET_RECORD_IDENTIFIER = 8,
475         ACPI_ERST_SET_RECORD_IDENTIFIER = 9,
476         ACPI_ERST_GET_RECORD_COUNT = 10,
477         ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
478         ACPI_ERST_NOT_USED = 12,
479         ACPI_ERST_GET_ERROR_RANGE = 13,
480         ACPI_ERST_GET_ERROR_LENGTH = 14,
481         ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
482         ACPI_ERST_ACTION_RESERVED = 16  /* 16 and greater are reserved */
483 };
484
485 /* Values for Instruction field above */
486
487 enum acpi_erst_instructions {
488         ACPI_ERST_READ_REGISTER = 0,
489         ACPI_ERST_READ_REGISTER_VALUE = 1,
490         ACPI_ERST_WRITE_REGISTER = 2,
491         ACPI_ERST_WRITE_REGISTER_VALUE = 3,
492         ACPI_ERST_NOOP = 4,
493         ACPI_ERST_LOAD_VAR1 = 5,
494         ACPI_ERST_LOAD_VAR2 = 6,
495         ACPI_ERST_STORE_VAR1 = 7,
496         ACPI_ERST_ADD = 8,
497         ACPI_ERST_SUBTRACT = 9,
498         ACPI_ERST_ADD_VALUE = 10,
499         ACPI_ERST_SUBTRACT_VALUE = 11,
500         ACPI_ERST_STALL = 12,
501         ACPI_ERST_STALL_WHILE_TRUE = 13,
502         ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
503         ACPI_ERST_GOTO = 15,
504         ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
505         ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
506         ACPI_ERST_MOVE_DATA = 18,
507         ACPI_ERST_INSTRUCTION_RESERVED = 19     /* 19 and greater are reserved */
508 };
509
510 /*******************************************************************************
511  *
512  * HEST - Hardware Error Source Table
513  *
514  ******************************************************************************/
515
516 struct acpi_table_hest {
517         struct acpi_table_header header;        /* Common ACPI table header */
518         u32 error_source_count;
519 };
520
521 /* TBD: Need Error Source Descriptor layout */
522
523 /*******************************************************************************
524  *
525  * HPET - High Precision Event Timer table
526  *
527  ******************************************************************************/
528
529 struct acpi_table_hpet {
530         struct acpi_table_header header;        /* Common ACPI table header */
531         u32 id;                 /* Hardware ID of event timer block */
532         struct acpi_generic_address address;    /* Address of event timer block */
533         u8 sequence;            /* HPET sequence number */
534         u16 minimum_tick;       /* Main counter min tick, periodic mode */
535         u8 flags;
536 };
537
538 /*! Flags */
539
540 #define ACPI_HPET_PAGE_PROTECT      (1) /* 00: No page protection */
541 #define ACPI_HPET_PAGE_PROTECT_4    (1<<1)      /* 01: 4KB page protected */
542 #define ACPI_HPET_PAGE_PROTECT_64   (1<<2)      /* 02: 64KB page protected */
543
544 /*! [End] no source code translation !*/
545
546 /*******************************************************************************
547  *
548  * IBFT - i_sCSI Boot Firmware Table
549  *
550  ******************************************************************************/
551
552 struct acpi_table_ibft {
553         struct acpi_table_header header;        /* Common ACPI table header */
554         u8 reserved[12];
555 };
556
557 /* IBFT common subtable header */
558
559 struct acpi_ibft_header {
560         u8 type;
561         u8 version;
562         u16 length;
563         u8 index;
564         u8 flags;
565 };
566
567 /* Values for Type field above */
568
569 enum acpi_ibft_type {
570         ACPI_IBFT_TYPE_NOT_USED = 0,
571         ACPI_IBFT_TYPE_CONTROL = 1,
572         ACPI_IBFT_TYPE_INITIATOR = 2,
573         ACPI_IBFT_TYPE_NIC = 3,
574         ACPI_IBFT_TYPE_TARGET = 4,
575         ACPI_IBFT_TYPE_EXTENSIONS = 5,
576         ACPI_IBFT_TYPE_RESERVED = 6     /* 6 and greater are reserved */
577 };
578
579 /* IBFT subtables */
580
581 struct acpi_ibft_control {
582         struct acpi_ibft_header header;
583         u16 extensions;
584         u16 initiator_offset;
585         u16 nic0_offset;
586         u16 target0_offset;
587         u16 nic1_offset;
588         u16 target1_offset;
589 };
590
591 struct acpi_ibft_initiator {
592         struct acpi_ibft_header header;
593         u8 sns_server[16];
594         u8 slp_server[16];
595         u8 primary_server[16];
596         u8 secondary_server[16];
597         u16 name_length;
598         u16 name_offset;
599 };
600
601 struct acpi_ibft_nic {
602         struct acpi_ibft_header header;
603         u8 ip_address[16];
604         u8 subnet_mask_prefix;
605         u8 origin;
606         u8 gateway[16];
607         u8 primary_dns[16];
608         u8 secondary_dns[16];
609         u8 dhcp[16];
610         u16 vlan;
611         u8 mac_address[6];
612         u16 pci_address;
613         u16 name_length;
614         u16 name_offset;
615 };
616
617 struct acpi_ibft_target {
618         struct acpi_ibft_header header;
619         u8 target_ip_address[16];
620         u16 target_ip_socket;
621         u8 target_boot_lun[8];
622         u8 chap_type;
623         u8 nic_association;
624         u16 target_name_length;
625         u16 target_name_offset;
626         u16 chap_name_length;
627         u16 chap_name_offset;
628         u16 chap_secret_length;
629         u16 chap_secret_offset;
630         u16 reverse_chap_name_length;
631         u16 reverse_chap_name_offset;
632         u16 reverse_chap_secret_length;
633         u16 reverse_chap_secret_offset;
634 };
635
636 /*******************************************************************************
637  *
638  * MADT - Multiple APIC Description Table
639  *
640  ******************************************************************************/
641
642 struct acpi_table_madt {
643         struct acpi_table_header header;        /* Common ACPI table header */
644         u32 address;            /* Physical address of local APIC */
645         u32 flags;
646 };
647
648 /* Flags */
649
650 #define ACPI_MADT_PCAT_COMPAT       (1) /* 00:    System also has dual 8259s */
651
652 /* Values for PCATCompat flag */
653
654 #define ACPI_MADT_DUAL_PIC          0
655 #define ACPI_MADT_MULTIPLE_APIC     1
656
657 /* Values for subtable type in struct acpi_subtable_header */
658
659 enum acpi_madt_type {
660         ACPI_MADT_TYPE_LOCAL_APIC = 0,
661         ACPI_MADT_TYPE_IO_APIC = 1,
662         ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
663         ACPI_MADT_TYPE_NMI_SOURCE = 3,
664         ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
665         ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
666         ACPI_MADT_TYPE_IO_SAPIC = 6,
667         ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
668         ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
669         ACPI_MADT_TYPE_RESERVED = 9     /* 9 and greater are reserved */
670 };
671
672 /*
673  * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
674  */
675
676 /* 0: Processor Local APIC */
677
678 struct acpi_madt_local_apic {
679         struct acpi_subtable_header header;
680         u8 processor_id;        /* ACPI processor id */
681         u8 id;                  /* Processor's local APIC id */
682         u32 lapic_flags;
683 };
684
685 /* 1: IO APIC */
686
687 struct acpi_madt_io_apic {
688         struct acpi_subtable_header header;
689         u8 id;                  /* I/O APIC ID */
690         u8 reserved;            /* Reserved - must be zero */
691         u32 address;            /* APIC physical address */
692         u32 global_irq_base;    /* Global system interrupt where INTI lines start */
693 };
694
695 /* 2: Interrupt Override */
696
697 struct acpi_madt_interrupt_override {
698         struct acpi_subtable_header header;
699         u8 bus;                 /* 0 - ISA */
700         u8 source_irq;          /* Interrupt source (IRQ) */
701         u32 global_irq;         /* Global system interrupt */
702         u16 inti_flags;
703 };
704
705 /* 3: NMI Source */
706
707 struct acpi_madt_nmi_source {
708         struct acpi_subtable_header header;
709         u16 inti_flags;
710         u32 global_irq;         /* Global system interrupt */
711 };
712
713 /* 4: Local APIC NMI */
714
715 struct acpi_madt_local_apic_nmi {
716         struct acpi_subtable_header header;
717         u8 processor_id;        /* ACPI processor id */
718         u16 inti_flags;
719         u8 lint;                /* LINTn to which NMI is connected */
720 };
721
722 /* 5: Address Override */
723
724 struct acpi_madt_local_apic_override {
725         struct acpi_subtable_header header;
726         u16 reserved;           /* Reserved, must be zero */
727         u64 address;            /* APIC physical address */
728 };
729
730 /* 6: I/O Sapic */
731
732 struct acpi_madt_io_sapic {
733         struct acpi_subtable_header header;
734         u8 id;                  /* I/O SAPIC ID */
735         u8 reserved;            /* Reserved, must be zero */
736         u32 global_irq_base;    /* Global interrupt for SAPIC start */
737         u64 address;            /* SAPIC physical address */
738 };
739
740 /* 7: Local Sapic */
741
742 struct acpi_madt_local_sapic {
743         struct acpi_subtable_header header;
744         u8 processor_id;        /* ACPI processor id */
745         u8 id;                  /* SAPIC ID */
746         u8 eid;                 /* SAPIC EID */
747         u8 reserved[3];         /* Reserved, must be zero */
748         u32 lapic_flags;
749         u32 uid;                /* Numeric UID - ACPI 3.0 */
750         char uid_string[1];     /* String UID  - ACPI 3.0 */
751 };
752
753 /* 8: Platform Interrupt Source */
754
755 struct acpi_madt_interrupt_source {
756         struct acpi_subtable_header header;
757         u16 inti_flags;
758         u8 type;                /* 1=PMI, 2=INIT, 3=corrected */
759         u8 id;                  /* Processor ID */
760         u8 eid;                 /* Processor EID */
761         u8 io_sapic_vector;     /* Vector value for PMI interrupts */
762         u32 global_irq;         /* Global system interrupt */
763         u32 flags;              /* Interrupt Source Flags */
764 };
765
766 /* Flags field above */
767
768 #define ACPI_MADT_CPEI_OVERRIDE     (1)
769
770 /*
771  * Common flags fields for MADT subtables
772  */
773
774 /* MADT Local APIC flags (lapic_flags) */
775
776 #define ACPI_MADT_ENABLED           (1) /* 00: Processor is usable if set */
777
778 /* MADT MPS INTI flags (inti_flags) */
779
780 #define ACPI_MADT_POLARITY_MASK     (3) /* 00-01: Polarity of APIC I/O input signals */
781 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
782
783 /* Values for MPS INTI flags */
784
785 #define ACPI_MADT_POLARITY_CONFORMS       0
786 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
787 #define ACPI_MADT_POLARITY_RESERVED       2
788 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
789
790 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
791 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
792 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
793 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
794
795 /*******************************************************************************
796  *
797  * MCFG - PCI Memory Mapped Configuration table and sub-table
798  *
799  ******************************************************************************/
800
801 struct acpi_table_mcfg {
802         struct acpi_table_header header;        /* Common ACPI table header */
803         u8 reserved[8];
804 };
805
806 /* Subtable */
807
808 struct acpi_mcfg_allocation {
809         u64 address;            /* Base address, processor-relative */
810         u16 pci_segment;        /* PCI segment group number */
811         u8 start_bus_number;    /* Starting PCI Bus number */
812         u8 end_bus_number;      /* Final PCI Bus number */
813         u32 reserved;
814 };
815
816 /*******************************************************************************
817  *
818  * SBST - Smart Battery Specification Table
819  *
820  ******************************************************************************/
821
822 struct acpi_table_sbst {
823         struct acpi_table_header header;        /* Common ACPI table header */
824         u32 warning_level;
825         u32 low_level;
826         u32 critical_level;
827 };
828
829 /*******************************************************************************
830  *
831  * SLIT - System Locality Distance Information Table
832  *
833  ******************************************************************************/
834
835 struct acpi_table_slit {
836         struct acpi_table_header header;        /* Common ACPI table header */
837         u64 locality_count;
838         u8 entry[1];            /* Real size = localities^2 */
839 };
840
841 /*******************************************************************************
842  *
843  * SPCR - Serial Port Console Redirection table
844  *
845  ******************************************************************************/
846
847 struct acpi_table_spcr {
848         struct acpi_table_header header;        /* Common ACPI table header */
849         u8 interface_type;      /* 0=full 16550, 1=subset of 16550 */
850         u8 reserved[3];
851         struct acpi_generic_address serial_port;
852         u8 interrupt_type;
853         u8 pc_interrupt;
854         u32 interrupt;
855         u8 baud_rate;
856         u8 parity;
857         u8 stop_bits;
858         u8 flow_control;
859         u8 terminal_type;
860         u8 reserved1;
861         u16 pci_device_id;
862         u16 pci_vendor_id;
863         u8 pci_bus;
864         u8 pci_device;
865         u8 pci_function;
866         u32 pci_flags;
867         u8 pci_segment;
868         u32 reserved2;
869 };
870
871 /*******************************************************************************
872  *
873  * SPMI - Server Platform Management Interface table
874  *
875  ******************************************************************************/
876
877 struct acpi_table_spmi {
878         struct acpi_table_header header;        /* Common ACPI table header */
879         u8 reserved;
880         u8 interface_type;
881         u16 spec_revision;      /* Version of IPMI */
882         u8 interrupt_type;
883         u8 gpe_number;          /* GPE assigned */
884         u8 reserved1;
885         u8 pci_device_flag;
886         u32 interrupt;
887         struct acpi_generic_address ipmi_register;
888         u8 pci_segment;
889         u8 pci_bus;
890         u8 pci_device;
891         u8 pci_function;
892 };
893
894 /*******************************************************************************
895  *
896  * SRAT - System Resource Affinity Table
897  *
898  ******************************************************************************/
899
900 struct acpi_table_srat {
901         struct acpi_table_header header;        /* Common ACPI table header */
902         u32 table_revision;     /* Must be value '1' */
903         u64 reserved;           /* Reserved, must be zero */
904 };
905
906 /* Values for subtable type in struct acpi_subtable_header */
907
908 enum acpi_srat_type {
909         ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
910         ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
911         ACPI_SRAT_TYPE_RESERVED = 2
912 };
913
914 /* SRAT sub-tables */
915
916 struct acpi_srat_cpu_affinity {
917         struct acpi_subtable_header header;
918         u8 proximity_domain_lo;
919         u8 apic_id;
920         u32 flags;
921         u8 local_sapic_eid;
922         u8 proximity_domain_hi[3];
923         u32 reserved;           /* Reserved, must be zero */
924 };
925
926 /* Flags */
927
928 #define ACPI_SRAT_CPU_ENABLED       (1) /* 00: Use affinity structure */
929
930 struct acpi_srat_mem_affinity {
931         struct acpi_subtable_header header;
932         u32 proximity_domain;
933         u16 reserved;           /* Reserved, must be zero */
934         u64 base_address;
935         u64 length;
936         u32 memory_type;        /* See acpi_address_range_id */
937         u32 flags;
938         u64 reserved1;          /* Reserved, must be zero */
939 };
940
941 /* Flags */
942
943 #define ACPI_SRAT_MEM_ENABLED       (1) /* 00: Use affinity structure */
944 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
945 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
946
947 /*******************************************************************************
948  *
949  * TCPA - Trusted Computing Platform Alliance table
950  *
951  ******************************************************************************/
952
953 struct acpi_table_tcpa {
954         struct acpi_table_header header;        /* Common ACPI table header */
955         u16 reserved;
956         u32 max_log_length;     /* Maximum length for the event log area */
957         u64 log_address;        /* Address of the event log area */
958 };
959
960 /*******************************************************************************
961  *
962  * UEFI - UEFI Boot optimization Table
963  *
964  ******************************************************************************/
965
966 struct acpi_table_uefi {
967         struct acpi_table_header header;        /* Common ACPI table header */
968         u8 identifier[16];      /* UUID identifier */
969         u16 data_offset;        /* Offset of remaining data in table */
970         u8 data;
971 };
972
973 /*******************************************************************************
974  *
975  * WDAT - Watchdog Action Table
976  *
977  ******************************************************************************/
978
979 struct acpi_table_wdat {
980         struct acpi_table_header header;        /* Common ACPI table header */
981         u32 header_length;      /* Watchdog Header Length */
982         u16 pci_segment;        /* PCI Segment number */
983         u8 pci_bus;             /* PCI Bus number */
984         u8 pci_device;          /* PCI Device number */
985         u8 pci_function;        /* PCI Function number */
986         u8 reserved[3];
987         u32 timer_period;       /* Period of one timer count (msec) */
988         u32 max_count;          /* Maximum counter value supported */
989         u32 min_count;          /* Minimum counter value */
990         u8 flags;
991         u8 reserved2[3];
992         u32 entries;            /* Number of watchdog entries that follow */
993 };
994
995 /* WDAT Instruction Entries (actions) */
996
997 struct acpi_wdat_entry {
998         struct acpi_whea_header whea_header;    /* Common header for WHEA tables */
999 };
1000
1001 /* Values for Action field above */
1002
1003 enum acpi_wdat_actions {
1004         ACPI_WDAT_RESET = 1,
1005         ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1006         ACPI_WDAT_GET_COUNTDOWN = 5,
1007         ACPI_WDAT_SET_COUNTDOWN = 6,
1008         ACPI_WDAT_GET_RUNNING_STATE = 8,
1009         ACPI_WDAT_SET_RUNNING_STATE = 9,
1010         ACPI_WDAT_GET_STOPPED_STATE = 10,
1011         ACPI_WDAT_SET_STOPPED_STATE = 11,
1012         ACPI_WDAT_GET_REBOOT = 16,
1013         ACPI_WDAT_SET_REBOOT = 17,
1014         ACPI_WDAT_GET_SHUTDOWN = 18,
1015         ACPI_WDAT_SET_SHUTDOWN = 19,
1016         ACPI_WDAT_GET_STATUS = 32,
1017         ACPI_WDAT_SET_STATUS = 33,
1018         ACPI_WDAT_ACTION_RESERVED = 34  /* 34 and greater are reserved */
1019 };
1020
1021 /* Values for Instruction field above */
1022
1023 enum acpi_wdat_instructions {
1024         ACPI_WDAT_READ_VALUE = 0,
1025         ACPI_WDAT_READ_COUNTDOWN = 1,
1026         ACPI_WDAT_WRITE_VALUE = 2,
1027         ACPI_WDAT_WRITE_COUNTDOWN = 3,
1028         ACPI_WDAT_INSTRUCTION_RESERVED = 4,     /* 4 and greater are reserved */
1029         ACPI_WDAT_PRESERVE_REGISTER = 0x80      /* Except for this value */
1030 };
1031
1032 /*******************************************************************************
1033  *
1034  * WDRT - Watchdog Resource Table
1035  *
1036  ******************************************************************************/
1037
1038 struct acpi_table_wdrt {
1039         struct acpi_table_header header;        /* Common ACPI table header */
1040         u32 header_length;      /* Watchdog Header Length */
1041         u8 pci_segment;         /* PCI Segment number */
1042         u8 pci_bus;             /* PCI Bus number */
1043         u8 pci_device;          /* PCI Device number */
1044         u8 pci_function;        /* PCI Function number */
1045         u32 timer_period;       /* Period of one timer count (msec) */
1046         u32 max_count;          /* Maximum counter value supported */
1047         u32 min_count;          /* Minimum counter value */
1048         u8 flags;
1049         u8 reserved[3];
1050         u32 entries;            /* Number of watchdog entries that follow */
1051 };
1052
1053 /* Flags */
1054
1055 #define ACPI_WDRT_TIMER_ENABLED     (1) /* 00: Timer enabled */
1056
1057 /* Reset to default packing */
1058
1059 #pragma pack()
1060
1061 #endif                          /* __ACTBL1_H__ */