]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/dev/acpica/include/actbl3.h
MFV of 233442, tzdata2012a
[FreeBSD/FreeBSD.git] / sys / contrib / dev / acpica / include / actbl3.h
1 /******************************************************************************
2  *
3  * Name: actbl3.h - ACPI Table Definitions
4  *
5  *****************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2012, 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
74 #define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
75 #define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
76
77 /* Reserved table signatures */
78
79 #define ACPI_SIG_CSRT           "CSRT"      /* Core System Resources Table */
80 #define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table 2 */
81 #define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
82 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
83 #define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
84
85 /*
86  * All tables must be byte-packed to match the ACPI specification, since
87  * the tables are provided by the system BIOS.
88  */
89 #pragma pack(1)
90
91 /*
92  * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
93  * This is the only type that is even remotely portable. Anything else is not
94  * portable, so do not use any other bitfield types.
95  */
96
97
98 /*******************************************************************************
99  *
100  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
101  *        Version 1
102  *
103  ******************************************************************************/
104
105 typedef struct acpi_table_bgrt
106 {
107     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
108     UINT16                  Version;
109     UINT8                   Status;
110     UINT8                   ImageType;
111     UINT64                  ImageAddress;
112     UINT32                  ImageOffsetX;
113     UINT32                  ImageOffsetY;
114
115 } ACPI_TABLE_BGRT;
116
117
118 /*******************************************************************************
119  *
120  * DRTM - Dynamic Root of Trust for Measurement table
121  *
122  ******************************************************************************/
123
124 typedef struct acpi_table_drtm
125 {
126     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
127     UINT64                  EntryBaseAddress;
128     UINT64                  EntryLength;
129     UINT32                  EntryAddress32;
130     UINT64                  EntryAddress64;
131     UINT64                  ExitAddress;
132     UINT64                  LogAreaAddress;
133     UINT32                  LogAreaLength;
134     UINT64                  ArchDependentAddress;
135     UINT32                  Flags;
136
137 } ACPI_TABLE_DRTM;
138
139 /* 1) Validated Tables List */
140
141 typedef struct acpi_drtm_vtl_list
142 {
143     UINT32                  ValidatedTableListCount;
144
145 } ACPI_DRTM_VTL_LIST;
146
147 /* 2) Resources List */
148
149 typedef struct acpi_drtm_resource_list
150 {
151     UINT32                  ResourceListCount;
152
153 } ACPI_DRTM_RESOURCE_LIST;
154
155 /* 3) Platform-specific Identifiers List */
156
157 typedef struct acpi_drtm_id_list
158 {
159     UINT32                  IdListCount;
160
161 } ACPI_DRTM_ID_LIST;
162
163
164 /*******************************************************************************
165  *
166  * FPDT - Firmware Performance Data Table (ACPI 5.0)
167  *        Version 1
168  *
169  ******************************************************************************/
170
171 typedef struct acpi_table_fpdt
172 {
173     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
174
175 } ACPI_TABLE_FPDT;
176
177
178 /* FPDT subtable header */
179
180 typedef struct acpi_fpdt_header
181 {
182     UINT16                  Type;
183     UINT8                   Length;
184     UINT8                   Revision;
185
186 } ACPI_FPDT_HEADER;
187
188 /* Values for Type field above */
189
190 enum AcpiFpdtType
191 {
192     ACPI_FPDT_TYPE_BOOT                 = 0,
193     ACPI_FPDT_TYPE_S3PERF               = 1,
194 };
195
196
197 /*
198  * FPDT subtables
199  */
200
201 /* 0: Firmware Basic Boot Performance Record */
202
203 typedef struct acpi_fpdt_boot
204 {
205     ACPI_FPDT_HEADER        Header;
206     UINT8                   Reserved[4];
207     UINT64                  ResetEnd;
208     UINT64                  LoadStart;
209     UINT64                  StartupStart;
210     UINT64                  ExitServicesEntry;
211     UINT64                  ExitServicesExit;
212
213 } ACPI_FPDT_BOOT;
214
215
216 /* 1: S3 Performance Table Pointer Record */
217
218 typedef struct acpi_fpdt_s3pt_ptr
219 {
220     ACPI_FPDT_HEADER        Header;
221     UINT8                   Reserved[4];
222     UINT64                  Address;
223
224 } ACPI_FPDT_S3PT_PTR;
225
226
227 /*
228  * S3PT - S3 Performance Table. This table is pointed to by the
229  * FPDT S3 Pointer Record above.
230  */
231 typedef struct acpi_table_s3pt
232 {
233     UINT8                   Signature[4]; /* "S3PT" */
234     UINT32                  Length;
235
236 } ACPI_TABLE_S3PT;
237
238
239 /*
240  * S3PT Subtables
241  */
242 typedef struct acpi_s3pt_header
243 {
244     UINT16                  Type;
245     UINT8                   Length;
246     UINT8                   Revision;
247
248 } ACPI_S3PT_HEADER;
249
250 /* Values for Type field above */
251
252 enum AcpiS3ptType
253 {
254     ACPI_S3PT_TYPE_RESUME               = 0,
255     ACPI_S3PT_TYPE_SUSPEND              = 1,
256 };
257
258 typedef struct acpi_s3pt_resume
259 {
260     ACPI_S3PT_HEADER        Header;
261     UINT32                  ResumeCount;
262     UINT64                  FullResume;
263     UINT64                  AverageResume;
264
265 } ACPI_S3PT_RESUME;
266
267 typedef struct acpi_s3pt_suspend
268 {
269     ACPI_S3PT_HEADER        Header;
270     UINT64                  SuspendStart;
271     UINT64                  SuspendEnd;
272
273 } ACPI_S3PT_SUSPEND;
274
275
276 /*******************************************************************************
277  *
278  * GTDT - Generic Timer Description Table (ACPI 5.0)
279  *        Version 1
280  *
281  ******************************************************************************/
282
283 typedef struct acpi_table_gtdt
284 {
285     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
286     UINT64                  Address;
287     UINT32                  Flags;
288     UINT32                  SecurePl1Interrupt;
289     UINT32                  SecurePl1Flags;
290     UINT32                  NonSecurePl1Interrupt;
291     UINT32                  NonSecurePl1Flags;
292     UINT32                  VirtualTimerInterrupt;
293     UINT32                  VirtualTimerFlags;
294     UINT32                  NonSecurePl2Interrupt;
295     UINT32                  NonSecurePl2Flags;
296
297 } ACPI_TABLE_GTDT;
298
299 /* Values for Flags field above */
300
301 #define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
302
303 /* Values for all "TimerFlags" fields above */
304
305 #define ACPI_GTDT_INTERRUPT_MODE            1
306 #define ACPI_GTDT_INTERRUPT_POLARITY        2
307
308
309 /*******************************************************************************
310  *
311  * MPST - Memory Power State Table (ACPI 5.0)
312  *        Version 1
313  *
314  ******************************************************************************/
315
316 #define ACPI_MPST_CHANNEL_INFO \
317     UINT16                  Reserved1; \
318     UINT8                   ChannelId; \
319     UINT8                   Reserved2; \
320     UINT16                  PowerNodeCount;
321
322 /* Main table */
323
324 typedef struct acpi_table_mpst
325 {
326     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
327     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
328
329 } ACPI_TABLE_MPST;
330
331
332 /* Memory Platform Communication Channel Info */
333
334 typedef struct acpi_mpst_channel
335 {
336     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
337
338 } ACPI_MPST_CHANNEL;
339
340
341 /* Memory Power Node Structure */
342
343 typedef struct acpi_mpst_power_node
344 {
345     UINT8                   Flags;
346     UINT8                   Reserved1;
347     UINT16                  NodeId;
348     UINT32                  Length;
349     UINT64                  RangeAddress;
350     UINT64                  RangeLength;
351     UINT8                   NumPowerStates;
352     UINT8                   NumPhysicalComponents;
353     UINT16                  Reserved2;
354
355 } ACPI_MPST_POWER_NODE;
356
357 /* Values for Flags field above */
358
359 #define ACPI_MPST_ENABLED               1
360 #define ACPI_MPST_POWER_MANAGED         2
361 #define ACPI_MPST_HOT_PLUG_CAPABLE      4
362
363
364 /* Memory Power State Structure (follows POWER_NODE above) */
365
366 typedef struct acpi_mpst_power_state
367 {
368     UINT8                   PowerState;
369     UINT8                   InfoIndex;
370
371 } ACPI_MPST_POWER_STATE;
372
373
374 /* Physical Component ID Structure (follows POWER_STATE above) */
375
376 typedef struct acpi_mpst_component
377 {
378     UINT16                  ComponentId;
379
380 } ACPI_MPST_COMPONENT;
381
382
383 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
384
385 typedef struct acpi_mpst_data_hdr
386 {
387     UINT16                  CharacteristicsCount;
388
389 } ACPI_MPST_DATA_HDR;
390
391 typedef struct acpi_mpst_power_data
392 {
393     UINT8                   Revision;
394     UINT8                   Flags;
395     UINT16                  Reserved1;
396     UINT32                  AveragePower;
397     UINT32                  PowerSaving;
398     UINT64                  ExitLatency;
399     UINT64                  Reserved2;
400
401 } ACPI_MPST_POWER_DATA;
402
403 /* Values for Flags field above */
404
405 #define ACPI_MPST_PRESERVE              1
406 #define ACPI_MPST_AUTOENTRY             2
407 #define ACPI_MPST_AUTOEXIT              4
408
409
410 /* Shared Memory Region (not part of an ACPI table) */
411
412 typedef struct acpi_mpst_shared
413 {
414     UINT32                  Signature;
415     UINT16                  PccCommand;
416     UINT16                  PccStatus;
417     UINT16                  CommandRegister;
418     UINT16                  StatusRegister;
419     UINT16                  PowerStateId;
420     UINT16                  PowerNodeId;
421     UINT64                  EnergyConsumed;
422     UINT64                  AveragePower;
423
424 } ACPI_MPST_SHARED;
425
426
427 /*******************************************************************************
428  *
429  * PCCT - Platform Communications Channel Table (ACPI 5.0)
430  *        Version 1
431  *
432  ******************************************************************************/
433
434 typedef struct acpi_table_pcct
435 {
436     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
437     UINT32                  Flags;
438     UINT32                  Latency;
439     UINT32                  Reserved;
440
441 } ACPI_TABLE_PCCT;
442
443 /* Values for Flags field above */
444
445 #define ACPI_PCCT_DOORBELL              1
446
447 /*
448  * PCCT subtables
449  */
450
451 /* 0: Generic Communications Subspace */
452
453 typedef struct acpi_pcct_subspace
454 {
455     ACPI_SUBTABLE_HEADER    Header;
456     UINT8                   Reserved[6];
457     UINT64                  BaseAddress;
458     UINT64                  Length;
459     ACPI_GENERIC_ADDRESS    DoorbellRegister;
460     UINT64                  PreserveMask;
461     UINT64                  WriteMask;
462
463 } ACPI_PCCT_SUBSPACE;
464
465
466 /*
467  * PCC memory structures (not part of the ACPI table)
468  */
469
470 /* Shared Memory Region */
471
472 typedef struct acpi_pcct_shared_memory
473 {
474     UINT32                  Signature;
475     UINT16                  Command;
476     UINT16                  Status;
477
478 } ACPI_PCCT_SHARED_MEMORY;
479
480
481 /*******************************************************************************
482  *
483  * PMTT - Platform Memory Topology Table (ACPI 5.0)
484  *        Version 1
485  *
486  ******************************************************************************/
487
488 typedef struct acpi_table_pmtt
489 {
490     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
491     UINT32                  Reserved;
492
493 } ACPI_TABLE_PMTT;
494
495
496 /* Common header for PMTT subtables that follow main table */
497
498 typedef struct acpi_pmtt_header
499 {
500     UINT8                   Type;
501     UINT8                   Reserved1;
502     UINT16                  Length;
503     UINT16                  Flags;
504     UINT16                  Reserved2;
505
506 } ACPI_PMTT_HEADER;
507
508 /* Values for Type field above */
509
510 #define ACPI_PMTT_TYPE_SOCKET           0
511 #define ACPI_PMTT_TYPE_CONTROLLER       1
512 #define ACPI_PMTT_TYPE_DIMM             2
513 #define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
514
515 /* Values for Flags field above */
516
517 #define ACPI_PMTT_TOP_LEVEL             0x0001
518 #define ACPI_PMTT_PHYSICAL              0x0002
519 #define ACPI_PMTT_MEMORY_TYPE           0x000C
520
521
522 /*
523  * PMTT subtables, correspond to Type in acpi_pmtt_header
524  */
525
526
527 /* 0: Socket Structure */
528
529 typedef struct acpi_pmtt_socket
530 {
531     ACPI_PMTT_HEADER        Header;
532     UINT16                  SocketId;
533     UINT16                  Reserved;
534
535 } ACPI_PMTT_SOCKET;
536
537
538 /* 1: Memory Controller subtable */
539
540 typedef struct acpi_pmtt_controller
541 {
542     ACPI_PMTT_HEADER        Header;
543     UINT32                  ReadLatency;
544     UINT32                  WriteLatency;
545     UINT32                  ReadBandwidth;
546     UINT32                  WriteBandwidth;
547     UINT16                  AccessWidth;
548     UINT16                  Alignment;
549     UINT16                  Reserved;
550     UINT16                  DomainCount;
551
552 } ACPI_PMTT_CONTROLLER;
553
554 /* 1a: Proximity Domain substructure */
555
556 typedef struct acpi_pmtt_domain
557 {
558     UINT32                  ProximityDomain;
559
560 } ACPI_PMTT_DOMAIN;
561
562
563 /* 2: Physical Component Identifier (DIMM) */
564
565 typedef struct acpi_pmtt_physical_component
566 {
567     ACPI_PMTT_HEADER        Header;
568     UINT16                  ComponentId;
569     UINT16                  Reserved;
570     UINT32                  MemorySize;
571     UINT32                  BiosHandle;
572
573 } ACPI_PMTT_PHYSICAL_COMPONENT;
574
575
576 /*******************************************************************************
577  *
578  * RASF - RAS Feature Table (ACPI 5.0)
579  *        Version 1
580  *
581  ******************************************************************************/
582
583 typedef struct acpi_table_rasf
584 {
585     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
586     UINT8                   ChannelId[12];
587
588 } ACPI_TABLE_RASF;
589
590 /* RASF Platform Communication Channel Shared Memory Region */
591
592 typedef struct acpi_rasf_shared_memory
593 {
594     UINT32                  Signature;
595     UINT16                  Command;
596     UINT16                  Status;
597     UINT64                  RequestedAddress;
598     UINT64                  RequestedLength;
599     UINT64                  ActualAddress;
600     UINT64                  ActualLength;
601     UINT16                  Flags;
602     UINT8                   Speed;
603
604 } ACPI_RASF_SHARED_MEMORY;
605
606 /* Masks for Flags and Speed fields above */
607
608 #define ACPI_RASF_SCRUBBER_RUNNING      1
609 #define ACPI_RASF_SPEED                 (7<<1)
610
611 /* Channel Commands */
612
613 enum AcpiRasfCommands
614 {
615     ACPI_RASF_GET_RAS_CAPABILITIES      = 1,
616     ACPI_RASF_GET_PATROL_PARAMETERS     = 2,
617     ACPI_RASF_START_PATROL_SCRUBBER     = 3,
618     ACPI_RASF_STOP_PATROL_SCRUBBER      = 4
619 };
620
621 /* Channel Command flags */
622
623 #define ACPI_RASF_GENERATE_SCI          (1<<15)
624
625 /* Status values */
626
627 enum AcpiRasfStatus
628 {
629     ACPI_RASF_SUCCESS                   = 0,
630     ACPI_RASF_NOT_VALID                 = 1,
631     ACPI_RASF_NOT_SUPPORTED             = 2,
632     ACPI_RASF_BUSY                      = 3,
633     ACPI_RASF_FAILED                    = 4,
634     ACPI_RASF_ABORTED                   = 5,
635     ACPI_RASF_INVALID_DATA              = 6
636 };
637
638 /* Status flags */
639
640 #define ACPI_RASF_COMMAND_COMPLETE      (1)
641 #define ACPI_RASF_SCI_DOORBELL          (1<<1)
642 #define ACPI_RASF_ERROR                 (1<<2)
643 #define ACPI_RASF_STATUS                (0x1F<<3)
644
645
646 /* Reset to default packing */
647
648 #pragma pack()
649
650 #endif /* __ACTBL3_H__ */