Sync ACPICA with Intel's version 20140828.
[dragonfly.git] / sys / contrib / dev / acpica / source / include / actbl3.h
1 /******************************************************************************
2  *
3  * Name: actbl3.h - ACPI Table Definitions
4  *
5  *****************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2014, 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 __ACTBL3_H__
45 #define __ACTBL3_H__
46
47
48 /*******************************************************************************
49  *
50  * Additional ACPI Tables (3)
51  *
52  * These tables are not consumed directly by the ACPICA subsystem, but are
53  * included here to support device drivers and the AML disassembler.
54  *
55  * The tables in this file are fully defined within the ACPI specification.
56  *
57  ******************************************************************************/
58
59
60 /*
61  * Values for description table header signatures for tables defined in this
62  * file. Useful because they make it more difficult to inadvertently type in
63  * the wrong signature.
64  */
65 #define ACPI_SIG_BGRT           "BGRT"      /* Boot Graphics Resource Table */
66 #define ACPI_SIG_DRTM           "DRTM"      /* Dynamic Root of Trust for Measurement table */
67 #define ACPI_SIG_FPDT           "FPDT"      /* Firmware Performance Data Table */
68 #define ACPI_SIG_GTDT           "GTDT"      /* Generic Timer Description Table */
69 #define ACPI_SIG_MPST           "MPST"      /* Memory Power State Table */
70 #define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
71 #define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
72 #define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
73 #define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
74
75 #define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
76 #define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
77
78 /* Reserved table signatures */
79
80 #define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
81 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
82 #define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
83
84 /*
85  * All tables must be byte-packed to match the ACPI specification, since
86  * the tables are provided by the system BIOS.
87  */
88 #pragma pack(1)
89
90 /*
91  * Note: C bitfields are not used for this reason:
92  *
93  * "Bitfields are great and easy to read, but unfortunately the C language
94  * does not specify the layout of bitfields in memory, which means they are
95  * essentially useless for dealing with packed data in on-disk formats or
96  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
97  * this decision was a design error in C. Ritchie could have picked an order
98  * and stuck with it." Norman Ramsey.
99  * See http://stackoverflow.com/a/1053662/41661
100  */
101
102
103 /*******************************************************************************
104  *
105  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
106  *        Version 1
107  *
108  ******************************************************************************/
109
110 typedef struct acpi_table_bgrt
111 {
112     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
113     UINT16                  Version;
114     UINT8                   Status;
115     UINT8                   ImageType;
116     UINT64                  ImageAddress;
117     UINT32                  ImageOffsetX;
118     UINT32                  ImageOffsetY;
119
120 } ACPI_TABLE_BGRT;
121
122
123 /*******************************************************************************
124  *
125  * DRTM - Dynamic Root of Trust for Measurement table
126  *
127  ******************************************************************************/
128
129 typedef struct acpi_table_drtm
130 {
131     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
132     UINT64                  EntryBaseAddress;
133     UINT64                  EntryLength;
134     UINT32                  EntryAddress32;
135     UINT64                  EntryAddress64;
136     UINT64                  ExitAddress;
137     UINT64                  LogAreaAddress;
138     UINT32                  LogAreaLength;
139     UINT64                  ArchDependentAddress;
140     UINT32                  Flags;
141
142 } ACPI_TABLE_DRTM;
143
144 /* 1) Validated Tables List */
145
146 typedef struct acpi_drtm_vtl_list
147 {
148     UINT32                  ValidatedTableListCount;
149
150 } ACPI_DRTM_VTL_LIST;
151
152 /* 2) Resources List */
153
154 typedef struct acpi_drtm_resource_list
155 {
156     UINT32                  ResourceListCount;
157
158 } ACPI_DRTM_RESOURCE_LIST;
159
160 /* 3) Platform-specific Identifiers List */
161
162 typedef struct acpi_drtm_id_list
163 {
164     UINT32                  IdListCount;
165
166 } ACPI_DRTM_ID_LIST;
167
168
169 /*******************************************************************************
170  *
171  * FPDT - Firmware Performance Data Table (ACPI 5.0)
172  *        Version 1
173  *
174  ******************************************************************************/
175
176 typedef struct acpi_table_fpdt
177 {
178     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
179
180 } ACPI_TABLE_FPDT;
181
182
183 /* FPDT subtable header */
184
185 typedef struct acpi_fpdt_header
186 {
187     UINT16                  Type;
188     UINT8                   Length;
189     UINT8                   Revision;
190
191 } ACPI_FPDT_HEADER;
192
193 /* Values for Type field above */
194
195 enum AcpiFpdtType
196 {
197     ACPI_FPDT_TYPE_BOOT                 = 0,
198     ACPI_FPDT_TYPE_S3PERF               = 1
199 };
200
201
202 /*
203  * FPDT subtables
204  */
205
206 /* 0: Firmware Basic Boot Performance Record */
207
208 typedef struct acpi_fpdt_boot
209 {
210     ACPI_FPDT_HEADER        Header;
211     UINT8                   Reserved[4];
212     UINT64                  ResetEnd;
213     UINT64                  LoadStart;
214     UINT64                  StartupStart;
215     UINT64                  ExitServicesEntry;
216     UINT64                  ExitServicesExit;
217
218 } ACPI_FPDT_BOOT;
219
220
221 /* 1: S3 Performance Table Pointer Record */
222
223 typedef struct acpi_fpdt_s3pt_ptr
224 {
225     ACPI_FPDT_HEADER        Header;
226     UINT8                   Reserved[4];
227     UINT64                  Address;
228
229 } ACPI_FPDT_S3PT_PTR;
230
231
232 /*
233  * S3PT - S3 Performance Table. This table is pointed to by the
234  * FPDT S3 Pointer Record above.
235  */
236 typedef struct acpi_table_s3pt
237 {
238     UINT8                   Signature[4]; /* "S3PT" */
239     UINT32                  Length;
240
241 } ACPI_TABLE_S3PT;
242
243
244 /*
245  * S3PT Subtables
246  */
247 typedef struct acpi_s3pt_header
248 {
249     UINT16                  Type;
250     UINT8                   Length;
251     UINT8                   Revision;
252
253 } ACPI_S3PT_HEADER;
254
255 /* Values for Type field above */
256
257 enum AcpiS3ptType
258 {
259     ACPI_S3PT_TYPE_RESUME               = 0,
260     ACPI_S3PT_TYPE_SUSPEND              = 1
261 };
262
263 typedef struct acpi_s3pt_resume
264 {
265     ACPI_S3PT_HEADER        Header;
266     UINT32                  ResumeCount;
267     UINT64                  FullResume;
268     UINT64                  AverageResume;
269
270 } ACPI_S3PT_RESUME;
271
272 typedef struct acpi_s3pt_suspend
273 {
274     ACPI_S3PT_HEADER        Header;
275     UINT64                  SuspendStart;
276     UINT64                  SuspendEnd;
277
278 } ACPI_S3PT_SUSPEND;
279
280
281 /*******************************************************************************
282  *
283  * GTDT - Generic Timer Description Table (ACPI 5.1)
284  *        Version 2
285  *
286  ******************************************************************************/
287
288 typedef struct acpi_table_gtdt
289 {
290     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
291     UINT64                  CounterBlockAddresss;
292     UINT32                  Reserved;
293     UINT32                  SecureEl1Interrupt;
294     UINT32                  SecureEl1Flags;
295     UINT32                  NonSecureEl1Interrupt;
296     UINT32                  NonSecureEl1Flags;
297     UINT32                  VirtualTimerInterrupt;
298     UINT32                  VirtualTimerFlags;
299     UINT32                  NonSecureEl2Interrupt;
300     UINT32                  NonSecureEl2Flags;
301     UINT64                  CounterReadBlockAddress;
302     UINT32                  PlatformTimerCount;
303     UINT32                  PlatformTimerOffset;
304
305 } ACPI_TABLE_GTDT;
306
307 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
308
309 #define ACPI_GTDT_INTERRUPT_MODE        (1)
310 #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
311 #define ACPI_GTDT_ALWAYS_ON             (1<<2)
312
313
314 /* Common GTDT subtable header */
315
316 typedef struct acpi_gtdt_header
317 {
318     UINT8                   Type;
319     UINT16                  Length;
320
321 } ACPI_GTDT_HEADER;
322
323 /* Values for GTDT subtable type above */
324
325 enum AcpiGtdtType
326 {
327     ACPI_GTDT_TYPE_TIMER_BLOCK      = 0,
328     ACPI_GTDT_TYPE_WATCHDOG         = 1,
329     ACPI_GTDT_TYPE_RESERVED         = 2    /* 2 and greater are reserved */
330 };
331
332
333 /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
334
335 /* 0: Generic Timer Block */
336
337 typedef struct acpi_gtdt_timer_block
338 {
339     ACPI_GTDT_HEADER        Header;
340     UINT8                   Reserved;
341     UINT64                  BlockAddress;
342     UINT32                  TimerCount;
343     UINT32                  TimerOffset;
344
345 } ACPI_GTDT_TIMER_BLOCK;
346
347 /* Timer Sub-Structure, one per timer */
348
349 typedef struct acpi_gtdt_timer_entry
350 {
351     UINT8                   FrameNumber;
352     UINT8                   Reserved[3];
353     UINT64                  BaseAddress;
354     UINT64                  El0BaseAddress;
355     UINT32                  TimerInterrupt;
356     UINT32                  TimerFlags;
357     UINT32                  VirtualTimerInterrupt;
358     UINT32                  VirtualTimerFlags;
359     UINT32                  CommonFlags;
360
361 } ACPI_GTDT_TIMER_ENTRY;
362
363 /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
364
365 #define ACPI_GTDT_GT_IRQ_MODE               (1)
366 #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
367
368 /* Flag Definitions: CommonFlags above */
369
370 #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
371 #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
372
373
374 /* 1: SBSA Generic Watchdog Structure */
375
376 typedef struct acpi_gtdt_watchdog
377 {
378     ACPI_GTDT_HEADER        Header;
379     UINT8                   Reserved;
380     UINT64                  RefreshFrameAddress;
381     UINT64                  ControlFrameAddress;
382     UINT32                  TimerInterrupt;
383     UINT32                  TimerFlags;
384
385 } ACPI_GTDT_WATCHDOG;
386
387 /* Flag Definitions: TimerFlags above */
388
389 #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
390 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
391 #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
392
393
394 /*******************************************************************************
395  *
396  * MPST - Memory Power State Table (ACPI 5.0)
397  *        Version 1
398  *
399  ******************************************************************************/
400
401 #define ACPI_MPST_CHANNEL_INFO \
402     UINT8                   ChannelId; \
403     UINT8                   Reserved1[3]; \
404     UINT16                  PowerNodeCount; \
405     UINT16                  Reserved2;
406
407 /* Main table */
408
409 typedef struct acpi_table_mpst
410 {
411     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
412     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
413
414 } ACPI_TABLE_MPST;
415
416
417 /* Memory Platform Communication Channel Info */
418
419 typedef struct acpi_mpst_channel
420 {
421     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
422
423 } ACPI_MPST_CHANNEL;
424
425
426 /* Memory Power Node Structure */
427
428 typedef struct acpi_mpst_power_node
429 {
430     UINT8                   Flags;
431     UINT8                   Reserved1;
432     UINT16                  NodeId;
433     UINT32                  Length;
434     UINT64                  RangeAddress;
435     UINT64                  RangeLength;
436     UINT32                  NumPowerStates;
437     UINT32                  NumPhysicalComponents;
438
439 } ACPI_MPST_POWER_NODE;
440
441 /* Values for Flags field above */
442
443 #define ACPI_MPST_ENABLED               1
444 #define ACPI_MPST_POWER_MANAGED         2
445 #define ACPI_MPST_HOT_PLUG_CAPABLE      4
446
447
448 /* Memory Power State Structure (follows POWER_NODE above) */
449
450 typedef struct acpi_mpst_power_state
451 {
452     UINT8                   PowerState;
453     UINT8                   InfoIndex;
454
455 } ACPI_MPST_POWER_STATE;
456
457
458 /* Physical Component ID Structure (follows POWER_STATE above) */
459
460 typedef struct acpi_mpst_component
461 {
462     UINT16                  ComponentId;
463
464 } ACPI_MPST_COMPONENT;
465
466
467 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
468
469 typedef struct acpi_mpst_data_hdr
470 {
471     UINT16                  CharacteristicsCount;
472     UINT16                  Reserved;
473
474 } ACPI_MPST_DATA_HDR;
475
476 typedef struct acpi_mpst_power_data
477 {
478     UINT8                   StructureId;
479     UINT8                   Flags;
480     UINT16                  Reserved1;
481     UINT32                  AveragePower;
482     UINT32                  PowerSaving;
483     UINT64                  ExitLatency;
484     UINT64                  Reserved2;
485
486 } ACPI_MPST_POWER_DATA;
487
488 /* Values for Flags field above */
489
490 #define ACPI_MPST_PRESERVE              1
491 #define ACPI_MPST_AUTOENTRY             2
492 #define ACPI_MPST_AUTOEXIT              4
493
494
495 /* Shared Memory Region (not part of an ACPI table) */
496
497 typedef struct acpi_mpst_shared
498 {
499     UINT32                  Signature;
500     UINT16                  PccCommand;
501     UINT16                  PccStatus;
502     UINT32                  CommandRegister;
503     UINT32                  StatusRegister;
504     UINT32                  PowerStateId;
505     UINT32                  PowerNodeId;
506     UINT64                  EnergyConsumed;
507     UINT64                  AveragePower;
508
509 } ACPI_MPST_SHARED;
510
511
512 /*******************************************************************************
513  *
514  * PCCT - Platform Communications Channel Table (ACPI 5.0)
515  *        Version 1
516  *
517  ******************************************************************************/
518
519 typedef struct acpi_table_pcct
520 {
521     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
522     UINT32                  Flags;
523     UINT64                  Reserved;
524
525 } ACPI_TABLE_PCCT;
526
527 /* Values for Flags field above */
528
529 #define ACPI_PCCT_DOORBELL              1
530
531 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
532
533 enum AcpiPcctType
534 {
535     ACPI_PCCT_TYPE_GENERIC_SUBSPACE     = 0,
536     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE  = 1,
537     ACPI_PCCT_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
538 };
539
540 /*
541  * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
542  */
543
544 /* 0: Generic Communications Subspace */
545
546 typedef struct acpi_pcct_subspace
547 {
548     ACPI_SUBTABLE_HEADER    Header;
549     UINT8                   Reserved[6];
550     UINT64                  BaseAddress;
551     UINT64                  Length;
552     ACPI_GENERIC_ADDRESS    DoorbellRegister;
553     UINT64                  PreserveMask;
554     UINT64                  WriteMask;
555     UINT32                  Latency;
556     UINT32                  MaxAccessRate;
557     UINT16                  MinTurnaroundTime;
558
559 } ACPI_PCCT_SUBSPACE;
560
561
562 /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
563
564 typedef struct acpi_pcct_hw_reduced
565 {
566     ACPI_SUBTABLE_HEADER    Header;
567     UINT32                  DoorbellInterrupt;
568     UINT8                   Flags;
569     UINT8                   Reserved;
570     UINT64                  BaseAddress;
571     UINT64                  Length;
572     ACPI_GENERIC_ADDRESS    DoorbellRegister;
573     UINT64                  PreserveMask;
574     UINT64                  WriteMask;
575     UINT32                  Latency;
576     UINT32                  MaxAccessRate;
577     UINT16                  MinTurnaroundTime;
578
579 } ACPI_PCCT_HW_REDUCED;
580
581 /* Values for doorbell flags above */
582
583 #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
584 #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
585
586
587 /*
588  * PCC memory structures (not part of the ACPI table)
589  */
590
591 /* Shared Memory Region */
592
593 typedef struct acpi_pcct_shared_memory
594 {
595     UINT32                  Signature;
596     UINT16                  Command;
597     UINT16                  Status;
598
599 } ACPI_PCCT_SHARED_MEMORY;
600
601
602 /*******************************************************************************
603  *
604  * PMTT - Platform Memory Topology Table (ACPI 5.0)
605  *        Version 1
606  *
607  ******************************************************************************/
608
609 typedef struct acpi_table_pmtt
610 {
611     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
612     UINT32                  Reserved;
613
614 } ACPI_TABLE_PMTT;
615
616
617 /* Common header for PMTT subtables that follow main table */
618
619 typedef struct acpi_pmtt_header
620 {
621     UINT8                   Type;
622     UINT8                   Reserved1;
623     UINT16                  Length;
624     UINT16                  Flags;
625     UINT16                  Reserved2;
626
627 } ACPI_PMTT_HEADER;
628
629 /* Values for Type field above */
630
631 #define ACPI_PMTT_TYPE_SOCKET           0
632 #define ACPI_PMTT_TYPE_CONTROLLER       1
633 #define ACPI_PMTT_TYPE_DIMM             2
634 #define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
635
636 /* Values for Flags field above */
637
638 #define ACPI_PMTT_TOP_LEVEL             0x0001
639 #define ACPI_PMTT_PHYSICAL              0x0002
640 #define ACPI_PMTT_MEMORY_TYPE           0x000C
641
642
643 /*
644  * PMTT subtables, correspond to Type in acpi_pmtt_header
645  */
646
647
648 /* 0: Socket Structure */
649
650 typedef struct acpi_pmtt_socket
651 {
652     ACPI_PMTT_HEADER        Header;
653     UINT16                  SocketId;
654     UINT16                  Reserved;
655
656 } ACPI_PMTT_SOCKET;
657
658
659 /* 1: Memory Controller subtable */
660
661 typedef struct acpi_pmtt_controller
662 {
663     ACPI_PMTT_HEADER        Header;
664     UINT32                  ReadLatency;
665     UINT32                  WriteLatency;
666     UINT32                  ReadBandwidth;
667     UINT32                  WriteBandwidth;
668     UINT16                  AccessWidth;
669     UINT16                  Alignment;
670     UINT16                  Reserved;
671     UINT16                  DomainCount;
672
673 } ACPI_PMTT_CONTROLLER;
674
675 /* 1a: Proximity Domain substructure */
676
677 typedef struct acpi_pmtt_domain
678 {
679     UINT32                  ProximityDomain;
680
681 } ACPI_PMTT_DOMAIN;
682
683
684 /* 2: Physical Component Identifier (DIMM) */
685
686 typedef struct acpi_pmtt_physical_component
687 {
688     ACPI_PMTT_HEADER        Header;
689     UINT16                  ComponentId;
690     UINT16                  Reserved;
691     UINT32                  MemorySize;
692     UINT32                  BiosHandle;
693
694 } ACPI_PMTT_PHYSICAL_COMPONENT;
695
696
697 /*******************************************************************************
698  *
699  * RASF - RAS Feature Table (ACPI 5.0)
700  *        Version 1
701  *
702  ******************************************************************************/
703
704 typedef struct acpi_table_rasf
705 {
706     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
707     UINT8                   ChannelId[12];
708
709 } ACPI_TABLE_RASF;
710
711 /* RASF Platform Communication Channel Shared Memory Region */
712
713 typedef struct acpi_rasf_shared_memory
714 {
715     UINT32                  Signature;
716     UINT16                  Command;
717     UINT16                  Status;
718     UINT16                  Version;
719     UINT8                   Capabilities[16];
720     UINT8                   SetCapabilities[16];
721     UINT16                  NumParameterBlocks;
722     UINT32                  SetCapabilitiesStatus;
723
724 } ACPI_RASF_SHARED_MEMORY;
725
726 /* RASF Parameter Block Structure Header */
727
728 typedef struct acpi_rasf_parameter_block
729 {
730     UINT16                  Type;
731     UINT16                  Version;
732     UINT16                  Length;
733
734 } ACPI_RASF_PARAMETER_BLOCK;
735
736 /* RASF Parameter Block Structure for PATROL_SCRUB */
737
738 typedef struct acpi_rasf_patrol_scrub_parameter
739 {
740     ACPI_RASF_PARAMETER_BLOCK   Header;
741     UINT16                      PatrolScrubCommand;
742     UINT64                      RequestedAddressRange[2];
743     UINT64                      ActualAddressRange[2];
744     UINT16                      Flags;
745     UINT8                       RequestedSpeed;
746
747 } ACPI_RASF_PATROL_SCRUB_PARAMETER;
748
749 /* Masks for Flags and Speed fields above */
750
751 #define ACPI_RASF_SCRUBBER_RUNNING      1
752 #define ACPI_RASF_SPEED                 (7<<1)
753 #define ACPI_RASF_SPEED_SLOW            (0<<1)
754 #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
755 #define ACPI_RASF_SPEED_FAST            (7<<1)
756
757 /* Channel Commands */
758
759 enum AcpiRasfCommands
760 {
761     ACPI_RASF_EXECUTE_RASF_COMMAND      = 1
762 };
763
764 /* Platform RAS Capabilities */
765
766 enum AcpiRasfCapabiliities
767 {
768     ACPI_HW_PATROL_SCRUB_SUPPORTED      = 0,
769     ACPI_SW_PATROL_SCRUB_EXPOSED        = 1
770 };
771
772 /* Patrol Scrub Commands */
773
774 enum AcpiRasfPatrolScrubCommands
775 {
776     ACPI_RASF_GET_PATROL_PARAMETERS     = 1,
777     ACPI_RASF_START_PATROL_SCRUBBER     = 2,
778     ACPI_RASF_STOP_PATROL_SCRUBBER      = 3
779 };
780
781 /* Channel Command flags */
782
783 #define ACPI_RASF_GENERATE_SCI          (1<<15)
784
785 /* Status values */
786
787 enum AcpiRasfStatus
788 {
789     ACPI_RASF_SUCCESS                   = 0,
790     ACPI_RASF_NOT_VALID                 = 1,
791     ACPI_RASF_NOT_SUPPORTED             = 2,
792     ACPI_RASF_BUSY                      = 3,
793     ACPI_RASF_FAILED                    = 4,
794     ACPI_RASF_ABORTED                   = 5,
795     ACPI_RASF_INVALID_DATA              = 6
796 };
797
798 /* Status flags */
799
800 #define ACPI_RASF_COMMAND_COMPLETE      (1)
801 #define ACPI_RASF_SCI_DOORBELL          (1<<1)
802 #define ACPI_RASF_ERROR                 (1<<2)
803 #define ACPI_RASF_STATUS                (0x1F<<3)
804
805
806 /*******************************************************************************
807  *
808  * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
809  *        Version 3
810  *
811  * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
812  *
813  ******************************************************************************/
814
815 typedef struct acpi_table_tpm2
816 {
817     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
818     UINT32                  Flags;
819     UINT64                  ControlAddress;
820     UINT32                  StartMethod;
821
822 } ACPI_TABLE_TPM2;
823
824 /* Control area structure (not part of table, pointed to by ControlAddress) */
825
826 typedef struct acpi_tpm2_control
827 {
828     UINT32                  Reserved;
829     UINT32                  Error;
830     UINT32                  Cancel;
831     UINT32                  Start;
832     UINT64                  InterruptControl;
833     UINT32                  CommandSize;
834     UINT64                  CommandAddress;
835     UINT32                  ResponseSize;
836     UINT64                  ResponseAddress;
837
838 } ACPI_TPM2_CONTROL;
839
840
841 /* Reset to default packing */
842
843 #pragma pack()
844
845 #endif /* __ACTBL3_H__ */