xref: /openbmc/linux/include/acpi/actbl1.h (revision e847c767)
1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /******************************************************************************
3  *
4  * Name: actbl1.h - Additional ACPI table definitions
5  *
6  * Copyright (C) 2000 - 2022, Intel Corp.
7  *
8  *****************************************************************************/
9 
10 #ifndef __ACTBL1_H__
11 #define __ACTBL1_H__
12 
13 /*******************************************************************************
14  *
15  * Additional ACPI Tables
16  *
17  * These tables are not consumed directly by the ACPICA subsystem, but are
18  * included here to support device drivers and the AML disassembler.
19  *
20  ******************************************************************************/
21 
22 /*
23  * Values for description table header signatures for tables defined in this
24  * file. Useful because they make it more difficult to inadvertently type in
25  * the wrong signature.
26  */
27 #define ACPI_SIG_AEST           "AEST"	/* Arm Error Source Table */
28 #define ACPI_SIG_ASF            "ASF!"	/* Alert Standard Format table */
29 #define ACPI_SIG_BERT           "BERT"	/* Boot Error Record Table */
30 #define ACPI_SIG_BGRT           "BGRT"	/* Boot Graphics Resource Table */
31 #define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
32 #define ACPI_SIG_CEDT           "CEDT"	/* CXL Early Discovery Table */
33 #define ACPI_SIG_CPEP           "CPEP"	/* Corrected Platform Error Polling table */
34 #define ACPI_SIG_CSRT           "CSRT"	/* Core System Resource Table */
35 #define ACPI_SIG_DBG2           "DBG2"	/* Debug Port table type 2 */
36 #define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
37 #define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
38 #define ACPI_SIG_DRTM           "DRTM"	/* Dynamic Root of Trust for Measurement table */
39 #define ACPI_SIG_ECDT           "ECDT"	/* Embedded Controller Boot Resources Table */
40 #define ACPI_SIG_EINJ           "EINJ"	/* Error Injection table */
41 #define ACPI_SIG_ERST           "ERST"	/* Error Record Serialization Table */
42 #define ACPI_SIG_FPDT           "FPDT"	/* Firmware Performance Data Table */
43 #define ACPI_SIG_GTDT           "GTDT"	/* Generic Timer Description Table */
44 #define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
45 #define ACPI_SIG_HMAT           "HMAT"	/* Heterogeneous Memory Attributes Table */
46 #define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
47 #define ACPI_SIG_IBFT           "IBFT"	/* iSCSI Boot Firmware Table */
48 #define ACPI_SIG_MSCT           "MSCT"	/* Maximum System Characteristics Table */
49 
50 #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
51 #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
52 
53 #define ACPI_SIG_NBFT		"NBFT"	/* NVMe Boot Firmware Table */
54 
55 /* Reserved table signatures */
56 
57 #define ACPI_SIG_MATR           "MATR"	/* Memory Address Translation Table */
58 #define ACPI_SIG_MSDM           "MSDM"	/* Microsoft Data Management Table */
59 
60 /*
61  * These tables have been seen in the field, but no definition has been found
62  */
63 #ifdef ACPI_UNDEFINED_TABLES
64 #define ACPI_SIG_ATKG           "ATKG"
65 #define ACPI_SIG_GSCI           "GSCI"	/* GMCH SCI table */
66 #define ACPI_SIG_IEIT           "IEIT"
67 #endif
68 
69 /*
70  * All tables must be byte-packed to match the ACPI specification, since
71  * the tables are provided by the system BIOS.
72  */
73 #pragma pack(1)
74 
75 /*
76  * Note: C bitfields are not used for this reason:
77  *
78  * "Bitfields are great and easy to read, but unfortunately the C language
79  * does not specify the layout of bitfields in memory, which means they are
80  * essentially useless for dealing with packed data in on-disk formats or
81  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
82  * this decision was a design error in C. Ritchie could have picked an order
83  * and stuck with it." Norman Ramsey.
84  * See http://stackoverflow.com/a/1053662/41661
85  */
86 
87 /*******************************************************************************
88  *
89  * Common subtable headers
90  *
91  ******************************************************************************/
92 
93 /* Generic subtable header (used in MADT, SRAT, etc.) */
94 
95 struct acpi_subtable_header {
96 	u8 type;
97 	u8 length;
98 };
99 
100 /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
101 
102 struct acpi_whea_header {
103 	u8 action;
104 	u8 instruction;
105 	u8 flags;
106 	u8 reserved;
107 	struct acpi_generic_address register_region;
108 	u64 value;		/* Value used with Read/Write register */
109 	u64 mask;		/* Bitmask required for this register instruction */
110 };
111 
112 /*******************************************************************************
113  *
114  * ASF - Alert Standard Format table (Signature "ASF!")
115  *       Revision 0x10
116  *
117  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
118  *
119  ******************************************************************************/
120 
121 struct acpi_table_asf {
122 	struct acpi_table_header header;	/* Common ACPI table header */
123 };
124 
125 /* ASF subtable header */
126 
127 struct acpi_asf_header {
128 	u8 type;
129 	u8 reserved;
130 	u16 length;
131 };
132 
133 /* Values for Type field above */
134 
135 enum acpi_asf_type {
136 	ACPI_ASF_TYPE_INFO = 0,
137 	ACPI_ASF_TYPE_ALERT = 1,
138 	ACPI_ASF_TYPE_CONTROL = 2,
139 	ACPI_ASF_TYPE_BOOT = 3,
140 	ACPI_ASF_TYPE_ADDRESS = 4,
141 	ACPI_ASF_TYPE_RESERVED = 5
142 };
143 
144 /*
145  * ASF subtables
146  */
147 
148 /* 0: ASF Information */
149 
150 struct acpi_asf_info {
151 	struct acpi_asf_header header;
152 	u8 min_reset_value;
153 	u8 min_poll_interval;
154 	u16 system_id;
155 	u32 mfg_id;
156 	u8 flags;
157 	u8 reserved2[3];
158 };
159 
160 /* Masks for Flags field above */
161 
162 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
163 
164 /* 1: ASF Alerts */
165 
166 struct acpi_asf_alert {
167 	struct acpi_asf_header header;
168 	u8 assert_mask;
169 	u8 deassert_mask;
170 	u8 alerts;
171 	u8 data_length;
172 };
173 
174 struct acpi_asf_alert_data {
175 	u8 address;
176 	u8 command;
177 	u8 mask;
178 	u8 value;
179 	u8 sensor_type;
180 	u8 type;
181 	u8 offset;
182 	u8 source_type;
183 	u8 severity;
184 	u8 sensor_number;
185 	u8 entity;
186 	u8 instance;
187 };
188 
189 /* 2: ASF Remote Control */
190 
191 struct acpi_asf_remote {
192 	struct acpi_asf_header header;
193 	u8 controls;
194 	u8 data_length;
195 	u16 reserved2;
196 };
197 
198 struct acpi_asf_control_data {
199 	u8 function;
200 	u8 address;
201 	u8 command;
202 	u8 value;
203 };
204 
205 /* 3: ASF RMCP Boot Options */
206 
207 struct acpi_asf_rmcp {
208 	struct acpi_asf_header header;
209 	u8 capabilities[7];
210 	u8 completion_code;
211 	u32 enterprise_id;
212 	u8 command;
213 	u16 parameter;
214 	u16 boot_options;
215 	u16 oem_parameters;
216 };
217 
218 /* 4: ASF Address */
219 
220 struct acpi_asf_address {
221 	struct acpi_asf_header header;
222 	u8 eprom_address;
223 	u8 devices;
224 };
225 
226 /*******************************************************************************
227  *
228  * BERT - Boot Error Record Table (ACPI 4.0)
229  *        Version 1
230  *
231  ******************************************************************************/
232 
233 struct acpi_table_bert {
234 	struct acpi_table_header header;	/* Common ACPI table header */
235 	u32 region_length;	/* Length of the boot error region */
236 	u64 address;		/* Physical address of the error region */
237 };
238 
239 /* Boot Error Region (not a subtable, pointed to by Address field above) */
240 
241 struct acpi_bert_region {
242 	u32 block_status;	/* Type of error information */
243 	u32 raw_data_offset;	/* Offset to raw error data */
244 	u32 raw_data_length;	/* Length of raw error data */
245 	u32 data_length;	/* Length of generic error data */
246 	u32 error_severity;	/* Severity code */
247 };
248 
249 /* Values for block_status flags above */
250 
251 #define ACPI_BERT_UNCORRECTABLE             (1)
252 #define ACPI_BERT_CORRECTABLE               (1<<1)
253 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
254 #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
255 #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
256 
257 /* Values for error_severity above */
258 
259 enum acpi_bert_error_severity {
260 	ACPI_BERT_ERROR_CORRECTABLE = 0,
261 	ACPI_BERT_ERROR_FATAL = 1,
262 	ACPI_BERT_ERROR_CORRECTED = 2,
263 	ACPI_BERT_ERROR_NONE = 3,
264 	ACPI_BERT_ERROR_RESERVED = 4	/* 4 and greater are reserved */
265 };
266 
267 /*
268  * Note: The generic error data that follows the error_severity field above
269  * uses the struct acpi_hest_generic_data defined under the HEST table below
270  */
271 
272 /*******************************************************************************
273  *
274  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
275  *        Version 1
276  *
277  ******************************************************************************/
278 
279 struct acpi_table_bgrt {
280 	struct acpi_table_header header;	/* Common ACPI table header */
281 	u16 version;
282 	u8 status;
283 	u8 image_type;
284 	u64 image_address;
285 	u32 image_offset_x;
286 	u32 image_offset_y;
287 };
288 
289 /* Flags for Status field above */
290 
291 #define ACPI_BGRT_DISPLAYED                 (1)
292 #define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
293 
294 /*******************************************************************************
295  *
296  * BOOT - Simple Boot Flag Table
297  *        Version 1
298  *
299  * Conforms to the "Simple Boot Flag Specification", Version 2.1
300  *
301  ******************************************************************************/
302 
303 struct acpi_table_boot {
304 	struct acpi_table_header header;	/* Common ACPI table header */
305 	u8 cmos_index;		/* Index in CMOS RAM for the boot register */
306 	u8 reserved[3];
307 };
308 
309 /*******************************************************************************
310  *
311  * CDAT - Coherent Device Attribute Table
312  *        Version 1
313  *
314  * Conforms to the "Coherent Device Attribute Table (CDAT) Specification
315  " (Revision 1.01, October 2020.)
316  *
317  ******************************************************************************/
318 
319 struct acpi_table_cdat {
320 	u32 length;		/* Length of table in bytes, including this header */
321 	u8 revision;		/* ACPI Specification minor version number */
322 	u8 checksum;		/* To make sum of entire table == 0 */
323 	u8 reserved[6];
324 	u32 sequence;		/* Used to detect runtime CDAT table changes */
325 };
326 
327 /* CDAT common subtable header */
328 
329 struct acpi_cdat_header {
330 	u8 type;
331 	u8 reserved;
332 	u16 length;
333 };
334 
335 /* Values for Type field above */
336 
337 enum acpi_cdat_type {
338 	ACPI_CDAT_TYPE_DSMAS = 0,
339 	ACPI_CDAT_TYPE_DSLBIS = 1,
340 	ACPI_CDAT_TYPE_DSMSCIS = 2,
341 	ACPI_CDAT_TYPE_DSIS = 3,
342 	ACPI_CDAT_TYPE_DSEMTS = 4,
343 	ACPI_CDAT_TYPE_SSLBIS = 5,
344 	ACPI_CDAT_TYPE_RESERVED = 6	/* 6 through 0xFF are reserved */
345 };
346 
347 /* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */
348 
349 struct acpi_cdat_dsmas {
350 	u8 dsmad_handle;
351 	u8 flags;
352 	u16 reserved;
353 	u64 dpa_base_address;
354 	u64 dpa_length;
355 };
356 
357 /* Flags for subtable above */
358 
359 #define ACPI_CEDT_DSMAS_NON_VOLATILE        (1 << 2)
360 
361 /* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */
362 
363 struct acpi_cdat_dslbis {
364 	u8 handle;
365 	u8 flags;		/* If Handle matches a DSMAS handle, the definition of this field matches
366 				 * Flags field in HMAT System Locality Latency */
367 	u8 data_type;
368 	u8 reserved;
369 	u64 entry_base_unit;
370 	u16 entry[3];
371 	u16 reserved2;
372 };
373 
374 /* Subtable 2: Device Scoped Memory Side Cache Information Structure (DSMSCIS) */
375 
376 struct acpi_cdat_dsmscis {
377 	u8 dsmas_handle;
378 	u8 reserved[3];
379 	u64 side_cache_size;
380 	u32 cache_attributes;
381 };
382 
383 /* Subtable 3: Device Scoped Initiator Structure (DSIS) */
384 
385 struct acpi_cdat_dsis {
386 	u8 flags;
387 	u8 handle;
388 	u16 reserved;
389 };
390 
391 /* Flags for above subtable */
392 
393 #define ACPI_CDAT_DSIS_MEM_ATTACHED         (1 << 0)
394 
395 /* Subtable 4: Device Scoped EFI Memory Type Structure (DSEMTS) */
396 
397 struct acpi_cdat_dsemts {
398 	u8 dsmas_handle;
399 	u8 memory_type;
400 	u16 reserved;
401 	u64 dpa_offset;
402 	u64 range_length;
403 };
404 
405 /* Subtable 5: Switch Scoped Latency and Bandwidth Information Structure (SSLBIS) */
406 
407 struct acpi_cdat_sslbis {
408 	u8 data_type;
409 	u8 reserved[3];
410 	u64 entry_base_unit;
411 };
412 
413 /* Sub-subtable for above, sslbe_entries field */
414 
415 struct acpi_cdat_sslbe {
416 	u16 portx_id;
417 	u16 porty_id;
418 	u16 latency_or_bandwidth;
419 	u16 reserved;
420 };
421 
422 /*******************************************************************************
423  *
424  * CEDT - CXL Early Discovery Table
425  *        Version 1
426  *
427  * Conforms to the "CXL Early Discovery Table" (CXL 2.0, October 2020)
428  *
429  ******************************************************************************/
430 
431 struct acpi_table_cedt {
432 	struct acpi_table_header header;	/* Common ACPI table header */
433 };
434 
435 /* CEDT subtable header (Performance Record Structure) */
436 
437 struct acpi_cedt_header {
438 	u8 type;
439 	u8 reserved;
440 	u16 length;
441 };
442 
443 /* Values for Type field above */
444 
445 enum acpi_cedt_type {
446 	ACPI_CEDT_TYPE_CHBS = 0,
447 	ACPI_CEDT_TYPE_CFMWS = 1,
448 	ACPI_CEDT_TYPE_CXIMS = 2,
449 	ACPI_CEDT_TYPE_RDPAS = 3,
450 	ACPI_CEDT_TYPE_RESERVED = 4,
451 };
452 
453 /* Values for version field above */
454 
455 #define ACPI_CEDT_CHBS_VERSION_CXL11    (0)
456 #define ACPI_CEDT_CHBS_VERSION_CXL20    (1)
457 
458 /* Values for length field above */
459 
460 #define ACPI_CEDT_CHBS_LENGTH_CXL11     (0x2000)
461 #define ACPI_CEDT_CHBS_LENGTH_CXL20     (0x10000)
462 
463 /*
464  * CEDT subtables
465  */
466 
467 /* 0: CXL Host Bridge Structure */
468 
469 struct acpi_cedt_chbs {
470 	struct acpi_cedt_header header;
471 	u32 uid;
472 	u32 cxl_version;
473 	u32 reserved;
474 	u64 base;
475 	u64 length;
476 };
477 
478 /* 1: CXL Fixed Memory Window Structure */
479 
480 struct acpi_cedt_cfmws {
481 	struct acpi_cedt_header header;
482 	u32 reserved1;
483 	u64 base_hpa;
484 	u64 window_size;
485 	u8 interleave_ways;
486 	u8 interleave_arithmetic;
487 	u16 reserved2;
488 	u32 granularity;
489 	u16 restrictions;
490 	u16 qtg_id;
491 	u32 interleave_targets[];
492 };
493 
494 struct acpi_cedt_cfmws_target_element {
495 	u32 interleave_target;
496 };
497 
498 /* Values for Interleave Arithmetic field above */
499 
500 #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO   (0)
501 #define ACPI_CEDT_CFMWS_ARITHMETIC_XOR      (1)
502 
503 /* Values for Restrictions field above */
504 
505 #define ACPI_CEDT_CFMWS_RESTRICT_TYPE2      (1)
506 #define ACPI_CEDT_CFMWS_RESTRICT_TYPE3      (1<<1)
507 #define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE   (1<<2)
508 #define ACPI_CEDT_CFMWS_RESTRICT_PMEM       (1<<3)
509 #define ACPI_CEDT_CFMWS_RESTRICT_FIXED      (1<<4)
510 
511 /* 2: CXL XOR Interleave Math Structure */
512 
513 struct acpi_cedt_cxims {
514 	struct acpi_cedt_header header;
515 	u16 reserved1;
516 	u8 hbig;
517 	u8 nr_xormaps;
518 	u64 xormap_list[];
519 };
520 
521 /* 3: CXL RCEC Downstream Port Association Structure */
522 
523 struct acpi_cedt_rdpas {
524 	struct acpi_cedt_header header;
525 	u8 reserved1;
526 	u16 length;
527 	u16 segment;
528 	u16 bdf;
529 	u8 protocol;
530 	u64 address;
531 };
532 
533 /* Masks for bdf field above */
534 #define ACPI_CEDT_RDPAS_BUS_MASK            0xff00
535 #define ACPI_CEDT_RDPAS_DEVICE_MASK         0x00f8
536 #define ACPI_CEDT_RDPAS_FUNCTION_MASK       0x0007
537 
538 #define ACPI_CEDT_RDPAS_PROTOCOL_IO        (0)
539 #define ACPI_CEDT_RDPAS_PROTOCOL_CACHEMEM  (1)
540 
541 /*******************************************************************************
542  *
543  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
544  *        Version 1
545  *
546  ******************************************************************************/
547 
548 struct acpi_table_cpep {
549 	struct acpi_table_header header;	/* Common ACPI table header */
550 	u64 reserved;
551 };
552 
553 /* Subtable */
554 
555 struct acpi_cpep_polling {
556 	struct acpi_subtable_header header;
557 	u8 id;			/* Processor ID */
558 	u8 eid;			/* Processor EID */
559 	u32 interval;		/* Polling interval (msec) */
560 };
561 
562 /*******************************************************************************
563  *
564  * CSRT - Core System Resource Table
565  *        Version 0
566  *
567  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
568  *
569  ******************************************************************************/
570 
571 struct acpi_table_csrt {
572 	struct acpi_table_header header;	/* Common ACPI table header */
573 };
574 
575 /* Resource Group subtable */
576 
577 struct acpi_csrt_group {
578 	u32 length;
579 	u32 vendor_id;
580 	u32 subvendor_id;
581 	u16 device_id;
582 	u16 subdevice_id;
583 	u16 revision;
584 	u16 reserved;
585 	u32 shared_info_length;
586 
587 	/* Shared data immediately follows (Length = shared_info_length) */
588 };
589 
590 /* Shared Info subtable */
591 
592 struct acpi_csrt_shared_info {
593 	u16 major_version;
594 	u16 minor_version;
595 	u32 mmio_base_low;
596 	u32 mmio_base_high;
597 	u32 gsi_interrupt;
598 	u8 interrupt_polarity;
599 	u8 interrupt_mode;
600 	u8 num_channels;
601 	u8 dma_address_width;
602 	u16 base_request_line;
603 	u16 num_handshake_signals;
604 	u32 max_block_size;
605 
606 	/* Resource descriptors immediately follow (Length = Group length - shared_info_length) */
607 };
608 
609 /* Resource Descriptor subtable */
610 
611 struct acpi_csrt_descriptor {
612 	u32 length;
613 	u16 type;
614 	u16 subtype;
615 	u32 uid;
616 
617 	/* Resource-specific information immediately follows */
618 };
619 
620 /* Resource Types */
621 
622 #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
623 #define ACPI_CSRT_TYPE_TIMER        0x0002
624 #define ACPI_CSRT_TYPE_DMA          0x0003
625 
626 /* Resource Subtypes */
627 
628 #define ACPI_CSRT_XRUPT_LINE        0x0000
629 #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
630 #define ACPI_CSRT_TIMER             0x0000
631 #define ACPI_CSRT_DMA_CHANNEL       0x0000
632 #define ACPI_CSRT_DMA_CONTROLLER    0x0001
633 
634 /*******************************************************************************
635  *
636  * DBG2 - Debug Port Table 2
637  *        Version 0 (Both main table and subtables)
638  *
639  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", September 21, 2020
640  *
641  ******************************************************************************/
642 
643 struct acpi_table_dbg2 {
644 	struct acpi_table_header header;	/* Common ACPI table header */
645 	u32 info_offset;
646 	u32 info_count;
647 };
648 
649 struct acpi_dbg2_header {
650 	u32 info_offset;
651 	u32 info_count;
652 };
653 
654 /* Debug Device Information Subtable */
655 
656 struct acpi_dbg2_device {
657 	u8 revision;
658 	u16 length;
659 	u8 register_count;	/* Number of base_address registers */
660 	u16 namepath_length;
661 	u16 namepath_offset;
662 	u16 oem_data_length;
663 	u16 oem_data_offset;
664 	u16 port_type;
665 	u16 port_subtype;
666 	u16 reserved;
667 	u16 base_address_offset;
668 	u16 address_size_offset;
669 	/*
670 	 * Data that follows:
671 	 *    base_address (required) - Each in 12-byte Generic Address Structure format.
672 	 *    address_size (required) - Array of u32 sizes corresponding to each base_address register.
673 	 *    Namepath    (required) - Null terminated string. Single dot if not supported.
674 	 *    oem_data    (optional) - Length is oem_data_length.
675 	 */
676 };
677 
678 /* Types for port_type field above */
679 
680 #define ACPI_DBG2_SERIAL_PORT       0x8000
681 #define ACPI_DBG2_1394_PORT         0x8001
682 #define ACPI_DBG2_USB_PORT          0x8002
683 #define ACPI_DBG2_NET_PORT          0x8003
684 
685 /* Subtypes for port_subtype field above */
686 
687 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
688 #define ACPI_DBG2_16550_SUBSET      0x0001
689 #define ACPI_DBG2_MAX311XE_SPI      0x0002
690 #define ACPI_DBG2_ARM_PL011         0x0003
691 #define ACPI_DBG2_MSM8X60           0x0004
692 #define ACPI_DBG2_16550_NVIDIA      0x0005
693 #define ACPI_DBG2_TI_OMAP           0x0006
694 #define ACPI_DBG2_APM88XXXX         0x0008
695 #define ACPI_DBG2_MSM8974           0x0009
696 #define ACPI_DBG2_SAM5250           0x000A
697 #define ACPI_DBG2_INTEL_USIF        0x000B
698 #define ACPI_DBG2_IMX6              0x000C
699 #define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
700 #define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
701 #define ACPI_DBG2_ARM_DCC           0x000F
702 #define ACPI_DBG2_BCM2835           0x0010
703 #define ACPI_DBG2_SDM845_1_8432MHZ  0x0011
704 #define ACPI_DBG2_16550_WITH_GAS    0x0012
705 #define ACPI_DBG2_SDM845_7_372MHZ   0x0013
706 #define ACPI_DBG2_INTEL_LPSS        0x0014
707 
708 #define ACPI_DBG2_1394_STANDARD     0x0000
709 
710 #define ACPI_DBG2_USB_XHCI          0x0000
711 #define ACPI_DBG2_USB_EHCI          0x0001
712 
713 /*******************************************************************************
714  *
715  * DBGP - Debug Port table
716  *        Version 1
717  *
718  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
719  *
720  ******************************************************************************/
721 
722 struct acpi_table_dbgp {
723 	struct acpi_table_header header;	/* Common ACPI table header */
724 	u8 type;		/* 0=full 16550, 1=subset of 16550 */
725 	u8 reserved[3];
726 	struct acpi_generic_address debug_port;
727 };
728 
729 /*******************************************************************************
730  *
731  * DMAR - DMA Remapping table
732  *        Version 1
733  *
734  * Conforms to "Intel Virtualization Technology for Directed I/O",
735  * Version 2.3, October 2014
736  *
737  ******************************************************************************/
738 
739 struct acpi_table_dmar {
740 	struct acpi_table_header header;	/* Common ACPI table header */
741 	u8 width;		/* Host Address Width */
742 	u8 flags;
743 	u8 reserved[10];
744 };
745 
746 /* Masks for Flags field above */
747 
748 #define ACPI_DMAR_INTR_REMAP        (1)
749 #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
750 #define ACPI_DMAR_X2APIC_MODE       (1<<2)
751 
752 /* DMAR subtable header */
753 
754 struct acpi_dmar_header {
755 	u16 type;
756 	u16 length;
757 };
758 
759 /* Values for subtable type in struct acpi_dmar_header */
760 
761 enum acpi_dmar_type {
762 	ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
763 	ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
764 	ACPI_DMAR_TYPE_ROOT_ATS = 2,
765 	ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
766 	ACPI_DMAR_TYPE_NAMESPACE = 4,
767 	ACPI_DMAR_TYPE_SATC = 5,
768 	ACPI_DMAR_TYPE_RESERVED = 6	/* 6 and greater are reserved */
769 };
770 
771 /* DMAR Device Scope structure */
772 
773 struct acpi_dmar_device_scope {
774 	u8 entry_type;
775 	u8 length;
776 	u16 reserved;
777 	u8 enumeration_id;
778 	u8 bus;
779 };
780 
781 /* Values for entry_type in struct acpi_dmar_device_scope - device types */
782 
783 enum acpi_dmar_scope_type {
784 	ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
785 	ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
786 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
787 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
788 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
789 	ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
790 	ACPI_DMAR_SCOPE_TYPE_RESERVED = 6	/* 6 and greater are reserved */
791 };
792 
793 struct acpi_dmar_pci_path {
794 	u8 device;
795 	u8 function;
796 };
797 
798 /*
799  * DMAR Subtables, correspond to Type in struct acpi_dmar_header
800  */
801 
802 /* 0: Hardware Unit Definition */
803 
804 struct acpi_dmar_hardware_unit {
805 	struct acpi_dmar_header header;
806 	u8 flags;
807 	u8 size;		/* Size of the register set */
808 	u16 segment;
809 	u64 address;		/* Register Base Address */
810 };
811 
812 /* Masks for Flags field above */
813 
814 #define ACPI_DMAR_INCLUDE_ALL       (1)
815 
816 /* 1: Reserved Memory Definition */
817 
818 struct acpi_dmar_reserved_memory {
819 	struct acpi_dmar_header header;
820 	u16 reserved;
821 	u16 segment;
822 	u64 base_address;	/* 4K aligned base address */
823 	u64 end_address;	/* 4K aligned limit address */
824 };
825 
826 /* Masks for Flags field above */
827 
828 #define ACPI_DMAR_ALLOW_ALL         (1)
829 
830 /* 2: Root Port ATS Capability Reporting Structure */
831 
832 struct acpi_dmar_atsr {
833 	struct acpi_dmar_header header;
834 	u8 flags;
835 	u8 reserved;
836 	u16 segment;
837 };
838 
839 /* Masks for Flags field above */
840 
841 #define ACPI_DMAR_ALL_PORTS         (1)
842 
843 /* 3: Remapping Hardware Static Affinity Structure */
844 
845 struct acpi_dmar_rhsa {
846 	struct acpi_dmar_header header;
847 	u32 reserved;
848 	u64 base_address;
849 	u32 proximity_domain;
850 };
851 
852 /* 4: ACPI Namespace Device Declaration Structure */
853 
854 struct acpi_dmar_andd {
855 	struct acpi_dmar_header header;
856 	u8 reserved[3];
857 	u8 device_number;
858 	char device_name[1];
859 };
860 
861 /* 5: SOC Integrated Address Translation Cache Reporting Structure */
862 
863 struct acpi_dmar_satc {
864 	struct acpi_dmar_header header;
865 	u8 flags;
866 	u8 reserved;
867 	u16 segment;
868 };
869 /*******************************************************************************
870  *
871  * DRTM - Dynamic Root of Trust for Measurement table
872  * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
873  * Table version 1
874  *
875  ******************************************************************************/
876 
877 struct acpi_table_drtm {
878 	struct acpi_table_header header;	/* Common ACPI table header */
879 	u64 entry_base_address;
880 	u64 entry_length;
881 	u32 entry_address32;
882 	u64 entry_address64;
883 	u64 exit_address;
884 	u64 log_area_address;
885 	u32 log_area_length;
886 	u64 arch_dependent_address;
887 	u32 flags;
888 };
889 
890 /* Flag Definitions for above */
891 
892 #define ACPI_DRTM_ACCESS_ALLOWED            (1)
893 #define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
894 #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
895 #define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
896 
897 /* 1) Validated Tables List (64-bit addresses) */
898 
899 struct acpi_drtm_vtable_list {
900 	u32 validated_table_count;
901 	u64 validated_tables[1];
902 };
903 
904 /* 2) Resources List (of Resource Descriptors) */
905 
906 /* Resource Descriptor */
907 
908 struct acpi_drtm_resource {
909 	u8 size[7];
910 	u8 type;
911 	u64 address;
912 };
913 
914 struct acpi_drtm_resource_list {
915 	u32 resource_count;
916 	struct acpi_drtm_resource resources[1];
917 };
918 
919 /* 3) Platform-specific Identifiers List */
920 
921 struct acpi_drtm_dps_id {
922 	u32 dps_id_length;
923 	u8 dps_id[16];
924 };
925 
926 /*******************************************************************************
927  *
928  * ECDT - Embedded Controller Boot Resources Table
929  *        Version 1
930  *
931  ******************************************************************************/
932 
933 struct acpi_table_ecdt {
934 	struct acpi_table_header header;	/* Common ACPI table header */
935 	struct acpi_generic_address control;	/* Address of EC command/status register */
936 	struct acpi_generic_address data;	/* Address of EC data register */
937 	u32 uid;		/* Unique ID - must be same as the EC _UID method */
938 	u8 gpe;			/* The GPE for the EC */
939 	u8 id[1];		/* Full namepath of the EC in the ACPI namespace */
940 };
941 
942 /*******************************************************************************
943  *
944  * EINJ - Error Injection Table (ACPI 4.0)
945  *        Version 1
946  *
947  ******************************************************************************/
948 
949 struct acpi_table_einj {
950 	struct acpi_table_header header;	/* Common ACPI table header */
951 	u32 header_length;
952 	u8 flags;
953 	u8 reserved[3];
954 	u32 entries;
955 };
956 
957 /* EINJ Injection Instruction Entries (actions) */
958 
959 struct acpi_einj_entry {
960 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
961 };
962 
963 /* Masks for Flags field above */
964 
965 #define ACPI_EINJ_PRESERVE          (1)
966 
967 /* Values for Action field above */
968 
969 enum acpi_einj_actions {
970 	ACPI_EINJ_BEGIN_OPERATION = 0,
971 	ACPI_EINJ_GET_TRIGGER_TABLE = 1,
972 	ACPI_EINJ_SET_ERROR_TYPE = 2,
973 	ACPI_EINJ_GET_ERROR_TYPE = 3,
974 	ACPI_EINJ_END_OPERATION = 4,
975 	ACPI_EINJ_EXECUTE_OPERATION = 5,
976 	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
977 	ACPI_EINJ_GET_COMMAND_STATUS = 7,
978 	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
979 	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
980 	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
981 	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
982 };
983 
984 /* Values for Instruction field above */
985 
986 enum acpi_einj_instructions {
987 	ACPI_EINJ_READ_REGISTER = 0,
988 	ACPI_EINJ_READ_REGISTER_VALUE = 1,
989 	ACPI_EINJ_WRITE_REGISTER = 2,
990 	ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
991 	ACPI_EINJ_NOOP = 4,
992 	ACPI_EINJ_FLUSH_CACHELINE = 5,
993 	ACPI_EINJ_INSTRUCTION_RESERVED = 6	/* 6 and greater are reserved */
994 };
995 
996 struct acpi_einj_error_type_with_addr {
997 	u32 error_type;
998 	u32 vendor_struct_offset;
999 	u32 flags;
1000 	u32 apic_id;
1001 	u64 address;
1002 	u64 range;
1003 	u32 pcie_id;
1004 };
1005 
1006 struct acpi_einj_vendor {
1007 	u32 length;
1008 	u32 pcie_id;
1009 	u16 vendor_id;
1010 	u16 device_id;
1011 	u8 revision_id;
1012 	u8 reserved[3];
1013 };
1014 
1015 /* EINJ Trigger Error Action Table */
1016 
1017 struct acpi_einj_trigger {
1018 	u32 header_size;
1019 	u32 revision;
1020 	u32 table_size;
1021 	u32 entry_count;
1022 };
1023 
1024 /* Command status return values */
1025 
1026 enum acpi_einj_command_status {
1027 	ACPI_EINJ_SUCCESS = 0,
1028 	ACPI_EINJ_FAILURE = 1,
1029 	ACPI_EINJ_INVALID_ACCESS = 2,
1030 	ACPI_EINJ_STATUS_RESERVED = 3	/* 3 and greater are reserved */
1031 };
1032 
1033 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
1034 
1035 #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
1036 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
1037 #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
1038 #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
1039 #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
1040 #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
1041 #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
1042 #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
1043 #define ACPI_EINJ_PCIX_FATAL                (1<<8)
1044 #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
1045 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
1046 #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
1047 #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
1048 
1049 /*******************************************************************************
1050  *
1051  * ERST - Error Record Serialization Table (ACPI 4.0)
1052  *        Version 1
1053  *
1054  ******************************************************************************/
1055 
1056 struct acpi_table_erst {
1057 	struct acpi_table_header header;	/* Common ACPI table header */
1058 	u32 header_length;
1059 	u32 reserved;
1060 	u32 entries;
1061 };
1062 
1063 /* ERST Serialization Entries (actions) */
1064 
1065 struct acpi_erst_entry {
1066 	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
1067 };
1068 
1069 /* Masks for Flags field above */
1070 
1071 #define ACPI_ERST_PRESERVE          (1)
1072 
1073 /* Values for Action field above */
1074 
1075 enum acpi_erst_actions {
1076 	ACPI_ERST_BEGIN_WRITE = 0,
1077 	ACPI_ERST_BEGIN_READ = 1,
1078 	ACPI_ERST_BEGIN_CLEAR = 2,
1079 	ACPI_ERST_END = 3,
1080 	ACPI_ERST_SET_RECORD_OFFSET = 4,
1081 	ACPI_ERST_EXECUTE_OPERATION = 5,
1082 	ACPI_ERST_CHECK_BUSY_STATUS = 6,
1083 	ACPI_ERST_GET_COMMAND_STATUS = 7,
1084 	ACPI_ERST_GET_RECORD_ID = 8,
1085 	ACPI_ERST_SET_RECORD_ID = 9,
1086 	ACPI_ERST_GET_RECORD_COUNT = 10,
1087 	ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
1088 	ACPI_ERST_NOT_USED = 12,
1089 	ACPI_ERST_GET_ERROR_RANGE = 13,
1090 	ACPI_ERST_GET_ERROR_LENGTH = 14,
1091 	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
1092 	ACPI_ERST_EXECUTE_TIMINGS = 16,
1093 	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
1094 };
1095 
1096 /* Values for Instruction field above */
1097 
1098 enum acpi_erst_instructions {
1099 	ACPI_ERST_READ_REGISTER = 0,
1100 	ACPI_ERST_READ_REGISTER_VALUE = 1,
1101 	ACPI_ERST_WRITE_REGISTER = 2,
1102 	ACPI_ERST_WRITE_REGISTER_VALUE = 3,
1103 	ACPI_ERST_NOOP = 4,
1104 	ACPI_ERST_LOAD_VAR1 = 5,
1105 	ACPI_ERST_LOAD_VAR2 = 6,
1106 	ACPI_ERST_STORE_VAR1 = 7,
1107 	ACPI_ERST_ADD = 8,
1108 	ACPI_ERST_SUBTRACT = 9,
1109 	ACPI_ERST_ADD_VALUE = 10,
1110 	ACPI_ERST_SUBTRACT_VALUE = 11,
1111 	ACPI_ERST_STALL = 12,
1112 	ACPI_ERST_STALL_WHILE_TRUE = 13,
1113 	ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
1114 	ACPI_ERST_GOTO = 15,
1115 	ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
1116 	ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
1117 	ACPI_ERST_MOVE_DATA = 18,
1118 	ACPI_ERST_INSTRUCTION_RESERVED = 19	/* 19 and greater are reserved */
1119 };
1120 
1121 /* Command status return values */
1122 
1123 enum acpi_erst_command_status {
1124 	ACPI_ERST_SUCCESS = 0,
1125 	ACPI_ERST_NO_SPACE = 1,
1126 	ACPI_ERST_NOT_AVAILABLE = 2,
1127 	ACPI_ERST_FAILURE = 3,
1128 	ACPI_ERST_RECORD_EMPTY = 4,
1129 	ACPI_ERST_NOT_FOUND = 5,
1130 	ACPI_ERST_STATUS_RESERVED = 6	/* 6 and greater are reserved */
1131 };
1132 
1133 /* Error Record Serialization Information */
1134 
1135 struct acpi_erst_info {
1136 	u16 signature;		/* Should be "ER" */
1137 	u8 data[48];
1138 };
1139 
1140 /*******************************************************************************
1141  *
1142  * FPDT - Firmware Performance Data Table (ACPI 5.0)
1143  *        Version 1
1144  *
1145  ******************************************************************************/
1146 
1147 struct acpi_table_fpdt {
1148 	struct acpi_table_header header;	/* Common ACPI table header */
1149 };
1150 
1151 /* FPDT subtable header (Performance Record Structure) */
1152 
1153 struct acpi_fpdt_header {
1154 	u16 type;
1155 	u8 length;
1156 	u8 revision;
1157 };
1158 
1159 /* Values for Type field above */
1160 
1161 enum acpi_fpdt_type {
1162 	ACPI_FPDT_TYPE_BOOT = 0,
1163 	ACPI_FPDT_TYPE_S3PERF = 1
1164 };
1165 
1166 /*
1167  * FPDT subtables
1168  */
1169 
1170 /* 0: Firmware Basic Boot Performance Record */
1171 
1172 struct acpi_fpdt_boot_pointer {
1173 	struct acpi_fpdt_header header;
1174 	u8 reserved[4];
1175 	u64 address;
1176 };
1177 
1178 /* 1: S3 Performance Table Pointer Record */
1179 
1180 struct acpi_fpdt_s3pt_pointer {
1181 	struct acpi_fpdt_header header;
1182 	u8 reserved[4];
1183 	u64 address;
1184 };
1185 
1186 /*
1187  * S3PT - S3 Performance Table. This table is pointed to by the
1188  * S3 Pointer Record above.
1189  */
1190 struct acpi_table_s3pt {
1191 	u8 signature[4];	/* "S3PT" */
1192 	u32 length;
1193 };
1194 
1195 /*
1196  * S3PT Subtables (Not part of the actual FPDT)
1197  */
1198 
1199 /* Values for Type field in S3PT header */
1200 
1201 enum acpi_s3pt_type {
1202 	ACPI_S3PT_TYPE_RESUME = 0,
1203 	ACPI_S3PT_TYPE_SUSPEND = 1,
1204 	ACPI_FPDT_BOOT_PERFORMANCE = 2
1205 };
1206 
1207 struct acpi_s3pt_resume {
1208 	struct acpi_fpdt_header header;
1209 	u32 resume_count;
1210 	u64 full_resume;
1211 	u64 average_resume;
1212 };
1213 
1214 struct acpi_s3pt_suspend {
1215 	struct acpi_fpdt_header header;
1216 	u64 suspend_start;
1217 	u64 suspend_end;
1218 };
1219 
1220 /*
1221  * FPDT Boot Performance Record (Not part of the actual FPDT)
1222  */
1223 struct acpi_fpdt_boot {
1224 	struct acpi_fpdt_header header;
1225 	u8 reserved[4];
1226 	u64 reset_end;
1227 	u64 load_start;
1228 	u64 startup_start;
1229 	u64 exit_services_entry;
1230 	u64 exit_services_exit;
1231 };
1232 
1233 /*******************************************************************************
1234  *
1235  * GTDT - Generic Timer Description Table (ACPI 5.1)
1236  *        Version 2
1237  *
1238  ******************************************************************************/
1239 
1240 struct acpi_table_gtdt {
1241 	struct acpi_table_header header;	/* Common ACPI table header */
1242 	u64 counter_block_addresss;
1243 	u32 reserved;
1244 	u32 secure_el1_interrupt;
1245 	u32 secure_el1_flags;
1246 	u32 non_secure_el1_interrupt;
1247 	u32 non_secure_el1_flags;
1248 	u32 virtual_timer_interrupt;
1249 	u32 virtual_timer_flags;
1250 	u32 non_secure_el2_interrupt;
1251 	u32 non_secure_el2_flags;
1252 	u64 counter_read_block_address;
1253 	u32 platform_timer_count;
1254 	u32 platform_timer_offset;
1255 };
1256 
1257 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
1258 
1259 #define ACPI_GTDT_INTERRUPT_MODE        (1)
1260 #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
1261 #define ACPI_GTDT_ALWAYS_ON             (1<<2)
1262 
1263 struct acpi_gtdt_el2 {
1264 	u32 virtual_el2_timer_gsiv;
1265 	u32 virtual_el2_timer_flags;
1266 };
1267 
1268 /* Common GTDT subtable header */
1269 
1270 struct acpi_gtdt_header {
1271 	u8 type;
1272 	u16 length;
1273 };
1274 
1275 /* Values for GTDT subtable type above */
1276 
1277 enum acpi_gtdt_type {
1278 	ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
1279 	ACPI_GTDT_TYPE_WATCHDOG = 1,
1280 	ACPI_GTDT_TYPE_RESERVED = 2	/* 2 and greater are reserved */
1281 };
1282 
1283 /* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
1284 
1285 /* 0: Generic Timer Block */
1286 
1287 struct acpi_gtdt_timer_block {
1288 	struct acpi_gtdt_header header;
1289 	u8 reserved;
1290 	u64 block_address;
1291 	u32 timer_count;
1292 	u32 timer_offset;
1293 };
1294 
1295 /* Timer Sub-Structure, one per timer */
1296 
1297 struct acpi_gtdt_timer_entry {
1298 	u8 frame_number;
1299 	u8 reserved[3];
1300 	u64 base_address;
1301 	u64 el0_base_address;
1302 	u32 timer_interrupt;
1303 	u32 timer_flags;
1304 	u32 virtual_timer_interrupt;
1305 	u32 virtual_timer_flags;
1306 	u32 common_flags;
1307 };
1308 
1309 /* Flag Definitions: timer_flags and virtual_timer_flags above */
1310 
1311 #define ACPI_GTDT_GT_IRQ_MODE               (1)
1312 #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
1313 
1314 /* Flag Definitions: common_flags above */
1315 
1316 #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
1317 #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
1318 
1319 /* 1: SBSA Generic Watchdog Structure */
1320 
1321 struct acpi_gtdt_watchdog {
1322 	struct acpi_gtdt_header header;
1323 	u8 reserved;
1324 	u64 refresh_frame_address;
1325 	u64 control_frame_address;
1326 	u32 timer_interrupt;
1327 	u32 timer_flags;
1328 };
1329 
1330 /* Flag Definitions: timer_flags above */
1331 
1332 #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
1333 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
1334 #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
1335 
1336 /*******************************************************************************
1337  *
1338  * HEST - Hardware Error Source Table (ACPI 4.0)
1339  *        Version 1
1340  *
1341  ******************************************************************************/
1342 
1343 struct acpi_table_hest {
1344 	struct acpi_table_header header;	/* Common ACPI table header */
1345 	u32 error_source_count;
1346 };
1347 
1348 /* HEST subtable header */
1349 
1350 struct acpi_hest_header {
1351 	u16 type;
1352 	u16 source_id;
1353 };
1354 
1355 /* Values for Type field above for subtables */
1356 
1357 enum acpi_hest_types {
1358 	ACPI_HEST_TYPE_IA32_CHECK = 0,
1359 	ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
1360 	ACPI_HEST_TYPE_IA32_NMI = 2,
1361 	ACPI_HEST_TYPE_NOT_USED3 = 3,
1362 	ACPI_HEST_TYPE_NOT_USED4 = 4,
1363 	ACPI_HEST_TYPE_NOT_USED5 = 5,
1364 	ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
1365 	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
1366 	ACPI_HEST_TYPE_AER_BRIDGE = 8,
1367 	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
1368 	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
1369 	ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
1370 	ACPI_HEST_TYPE_RESERVED = 12	/* 12 and greater are reserved */
1371 };
1372 
1373 /*
1374  * HEST substructures contained in subtables
1375  */
1376 
1377 /*
1378  * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and
1379  * struct acpi_hest_ia_corrected structures.
1380  */
1381 struct acpi_hest_ia_error_bank {
1382 	u8 bank_number;
1383 	u8 clear_status_on_init;
1384 	u8 status_format;
1385 	u8 reserved;
1386 	u32 control_register;
1387 	u64 control_data;
1388 	u32 status_register;
1389 	u32 address_register;
1390 	u32 misc_register;
1391 };
1392 
1393 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
1394 
1395 struct acpi_hest_aer_common {
1396 	u16 reserved1;
1397 	u8 flags;
1398 	u8 enabled;
1399 	u32 records_to_preallocate;
1400 	u32 max_sections_per_record;
1401 	u32 bus;		/* Bus and Segment numbers */
1402 	u16 device;
1403 	u16 function;
1404 	u16 device_control;
1405 	u16 reserved2;
1406 	u32 uncorrectable_mask;
1407 	u32 uncorrectable_severity;
1408 	u32 correctable_mask;
1409 	u32 advanced_capabilities;
1410 };
1411 
1412 /* Masks for HEST Flags fields */
1413 
1414 #define ACPI_HEST_FIRMWARE_FIRST        (1)
1415 #define ACPI_HEST_GLOBAL                (1<<1)
1416 #define ACPI_HEST_GHES_ASSIST           (1<<2)
1417 
1418 /*
1419  * Macros to access the bus/segment numbers in Bus field above:
1420  *  Bus number is encoded in bits 7:0
1421  *  Segment number is encoded in bits 23:8
1422  */
1423 #define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
1424 #define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
1425 
1426 /* Hardware Error Notification */
1427 
1428 struct acpi_hest_notify {
1429 	u8 type;
1430 	u8 length;
1431 	u16 config_write_enable;
1432 	u32 poll_interval;
1433 	u32 vector;
1434 	u32 polling_threshold_value;
1435 	u32 polling_threshold_window;
1436 	u32 error_threshold_value;
1437 	u32 error_threshold_window;
1438 };
1439 
1440 /* Values for Notify Type field above */
1441 
1442 enum acpi_hest_notify_types {
1443 	ACPI_HEST_NOTIFY_POLLED = 0,
1444 	ACPI_HEST_NOTIFY_EXTERNAL = 1,
1445 	ACPI_HEST_NOTIFY_LOCAL = 2,
1446 	ACPI_HEST_NOTIFY_SCI = 3,
1447 	ACPI_HEST_NOTIFY_NMI = 4,
1448 	ACPI_HEST_NOTIFY_CMCI = 5,	/* ACPI 5.0 */
1449 	ACPI_HEST_NOTIFY_MCE = 6,	/* ACPI 5.0 */
1450 	ACPI_HEST_NOTIFY_GPIO = 7,	/* ACPI 6.0 */
1451 	ACPI_HEST_NOTIFY_SEA = 8,	/* ACPI 6.1 */
1452 	ACPI_HEST_NOTIFY_SEI = 9,	/* ACPI 6.1 */
1453 	ACPI_HEST_NOTIFY_GSIV = 10,	/* ACPI 6.1 */
1454 	ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,	/* ACPI 6.2 */
1455 	ACPI_HEST_NOTIFY_RESERVED = 12	/* 12 and greater are reserved */
1456 };
1457 
1458 /* Values for config_write_enable bitfield above */
1459 
1460 #define ACPI_HEST_TYPE                  (1)
1461 #define ACPI_HEST_POLL_INTERVAL         (1<<1)
1462 #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
1463 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
1464 #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
1465 #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
1466 
1467 /*
1468  * HEST subtables
1469  */
1470 
1471 /* 0: IA32 Machine Check Exception */
1472 
1473 struct acpi_hest_ia_machine_check {
1474 	struct acpi_hest_header header;
1475 	u16 reserved1;
1476 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
1477 	u8 enabled;
1478 	u32 records_to_preallocate;
1479 	u32 max_sections_per_record;
1480 	u64 global_capability_data;
1481 	u64 global_control_data;
1482 	u8 num_hardware_banks;
1483 	u8 reserved3[7];
1484 };
1485 
1486 /* 1: IA32 Corrected Machine Check */
1487 
1488 struct acpi_hest_ia_corrected {
1489 	struct acpi_hest_header header;
1490 	u16 reserved1;
1491 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
1492 	u8 enabled;
1493 	u32 records_to_preallocate;
1494 	u32 max_sections_per_record;
1495 	struct acpi_hest_notify notify;
1496 	u8 num_hardware_banks;
1497 	u8 reserved2[3];
1498 };
1499 
1500 /* 2: IA32 Non-Maskable Interrupt */
1501 
1502 struct acpi_hest_ia_nmi {
1503 	struct acpi_hest_header header;
1504 	u32 reserved;
1505 	u32 records_to_preallocate;
1506 	u32 max_sections_per_record;
1507 	u32 max_raw_data_length;
1508 };
1509 
1510 /* 3,4,5: Not used */
1511 
1512 /* 6: PCI Express Root Port AER */
1513 
1514 struct acpi_hest_aer_root {
1515 	struct acpi_hest_header header;
1516 	struct acpi_hest_aer_common aer;
1517 	u32 root_error_command;
1518 };
1519 
1520 /* 7: PCI Express AER (AER Endpoint) */
1521 
1522 struct acpi_hest_aer {
1523 	struct acpi_hest_header header;
1524 	struct acpi_hest_aer_common aer;
1525 };
1526 
1527 /* 8: PCI Express/PCI-X Bridge AER */
1528 
1529 struct acpi_hest_aer_bridge {
1530 	struct acpi_hest_header header;
1531 	struct acpi_hest_aer_common aer;
1532 	u32 uncorrectable_mask2;
1533 	u32 uncorrectable_severity2;
1534 	u32 advanced_capabilities2;
1535 };
1536 
1537 /* 9: Generic Hardware Error Source */
1538 
1539 struct acpi_hest_generic {
1540 	struct acpi_hest_header header;
1541 	u16 related_source_id;
1542 	u8 reserved;
1543 	u8 enabled;
1544 	u32 records_to_preallocate;
1545 	u32 max_sections_per_record;
1546 	u32 max_raw_data_length;
1547 	struct acpi_generic_address error_status_address;
1548 	struct acpi_hest_notify notify;
1549 	u32 error_block_length;
1550 };
1551 
1552 /* 10: Generic Hardware Error Source, version 2 */
1553 
1554 struct acpi_hest_generic_v2 {
1555 	struct acpi_hest_header header;
1556 	u16 related_source_id;
1557 	u8 reserved;
1558 	u8 enabled;
1559 	u32 records_to_preallocate;
1560 	u32 max_sections_per_record;
1561 	u32 max_raw_data_length;
1562 	struct acpi_generic_address error_status_address;
1563 	struct acpi_hest_notify notify;
1564 	u32 error_block_length;
1565 	struct acpi_generic_address read_ack_register;
1566 	u64 read_ack_preserve;
1567 	u64 read_ack_write;
1568 };
1569 
1570 /* Generic Error Status block */
1571 
1572 struct acpi_hest_generic_status {
1573 	u32 block_status;
1574 	u32 raw_data_offset;
1575 	u32 raw_data_length;
1576 	u32 data_length;
1577 	u32 error_severity;
1578 };
1579 
1580 /* Values for block_status flags above */
1581 
1582 #define ACPI_HEST_UNCORRECTABLE             (1)
1583 #define ACPI_HEST_CORRECTABLE               (1<<1)
1584 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
1585 #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
1586 #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4)	/* 8 bits, error count */
1587 
1588 /* Generic Error Data entry */
1589 
1590 struct acpi_hest_generic_data {
1591 	u8 section_type[16];
1592 	u32 error_severity;
1593 	u16 revision;
1594 	u8 validation_bits;
1595 	u8 flags;
1596 	u32 error_data_length;
1597 	u8 fru_id[16];
1598 	u8 fru_text[20];
1599 };
1600 
1601 /* Extension for revision 0x0300 */
1602 
1603 struct acpi_hest_generic_data_v300 {
1604 	u8 section_type[16];
1605 	u32 error_severity;
1606 	u16 revision;
1607 	u8 validation_bits;
1608 	u8 flags;
1609 	u32 error_data_length;
1610 	u8 fru_id[16];
1611 	u8 fru_text[20];
1612 	u64 time_stamp;
1613 };
1614 
1615 /* Values for error_severity above */
1616 
1617 #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
1618 #define ACPI_HEST_GEN_ERROR_FATAL           1
1619 #define ACPI_HEST_GEN_ERROR_CORRECTED       2
1620 #define ACPI_HEST_GEN_ERROR_NONE            3
1621 
1622 /* Flags for validation_bits above */
1623 
1624 #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
1625 #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
1626 #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
1627 
1628 /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
1629 
1630 struct acpi_hest_ia_deferred_check {
1631 	struct acpi_hest_header header;
1632 	u16 reserved1;
1633 	u8 flags;		/* See flags ACPI_HEST_GLOBAL, etc. above */
1634 	u8 enabled;
1635 	u32 records_to_preallocate;
1636 	u32 max_sections_per_record;
1637 	struct acpi_hest_notify notify;
1638 	u8 num_hardware_banks;
1639 	u8 reserved2[3];
1640 };
1641 
1642 /*******************************************************************************
1643  *
1644  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
1645  *        Version 1
1646  *
1647  ******************************************************************************/
1648 
1649 struct acpi_table_hmat {
1650 	struct acpi_table_header header;	/* Common ACPI table header */
1651 	u32 reserved;
1652 };
1653 
1654 /* Values for HMAT structure types */
1655 
1656 enum acpi_hmat_type {
1657 	ACPI_HMAT_TYPE_PROXIMITY = 0,	/* Memory proximity domain attributes */
1658 	ACPI_HMAT_TYPE_LOCALITY = 1,	/* System locality latency and bandwidth information */
1659 	ACPI_HMAT_TYPE_CACHE = 2,	/* Memory side cache information */
1660 	ACPI_HMAT_TYPE_RESERVED = 3	/* 3 and greater are reserved */
1661 };
1662 
1663 struct acpi_hmat_structure {
1664 	u16 type;
1665 	u16 reserved;
1666 	u32 length;
1667 };
1668 
1669 /*
1670  * HMAT Structures, correspond to Type in struct acpi_hmat_structure
1671  */
1672 
1673 /* 0: Memory proximity domain attributes */
1674 
1675 struct acpi_hmat_proximity_domain {
1676 	struct acpi_hmat_structure header;
1677 	u16 flags;
1678 	u16 reserved1;
1679 	u32 processor_PD;	/* Processor proximity domain */
1680 	u32 memory_PD;		/* Memory proximity domain */
1681 	u32 reserved2;
1682 	u64 reserved3;
1683 	u64 reserved4;
1684 };
1685 
1686 /* Masks for Flags field above */
1687 
1688 #define ACPI_HMAT_PROCESSOR_PD_VALID    (1)	/* 1: processor_PD field is valid */
1689 #define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)	/* 1: memory_PD field is valid */
1690 #define ACPI_HMAT_RESERVATION_HINT      (1<<2)	/* 1: Reservation hint */
1691 
1692 /* 1: System locality latency and bandwidth information */
1693 
1694 struct acpi_hmat_locality {
1695 	struct acpi_hmat_structure header;
1696 	u8 flags;
1697 	u8 data_type;
1698 	u8 min_transfer_size;
1699 	u8 reserved1;
1700 	u32 number_of_initiator_Pds;
1701 	u32 number_of_target_Pds;
1702 	u32 reserved2;
1703 	u64 entry_base_unit;
1704 };
1705 
1706 /* Masks for Flags field above */
1707 
1708 #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)     /* Bits 0-3 */
1709 
1710 /* Values for Memory Hierarchy flags */
1711 
1712 #define ACPI_HMAT_MEMORY            0
1713 #define ACPI_HMAT_LAST_LEVEL_CACHE  1
1714 #define ACPI_HMAT_1ST_LEVEL_CACHE   2
1715 #define ACPI_HMAT_2ND_LEVEL_CACHE   3
1716 #define ACPI_HMAT_3RD_LEVEL_CACHE   4
1717 #define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10       /* Bit 4: ACPI 6.4 */
1718 #define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20    /* Bit 5: ACPI 6.4 */
1719 
1720 
1721 /* Values for data_type field above */
1722 
1723 #define ACPI_HMAT_ACCESS_LATENCY    0
1724 #define ACPI_HMAT_READ_LATENCY      1
1725 #define ACPI_HMAT_WRITE_LATENCY     2
1726 #define ACPI_HMAT_ACCESS_BANDWIDTH  3
1727 #define ACPI_HMAT_READ_BANDWIDTH    4
1728 #define ACPI_HMAT_WRITE_BANDWIDTH   5
1729 
1730 /* 2: Memory side cache information */
1731 
1732 struct acpi_hmat_cache {
1733 	struct acpi_hmat_structure header;
1734 	u32 memory_PD;
1735 	u32 reserved1;
1736 	u64 cache_size;
1737 	u32 cache_attributes;
1738 	u16 reserved2;
1739 	u16 number_of_SMBIOShandles;
1740 };
1741 
1742 /* Masks for cache_attributes field above */
1743 
1744 #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
1745 #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
1746 #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
1747 #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
1748 #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
1749 
1750 /* Values for cache associativity flag */
1751 
1752 #define ACPI_HMAT_CA_NONE                     (0)
1753 #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
1754 #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
1755 
1756 /* Values for write policy flag */
1757 
1758 #define ACPI_HMAT_CP_NONE   (0)
1759 #define ACPI_HMAT_CP_WB     (1)
1760 #define ACPI_HMAT_CP_WT     (2)
1761 
1762 /*******************************************************************************
1763  *
1764  * HPET - High Precision Event Timer table
1765  *        Version 1
1766  *
1767  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
1768  * Version 1.0a, October 2004
1769  *
1770  ******************************************************************************/
1771 
1772 struct acpi_table_hpet {
1773 	struct acpi_table_header header;	/* Common ACPI table header */
1774 	u32 id;			/* Hardware ID of event timer block */
1775 	struct acpi_generic_address address;	/* Address of event timer block */
1776 	u8 sequence;		/* HPET sequence number */
1777 	u16 minimum_tick;	/* Main counter min tick, periodic mode */
1778 	u8 flags;
1779 };
1780 
1781 /* Masks for Flags field above */
1782 
1783 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
1784 
1785 /* Values for Page Protect flags */
1786 
1787 enum acpi_hpet_page_protect {
1788 	ACPI_HPET_NO_PAGE_PROTECT = 0,
1789 	ACPI_HPET_PAGE_PROTECT4 = 1,
1790 	ACPI_HPET_PAGE_PROTECT64 = 2
1791 };
1792 
1793 /*******************************************************************************
1794  *
1795  * IBFT - Boot Firmware Table
1796  *        Version 1
1797  *
1798  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
1799  * Specification", Version 1.01, March 1, 2007
1800  *
1801  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
1802  * Therefore, it is not currently supported by the disassembler.
1803  *
1804  ******************************************************************************/
1805 
1806 struct acpi_table_ibft {
1807 	struct acpi_table_header header;	/* Common ACPI table header */
1808 	u8 reserved[12];
1809 };
1810 
1811 /* IBFT common subtable header */
1812 
1813 struct acpi_ibft_header {
1814 	u8 type;
1815 	u8 version;
1816 	u16 length;
1817 	u8 index;
1818 	u8 flags;
1819 };
1820 
1821 /* Values for Type field above */
1822 
1823 enum acpi_ibft_type {
1824 	ACPI_IBFT_TYPE_NOT_USED = 0,
1825 	ACPI_IBFT_TYPE_CONTROL = 1,
1826 	ACPI_IBFT_TYPE_INITIATOR = 2,
1827 	ACPI_IBFT_TYPE_NIC = 3,
1828 	ACPI_IBFT_TYPE_TARGET = 4,
1829 	ACPI_IBFT_TYPE_EXTENSIONS = 5,
1830 	ACPI_IBFT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
1831 };
1832 
1833 /* IBFT subtables */
1834 
1835 struct acpi_ibft_control {
1836 	struct acpi_ibft_header header;
1837 	u16 extensions;
1838 	u16 initiator_offset;
1839 	u16 nic0_offset;
1840 	u16 target0_offset;
1841 	u16 nic1_offset;
1842 	u16 target1_offset;
1843 };
1844 
1845 struct acpi_ibft_initiator {
1846 	struct acpi_ibft_header header;
1847 	u8 sns_server[16];
1848 	u8 slp_server[16];
1849 	u8 primary_server[16];
1850 	u8 secondary_server[16];
1851 	u16 name_length;
1852 	u16 name_offset;
1853 };
1854 
1855 struct acpi_ibft_nic {
1856 	struct acpi_ibft_header header;
1857 	u8 ip_address[16];
1858 	u8 subnet_mask_prefix;
1859 	u8 origin;
1860 	u8 gateway[16];
1861 	u8 primary_dns[16];
1862 	u8 secondary_dns[16];
1863 	u8 dhcp[16];
1864 	u16 vlan;
1865 	u8 mac_address[6];
1866 	u16 pci_address;
1867 	u16 name_length;
1868 	u16 name_offset;
1869 };
1870 
1871 struct acpi_ibft_target {
1872 	struct acpi_ibft_header header;
1873 	u8 target_ip_address[16];
1874 	u16 target_ip_socket;
1875 	u8 target_boot_lun[8];
1876 	u8 chap_type;
1877 	u8 nic_association;
1878 	u16 target_name_length;
1879 	u16 target_name_offset;
1880 	u16 chap_name_length;
1881 	u16 chap_name_offset;
1882 	u16 chap_secret_length;
1883 	u16 chap_secret_offset;
1884 	u16 reverse_chap_name_length;
1885 	u16 reverse_chap_name_offset;
1886 	u16 reverse_chap_secret_length;
1887 	u16 reverse_chap_secret_offset;
1888 };
1889 
1890 /* Reset to default packing */
1891 
1892 #pragma pack()
1893 
1894 #endif				/* __ACTBL1_H__ */
1895