actbl3.h revision 1.1.1.6 1 1.1 christos /******************************************************************************
2 1.1 christos *
3 1.1 christos * Name: actbl3.h - ACPI Table Definitions
4 1.1 christos *
5 1.1 christos *****************************************************************************/
6 1.1 christos
7 1.1 christos /*
8 1.1.1.5 christos * Copyright (C) 2000 - 2016, Intel Corp.
9 1.1 christos * All rights reserved.
10 1.1 christos *
11 1.1 christos * Redistribution and use in source and binary forms, with or without
12 1.1 christos * modification, are permitted provided that the following conditions
13 1.1 christos * are met:
14 1.1 christos * 1. Redistributions of source code must retain the above copyright
15 1.1 christos * notice, this list of conditions, and the following disclaimer,
16 1.1 christos * without modification.
17 1.1 christos * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1 christos * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1 christos * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1 christos * including a substantially similar Disclaimer requirement for further
21 1.1 christos * binary redistribution.
22 1.1 christos * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1 christos * of any contributors may be used to endorse or promote products derived
24 1.1 christos * from this software without specific prior written permission.
25 1.1 christos *
26 1.1 christos * Alternatively, this software may be distributed under the terms of the
27 1.1 christos * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1 christos * Software Foundation.
29 1.1 christos *
30 1.1 christos * NO WARRANTY
31 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1 christos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1 christos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1 christos * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1 christos * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1 christos * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1 christos * POSSIBILITY OF SUCH DAMAGES.
42 1.1 christos */
43 1.1 christos
44 1.1 christos #ifndef __ACTBL3_H__
45 1.1 christos #define __ACTBL3_H__
46 1.1 christos
47 1.1 christos
48 1.1 christos /*******************************************************************************
49 1.1 christos *
50 1.1 christos * Additional ACPI Tables (3)
51 1.1 christos *
52 1.1 christos * These tables are not consumed directly by the ACPICA subsystem, but are
53 1.1 christos * included here to support device drivers and the AML disassembler.
54 1.1 christos *
55 1.1.1.4 christos * In general, the tables in this file are fully defined within the ACPI
56 1.1.1.4 christos * specification.
57 1.1 christos *
58 1.1 christos ******************************************************************************/
59 1.1 christos
60 1.1 christos
61 1.1 christos /*
62 1.1 christos * Values for description table header signatures for tables defined in this
63 1.1 christos * file. Useful because they make it more difficult to inadvertently type in
64 1.1 christos * the wrong signature.
65 1.1 christos */
66 1.1 christos #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
67 1.1 christos #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
68 1.1 christos #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
69 1.1 christos #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
70 1.1 christos #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
71 1.1 christos #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
72 1.1 christos #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
73 1.1 christos #define ACPI_SIG_RASF "RASF" /* RAS Feature table */
74 1.1.1.4 christos #define ACPI_SIG_STAO "STAO" /* Status Override table */
75 1.1.1.4 christos #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
76 1.1.1.4 christos #define ACPI_SIG_XENV "XENV" /* Xen Environment table */
77 1.1 christos
78 1.1 christos #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
79 1.1 christos #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
80 1.1 christos
81 1.1 christos /* Reserved table signatures */
82 1.1 christos
83 1.1 christos #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
84 1.1 christos #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
85 1.1 christos
86 1.1 christos /*
87 1.1 christos * All tables must be byte-packed to match the ACPI specification, since
88 1.1 christos * the tables are provided by the system BIOS.
89 1.1 christos */
90 1.1 christos #pragma pack(1)
91 1.1 christos
92 1.1 christos /*
93 1.1 christos * Note: C bitfields are not used for this reason:
94 1.1 christos *
95 1.1 christos * "Bitfields are great and easy to read, but unfortunately the C language
96 1.1 christos * does not specify the layout of bitfields in memory, which means they are
97 1.1 christos * essentially useless for dealing with packed data in on-disk formats or
98 1.1 christos * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
99 1.1 christos * this decision was a design error in C. Ritchie could have picked an order
100 1.1 christos * and stuck with it." Norman Ramsey.
101 1.1 christos * See http://stackoverflow.com/a/1053662/41661
102 1.1 christos */
103 1.1 christos
104 1.1 christos
105 1.1 christos /*******************************************************************************
106 1.1 christos *
107 1.1 christos * BGRT - Boot Graphics Resource Table (ACPI 5.0)
108 1.1 christos * Version 1
109 1.1 christos *
110 1.1 christos ******************************************************************************/
111 1.1 christos
112 1.1 christos typedef struct acpi_table_bgrt
113 1.1 christos {
114 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
115 1.1 christos UINT16 Version;
116 1.1 christos UINT8 Status;
117 1.1 christos UINT8 ImageType;
118 1.1 christos UINT64 ImageAddress;
119 1.1 christos UINT32 ImageOffsetX;
120 1.1 christos UINT32 ImageOffsetY;
121 1.1 christos
122 1.1 christos } ACPI_TABLE_BGRT;
123 1.1 christos
124 1.1 christos
125 1.1 christos /*******************************************************************************
126 1.1 christos *
127 1.1 christos * DRTM - Dynamic Root of Trust for Measurement table
128 1.1.1.4 christos * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
129 1.1.1.4 christos * Table version 1
130 1.1 christos *
131 1.1 christos ******************************************************************************/
132 1.1 christos
133 1.1 christos typedef struct acpi_table_drtm
134 1.1 christos {
135 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
136 1.1 christos UINT64 EntryBaseAddress;
137 1.1 christos UINT64 EntryLength;
138 1.1 christos UINT32 EntryAddress32;
139 1.1 christos UINT64 EntryAddress64;
140 1.1 christos UINT64 ExitAddress;
141 1.1 christos UINT64 LogAreaAddress;
142 1.1 christos UINT32 LogAreaLength;
143 1.1 christos UINT64 ArchDependentAddress;
144 1.1 christos UINT32 Flags;
145 1.1 christos
146 1.1 christos } ACPI_TABLE_DRTM;
147 1.1 christos
148 1.1.1.4 christos /* Flag Definitions for above */
149 1.1.1.4 christos
150 1.1.1.4 christos #define ACPI_DRTM_ACCESS_ALLOWED (1)
151 1.1.1.4 christos #define ACPI_DRTM_ENABLE_GAP_CODE (1<<1)
152 1.1.1.4 christos #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2)
153 1.1.1.4 christos #define ACPI_DRTM_AUTHORITY_ORDER (1<<3)
154 1.1.1.4 christos
155 1.1.1.4 christos
156 1.1.1.4 christos /* 1) Validated Tables List (64-bit addresses) */
157 1.1 christos
158 1.1.1.4 christos typedef struct acpi_drtm_vtable_list
159 1.1 christos {
160 1.1.1.4 christos UINT32 ValidatedTableCount;
161 1.1.1.4 christos UINT64 ValidatedTables[1];
162 1.1 christos
163 1.1.1.4 christos } ACPI_DRTM_VTABLE_LIST;
164 1.1.1.4 christos
165 1.1.1.4 christos /* 2) Resources List (of Resource Descriptors) */
166 1.1.1.4 christos
167 1.1.1.4 christos /* Resource Descriptor */
168 1.1.1.4 christos
169 1.1.1.4 christos typedef struct acpi_drtm_resource
170 1.1.1.4 christos {
171 1.1.1.4 christos UINT8 Size[7];
172 1.1.1.4 christos UINT8 Type;
173 1.1.1.4 christos UINT64 Address;
174 1.1 christos
175 1.1.1.4 christos } ACPI_DRTM_RESOURCE;
176 1.1 christos
177 1.1 christos typedef struct acpi_drtm_resource_list
178 1.1 christos {
179 1.1.1.4 christos UINT32 ResourceCount;
180 1.1.1.4 christos ACPI_DRTM_RESOURCE Resources[1];
181 1.1 christos
182 1.1 christos } ACPI_DRTM_RESOURCE_LIST;
183 1.1 christos
184 1.1 christos /* 3) Platform-specific Identifiers List */
185 1.1 christos
186 1.1.1.4 christos typedef struct acpi_drtm_dps_id
187 1.1 christos {
188 1.1.1.4 christos UINT32 DpsIdLength;
189 1.1.1.4 christos UINT8 DpsId[16];
190 1.1 christos
191 1.1.1.4 christos } ACPI_DRTM_DPS_ID;
192 1.1 christos
193 1.1 christos
194 1.1 christos /*******************************************************************************
195 1.1 christos *
196 1.1 christos * FPDT - Firmware Performance Data Table (ACPI 5.0)
197 1.1 christos * Version 1
198 1.1 christos *
199 1.1 christos ******************************************************************************/
200 1.1 christos
201 1.1 christos typedef struct acpi_table_fpdt
202 1.1 christos {
203 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
204 1.1 christos
205 1.1 christos } ACPI_TABLE_FPDT;
206 1.1 christos
207 1.1 christos
208 1.1.1.6 christos /* FPDT subtable header (Performance Record Structure) */
209 1.1 christos
210 1.1 christos typedef struct acpi_fpdt_header
211 1.1 christos {
212 1.1 christos UINT16 Type;
213 1.1 christos UINT8 Length;
214 1.1 christos UINT8 Revision;
215 1.1 christos
216 1.1 christos } ACPI_FPDT_HEADER;
217 1.1 christos
218 1.1 christos /* Values for Type field above */
219 1.1 christos
220 1.1 christos enum AcpiFpdtType
221 1.1 christos {
222 1.1 christos ACPI_FPDT_TYPE_BOOT = 0,
223 1.1 christos ACPI_FPDT_TYPE_S3PERF = 1
224 1.1 christos };
225 1.1 christos
226 1.1 christos
227 1.1 christos /*
228 1.1 christos * FPDT subtables
229 1.1 christos */
230 1.1 christos
231 1.1 christos /* 0: Firmware Basic Boot Performance Record */
232 1.1 christos
233 1.1.1.6 christos typedef struct acpi_fpdt_boot_pointer
234 1.1 christos {
235 1.1 christos ACPI_FPDT_HEADER Header;
236 1.1 christos UINT8 Reserved[4];
237 1.1.1.6 christos UINT64 Address;
238 1.1 christos
239 1.1.1.6 christos } ACPI_FPDT_BOOT_POINTER;
240 1.1 christos
241 1.1 christos
242 1.1 christos /* 1: S3 Performance Table Pointer Record */
243 1.1 christos
244 1.1.1.6 christos typedef struct acpi_fpdt_s3pt_pointer
245 1.1 christos {
246 1.1 christos ACPI_FPDT_HEADER Header;
247 1.1 christos UINT8 Reserved[4];
248 1.1 christos UINT64 Address;
249 1.1 christos
250 1.1.1.6 christos } ACPI_FPDT_S3PT_POINTER;
251 1.1 christos
252 1.1 christos
253 1.1 christos /*
254 1.1 christos * S3PT - S3 Performance Table. This table is pointed to by the
255 1.1.1.6 christos * S3 Pointer Record above.
256 1.1 christos */
257 1.1 christos typedef struct acpi_table_s3pt
258 1.1 christos {
259 1.1 christos UINT8 Signature[4]; /* "S3PT" */
260 1.1 christos UINT32 Length;
261 1.1 christos
262 1.1 christos } ACPI_TABLE_S3PT;
263 1.1 christos
264 1.1 christos
265 1.1 christos /*
266 1.1.1.6 christos * S3PT Subtables (Not part of the actual FPDT)
267 1.1 christos */
268 1.1 christos
269 1.1.1.6 christos /* Values for Type field in S3PT header */
270 1.1 christos
271 1.1 christos enum AcpiS3ptType
272 1.1 christos {
273 1.1 christos ACPI_S3PT_TYPE_RESUME = 0,
274 1.1.1.6 christos ACPI_S3PT_TYPE_SUSPEND = 1,
275 1.1.1.6 christos ACPI_FPDT_BOOT_PERFORMANCE = 2
276 1.1 christos };
277 1.1 christos
278 1.1 christos typedef struct acpi_s3pt_resume
279 1.1 christos {
280 1.1.1.6 christos ACPI_FPDT_HEADER Header;
281 1.1 christos UINT32 ResumeCount;
282 1.1 christos UINT64 FullResume;
283 1.1 christos UINT64 AverageResume;
284 1.1 christos
285 1.1 christos } ACPI_S3PT_RESUME;
286 1.1 christos
287 1.1 christos typedef struct acpi_s3pt_suspend
288 1.1 christos {
289 1.1.1.6 christos ACPI_FPDT_HEADER Header;
290 1.1 christos UINT64 SuspendStart;
291 1.1 christos UINT64 SuspendEnd;
292 1.1 christos
293 1.1 christos } ACPI_S3PT_SUSPEND;
294 1.1 christos
295 1.1 christos
296 1.1.1.6 christos /*
297 1.1.1.6 christos * FPDT Boot Performance Record (Not part of the actual FPDT)
298 1.1.1.6 christos */
299 1.1.1.6 christos typedef struct acpi_fpdt_boot
300 1.1.1.6 christos {
301 1.1.1.6 christos ACPI_FPDT_HEADER Header;
302 1.1.1.6 christos UINT8 Reserved[4];
303 1.1.1.6 christos UINT64 ResetEnd;
304 1.1.1.6 christos UINT64 LoadStart;
305 1.1.1.6 christos UINT64 StartupStart;
306 1.1.1.6 christos UINT64 ExitServicesEntry;
307 1.1.1.6 christos UINT64 ExitServicesExit;
308 1.1.1.6 christos
309 1.1.1.6 christos } ACPI_FPDT_BOOT;
310 1.1.1.6 christos
311 1.1.1.6 christos
312 1.1 christos /*******************************************************************************
313 1.1 christos *
314 1.1.1.2 christos * GTDT - Generic Timer Description Table (ACPI 5.1)
315 1.1.1.2 christos * Version 2
316 1.1 christos *
317 1.1 christos ******************************************************************************/
318 1.1 christos
319 1.1 christos typedef struct acpi_table_gtdt
320 1.1 christos {
321 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
322 1.1.1.2 christos UINT64 CounterBlockAddresss;
323 1.1.1.2 christos UINT32 Reserved;
324 1.1.1.2 christos UINT32 SecureEl1Interrupt;
325 1.1.1.2 christos UINT32 SecureEl1Flags;
326 1.1.1.2 christos UINT32 NonSecureEl1Interrupt;
327 1.1.1.2 christos UINT32 NonSecureEl1Flags;
328 1.1 christos UINT32 VirtualTimerInterrupt;
329 1.1 christos UINT32 VirtualTimerFlags;
330 1.1.1.2 christos UINT32 NonSecureEl2Interrupt;
331 1.1.1.2 christos UINT32 NonSecureEl2Flags;
332 1.1.1.2 christos UINT64 CounterReadBlockAddress;
333 1.1.1.2 christos UINT32 PlatformTimerCount;
334 1.1.1.2 christos UINT32 PlatformTimerOffset;
335 1.1 christos
336 1.1 christos } ACPI_TABLE_GTDT;
337 1.1 christos
338 1.1.1.2 christos /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
339 1.1.1.2 christos
340 1.1.1.2 christos #define ACPI_GTDT_INTERRUPT_MODE (1)
341 1.1.1.2 christos #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
342 1.1.1.2 christos #define ACPI_GTDT_ALWAYS_ON (1<<2)
343 1.1.1.2 christos
344 1.1.1.2 christos
345 1.1.1.2 christos /* Common GTDT subtable header */
346 1.1.1.2 christos
347 1.1.1.2 christos typedef struct acpi_gtdt_header
348 1.1.1.2 christos {
349 1.1.1.2 christos UINT8 Type;
350 1.1.1.2 christos UINT16 Length;
351 1.1.1.2 christos
352 1.1.1.2 christos } ACPI_GTDT_HEADER;
353 1.1.1.2 christos
354 1.1.1.2 christos /* Values for GTDT subtable type above */
355 1.1 christos
356 1.1.1.2 christos enum AcpiGtdtType
357 1.1.1.2 christos {
358 1.1.1.2 christos ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
359 1.1.1.2 christos ACPI_GTDT_TYPE_WATCHDOG = 1,
360 1.1.1.2 christos ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
361 1.1.1.2 christos };
362 1.1.1.2 christos
363 1.1.1.2 christos
364 1.1.1.2 christos /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
365 1.1.1.2 christos
366 1.1.1.2 christos /* 0: Generic Timer Block */
367 1.1.1.2 christos
368 1.1.1.2 christos typedef struct acpi_gtdt_timer_block
369 1.1.1.2 christos {
370 1.1.1.2 christos ACPI_GTDT_HEADER Header;
371 1.1.1.2 christos UINT8 Reserved;
372 1.1.1.2 christos UINT64 BlockAddress;
373 1.1.1.2 christos UINT32 TimerCount;
374 1.1.1.2 christos UINT32 TimerOffset;
375 1.1.1.2 christos
376 1.1.1.2 christos } ACPI_GTDT_TIMER_BLOCK;
377 1.1.1.2 christos
378 1.1.1.2 christos /* Timer Sub-Structure, one per timer */
379 1.1.1.2 christos
380 1.1.1.2 christos typedef struct acpi_gtdt_timer_entry
381 1.1.1.2 christos {
382 1.1.1.2 christos UINT8 FrameNumber;
383 1.1.1.2 christos UINT8 Reserved[3];
384 1.1.1.2 christos UINT64 BaseAddress;
385 1.1.1.2 christos UINT64 El0BaseAddress;
386 1.1.1.2 christos UINT32 TimerInterrupt;
387 1.1.1.2 christos UINT32 TimerFlags;
388 1.1.1.2 christos UINT32 VirtualTimerInterrupt;
389 1.1.1.2 christos UINT32 VirtualTimerFlags;
390 1.1.1.2 christos UINT32 CommonFlags;
391 1.1 christos
392 1.1.1.2 christos } ACPI_GTDT_TIMER_ENTRY;
393 1.1 christos
394 1.1.1.2 christos /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
395 1.1.1.2 christos
396 1.1.1.2 christos #define ACPI_GTDT_GT_IRQ_MODE (1)
397 1.1.1.2 christos #define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
398 1.1.1.2 christos
399 1.1.1.2 christos /* Flag Definitions: CommonFlags above */
400 1.1.1.2 christos
401 1.1.1.2 christos #define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
402 1.1.1.2 christos #define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
403 1.1.1.2 christos
404 1.1.1.2 christos
405 1.1.1.2 christos /* 1: SBSA Generic Watchdog Structure */
406 1.1.1.2 christos
407 1.1.1.2 christos typedef struct acpi_gtdt_watchdog
408 1.1.1.2 christos {
409 1.1.1.2 christos ACPI_GTDT_HEADER Header;
410 1.1.1.2 christos UINT8 Reserved;
411 1.1.1.2 christos UINT64 RefreshFrameAddress;
412 1.1.1.2 christos UINT64 ControlFrameAddress;
413 1.1.1.2 christos UINT32 TimerInterrupt;
414 1.1.1.2 christos UINT32 TimerFlags;
415 1.1.1.2 christos
416 1.1.1.2 christos } ACPI_GTDT_WATCHDOG;
417 1.1.1.2 christos
418 1.1.1.2 christos /* Flag Definitions: TimerFlags above */
419 1.1.1.2 christos
420 1.1.1.2 christos #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
421 1.1.1.2 christos #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
422 1.1.1.2 christos #define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
423 1.1 christos
424 1.1 christos
425 1.1 christos /*******************************************************************************
426 1.1 christos *
427 1.1 christos * MPST - Memory Power State Table (ACPI 5.0)
428 1.1 christos * Version 1
429 1.1 christos *
430 1.1 christos ******************************************************************************/
431 1.1 christos
432 1.1 christos #define ACPI_MPST_CHANNEL_INFO \
433 1.1 christos UINT8 ChannelId; \
434 1.1 christos UINT8 Reserved1[3]; \
435 1.1 christos UINT16 PowerNodeCount; \
436 1.1 christos UINT16 Reserved2;
437 1.1 christos
438 1.1 christos /* Main table */
439 1.1 christos
440 1.1 christos typedef struct acpi_table_mpst
441 1.1 christos {
442 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
443 1.1 christos ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
444 1.1 christos
445 1.1 christos } ACPI_TABLE_MPST;
446 1.1 christos
447 1.1 christos
448 1.1 christos /* Memory Platform Communication Channel Info */
449 1.1 christos
450 1.1 christos typedef struct acpi_mpst_channel
451 1.1 christos {
452 1.1 christos ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
453 1.1 christos
454 1.1 christos } ACPI_MPST_CHANNEL;
455 1.1 christos
456 1.1 christos
457 1.1 christos /* Memory Power Node Structure */
458 1.1 christos
459 1.1 christos typedef struct acpi_mpst_power_node
460 1.1 christos {
461 1.1 christos UINT8 Flags;
462 1.1 christos UINT8 Reserved1;
463 1.1 christos UINT16 NodeId;
464 1.1 christos UINT32 Length;
465 1.1 christos UINT64 RangeAddress;
466 1.1 christos UINT64 RangeLength;
467 1.1 christos UINT32 NumPowerStates;
468 1.1 christos UINT32 NumPhysicalComponents;
469 1.1 christos
470 1.1 christos } ACPI_MPST_POWER_NODE;
471 1.1 christos
472 1.1 christos /* Values for Flags field above */
473 1.1 christos
474 1.1 christos #define ACPI_MPST_ENABLED 1
475 1.1 christos #define ACPI_MPST_POWER_MANAGED 2
476 1.1 christos #define ACPI_MPST_HOT_PLUG_CAPABLE 4
477 1.1 christos
478 1.1 christos
479 1.1 christos /* Memory Power State Structure (follows POWER_NODE above) */
480 1.1 christos
481 1.1 christos typedef struct acpi_mpst_power_state
482 1.1 christos {
483 1.1 christos UINT8 PowerState;
484 1.1 christos UINT8 InfoIndex;
485 1.1 christos
486 1.1 christos } ACPI_MPST_POWER_STATE;
487 1.1 christos
488 1.1 christos
489 1.1 christos /* Physical Component ID Structure (follows POWER_STATE above) */
490 1.1 christos
491 1.1 christos typedef struct acpi_mpst_component
492 1.1 christos {
493 1.1 christos UINT16 ComponentId;
494 1.1 christos
495 1.1 christos } ACPI_MPST_COMPONENT;
496 1.1 christos
497 1.1 christos
498 1.1 christos /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
499 1.1 christos
500 1.1 christos typedef struct acpi_mpst_data_hdr
501 1.1 christos {
502 1.1 christos UINT16 CharacteristicsCount;
503 1.1 christos UINT16 Reserved;
504 1.1 christos
505 1.1 christos } ACPI_MPST_DATA_HDR;
506 1.1 christos
507 1.1 christos typedef struct acpi_mpst_power_data
508 1.1 christos {
509 1.1 christos UINT8 StructureId;
510 1.1 christos UINT8 Flags;
511 1.1 christos UINT16 Reserved1;
512 1.1 christos UINT32 AveragePower;
513 1.1 christos UINT32 PowerSaving;
514 1.1 christos UINT64 ExitLatency;
515 1.1 christos UINT64 Reserved2;
516 1.1 christos
517 1.1 christos } ACPI_MPST_POWER_DATA;
518 1.1 christos
519 1.1 christos /* Values for Flags field above */
520 1.1 christos
521 1.1 christos #define ACPI_MPST_PRESERVE 1
522 1.1 christos #define ACPI_MPST_AUTOENTRY 2
523 1.1 christos #define ACPI_MPST_AUTOEXIT 4
524 1.1 christos
525 1.1 christos
526 1.1 christos /* Shared Memory Region (not part of an ACPI table) */
527 1.1 christos
528 1.1 christos typedef struct acpi_mpst_shared
529 1.1 christos {
530 1.1 christos UINT32 Signature;
531 1.1 christos UINT16 PccCommand;
532 1.1 christos UINT16 PccStatus;
533 1.1 christos UINT32 CommandRegister;
534 1.1 christos UINT32 StatusRegister;
535 1.1 christos UINT32 PowerStateId;
536 1.1 christos UINT32 PowerNodeId;
537 1.1 christos UINT64 EnergyConsumed;
538 1.1 christos UINT64 AveragePower;
539 1.1 christos
540 1.1 christos } ACPI_MPST_SHARED;
541 1.1 christos
542 1.1 christos
543 1.1 christos /*******************************************************************************
544 1.1 christos *
545 1.1 christos * PCCT - Platform Communications Channel Table (ACPI 5.0)
546 1.1 christos * Version 1
547 1.1 christos *
548 1.1 christos ******************************************************************************/
549 1.1 christos
550 1.1 christos typedef struct acpi_table_pcct
551 1.1 christos {
552 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
553 1.1 christos UINT32 Flags;
554 1.1 christos UINT64 Reserved;
555 1.1 christos
556 1.1 christos } ACPI_TABLE_PCCT;
557 1.1 christos
558 1.1 christos /* Values for Flags field above */
559 1.1 christos
560 1.1 christos #define ACPI_PCCT_DOORBELL 1
561 1.1 christos
562 1.1 christos /* Values for subtable type in ACPI_SUBTABLE_HEADER */
563 1.1 christos
564 1.1 christos enum AcpiPcctType
565 1.1 christos {
566 1.1.1.6 christos ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
567 1.1.1.6 christos ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
568 1.1.1.6 christos ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
569 1.1.1.6 christos ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
570 1.1 christos };
571 1.1 christos
572 1.1 christos /*
573 1.1 christos * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
574 1.1 christos */
575 1.1 christos
576 1.1 christos /* 0: Generic Communications Subspace */
577 1.1 christos
578 1.1 christos typedef struct acpi_pcct_subspace
579 1.1 christos {
580 1.1 christos ACPI_SUBTABLE_HEADER Header;
581 1.1 christos UINT8 Reserved[6];
582 1.1 christos UINT64 BaseAddress;
583 1.1 christos UINT64 Length;
584 1.1 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
585 1.1 christos UINT64 PreserveMask;
586 1.1 christos UINT64 WriteMask;
587 1.1 christos UINT32 Latency;
588 1.1 christos UINT32 MaxAccessRate;
589 1.1 christos UINT16 MinTurnaroundTime;
590 1.1 christos
591 1.1 christos } ACPI_PCCT_SUBSPACE;
592 1.1 christos
593 1.1 christos
594 1.1.1.2 christos /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
595 1.1.1.2 christos
596 1.1.1.2 christos typedef struct acpi_pcct_hw_reduced
597 1.1.1.2 christos {
598 1.1.1.2 christos ACPI_SUBTABLE_HEADER Header;
599 1.1.1.2 christos UINT32 DoorbellInterrupt;
600 1.1.1.2 christos UINT8 Flags;
601 1.1.1.2 christos UINT8 Reserved;
602 1.1.1.2 christos UINT64 BaseAddress;
603 1.1.1.2 christos UINT64 Length;
604 1.1.1.2 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
605 1.1.1.2 christos UINT64 PreserveMask;
606 1.1.1.2 christos UINT64 WriteMask;
607 1.1.1.2 christos UINT32 Latency;
608 1.1.1.2 christos UINT32 MaxAccessRate;
609 1.1.1.2 christos UINT16 MinTurnaroundTime;
610 1.1.1.2 christos
611 1.1.1.2 christos } ACPI_PCCT_HW_REDUCED;
612 1.1.1.2 christos
613 1.1.1.6 christos
614 1.1.1.6 christos /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
615 1.1.1.6 christos
616 1.1.1.6 christos typedef struct acpi_pcct_hw_reduced_type2
617 1.1.1.6 christos {
618 1.1.1.6 christos ACPI_SUBTABLE_HEADER Header;
619 1.1.1.6 christos UINT32 DoorbellInterrupt;
620 1.1.1.6 christos UINT8 Flags;
621 1.1.1.6 christos UINT8 Reserved;
622 1.1.1.6 christos UINT64 BaseAddress;
623 1.1.1.6 christos UINT64 Length;
624 1.1.1.6 christos ACPI_GENERIC_ADDRESS DoorbellRegister;
625 1.1.1.6 christos UINT64 PreserveMask;
626 1.1.1.6 christos UINT64 WriteMask;
627 1.1.1.6 christos UINT32 Latency;
628 1.1.1.6 christos UINT32 MaxAccessRate;
629 1.1.1.6 christos UINT16 MinTurnaroundTime;
630 1.1.1.6 christos ACPI_GENERIC_ADDRESS DoorbellAckRegister;
631 1.1.1.6 christos UINT64 AckPreserveMask;
632 1.1.1.6 christos UINT64 AckWriteMask;
633 1.1.1.6 christos
634 1.1.1.6 christos } ACPI_PCCT_HW_REDUCED_TYPE2;
635 1.1.1.6 christos
636 1.1.1.6 christos
637 1.1.1.2 christos /* Values for doorbell flags above */
638 1.1.1.2 christos
639 1.1.1.2 christos #define ACPI_PCCT_INTERRUPT_POLARITY (1)
640 1.1.1.2 christos #define ACPI_PCCT_INTERRUPT_MODE (1<<1)
641 1.1.1.2 christos
642 1.1.1.2 christos
643 1.1 christos /*
644 1.1 christos * PCC memory structures (not part of the ACPI table)
645 1.1 christos */
646 1.1 christos
647 1.1 christos /* Shared Memory Region */
648 1.1 christos
649 1.1 christos typedef struct acpi_pcct_shared_memory
650 1.1 christos {
651 1.1 christos UINT32 Signature;
652 1.1 christos UINT16 Command;
653 1.1 christos UINT16 Status;
654 1.1 christos
655 1.1 christos } ACPI_PCCT_SHARED_MEMORY;
656 1.1 christos
657 1.1 christos
658 1.1 christos /*******************************************************************************
659 1.1 christos *
660 1.1 christos * PMTT - Platform Memory Topology Table (ACPI 5.0)
661 1.1 christos * Version 1
662 1.1 christos *
663 1.1 christos ******************************************************************************/
664 1.1 christos
665 1.1 christos typedef struct acpi_table_pmtt
666 1.1 christos {
667 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
668 1.1 christos UINT32 Reserved;
669 1.1 christos
670 1.1 christos } ACPI_TABLE_PMTT;
671 1.1 christos
672 1.1 christos
673 1.1 christos /* Common header for PMTT subtables that follow main table */
674 1.1 christos
675 1.1 christos typedef struct acpi_pmtt_header
676 1.1 christos {
677 1.1 christos UINT8 Type;
678 1.1 christos UINT8 Reserved1;
679 1.1 christos UINT16 Length;
680 1.1 christos UINT16 Flags;
681 1.1 christos UINT16 Reserved2;
682 1.1 christos
683 1.1 christos } ACPI_PMTT_HEADER;
684 1.1 christos
685 1.1 christos /* Values for Type field above */
686 1.1 christos
687 1.1 christos #define ACPI_PMTT_TYPE_SOCKET 0
688 1.1 christos #define ACPI_PMTT_TYPE_CONTROLLER 1
689 1.1 christos #define ACPI_PMTT_TYPE_DIMM 2
690 1.1 christos #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
691 1.1 christos
692 1.1 christos /* Values for Flags field above */
693 1.1 christos
694 1.1 christos #define ACPI_PMTT_TOP_LEVEL 0x0001
695 1.1 christos #define ACPI_PMTT_PHYSICAL 0x0002
696 1.1 christos #define ACPI_PMTT_MEMORY_TYPE 0x000C
697 1.1 christos
698 1.1 christos
699 1.1 christos /*
700 1.1 christos * PMTT subtables, correspond to Type in acpi_pmtt_header
701 1.1 christos */
702 1.1 christos
703 1.1 christos
704 1.1 christos /* 0: Socket Structure */
705 1.1 christos
706 1.1 christos typedef struct acpi_pmtt_socket
707 1.1 christos {
708 1.1 christos ACPI_PMTT_HEADER Header;
709 1.1 christos UINT16 SocketId;
710 1.1 christos UINT16 Reserved;
711 1.1 christos
712 1.1 christos } ACPI_PMTT_SOCKET;
713 1.1 christos
714 1.1 christos
715 1.1 christos /* 1: Memory Controller subtable */
716 1.1 christos
717 1.1 christos typedef struct acpi_pmtt_controller
718 1.1 christos {
719 1.1 christos ACPI_PMTT_HEADER Header;
720 1.1 christos UINT32 ReadLatency;
721 1.1 christos UINT32 WriteLatency;
722 1.1 christos UINT32 ReadBandwidth;
723 1.1 christos UINT32 WriteBandwidth;
724 1.1 christos UINT16 AccessWidth;
725 1.1 christos UINT16 Alignment;
726 1.1 christos UINT16 Reserved;
727 1.1 christos UINT16 DomainCount;
728 1.1 christos
729 1.1 christos } ACPI_PMTT_CONTROLLER;
730 1.1 christos
731 1.1 christos /* 1a: Proximity Domain substructure */
732 1.1 christos
733 1.1 christos typedef struct acpi_pmtt_domain
734 1.1 christos {
735 1.1 christos UINT32 ProximityDomain;
736 1.1 christos
737 1.1 christos } ACPI_PMTT_DOMAIN;
738 1.1 christos
739 1.1 christos
740 1.1 christos /* 2: Physical Component Identifier (DIMM) */
741 1.1 christos
742 1.1 christos typedef struct acpi_pmtt_physical_component
743 1.1 christos {
744 1.1 christos ACPI_PMTT_HEADER Header;
745 1.1 christos UINT16 ComponentId;
746 1.1 christos UINT16 Reserved;
747 1.1 christos UINT32 MemorySize;
748 1.1 christos UINT32 BiosHandle;
749 1.1 christos
750 1.1 christos } ACPI_PMTT_PHYSICAL_COMPONENT;
751 1.1 christos
752 1.1 christos
753 1.1 christos /*******************************************************************************
754 1.1 christos *
755 1.1 christos * RASF - RAS Feature Table (ACPI 5.0)
756 1.1 christos * Version 1
757 1.1 christos *
758 1.1 christos ******************************************************************************/
759 1.1 christos
760 1.1 christos typedef struct acpi_table_rasf
761 1.1 christos {
762 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
763 1.1 christos UINT8 ChannelId[12];
764 1.1 christos
765 1.1 christos } ACPI_TABLE_RASF;
766 1.1 christos
767 1.1 christos /* RASF Platform Communication Channel Shared Memory Region */
768 1.1 christos
769 1.1 christos typedef struct acpi_rasf_shared_memory
770 1.1 christos {
771 1.1 christos UINT32 Signature;
772 1.1 christos UINT16 Command;
773 1.1 christos UINT16 Status;
774 1.1 christos UINT16 Version;
775 1.1 christos UINT8 Capabilities[16];
776 1.1 christos UINT8 SetCapabilities[16];
777 1.1 christos UINT16 NumParameterBlocks;
778 1.1 christos UINT32 SetCapabilitiesStatus;
779 1.1 christos
780 1.1 christos } ACPI_RASF_SHARED_MEMORY;
781 1.1 christos
782 1.1 christos /* RASF Parameter Block Structure Header */
783 1.1 christos
784 1.1 christos typedef struct acpi_rasf_parameter_block
785 1.1 christos {
786 1.1 christos UINT16 Type;
787 1.1 christos UINT16 Version;
788 1.1 christos UINT16 Length;
789 1.1 christos
790 1.1 christos } ACPI_RASF_PARAMETER_BLOCK;
791 1.1 christos
792 1.1 christos /* RASF Parameter Block Structure for PATROL_SCRUB */
793 1.1 christos
794 1.1 christos typedef struct acpi_rasf_patrol_scrub_parameter
795 1.1 christos {
796 1.1 christos ACPI_RASF_PARAMETER_BLOCK Header;
797 1.1 christos UINT16 PatrolScrubCommand;
798 1.1 christos UINT64 RequestedAddressRange[2];
799 1.1 christos UINT64 ActualAddressRange[2];
800 1.1 christos UINT16 Flags;
801 1.1 christos UINT8 RequestedSpeed;
802 1.1 christos
803 1.1 christos } ACPI_RASF_PATROL_SCRUB_PARAMETER;
804 1.1 christos
805 1.1 christos /* Masks for Flags and Speed fields above */
806 1.1 christos
807 1.1 christos #define ACPI_RASF_SCRUBBER_RUNNING 1
808 1.1 christos #define ACPI_RASF_SPEED (7<<1)
809 1.1 christos #define ACPI_RASF_SPEED_SLOW (0<<1)
810 1.1 christos #define ACPI_RASF_SPEED_MEDIUM (4<<1)
811 1.1 christos #define ACPI_RASF_SPEED_FAST (7<<1)
812 1.1 christos
813 1.1 christos /* Channel Commands */
814 1.1 christos
815 1.1 christos enum AcpiRasfCommands
816 1.1 christos {
817 1.1 christos ACPI_RASF_EXECUTE_RASF_COMMAND = 1
818 1.1 christos };
819 1.1 christos
820 1.1 christos /* Platform RAS Capabilities */
821 1.1 christos
822 1.1 christos enum AcpiRasfCapabiliities
823 1.1 christos {
824 1.1 christos ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
825 1.1 christos ACPI_SW_PATROL_SCRUB_EXPOSED = 1
826 1.1 christos };
827 1.1 christos
828 1.1 christos /* Patrol Scrub Commands */
829 1.1 christos
830 1.1 christos enum AcpiRasfPatrolScrubCommands
831 1.1 christos {
832 1.1 christos ACPI_RASF_GET_PATROL_PARAMETERS = 1,
833 1.1 christos ACPI_RASF_START_PATROL_SCRUBBER = 2,
834 1.1 christos ACPI_RASF_STOP_PATROL_SCRUBBER = 3
835 1.1 christos };
836 1.1 christos
837 1.1 christos /* Channel Command flags */
838 1.1 christos
839 1.1 christos #define ACPI_RASF_GENERATE_SCI (1<<15)
840 1.1 christos
841 1.1 christos /* Status values */
842 1.1 christos
843 1.1 christos enum AcpiRasfStatus
844 1.1 christos {
845 1.1 christos ACPI_RASF_SUCCESS = 0,
846 1.1 christos ACPI_RASF_NOT_VALID = 1,
847 1.1 christos ACPI_RASF_NOT_SUPPORTED = 2,
848 1.1 christos ACPI_RASF_BUSY = 3,
849 1.1 christos ACPI_RASF_FAILED = 4,
850 1.1 christos ACPI_RASF_ABORTED = 5,
851 1.1 christos ACPI_RASF_INVALID_DATA = 6
852 1.1 christos };
853 1.1 christos
854 1.1 christos /* Status flags */
855 1.1 christos
856 1.1 christos #define ACPI_RASF_COMMAND_COMPLETE (1)
857 1.1 christos #define ACPI_RASF_SCI_DOORBELL (1<<1)
858 1.1 christos #define ACPI_RASF_ERROR (1<<2)
859 1.1 christos #define ACPI_RASF_STATUS (0x1F<<3)
860 1.1 christos
861 1.1 christos
862 1.1 christos /*******************************************************************************
863 1.1 christos *
864 1.1.1.4 christos * STAO - Status Override Table (_STA override) - ACPI 6.0
865 1.1.1.4 christos * Version 1
866 1.1 christos *
867 1.1.1.4 christos * Conforms to "ACPI Specification for Status Override Table"
868 1.1.1.4 christos * 6 January 2015
869 1.1 christos *
870 1.1 christos ******************************************************************************/
871 1.1 christos
872 1.1.1.4 christos typedef struct acpi_table_stao
873 1.1 christos {
874 1.1 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
875 1.1.1.4 christos UINT8 IgnoreUart;
876 1.1 christos
877 1.1.1.4 christos } ACPI_TABLE_STAO;
878 1.1 christos
879 1.1 christos
880 1.1.1.4 christos /*******************************************************************************
881 1.1.1.4 christos *
882 1.1.1.4 christos * WPBT - Windows Platform Environment Table (ACPI 6.0)
883 1.1.1.4 christos * Version 1
884 1.1.1.4 christos *
885 1.1.1.4 christos * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
886 1.1.1.4 christos *
887 1.1.1.4 christos ******************************************************************************/
888 1.1.1.4 christos
889 1.1.1.4 christos typedef struct acpi_table_wpbt
890 1.1 christos {
891 1.1.1.4 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
892 1.1.1.4 christos UINT32 HandoffSize;
893 1.1.1.4 christos UINT64 HandoffAddress;
894 1.1.1.4 christos UINT8 Layout;
895 1.1.1.4 christos UINT8 Type;
896 1.1.1.4 christos UINT16 ArgumentsLength;
897 1.1.1.4 christos
898 1.1.1.4 christos } ACPI_TABLE_WPBT;
899 1.1.1.4 christos
900 1.1.1.4 christos
901 1.1.1.4 christos /*******************************************************************************
902 1.1.1.4 christos *
903 1.1.1.4 christos * XENV - Xen Environment Table (ACPI 6.0)
904 1.1.1.4 christos * Version 1
905 1.1.1.4 christos *
906 1.1.1.4 christos * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
907 1.1.1.4 christos *
908 1.1.1.4 christos ******************************************************************************/
909 1.1.1.4 christos
910 1.1.1.4 christos typedef struct acpi_table_xenv
911 1.1.1.4 christos {
912 1.1.1.4 christos ACPI_TABLE_HEADER Header; /* Common ACPI table header */
913 1.1.1.4 christos UINT64 GrantTableAddress;
914 1.1.1.4 christos UINT64 GrantTableSize;
915 1.1.1.4 christos UINT32 EventInterrupt;
916 1.1.1.4 christos UINT8 EventFlags;
917 1.1 christos
918 1.1.1.4 christos } ACPI_TABLE_XENV;
919 1.1 christos
920 1.1 christos
921 1.1 christos /* Reset to default packing */
922 1.1 christos
923 1.1 christos #pragma pack()
924 1.1 christos
925 1.1 christos #endif /* __ACTBL3_H__ */
926