1 /******************************************************************************
2  *
3  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2011, Intel Corp.
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 __ACTBL2_H__
45 #define __ACTBL2_H__
46 
47 /*******************************************************************************
48  *
49  * Additional ACPI Tables (2)
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  * The tables in this file are defined by third-party specifications, and are
55  * not defined directly by the ACPI specification itself.
56  *
57  ******************************************************************************/
58 
59 /*
60  * Values for description table header signatures for tables defined in this
61  * file. Useful because they make it more difficult to inadvertently type in
62  * the wrong signature.
63  */
64 #define ACPI_SIG_ASF            "ASF!"	/* Alert Standard Format table */
65 #define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
66 #define ACPI_SIG_DBG2           "DBG2"	/* Debug Port table type 2 */
67 #define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
68 #define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
69 #define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
70 #define ACPI_SIG_IBFT           "IBFT"	/* i_sCSI Boot Firmware Table */
71 #define ACPI_SIG_IORT           "IORT"	/* IO Remapping Table */
72 #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
73 #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
74 #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
75 #define ACPI_SIG_SLIC           "SLIC"	/* Software Licensing Description Table */
76 #define ACPI_SIG_SPCR           "SPCR"	/* Serial Port Console Redirection table */
77 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
78 #define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
79 #define ACPI_SIG_UEFI           "UEFI"	/* Uefi Boot Optimization Table */
80 #define ACPI_SIG_WAET           "WAET"	/* Windows ACPI Emulated devices Table */
81 #define ACPI_SIG_WDAT           "WDAT"	/* Watchdog Action Table */
82 #define ACPI_SIG_WDDT           "WDDT"	/* Watchdog Timer Description Table */
83 #define ACPI_SIG_WDRT           "WDRT"	/* Watchdog Resource Table */
84 
85 #ifdef ACPI_UNDEFINED_TABLES
86 /*
87  * These tables have been seen in the field, but no definition has been found
88  */
89 #define ACPI_SIG_ATKG           "ATKG"
90 #define ACPI_SIG_GSCI           "GSCI"	/* GMCH SCI table */
91 #define ACPI_SIG_IEIT           "IEIT"
92 #endif
93 
94 /*
95  * All tables must be byte-packed to match the ACPI specification, since
96  * the tables are provided by the system BIOS.
97  */
98 #pragma pack(1)
99 
100 /*
101  * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
102  * This is the only type that is even remotely portable. Anything else is not
103  * portable, so do not use any other bitfield types.
104  */
105 
106 /*******************************************************************************
107  *
108  * ASF - Alert Standard Format table (Signature "ASF!")
109  *       Revision 0x10
110  *
111  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
112  *
113  ******************************************************************************/
114 
115 struct acpi_table_asf {
116 	struct acpi_table_header header;	/* Common ACPI table header */
117 };
118 
119 /* ASF subtable header */
120 
121 struct acpi_asf_header {
122 	u8 type;
123 	u8 reserved;
124 	u16 length;
125 };
126 
127 /* Values for Type field above */
128 
129 enum acpi_asf_type {
130 	ACPI_ASF_TYPE_INFO = 0,
131 	ACPI_ASF_TYPE_ALERT = 1,
132 	ACPI_ASF_TYPE_CONTROL = 2,
133 	ACPI_ASF_TYPE_BOOT = 3,
134 	ACPI_ASF_TYPE_ADDRESS = 4,
135 	ACPI_ASF_TYPE_RESERVED = 5
136 };
137 
138 /*
139  * ASF subtables
140  */
141 
142 /* 0: ASF Information */
143 
144 struct acpi_asf_info {
145 	struct acpi_asf_header header;
146 	u8 min_reset_value;
147 	u8 min_poll_interval;
148 	u16 system_id;
149 	u32 mfg_id;
150 	u8 flags;
151 	u8 reserved2[3];
152 };
153 
154 /* Masks for Flags field above */
155 
156 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
157 
158 /* 1: ASF Alerts */
159 
160 struct acpi_asf_alert {
161 	struct acpi_asf_header header;
162 	u8 assert_mask;
163 	u8 deassert_mask;
164 	u8 alerts;
165 	u8 data_length;
166 };
167 
168 struct acpi_asf_alert_data {
169 	u8 address;
170 	u8 command;
171 	u8 mask;
172 	u8 value;
173 	u8 sensor_type;
174 	u8 type;
175 	u8 offset;
176 	u8 source_type;
177 	u8 severity;
178 	u8 sensor_number;
179 	u8 entity;
180 	u8 instance;
181 };
182 
183 /* 2: ASF Remote Control */
184 
185 struct acpi_asf_remote {
186 	struct acpi_asf_header header;
187 	u8 controls;
188 	u8 data_length;
189 	u16 reserved2;
190 };
191 
192 struct acpi_asf_control_data {
193 	u8 function;
194 	u8 address;
195 	u8 command;
196 	u8 value;
197 };
198 
199 /* 3: ASF RMCP Boot Options */
200 
201 struct acpi_asf_rmcp {
202 	struct acpi_asf_header header;
203 	u8 capabilities[7];
204 	u8 completion_code;
205 	u32 enterprise_id;
206 	u8 command;
207 	u16 parameter;
208 	u16 boot_options;
209 	u16 oem_parameters;
210 };
211 
212 /* 4: ASF Address */
213 
214 struct acpi_asf_address {
215 	struct acpi_asf_header header;
216 	u8 eprom_address;
217 	u8 devices;
218 };
219 
220 /*******************************************************************************
221  *
222  * BOOT - Simple Boot Flag Table
223  *        Version 1
224  *
225  * Conforms to the "Simple Boot Flag Specification", Version 2.1
226  *
227  ******************************************************************************/
228 
229 struct acpi_table_boot {
230 	struct acpi_table_header header;	/* Common ACPI table header */
231 	u8 cmos_index;		/* Index in CMOS RAM for the boot register */
232 	u8 reserved[3];
233 };
234 
235 /*******************************************************************************
236  *
237  * DBG2 - Debug Port Table 2
238  *        Version 0 (Both main table and subtables)
239  *
240  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
241  *
242  ******************************************************************************/
243 
244 struct acpi_table_dbg2 {
245 	struct acpi_table_header header;	/* Common ACPI table header */
246 	u32 info_offset;
247 	u32 info_count;
248 };
249 
250 /* Debug Device Information Subtable */
251 
252 struct acpi_dbg2_device {
253 	u8 revision;
254 	u16 length;
255 	u8 register_count;	/* Number of base_address registers */
256 	u16 namepath_length;
257 	u16 namepath_offset;
258 	u16 oem_data_length;
259 	u16 oem_data_offset;
260 	u16 port_type;
261 	u16 port_subtype;
262 	u16 reserved;
263 	u16 base_address_offset;
264 	u16 address_size_offset;
265 	/*
266 	 * Data that follows:
267 	 *    base_address (required) - Each in 12-byte Generic Address Structure format.
268 	 *    address_size (required) - Array of u32 sizes corresponding to each base_address register.
269 	 *    Namepath    (required) - Null terminated string. Single dot if not supported.
270 	 *    oem_data    (optional) - Length is oem_data_length.
271 	 */
272 };
273 
274 /* Types for port_type field above */
275 
276 #define ACPI_DBG2_SERIAL_PORT       0x8000
277 #define ACPI_DBG2_1394_PORT         0x8001
278 #define ACPI_DBG2_USB_PORT          0x8002
279 #define ACPI_DBG2_NET_PORT          0x8003
280 
281 /* Subtypes for port_subtype field above */
282 
283 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
284 #define ACPI_DBG2_16550_SUBSET      0x0001
285 #define ACPI_DBG2_PL011             0x0003
286 #define ACPI_DBG2_SBSA_32           0x000d
287 #define ACPI_DBG2_SBSA              0x000e
288 #define ACPI_DBG2_DCC               0x000f
289 #define ACPI_DBG2_BCM2835           0x0010
290 
291 #define ACPI_DBG2_1394_STANDARD     0x0000
292 
293 #define ACPI_DBG2_USB_XHCI          0x0000
294 #define ACPI_DBG2_USB_EHCI          0x0001
295 
296 /*******************************************************************************
297  *
298  * DBGP - Debug Port table
299  *        Version 1
300  *
301  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
302  *
303  ******************************************************************************/
304 
305 struct acpi_table_dbgp {
306 	struct acpi_table_header header;	/* Common ACPI table header */
307 	u8 type;		/* 0=full 16550, 1=subset of 16550 */
308 	u8 reserved[3];
309 	struct acpi_generic_address debug_port;
310 };
311 
312 /*******************************************************************************
313  *
314  * DMAR - DMA Remapping table
315  *        Version 1
316  *
317  * Conforms to "Intel Virtualization Technology for Directed I/O",
318  * Version 1.2, Sept. 2008
319  *
320  ******************************************************************************/
321 
322 struct acpi_table_dmar {
323 	struct acpi_table_header header;	/* Common ACPI table header */
324 	u8 width;		/* Host Address Width */
325 	u8 flags;
326 	u8 reserved[10];
327 };
328 
329 /* Masks for Flags field above */
330 
331 #define ACPI_DMAR_INTR_REMAP        (1)
332 #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
333 
334 /* DMAR subtable header */
335 
336 struct acpi_dmar_header {
337 	u16 type;
338 	u16 length;
339 };
340 
341 /* Values for subtable type in struct acpi_dmar_header */
342 
343 enum acpi_dmar_type {
344 	ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
345 	ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
346 	ACPI_DMAR_TYPE_ATSR = 2,
347 	ACPI_DMAR_HARDWARE_AFFINITY = 3,
348 	ACPI_DMAR_TYPE_RESERVED = 4	/* 4 and greater are reserved */
349 };
350 
351 /* DMAR Device Scope structure */
352 
353 struct acpi_dmar_device_scope {
354 	u8 entry_type;
355 	u8 length;
356 	u16 reserved;
357 	u8 enumeration_id;
358 	u8 bus;
359 };
360 
361 /* Values for entry_type in struct acpi_dmar_device_scope */
362 
363 enum acpi_dmar_scope_type {
364 	ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
365 	ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
366 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
367 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
368 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
369 };
370 
371 struct acpi_dmar_pci_path {
372 	u8 dev;
373 	u8 fn;
374 };
375 
376 /*
377  * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
378  */
379 
380 /* 0: Hardware Unit Definition */
381 
382 struct acpi_dmar_hardware_unit {
383 	struct acpi_dmar_header header;
384 	u8 flags;
385 	u8 reserved;
386 	u16 segment;
387 	u64 address;		/* Register Base Address */
388 };
389 
390 /* Masks for Flags field above */
391 
392 #define ACPI_DMAR_INCLUDE_ALL       (1)
393 
394 /* 1: Reserved Memory Defininition */
395 
396 struct acpi_dmar_reserved_memory {
397 	struct acpi_dmar_header header;
398 	u16 reserved;
399 	u16 segment;
400 	u64 base_address;	/* 4_k aligned base address */
401 	u64 end_address;	/* 4_k aligned limit address */
402 };
403 
404 /* Masks for Flags field above */
405 
406 #define ACPI_DMAR_ALLOW_ALL         (1)
407 
408 /* 2: Root Port ATS Capability Reporting Structure */
409 
410 struct acpi_dmar_atsr {
411 	struct acpi_dmar_header header;
412 	u8 flags;
413 	u8 reserved;
414 	u16 segment;
415 };
416 
417 /* Masks for Flags field above */
418 
419 #define ACPI_DMAR_ALL_PORTS         (1)
420 
421 /* 3: Remapping Hardware Static Affinity Structure */
422 
423 struct acpi_dmar_rhsa {
424 	struct acpi_dmar_header header;
425 	u32 reserved;
426 	u64 base_address;
427 	u32 proximity_domain;
428 };
429 
430 /*******************************************************************************
431  *
432  * HPET - High Precision Event Timer table
433  *        Version 1
434  *
435  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
436  * Version 1.0a, October 2004
437  *
438  ******************************************************************************/
439 
440 struct acpi_table_hpet {
441 	struct acpi_table_header header;	/* Common ACPI table header */
442 	u32 id;			/* Hardware ID of event timer block */
443 	struct acpi_generic_address address;	/* Address of event timer block */
444 	u8 sequence;		/* HPET sequence number */
445 	u16 minimum_tick;	/* Main counter min tick, periodic mode */
446 	u8 flags;
447 };
448 
449 /* Masks for Flags field above */
450 
451 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
452 
453 /* Values for Page Protect flags */
454 
455 enum acpi_hpet_page_protect {
456 	ACPI_HPET_NO_PAGE_PROTECT = 0,
457 	ACPI_HPET_PAGE_PROTECT4 = 1,
458 	ACPI_HPET_PAGE_PROTECT64 = 2
459 };
460 
461 /*******************************************************************************
462  *
463  * IBFT - Boot Firmware Table
464  *        Version 1
465  *
466  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
467  * Specification", Version 1.01, March 1, 2007
468  *
469  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
470  * Therefore, it is not currently supported by the disassembler.
471  *
472  ******************************************************************************/
473 
474 struct acpi_table_ibft {
475 	struct acpi_table_header header;	/* Common ACPI table header */
476 	u8 reserved[12];
477 };
478 
479 /* IBFT common subtable header */
480 
481 struct acpi_ibft_header {
482 	u8 type;
483 	u8 version;
484 	u16 length;
485 	u8 index;
486 	u8 flags;
487 };
488 
489 /* Values for Type field above */
490 
491 enum acpi_ibft_type {
492 	ACPI_IBFT_TYPE_NOT_USED = 0,
493 	ACPI_IBFT_TYPE_CONTROL = 1,
494 	ACPI_IBFT_TYPE_INITIATOR = 2,
495 	ACPI_IBFT_TYPE_NIC = 3,
496 	ACPI_IBFT_TYPE_TARGET = 4,
497 	ACPI_IBFT_TYPE_EXTENSIONS = 5,
498 	ACPI_IBFT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
499 };
500 
501 /* IBFT subtables */
502 
503 struct acpi_ibft_control {
504 	struct acpi_ibft_header header;
505 	u16 extensions;
506 	u16 initiator_offset;
507 	u16 nic0_offset;
508 	u16 target0_offset;
509 	u16 nic1_offset;
510 	u16 target1_offset;
511 };
512 
513 struct acpi_ibft_initiator {
514 	struct acpi_ibft_header header;
515 	u8 sns_server[16];
516 	u8 slp_server[16];
517 	u8 primary_server[16];
518 	u8 secondary_server[16];
519 	u16 name_length;
520 	u16 name_offset;
521 };
522 
523 struct acpi_ibft_nic {
524 	struct acpi_ibft_header header;
525 	u8 ip_address[16];
526 	u8 subnet_mask_prefix;
527 	u8 origin;
528 	u8 gateway[16];
529 	u8 primary_dns[16];
530 	u8 secondary_dns[16];
531 	u8 dhcp[16];
532 	u16 vlan;
533 	u8 mac_address[6];
534 	u16 pci_address;
535 	u16 name_length;
536 	u16 name_offset;
537 };
538 
539 struct acpi_ibft_target {
540 	struct acpi_ibft_header header;
541 	u8 target_ip_address[16];
542 	u16 target_ip_socket;
543 	u8 target_boot_lun[8];
544 	u8 chap_type;
545 	u8 nic_association;
546 	u16 target_name_length;
547 	u16 target_name_offset;
548 	u16 chap_name_length;
549 	u16 chap_name_offset;
550 	u16 chap_secret_length;
551 	u16 chap_secret_offset;
552 	u16 reverse_chap_name_length;
553 	u16 reverse_chap_name_offset;
554 	u16 reverse_chap_secret_length;
555 	u16 reverse_chap_secret_offset;
556 };
557 
558 /*******************************************************************************
559  *
560  * IORT - IO Remapping Table
561  *
562  * Conforms to "IO Remapping Table System Software on ARM Platforms",
563  * Document number: ARM DEN 0049B, October 2015
564  *
565  ******************************************************************************/
566 
567 struct acpi_table_iort {
568 	struct acpi_table_header header;
569 	u32 node_count;
570 	u32 node_offset;
571 	u32 reserved;
572 };
573 
574 /*
575  * IORT subtables
576  */
577 struct acpi_iort_node {
578 	u8 type;
579 	u16 length;
580 	u8 revision;
581 	u32 reserved;
582 	u32 mapping_count;
583 	u32 mapping_offset;
584 	char node_data[1];
585 };
586 
587 /* Values for subtable Type above */
588 
589 enum acpi_iort_node_type {
590 	ACPI_IORT_NODE_ITS_GROUP = 0x00,
591 	ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
592 	ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
593 	ACPI_IORT_NODE_SMMU = 0x03,
594 	ACPI_IORT_NODE_SMMU_V3 = 0x04
595 };
596 
597 struct acpi_iort_id_mapping {
598 	u32 input_base;		/* Lowest value in input range */
599 	u32 id_count;		/* Number of IDs */
600 	u32 output_base;	/* Lowest value in output range */
601 	u32 output_reference;	/* A reference to the output node */
602 	u32 flags;
603 };
604 
605 /* Masks for Flags field above for IORT subtable */
606 
607 #define ACPI_IORT_ID_SINGLE_MAPPING (1)
608 
609 struct acpi_iort_memory_access {
610 	u32 cache_coherency;
611 	u8 hints;
612 	u16 reserved;
613 	u8 memory_flags;
614 };
615 
616 /* Values for cache_coherency field above */
617 
618 #define ACPI_IORT_NODE_COHERENT         0x00000001	/* The device node is fully coherent */
619 #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000	/* The device node is not coherent */
620 
621 /* Masks for Hints field above */
622 
623 #define ACPI_IORT_HT_TRANSIENT          (1)
624 #define ACPI_IORT_HT_WRITE              (1<<1)
625 #define ACPI_IORT_HT_READ               (1<<2)
626 #define ACPI_IORT_HT_OVERRIDE           (1<<3)
627 
628 /* Masks for memory_flags field above */
629 
630 #define ACPI_IORT_MF_COHERENCY          (1)
631 #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
632 
633 /*
634  * IORT node specific subtables
635  */
636 struct acpi_iort_its_group {
637 	u32 its_count;
638 	u32 identifiers[1];	/* GIC ITS identifier arrary */
639 };
640 
641 struct acpi_iort_named_component {
642 	u32 node_flags;
643 	u64 memory_properties;	/* Memory access properties */
644 	u8 memory_address_limit;	/* Memory address size limit */
645 	char device_name[1];	/* Path of namespace object */
646 };
647 
648 struct acpi_iort_root_complex {
649 	u64 memory_properties;	/* Memory access properties */
650 	u32 ats_attribute;
651 	u32 pci_segment_number;
652 };
653 
654 /* Values for ats_attribute field above */
655 
656 #define ACPI_IORT_ATS_SUPPORTED         0x00000001	/* The root complex supports ATS */
657 #define ACPI_IORT_ATS_UNSUPPORTED       0x00000000	/* The root complex doesn't support ATS */
658 
659 struct acpi_iort_smmu {
660 	u64 base_address;	/* SMMU base address */
661 	u64 span;		/* Length of memory range */
662 	u32 model;
663 	u32 flags;
664 	u32 global_interrupt_offset;
665 	u32 context_interrupt_count;
666 	u32 context_interrupt_offset;
667 	u32 pmu_interrupt_count;
668 	u32 pmu_interrupt_offset;
669 	u64 interrupts[1];	/* Interrupt array */
670 };
671 
672 /* Values for Model field above */
673 
674 #define ACPI_IORT_SMMU_V1               0x00000000	/* Generic SMMUv1 */
675 #define ACPI_IORT_SMMU_V2               0x00000001	/* Generic SMMUv2 */
676 #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002	/* ARM Corelink MMU-400 */
677 #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003	/* ARM Corelink MMU-500 */
678 
679 /* Masks for Flags field above */
680 
681 #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
682 #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
683 
684 struct acpi_iort_smmu_v3 {
685 	u64 base_address;	/* SMMUv3 base address */
686 	u32 flags;
687 	u32 reserved;
688 	u64 vatos_address;
689 	u32 model;		/* O: generic SMMUv3 */
690 	u32 event_gsiv;
691 	u32 pri_gsiv;
692 	u32 gerr_gsiv;
693 	u32 sync_gsiv;
694 };
695 
696 /* Masks for Flags field above */
697 
698 #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
699 #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (1<<1)
700 
701 /*******************************************************************************
702  *
703  * IVRS - I/O Virtualization Reporting Structure
704  *        Version 1
705  *
706  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
707  * Revision 1.26, February 2009.
708  *
709  ******************************************************************************/
710 
711 struct acpi_table_ivrs {
712 	struct acpi_table_header header;	/* Common ACPI table header */
713 	u32 info;		/* Common virtualization info */
714 	u64 reserved;
715 };
716 
717 /* Values for Info field above */
718 
719 #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00	/* 7 bits, physical address size */
720 #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000	/* 7 bits, virtual address size */
721 #define ACPI_IVRS_ATS_RESERVED      0x00400000	/* ATS address translation range reserved */
722 
723 /* IVRS subtable header */
724 
725 struct acpi_ivrs_header {
726 	u8 type;		/* Subtable type */
727 	u8 flags;
728 	u16 length;		/* Subtable length */
729 	u16 device_id;		/* ID of IOMMU */
730 };
731 
732 /* Values for subtable Type above */
733 
734 enum acpi_ivrs_type {
735 	ACPI_IVRS_TYPE_HARDWARE = 0x10,
736 	ACPI_IVRS_TYPE_HARDWARE_11H = 0x11,
737 	ACPI_IVRS_TYPE_MEMORY_ALL /* _MEMORY1 */ = 0x20,
738 	ACPI_IVRS_TYPE_MEMORY_ONE /* _MEMORY2 */ = 0x21,
739 	ACPI_IVRS_TYPE_MEMORY_RANGE /* _MEMORY3 */ = 0x22,
740 	ACPI_IVRS_TYPE_MEMORY_IOMMU = 0x23
741 };
742 
743 /* Masks for Flags field above for IVHD subtable */
744 
745 #define ACPI_IVHD_TT_ENABLE         (1)
746 #define ACPI_IVHD_PASS_PW           (1<<1)
747 #define ACPI_IVHD_RES_PASS_PW       (1<<2)
748 #define ACPI_IVHD_ISOC              (1<<3)
749 #define ACPI_IVHD_IOTLB             (1<<4)
750 
751 /* Masks for Flags field above for IVMD subtable */
752 
753 #define ACPI_IVMD_UNITY             (1)
754 #define ACPI_IVMD_READ              (1<<1)
755 #define ACPI_IVMD_WRITE             (1<<2)
756 #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
757 
758 /*
759  * IVRS subtables, correspond to Type in struct acpi_ivrs_header
760  */
761 
762 /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
763 
764 struct acpi_ivrs_hardware {
765 	struct acpi_ivrs_header header;
766 	u16 capability_offset;	/* Offset for IOMMU control fields */
767 	u64 base_address;	/* IOMMU control registers */
768 	u16 pci_segment_group;
769 	u16 info;		/* MSI number and unit ID */
770 	u32 iommu_attr;
771 	u64 efr_image;		/* Extd feature register */
772 	u64 reserved;
773 };
774 
775 /* Masks for Info field above */
776 
777 #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F	/* 5 bits, MSI message number */
778 #define ACPI_IVHD_UNIT_ID_MASK      0x1F00	/* 5 bits, unit_iD */
779 
780 /*
781  * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
782  * Upper two bits of the Type field are the (encoded) length of the structure.
783  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
784  * are reserved for future use but not defined.
785  */
786 struct acpi_ivrs_de_header {
787 	u8 type;
788 	u16 id;
789 	u8 data_setting;
790 };
791 
792 /* Length of device entry is in the top two bits of Type field above */
793 
794 #define ACPI_IVHD_ENTRY_LENGTH      0xC0
795 
796 /* Values for device entry Type field above */
797 
798 enum acpi_ivrs_device_entry_type {
799 	/* 4-byte device entries, all use struct acpi_ivrs_device4 */
800 
801 	ACPI_IVRS_TYPE_PAD4 = 0,
802 	ACPI_IVRS_TYPE_ALL = 1,
803 	ACPI_IVRS_TYPE_SELECT = 2,
804 	ACPI_IVRS_TYPE_START = 3,
805 	ACPI_IVRS_TYPE_END = 4,
806 
807 	/* 8-byte device entries */
808 
809 	ACPI_IVRS_TYPE_PAD8 = 64,
810 	ACPI_IVRS_TYPE_NOT_USED = 65,
811 	ACPI_IVRS_TYPE_ALIAS_SELECT = 66,	/* Uses struct acpi_ivrs_device8a */
812 	ACPI_IVRS_TYPE_ALIAS_START = 67,	/* Uses struct acpi_ivrs_device8a */
813 	ACPI_IVRS_TYPE_EXT_SELECT = 70,	/* Uses struct acpi_ivrs_device8b */
814 	ACPI_IVRS_TYPE_EXT_START = 71,	/* Uses struct acpi_ivrs_device8b */
815 	ACPI_IVRS_TYPE_SPECIAL = 72	/* Uses struct acpi_ivrs_device8c */
816 };
817 
818 /* Values for Data field above */
819 
820 #define ACPI_IVHD_INIT_PASS         (1)
821 #define ACPI_IVHD_EINT_PASS         (1<<1)
822 #define ACPI_IVHD_NMI_PASS          (1<<2)
823 #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
824 #define ACPI_IVHD_LINT0_PASS        (1<<6)
825 #define ACPI_IVHD_LINT1_PASS        (1<<7)
826 
827 /* Types 0-4: 4-byte device entry */
828 
829 struct acpi_ivrs_device4 {
830 	struct acpi_ivrs_de_header header;
831 };
832 
833 /* Types 66-67: 8-byte device entry */
834 
835 struct acpi_ivrs_device8a {
836 	struct acpi_ivrs_de_header header;
837 	u8 reserved1;
838 	u16 used_id;
839 	u8 reserved2;
840 };
841 
842 /* Types 70-71: 8-byte device entry */
843 
844 struct acpi_ivrs_device8b {
845 	struct acpi_ivrs_de_header header;
846 	u32 extended_data;
847 };
848 
849 /* Values for extended_data above */
850 
851 #define ACPI_IVHD_ATS_DISABLED      (1<<31)
852 
853 /* Type 72: 8-byte device entry */
854 
855 struct acpi_ivrs_device8c {
856 	struct acpi_ivrs_de_header header;
857 	u8 handle;
858 	u16 used_id;
859 	u8 variety;
860 };
861 
862 /* Values for Variety field above */
863 
864 #define ACPI_IVHD_IOAPIC            1
865 #define ACPI_IVHD_HPET              2
866 
867 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
868 
869 struct acpi_ivrs_memory {
870 	struct acpi_ivrs_header header;
871 	u16 aux_data;
872 	u64 reserved;
873 	u64 start_address;
874 	u64 memory_length;
875 };
876 
877 /*******************************************************************************
878  *
879  * MCFG - PCI Memory Mapped Configuration table and sub-table
880  *        Version 1
881  *
882  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
883  *
884  ******************************************************************************/
885 
886 struct acpi_table_mcfg {
887 	struct acpi_table_header header;	/* Common ACPI table header */
888 	u8 reserved[8];
889 };
890 
891 /* Subtable */
892 
893 struct acpi_mcfg_allocation {
894 	u64 address;		/* Base address, processor-relative */
895 	u16 pci_segment;	/* PCI segment group number */
896 	u8 start_bus_number;	/* Starting PCI Bus number */
897 	u8 end_bus_number;	/* Final PCI Bus number */
898 	u32 reserved;
899 };
900 
901 /*******************************************************************************
902  *
903  * MCHI - Management Controller Host Interface Table
904  *        Version 1
905  *
906  * Conforms to "Management Component Transport Protocol (MCTP) Host
907  * Interface Specification", Revision 1.0.0a, October 13, 2009
908  *
909  ******************************************************************************/
910 
911 struct acpi_table_mchi {
912 	struct acpi_table_header header;	/* Common ACPI table header */
913 	u8 interface_type;
914 	u8 protocol;
915 	u64 protocol_data;
916 	u8 interrupt_type;
917 	u8 gpe;
918 	u8 pci_device_flag;
919 	u32 global_interrupt;
920 	struct acpi_generic_address control_register;
921 	u8 pci_segment;
922 	u8 pci_bus;
923 	u8 pci_device;
924 	u8 pci_function;
925 };
926 
927 /*******************************************************************************
928  *
929  * SLIC - Software Licensing Description Table
930  *        Version 1
931  *
932  * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
933  * Copyright 2006
934  *
935  ******************************************************************************/
936 
937 /* Basic SLIC table is only the common ACPI header */
938 
939 struct acpi_table_slic {
940 	struct acpi_table_header header;	/* Common ACPI table header */
941 };
942 
943 /* Common SLIC subtable header */
944 
945 struct acpi_slic_header {
946 	u32 type;
947 	u32 length;
948 };
949 
950 /* Values for Type field above */
951 
952 enum acpi_slic_type {
953 	ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
954 	ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
955 	ACPI_SLIC_TYPE_RESERVED = 2	/* 2 and greater are reserved */
956 };
957 
958 /*
959  * SLIC Sub-tables, correspond to Type in struct acpi_slic_header
960  */
961 
962 /* 0: Public Key Structure */
963 
964 struct acpi_slic_key {
965 	struct acpi_slic_header header;
966 	u8 key_type;
967 	u8 version;
968 	u16 reserved;
969 	u32 algorithm;
970 	char magic[4];
971 	u32 bit_length;
972 	u32 exponent;
973 	u8 modulus[128];
974 };
975 
976 /* 1: Windows Marker Structure */
977 
978 struct acpi_slic_marker {
979 	struct acpi_slic_header header;
980 	u32 version;
981 	char oem_id[ACPI_OEM_ID_SIZE];	/* ASCII OEM identification */
982 	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE];	/* ASCII OEM table identification */
983 	char windows_flag[8];
984 	u32 slic_version;
985 	u8 reserved[16];
986 	u8 signature[128];
987 };
988 
989 /*******************************************************************************
990  *
991  * SPCR - Serial Port Console Redirection table
992  *        Version 1
993  *
994  * Conforms to "Serial Port Console Redirection Table",
995  * Version 1.00, January 11, 2002
996  *
997  ******************************************************************************/
998 
999 struct acpi_table_spcr {
1000 	struct acpi_table_header header;	/* Common ACPI table header */
1001 	u8 interface_type;	/* 0=full 16550, 1=subset of 16550 */
1002 	u8 reserved[3];
1003 	struct acpi_generic_address serial_port;
1004 	u8 interrupt_type;
1005 	u8 pc_interrupt;
1006 	u32 interrupt;
1007 	u8 baud_rate;
1008 	u8 parity;
1009 	u8 stop_bits;
1010 	u8 flow_control;
1011 	u8 terminal_type;
1012 	u8 reserved1;
1013 	u16 pci_device_id;
1014 	u16 pci_vendor_id;
1015 	u8 pci_bus;
1016 	u8 pci_device;
1017 	u8 pci_function;
1018 	u32 pci_flags;
1019 	u8 pci_segment;
1020 	u32 reserved2;
1021 };
1022 
1023 /* Masks for pci_flags field above */
1024 
1025 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
1026 
1027 /*******************************************************************************
1028  *
1029  * SPMI - Server Platform Management Interface table
1030  *        Version 5
1031  *
1032  * Conforms to "Intelligent Platform Management Interface Specification
1033  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
1034  * June 12, 2009 markup.
1035  *
1036  ******************************************************************************/
1037 
1038 struct acpi_table_spmi {
1039 	struct acpi_table_header header;	/* Common ACPI table header */
1040 	u8 interface_type;
1041 	u8 reserved;		/* Must be 1 */
1042 	u16 spec_revision;	/* Version of IPMI */
1043 	u8 interrupt_type;
1044 	u8 gpe_number;		/* GPE assigned */
1045 	u8 reserved1;
1046 	u8 pci_device_flag;
1047 	u32 interrupt;
1048 	struct acpi_generic_address ipmi_register;
1049 	u8 pci_segment;
1050 	u8 pci_bus;
1051 	u8 pci_device;
1052 	u8 pci_function;
1053 	u8 reserved2;
1054 };
1055 
1056 /* Values for interface_type above */
1057 
1058 enum acpi_spmi_interface_types {
1059 	ACPI_SPMI_NOT_USED = 0,
1060 	ACPI_SPMI_KEYBOARD = 1,
1061 	ACPI_SPMI_SMI = 2,
1062 	ACPI_SPMI_BLOCK_TRANSFER = 3,
1063 	ACPI_SPMI_SMBUS = 4,
1064 	ACPI_SPMI_RESERVED = 5	/* 5 and above are reserved */
1065 };
1066 
1067 /*******************************************************************************
1068  *
1069  * TCPA - Trusted Computing Platform Alliance table
1070  *        Version 1
1071  *
1072  * Conforms to "TCG PC Specific Implementation Specification",
1073  * Version 1.1, August 18, 2003
1074  *
1075  ******************************************************************************/
1076 
1077 struct acpi_table_tcpa {
1078 	struct acpi_table_header header;	/* Common ACPI table header */
1079 	u16 reserved;
1080 	u32 max_log_length;	/* Maximum length for the event log area */
1081 	u64 log_address;	/* Address of the event log area */
1082 };
1083 
1084 /*******************************************************************************
1085  *
1086  * UEFI - UEFI Boot optimization Table
1087  *        Version 1
1088  *
1089  * Conforms to "Unified Extensible Firmware Interface Specification",
1090  * Version 2.3, May 8, 2009
1091  *
1092  ******************************************************************************/
1093 
1094 struct acpi_table_uefi {
1095 	struct acpi_table_header header;	/* Common ACPI table header */
1096 	u8 identifier[16];	/* UUID identifier */
1097 	u16 data_offset;	/* Offset of remaining data in table */
1098 };
1099 
1100 /*******************************************************************************
1101  *
1102  * WAET - Windows ACPI Emulated devices Table
1103  *        Version 1
1104  *
1105  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
1106  *
1107  ******************************************************************************/
1108 
1109 struct acpi_table_waet {
1110 	struct acpi_table_header header;	/* Common ACPI table header */
1111 	u32 flags;
1112 };
1113 
1114 /* Masks for Flags field above */
1115 
1116 #define ACPI_WAET_RTC_NO_ACK        (1)	/* RTC requires no int acknowledge */
1117 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)	/* PM timer requires only one read */
1118 
1119 /*******************************************************************************
1120  *
1121  * WDAT - Watchdog Action Table
1122  *        Version 1
1123  *
1124  * Conforms to "Hardware Watchdog Timers Design Specification",
1125  * Copyright 2006 Microsoft Corporation.
1126  *
1127  ******************************************************************************/
1128 
1129 struct acpi_table_wdat {
1130 	struct acpi_table_header header;	/* Common ACPI table header */
1131 	u32 header_length;	/* Watchdog Header Length */
1132 	u16 pci_segment;	/* PCI Segment number */
1133 	u8 pci_bus;		/* PCI Bus number */
1134 	u8 pci_device;		/* PCI Device number */
1135 	u8 pci_function;	/* PCI Function number */
1136 	u8 reserved[3];
1137 	u32 timer_period;	/* Period of one timer count (msec) */
1138 	u32 max_count;		/* Maximum counter value supported */
1139 	u32 min_count;		/* Minimum counter value */
1140 	u8 flags;
1141 	u8 reserved2[3];
1142 	u32 entries;		/* Number of watchdog entries that follow */
1143 };
1144 
1145 /* Masks for Flags field above */
1146 
1147 #define ACPI_WDAT_ENABLED           (1)
1148 #define ACPI_WDAT_STOPPED           0x80
1149 
1150 /* WDAT Instruction Entries (actions) */
1151 
1152 struct acpi_wdat_entry {
1153 	u8 action;
1154 	u8 instruction;
1155 	u16 reserved;
1156 	struct acpi_generic_address register_region;
1157 	u32 value;		/* Value used with Read/Write register */
1158 	u32 mask;		/* Bitmask required for this register instruction */
1159 };
1160 
1161 /* Values for Action field above */
1162 
1163 enum acpi_wdat_actions {
1164 	ACPI_WDAT_RESET = 1,
1165 	ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1166 	ACPI_WDAT_GET_COUNTDOWN = 5,
1167 	ACPI_WDAT_SET_COUNTDOWN = 6,
1168 	ACPI_WDAT_GET_RUNNING_STATE = 8,
1169 	ACPI_WDAT_SET_RUNNING_STATE = 9,
1170 	ACPI_WDAT_GET_STOPPED_STATE = 10,
1171 	ACPI_WDAT_SET_STOPPED_STATE = 11,
1172 	ACPI_WDAT_GET_REBOOT = 16,
1173 	ACPI_WDAT_SET_REBOOT = 17,
1174 	ACPI_WDAT_GET_SHUTDOWN = 18,
1175 	ACPI_WDAT_SET_SHUTDOWN = 19,
1176 	ACPI_WDAT_GET_STATUS = 32,
1177 	ACPI_WDAT_SET_STATUS = 33,
1178 	ACPI_WDAT_ACTION_RESERVED = 34	/* 34 and greater are reserved */
1179 };
1180 
1181 /* Values for Instruction field above */
1182 
1183 enum acpi_wdat_instructions {
1184 	ACPI_WDAT_READ_VALUE = 0,
1185 	ACPI_WDAT_READ_COUNTDOWN = 1,
1186 	ACPI_WDAT_WRITE_VALUE = 2,
1187 	ACPI_WDAT_WRITE_COUNTDOWN = 3,
1188 	ACPI_WDAT_INSTRUCTION_RESERVED = 4,	/* 4 and greater are reserved */
1189 	ACPI_WDAT_PRESERVE_REGISTER = 0x80	/* Except for this value */
1190 };
1191 
1192 /*******************************************************************************
1193  *
1194  * WDDT - Watchdog Descriptor Table
1195  *        Version 1
1196  *
1197  * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
1198  * Version 001, September 2002
1199  *
1200  ******************************************************************************/
1201 
1202 struct acpi_table_wddt {
1203 	struct acpi_table_header header;	/* Common ACPI table header */
1204 	u16 spec_version;
1205 	u16 table_version;
1206 	u16 pci_vendor_id;
1207 	struct acpi_generic_address address;
1208 	u16 max_count;		/* Maximum counter value supported */
1209 	u16 min_count;		/* Minimum counter value supported */
1210 	u16 period;
1211 	u16 status;
1212 	u16 capability;
1213 };
1214 
1215 /* Flags for Status field above */
1216 
1217 #define ACPI_WDDT_AVAILABLE     (1)
1218 #define ACPI_WDDT_ACTIVE        (1<<1)
1219 #define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
1220 #define ACPI_WDDT_USER_RESET    (1<<11)
1221 #define ACPI_WDDT_WDT_RESET     (1<<12)
1222 #define ACPI_WDDT_POWER_FAIL    (1<<13)
1223 #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
1224 
1225 /* Flags for Capability field above */
1226 
1227 #define ACPI_WDDT_AUTO_RESET    (1)
1228 #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
1229 
1230 /*******************************************************************************
1231  *
1232  * WDRT - Watchdog Resource Table
1233  *        Version 1
1234  *
1235  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
1236  * Version 1.01, August 28, 2006
1237  *
1238  ******************************************************************************/
1239 
1240 struct acpi_table_wdrt {
1241 	struct acpi_table_header header;	/* Common ACPI table header */
1242 	struct acpi_generic_address control_register;
1243 	struct acpi_generic_address count_register;
1244 	u16 pci_device_id;
1245 	u16 pci_vendor_id;
1246 	u8 pci_bus;		/* PCI Bus number */
1247 	u8 pci_device;		/* PCI Device number */
1248 	u8 pci_function;	/* PCI Function number */
1249 	u8 pci_segment;		/* PCI Segment number */
1250 	u16 max_count;		/* Maximum counter value supported */
1251 	u8 units;
1252 };
1253 
1254 /* Reset to default packing */
1255 
1256 #pragma pack()
1257 
1258 #endif				/* __ACTBL2_H__ */
1259