Merge branch 'acpi-config' into acpica
[deliverable/linux.git] / include / acpi / actbl3.h
CommitLineData
c5bd6537
BM
1/******************************************************************************
2 *
3 * Name: actbl3.h - ACPI Table Definitions
4 *
5 *****************************************************************************/
6
7/*
fbb7a2dc 8 * Copyright (C) 2000 - 2014, Intel Corp.
c5bd6537
BM
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
4ac4c5fa
BM
47#pragma pack(push) /* Set default struct packing */
48
c5bd6537
BM
49/*******************************************************************************
50 *
51 * Additional ACPI Tables (3)
52 *
53 * These tables are not consumed directly by the ACPICA subsystem, but are
54 * included here to support device drivers and the AML disassembler.
55 *
56 * The tables in this file are fully defined within the ACPI specification.
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 */
99c93f55 73#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */
c5bd6537
BM
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
c5bd6537
BM
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/*
be030a57
BM
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
c5bd6537
BM
100 */
101
102/*******************************************************************************
103 *
104 * BGRT - Boot Graphics Resource Table (ACPI 5.0)
105 * Version 1
106 *
107 ******************************************************************************/
108
109struct acpi_table_bgrt {
110 struct acpi_table_header header; /* Common ACPI table header */
111 u16 version;
112 u8 status;
113 u8 image_type;
114 u64 image_address;
115 u32 image_offset_x;
116 u32 image_offset_y;
117};
118
119/*******************************************************************************
120 *
121 * DRTM - Dynamic Root of Trust for Measurement table
122 *
123 ******************************************************************************/
124
125struct acpi_table_drtm {
126 struct acpi_table_header header; /* Common ACPI table header */
127 u64 entry_base_address;
128 u64 entry_length;
129 u32 entry_address32;
130 u64 entry_address64;
131 u64 exit_address;
132 u64 log_area_address;
133 u32 log_area_length;
134 u64 arch_dependent_address;
135 u32 flags;
136};
137
138/* 1) Validated Tables List */
139
140struct acpi_drtm_vtl_list {
141 u32 validated_table_list_count;
142};
143
144/* 2) Resources List */
145
146struct acpi_drtm_resource_list {
147 u32 resource_list_count;
148};
149
150/* 3) Platform-specific Identifiers List */
151
152struct acpi_drtm_id_list {
153 u32 id_list_count;
154};
155
156/*******************************************************************************
157 *
158 * FPDT - Firmware Performance Data Table (ACPI 5.0)
159 * Version 1
160 *
161 ******************************************************************************/
162
163struct acpi_table_fpdt {
164 struct acpi_table_header header; /* Common ACPI table header */
165};
166
167/* FPDT subtable header */
168
169struct acpi_fpdt_header {
170 u16 type;
171 u8 length;
172 u8 revision;
173};
174
175/* Values for Type field above */
176
177enum acpi_fpdt_type {
178 ACPI_FPDT_TYPE_BOOT = 0,
6be58e2f 179 ACPI_FPDT_TYPE_S3PERF = 1
c5bd6537
BM
180};
181
182/*
183 * FPDT subtables
184 */
185
186/* 0: Firmware Basic Boot Performance Record */
187
188struct acpi_fpdt_boot {
189 struct acpi_fpdt_header header;
190 u8 reserved[4];
191 u64 reset_end;
192 u64 load_start;
193 u64 startup_start;
194 u64 exit_services_entry;
195 u64 exit_services_exit;
196};
197
198/* 1: S3 Performance Table Pointer Record */
199
200struct acpi_fpdt_s3pt_ptr {
201 struct acpi_fpdt_header header;
202 u8 reserved[4];
203 u64 address;
204};
205
206/*
207 * S3PT - S3 Performance Table. This table is pointed to by the
208 * FPDT S3 Pointer Record above.
209 */
210struct acpi_table_s3pt {
211 u8 signature[4]; /* "S3PT" */
212 u32 length;
213};
214
215/*
216 * S3PT Subtables
217 */
218struct acpi_s3pt_header {
219 u16 type;
220 u8 length;
221 u8 revision;
222};
223
224/* Values for Type field above */
225
226enum acpi_s3pt_type {
227 ACPI_S3PT_TYPE_RESUME = 0,
6be58e2f 228 ACPI_S3PT_TYPE_SUSPEND = 1
c5bd6537
BM
229};
230
231struct acpi_s3pt_resume {
232 struct acpi_s3pt_header header;
233 u32 resume_count;
234 u64 full_resume;
235 u64 average_resume;
236};
237
238struct acpi_s3pt_suspend {
239 struct acpi_s3pt_header header;
240 u64 suspend_start;
241 u64 suspend_end;
242};
243
244/*******************************************************************************
245 *
246 * GTDT - Generic Timer Description Table (ACPI 5.0)
247 * Version 1
248 *
249 ******************************************************************************/
250
251struct acpi_table_gtdt {
252 struct acpi_table_header header; /* Common ACPI table header */
253 u64 address;
254 u32 flags;
255 u32 secure_pl1_interrupt;
256 u32 secure_pl1_flags;
257 u32 non_secure_pl1_interrupt;
258 u32 non_secure_pl1_flags;
259 u32 virtual_timer_interrupt;
260 u32 virtual_timer_flags;
261 u32 non_secure_pl2_interrupt;
262 u32 non_secure_pl2_flags;
263};
264
265/* Values for Flags field above */
266
267#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
268
269/* Values for all "TimerFlags" fields above */
270
271#define ACPI_GTDT_INTERRUPT_MODE 1
272#define ACPI_GTDT_INTERRUPT_POLARITY 2
273
274/*******************************************************************************
275 *
276 * MPST - Memory Power State Table (ACPI 5.0)
277 * Version 1
278 *
279 ******************************************************************************/
280
281#define ACPI_MPST_CHANNEL_INFO \
c5bd6537 282 u8 channel_id; \
2d2dd508
BM
283 u8 reserved1[3]; \
284 u16 power_node_count; \
285 u16 reserved2;
c5bd6537
BM
286
287/* Main table */
288
289struct acpi_table_mpst {
290 struct acpi_table_header header; /* Common ACPI table header */
291 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
292};
293
294/* Memory Platform Communication Channel Info */
295
296struct acpi_mpst_channel {
297 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
298};
299
300/* Memory Power Node Structure */
301
302struct acpi_mpst_power_node {
303 u8 flags;
304 u8 reserved1;
305 u16 node_id;
306 u32 length;
307 u64 range_address;
308 u64 range_length;
2d2dd508
BM
309 u32 num_power_states;
310 u32 num_physical_components;
c5bd6537
BM
311};
312
313/* Values for Flags field above */
314
315#define ACPI_MPST_ENABLED 1
316#define ACPI_MPST_POWER_MANAGED 2
317#define ACPI_MPST_HOT_PLUG_CAPABLE 4
318
319/* Memory Power State Structure (follows POWER_NODE above) */
320
321struct acpi_mpst_power_state {
322 u8 power_state;
323 u8 info_index;
324};
325
326/* Physical Component ID Structure (follows POWER_STATE above) */
327
328struct acpi_mpst_component {
329 u16 component_id;
330};
331
332/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
333
334struct acpi_mpst_data_hdr {
335 u16 characteristics_count;
2d2dd508 336 u16 reserved;
c5bd6537
BM
337};
338
339struct acpi_mpst_power_data {
2d2dd508 340 u8 structure_id;
c5bd6537
BM
341 u8 flags;
342 u16 reserved1;
343 u32 average_power;
344 u32 power_saving;
345 u64 exit_latency;
346 u64 reserved2;
347};
348
349/* Values for Flags field above */
350
351#define ACPI_MPST_PRESERVE 1
352#define ACPI_MPST_AUTOENTRY 2
353#define ACPI_MPST_AUTOEXIT 4
354
355/* Shared Memory Region (not part of an ACPI table) */
356
357struct acpi_mpst_shared {
358 u32 signature;
359 u16 pcc_command;
360 u16 pcc_status;
2d2dd508
BM
361 u32 command_register;
362 u32 status_register;
363 u32 power_state_id;
364 u32 power_node_id;
c5bd6537
BM
365 u64 energy_consumed;
366 u64 average_power;
367};
368
369/*******************************************************************************
370 *
371 * PCCT - Platform Communications Channel Table (ACPI 5.0)
372 * Version 1
373 *
374 ******************************************************************************/
375
376struct acpi_table_pcct {
377 struct acpi_table_header header; /* Common ACPI table header */
378 u32 flags;
f0d73664 379 u64 reserved;
c5bd6537
BM
380};
381
382/* Values for Flags field above */
383
384#define ACPI_PCCT_DOORBELL 1
385
f0d73664
BM
386/* Values for subtable type in struct acpi_subtable_header */
387
388enum acpi_pcct_type {
389 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
390 ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */
391};
392
c5bd6537 393/*
f0d73664 394 * PCCT Subtables, correspond to Type in struct acpi_subtable_header
c5bd6537
BM
395 */
396
397/* 0: Generic Communications Subspace */
398
399struct acpi_pcct_subspace {
400 struct acpi_subtable_header header;
401 u8 reserved[6];
402 u64 base_address;
403 u64 length;
404 struct acpi_generic_address doorbell_register;
405 u64 preserve_mask;
406 u64 write_mask;
f0d73664
BM
407 u32 latency;
408 u32 max_access_rate;
409 u16 min_turnaround_time;
c5bd6537
BM
410};
411
412/*
413 * PCC memory structures (not part of the ACPI table)
414 */
415
416/* Shared Memory Region */
417
418struct acpi_pcct_shared_memory {
419 u32 signature;
420 u16 command;
421 u16 status;
422};
423
424/*******************************************************************************
425 *
426 * PMTT - Platform Memory Topology Table (ACPI 5.0)
427 * Version 1
428 *
429 ******************************************************************************/
430
431struct acpi_table_pmtt {
432 struct acpi_table_header header; /* Common ACPI table header */
433 u32 reserved;
434};
435
436/* Common header for PMTT subtables that follow main table */
437
438struct acpi_pmtt_header {
439 u8 type;
440 u8 reserved1;
441 u16 length;
442 u16 flags;
443 u16 reserved2;
444};
445
446/* Values for Type field above */
447
448#define ACPI_PMTT_TYPE_SOCKET 0
449#define ACPI_PMTT_TYPE_CONTROLLER 1
450#define ACPI_PMTT_TYPE_DIMM 2
451#define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
452
453/* Values for Flags field above */
454
455#define ACPI_PMTT_TOP_LEVEL 0x0001
456#define ACPI_PMTT_PHYSICAL 0x0002
457#define ACPI_PMTT_MEMORY_TYPE 0x000C
458
459/*
460 * PMTT subtables, correspond to Type in struct acpi_pmtt_header
461 */
462
463/* 0: Socket Structure */
464
465struct acpi_pmtt_socket {
466 struct acpi_pmtt_header header;
467 u16 socket_id;
468 u16 reserved;
469};
470
471/* 1: Memory Controller subtable */
472
473struct acpi_pmtt_controller {
474 struct acpi_pmtt_header header;
475 u32 read_latency;
476 u32 write_latency;
477 u32 read_bandwidth;
478 u32 write_bandwidth;
479 u16 access_width;
480 u16 alignment;
481 u16 reserved;
482 u16 domain_count;
483};
484
485/* 1a: Proximity Domain substructure */
486
487struct acpi_pmtt_domain {
488 u32 proximity_domain;
489};
490
491/* 2: Physical Component Identifier (DIMM) */
492
493struct acpi_pmtt_physical_component {
494 struct acpi_pmtt_header header;
495 u16 component_id;
496 u16 reserved;
497 u32 memory_size;
498 u32 bios_handle;
499};
500
501/*******************************************************************************
502 *
503 * RASF - RAS Feature Table (ACPI 5.0)
504 * Version 1
505 *
506 ******************************************************************************/
507
508struct acpi_table_rasf {
509 struct acpi_table_header header; /* Common ACPI table header */
510 u8 channel_id[12];
511};
512
513/* RASF Platform Communication Channel Shared Memory Region */
514
515struct acpi_rasf_shared_memory {
516 u32 signature;
517 u16 command;
518 u16 status;
8c280914
LZ
519 u16 version;
520 u8 capabilities[16];
521 u8 set_capabilities[16];
522 u16 num_parameter_blocks;
523 u32 set_capabilities_status;
524};
525
526/* RASF Parameter Block Structure Header */
527
528struct acpi_rasf_parameter_block {
529 u16 type;
530 u16 version;
531 u16 length;
532};
533
534/* RASF Parameter Block Structure for PATROL_SCRUB */
535
536struct acpi_rasf_patrol_scrub_parameter {
537 struct acpi_rasf_parameter_block header;
538 u16 patrol_scrub_command;
539 u64 requested_address_range[2];
540 u64 actual_address_range[2];
c5bd6537 541 u16 flags;
8c280914 542 u8 requested_speed;
c5bd6537
BM
543};
544
545/* Masks for Flags and Speed fields above */
546
547#define ACPI_RASF_SCRUBBER_RUNNING 1
548#define ACPI_RASF_SPEED (7<<1)
8c280914
LZ
549#define ACPI_RASF_SPEED_SLOW (0<<1)
550#define ACPI_RASF_SPEED_MEDIUM (4<<1)
551#define ACPI_RASF_SPEED_FAST (7<<1)
c5bd6537
BM
552
553/* Channel Commands */
554
555enum acpi_rasf_commands {
8c280914
LZ
556 ACPI_RASF_EXECUTE_RASF_COMMAND = 1
557};
558
559/* Platform RAS Capabilities */
560
561enum acpi_rasf_capabiliities {
562 ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
563 ACPI_SW_PATROL_SCRUB_EXPOSED = 1
564};
565
566/* Patrol Scrub Commands */
567
568enum acpi_rasf_patrol_scrub_commands {
569 ACPI_RASF_GET_PATROL_PARAMETERS = 1,
570 ACPI_RASF_START_PATROL_SCRUBBER = 2,
571 ACPI_RASF_STOP_PATROL_SCRUBBER = 3
c5bd6537
BM
572};
573
574/* Channel Command flags */
575
576#define ACPI_RASF_GENERATE_SCI (1<<15)
577
578/* Status values */
579
580enum acpi_rasf_status {
581 ACPI_RASF_SUCCESS = 0,
582 ACPI_RASF_NOT_VALID = 1,
583 ACPI_RASF_NOT_SUPPORTED = 2,
584 ACPI_RASF_BUSY = 3,
585 ACPI_RASF_FAILED = 4,
586 ACPI_RASF_ABORTED = 5,
587 ACPI_RASF_INVALID_DATA = 6
588};
589
590/* Status flags */
591
592#define ACPI_RASF_COMMAND_COMPLETE (1)
593#define ACPI_RASF_SCI_DOORBELL (1<<1)
594#define ACPI_RASF_ERROR (1<<2)
595#define ACPI_RASF_STATUS (0x1F<<3)
596
99c93f55
BM
597/*******************************************************************************
598 *
599 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
600 * Version 3
601 *
602 * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
603 *
604 ******************************************************************************/
605
606struct acpi_table_tpm2 {
607 struct acpi_table_header header; /* Common ACPI table header */
608 u32 flags;
609 u64 control_address;
610 u32 start_method;
611};
612
613/* Control area structure (not part of table, pointed to by control_address) */
614
615struct acpi_tpm2_control {
616 u32 reserved;
617 u32 error;
618 u32 cancel;
619 u32 start;
620 u64 interrupt_control;
621 u32 command_size;
622 u64 command_address;
623 u32 response_size;
624 u64 response_address;
625};
626
4ac4c5fa 627#pragma pack(pop) /* Restore original struct packing */
c5bd6537
BM
628
629#endif /* __ACTBL3_H__ */
This page took 0.183798 seconds and 5 git commands to generate.