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