blob: d6c30c1b5f63fae1652a1c18edef00a9da9d4301 [file] [log] [blame]
Furquan Shaikhe0844632020-05-02 10:23:37 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Furquan Shaikhe0844632020-05-02 10:23:37 -07002
3/*
4 * coreboot ACPI support - headers and defines.
5 */
6
Furquan Shaikh56eafbb2020-04-30 18:38:55 -07007#ifndef __ACPI_ACPI_H__
8#define __ACPI_ACPI_H__
Furquan Shaikhe0844632020-05-02 10:23:37 -07009
10/*
11 * The type and enable fields are common in ACPI, but the
12 * values themselves are hardware implementation defined.
13 */
14#if CONFIG(ACPI_INTEL_HARDWARE_SLEEP_VALUES)
15 #define SLP_EN (1 << 13)
16 #define SLP_TYP_SHIFT 10
17 #define SLP_TYP (7 << SLP_TYP_SHIFT)
18 #define SLP_TYP_S0 0
19 #define SLP_TYP_S1 1
20 #define SLP_TYP_S3 5
21 #define SLP_TYP_S4 6
22 #define SLP_TYP_S5 7
23#elif CONFIG(ACPI_AMD_HARDWARE_SLEEP_VALUES)
24 #define SLP_EN (1 << 13)
25 #define SLP_TYP_SHIFT 10
26 #define SLP_TYP (7 << SLP_TYP_SHIFT)
27 #define SLP_TYP_S0 0
28 #define SLP_TYP_S1 1
29 #define SLP_TYP_S3 3
30 #define SLP_TYP_S4 4
31 #define SLP_TYP_S5 5
32#endif
33
34#define ACPI_TABLE_CREATOR "COREBOOT" /* Must be exactly 8 bytes long! */
35#define OEM_ID "COREv4" /* Must be exactly 6 bytes long! */
Elyes HAOUAS288426d2020-10-01 16:52:26 +020036#define ACPI_DSDT_REV_1 0x01 /* DSDT revision: ACPI v1 */
Elyes HAOUAS7f53ec62020-10-05 16:33:52 +020037#define ACPI_DSDT_REV_2 0x02 /* DSDT revision: ACPI v2.0 and greater */
Furquan Shaikhe0844632020-05-02 10:23:37 -070038
39#if !defined(__ASSEMBLER__) && !defined(__ACPI__)
40#include <commonlib/helpers.h>
41#include <device/device.h>
42#include <uuid.h>
43#include <cper.h>
Kyösti Mälkkiac0dc4a2020-11-18 07:40:21 +020044#include <romstage_handoff.h>
Furquan Shaikhe0844632020-05-02 10:23:37 -070045#include <types.h>
46
Tim Wawrzynczak05a6d5c2021-11-24 09:54:59 -070047enum acpi_device_sleep_states {
48 ACPI_DEVICE_SLEEP_D0 = 0,
49 ACPI_DEVICE_SLEEP_D1 = 1,
50 ACPI_DEVICE_SLEEP_D2 = 2,
51 ACPI_DEVICE_SLEEP_D3 = 3,
52 ACPI_DEVICE_SLEEP_D3_HOT = ACPI_DEVICE_SLEEP_D3,
53 ACPI_DEVICE_SLEEP_D3_COLD = 4,
Eran Mitrani4c9440c2022-11-29 17:46:38 -080054 ACPI_DEVICE_SLEEP_NONE = 5,
Tim Wawrzynczak05a6d5c2021-11-24 09:54:59 -070055};
56
Furquan Shaikhe0844632020-05-02 10:23:37 -070057#define RSDP_SIG "RSD PTR " /* RSDT pointer signature */
58#define ASLC "CORE" /* Must be exactly 4 bytes long! */
59
Raul E Rangel1c0b9f22020-07-09 11:58:38 -060060#define ACPI_NAME_BUFFER_SIZE 5 /* 4 chars + 1 NUL */
61
Furquan Shaikhe0844632020-05-02 10:23:37 -070062/*
63 * The assigned ACPI ID for the coreboot project is 'BOOT'
64 * http://www.uefi.org/acpi_id_list
65 */
66#define COREBOOT_ACPI_ID "BOOT" /* ACPI ID for coreboot HIDs */
67
68/* List of ACPI HID that use the coreboot ACPI ID */
69enum coreboot_acpi_ids {
70 COREBOOT_ACPI_ID_CBTABLE = 0x0000, /* BOOT0000 */
CoolStarc7b27b32023-07-10 18:03:40 -070071 COREBOOT_ACPI_ID_IGD_GMBUS_ARB = 0x0001, /* BOOT0001 */
72 COREBOOT_ACPI_ID_IGD_GMBUS_LINK = 0x0002, /* BOOT0002 */
CoolStarce84a342023-10-15 16:51:54 -070073 COREBOOT_ACPI_ID_AMDGFX_ACP = 0x0003, /* BOOT0003 */
Furquan Shaikhe0844632020-05-02 10:23:37 -070074 COREBOOT_ACPI_ID_MAX = 0xFFFF, /* BOOTFFFF */
75};
76
77enum acpi_tables {
Naresh Solanki18051b32023-11-17 01:19:27 +053078 /* Alphabetic list of Tables defined by ACPI and used by coreboot */
79 BERT, /* Boot Error Record Table */
80 CEDT, /* CXL Early Discovery Table */
81 DBG2, /* Debug Port Table 2 */
82 DMAR, /* DMA Remapping Table */
83 DSDT, /* Differentiated System Description Table */
84 ECDT, /* Embedded Controller Boot Resources Table */
85 EINJ, /* Error Injection Table */
86 FACS, /* Firmware ACPI Control Structure */
87 FADT, /* Fixed ACPI Description Table */
88 GTDT, /* Generic Timer Description Table */
89 HEST, /* Hardware Error Source Table */
90 HMAT, /* Heterogeneous Memory Attribute Table */
91 HPET, /* High Precision Event Timer Table */
92 IVRS, /* I/O Virtualization Reporting Structure */
93 LPIT, /* Low Power Idle Table */
94 MADT, /* Multiple APIC Description Table */
95 MCFG, /* PCI Express Memory Mapped Configuration */
David Milosevicd9822742023-09-22 14:34:28 +020096 PPTT, /* Processor Properties Topology Table */
Naresh Solanki18051b32023-11-17 01:19:27 +053097 RSDP, /* Root System Description Pointer */
98 RSDT, /* Root System Description Table */
99 SLIT, /* System Locality Distance Information Table */
100 SPCR, /* Serial Port Console Redirection Table */
101 SRAT, /* System Resource Affinity Table */
102 SSDT, /* Secondary System Description Table */
103 TCPA, /* Trusted Computing Platform Alliance Table */
104 TPM2, /* Trusted Platform Module 2.0 Table */
Marek Maslanka017003c2023-12-07 13:21:35 +0000105 WDAT, /* Watchdog Action Table */
Naresh Solanki18051b32023-11-17 01:19:27 +0530106 XSDT, /* Extended System Description Table */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700107 /* Additional proprietary tables used by coreboot */
Naresh Solanki18051b32023-11-17 01:19:27 +0530108 CRAT, /* Component Resource Attribute Table */
Naresh Solanki6920c6f2023-09-13 12:01:58 +0200109 IORT, /* Input Output Remapping Table */
Naresh Solanki18051b32023-11-17 01:19:27 +0530110 NHLT, /* Non HD audio Link Table */
111 SPMI, /* Server Platform Management Interface table */
112 VFCT /* VBIOS Fetch Table */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700113};
114
115/* RSDP (Root System Description Pointer) */
116typedef struct acpi_rsdp {
117 char signature[8]; /* RSDP signature */
118 u8 checksum; /* Checksum of the first 20 bytes */
119 char oem_id[6]; /* OEM ID */
120 u8 revision; /* RSDP revision */
121 u32 rsdt_address; /* Physical address of RSDT (32 bits) */
122 u32 length; /* Total RSDP length (incl. extended part) */
123 u64 xsdt_address; /* Physical address of XSDT (64 bits) */
124 u8 ext_checksum; /* Checksum of the whole table */
125 u8 reserved[3];
126} __packed acpi_rsdp_t;
127
128/* GAS (Generic Address Structure) */
129typedef struct acpi_gen_regaddr {
130 u8 space_id; /* Address space ID */
131 u8 bit_width; /* Register size in bits */
132 u8 bit_offset; /* Register bit offset */
133 u8 access_size; /* Access size since ACPI 2.0c */
134 u32 addrl; /* Register address, low 32 bits */
135 u32 addrh; /* Register address, high 32 bits */
136} __packed acpi_addr_t;
137
Elyes HAOUAS5f5fd852020-10-15 12:24:00 +0200138#define ACPI_ADDRESS_SPACE_MEMORY 0 /* System memory */
139#define ACPI_ADDRESS_SPACE_IO 1 /* System I/O */
140#define ACPI_ADDRESS_SPACE_PCI 2 /* PCI config space */
141#define ACPI_ADDRESS_SPACE_EC 3 /* Embedded controller */
142#define ACPI_ADDRESS_SPACE_SMBUS 4 /* SMBus */
143#define ACPI_ADDRESS_SPACE_CMOS 5 /* SystemCMOS */
144#define ACPI_ADDRESS_SPACE_PCI_BAR_TARGET 6 /* PciBarTarget */
145#define ACPI_ADDRESS_SPACE_IPMI 7 /* IPMI */
146#define ACPI_ADDRESS_SPACE_GENERAL_PURPOSE_IO 8 /* GeneralPurposeIO */
147#define ACPI_ADDRESS_SPACE_GENERIC_SERIAL_BUS 9 /* GenericSerialBus */
148#define ACPI_ADDRESS_SPACE_PCC 0x0A /* Platform Comm. Channel */
149#define ACPI_ADDRESS_SPACE_FIXED 0x7f /* Functional fixed hardware */
150#define ACPI_FFIXEDHW_VENDOR_INTEL 1 /* Intel */
151#define ACPI_FFIXEDHW_CLASS_HLT 0 /* C1 Halt */
152#define ACPI_FFIXEDHW_CLASS_IO_HLT 1 /* C1 I/O then Halt */
153#define ACPI_FFIXEDHW_CLASS_MWAIT 2 /* MWAIT Native C-state */
154#define ACPI_FFIXEDHW_FLAG_HW_COORD 1 /* Hardware Coordination bit */
155#define ACPI_FFIXEDHW_FLAG_BM_STS 2 /* BM_STS avoidance bit */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700156/* 0x80-0xbf: Reserved */
157/* 0xc0-0xff: OEM defined */
158
159/* Access size definitions for Generic address structure */
160#define ACPI_ACCESS_SIZE_UNDEFINED 0 /* Undefined (legacy reasons) */
161#define ACPI_ACCESS_SIZE_BYTE_ACCESS 1
162#define ACPI_ACCESS_SIZE_WORD_ACCESS 2
163#define ACPI_ACCESS_SIZE_DWORD_ACCESS 3
164#define ACPI_ACCESS_SIZE_QWORD_ACCESS 4
165
Michael Niewöhnerab088c92021-09-23 17:04:35 +0200166/* Macros for common resource types */
167#define ACPI_REG_MSR(address, offset, width) \
Michael Niewöhnerf72c7b12021-10-05 21:42:57 +0200168 (acpi_addr_t){ \
Michael Niewöhnerab088c92021-09-23 17:04:35 +0200169 .space_id = ACPI_ADDRESS_SPACE_FIXED, \
170 .access_size = ACPI_ACCESS_SIZE_QWORD_ACCESS, \
171 .addrl = address, \
172 .bit_offset = offset, \
173 .bit_width = width, \
174 }
175
Michael Niewöhnerf72c7b12021-10-05 21:42:57 +0200176#define ACPI_REG_UNSUPPORTED (acpi_addr_t){0}
Michael Niewöhnerab088c92021-09-23 17:04:35 +0200177
Furquan Shaikhe0844632020-05-02 10:23:37 -0700178/* Common ACPI HIDs */
179#define ACPI_HID_FDC "PNP0700"
180#define ACPI_HID_KEYBOARD "PNP0303"
181#define ACPI_HID_MOUSE "PNP0F03"
182#define ACPI_HID_COM "PNP0501"
183#define ACPI_HID_LPT "PNP0400"
184#define ACPI_HID_PNP "PNP0C02"
185#define ACPI_HID_CONTAINER "PNP0A05"
186
187/* Generic ACPI header, provided by (almost) all tables */
188typedef struct acpi_table_header {
189 char signature[4]; /* ACPI signature (4 ASCII characters) */
190 u32 length; /* Table length in bytes (incl. header) */
191 u8 revision; /* Table version (not ACPI version!) */
192 u8 checksum; /* To make sum of entire table == 0 */
193 char oem_id[6]; /* OEM identification */
194 char oem_table_id[8]; /* OEM table identification */
195 u32 oem_revision; /* OEM revision number */
196 char asl_compiler_id[4]; /* ASL compiler vendor ID */
197 u32 asl_compiler_revision; /* ASL compiler revision number */
198} __packed acpi_header_t;
199
200/* A maximum number of 32 ACPI tables ought to be enough for now. */
201#define MAX_ACPI_TABLES 32
202
203/* RSDT (Root System Description Table) */
204typedef struct acpi_rsdt {
205 acpi_header_t header;
206 u32 entry[MAX_ACPI_TABLES];
207} __packed acpi_rsdt_t;
208
209/* XSDT (Extended System Description Table) */
210typedef struct acpi_xsdt {
211 acpi_header_t header;
212 u64 entry[MAX_ACPI_TABLES];
213} __packed acpi_xsdt_t;
214
215/* HPET timers */
216typedef struct acpi_hpet {
217 acpi_header_t header;
218 u32 id;
219 acpi_addr_t addr;
220 u8 number;
221 u16 min_tick;
222 u8 attributes;
223} __packed acpi_hpet_t;
224
225/* MCFG (PCI Express MMIO config space BAR description table) */
226typedef struct acpi_mcfg {
227 acpi_header_t header;
228 u8 reserved[8];
229} __packed acpi_mcfg_t;
230
231typedef struct acpi_tcpa {
232 acpi_header_t header;
233 u16 platform_class;
234 u32 laml;
235 u64 lasa;
236} __packed acpi_tcpa_t;
237
238typedef struct acpi_tpm2 {
239 acpi_header_t header;
240 u16 platform_class;
241 u8 reserved[2];
242 u64 control_area;
243 u32 start_method;
244 u8 msp[12];
245 u32 laml;
246 u64 lasa;
247} __packed acpi_tpm2_t;
248
249typedef struct acpi_mcfg_mmconfig {
Naresh Solanki4d0b1842023-08-25 12:58:11 +0200250 u64 base_address;
Furquan Shaikhe0844632020-05-02 10:23:37 -0700251 u16 pci_segment_group_number;
252 u8 start_bus_number;
253 u8 end_bus_number;
254 u8 reserved[4];
255} __packed acpi_mcfg_mmconfig_t;
256
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -0700257/*
Jonathan Zhang3dcafa82022-05-11 13:11:20 -0700258 * CEDT (CXL Early Discovery Table)
259 * CXL spec 2.0 section 9.14.1
260 */
261typedef struct acpi_cedt {
262 acpi_header_t header;
263 /* Followed by CEDT structures[n] */
264} __packed acpi_cedt_t;
265
266#define ACPI_CEDT_STRUCTURE_CHBS 0
267#define ACPI_CEDT_STRUCTURE_CFMWS 1
268
269#define ACPI_CEDT_CHBS_CXL_VER_1_1 0x00
270#define ACPI_CEDT_CHBS_CXL_VER_2_0 0x01
271
272/* CHBS: CXL Host Bridge Structure */
273typedef struct acpi_cedt_chbs {
274 u8 type; /* Always 0, other values reserved */
275 u8 resv1;
276 u16 length; /* Length in bytes (32) */
277 u32 uid; /* CXL Host Bridge Unique ID */
278 u32 cxl_ver;
279 u32 resv2;
280 /*
281 * For CXL 1.1, the base is Downstream Port Root Complex Resource Block;
282 * For CXL 2.0, the base is CXL Host Bridge Component Registers.
283 */
284 u64 base;
285 u64 len;
286} __packed acpi_cedt_chbs_t;
287
288#define ACPI_CEDT_CFMWS_RESTRICTION_TYPE_2_MEM (1 << 0)
289#define ACPI_CEDT_CFMWS_RESTRICTION_TYPE_3_MEM (1 << 1)
290#define ACPI_CEDT_CFMWS_RESTRICTION_VOLATIL (1 << 2)
291#define ACPI_CEDT_CFMWS_RESTRICTION_PERSISTENT (1 << 3)
292#define ACPI_CEDT_CFMWS_RESTRICTION_FIXED (1 << 4)
293
294/* CFMWS: CXL Fixed Memory Window Structure */
295typedef struct acpi_cedt_cfmws {
296 u8 type; /* Type (0) */
297 u8 resv1;
298 u16 length; /* Length in bytes (32) */
299 u32 resv2;
300 u64 base_hpa; /* Base of the HPA range, 256MB aligned */
301 u64 window_size; /* Number of bytes this window represents */
302 u8 eniw; /* Encoded Number of Interleave Ways */
303 u8 interleave_arithmetic; /* Standard Modulo arithmetic (0) */
304 u16 resv3;
305 u32 hbig; /* Host Bridge Interleave Granularity */
306 u16 restriction;
307 u16 qtg_id;
308 u32 interleave_target[]; /* Interleave Target List */
309} __packed acpi_cedt_cfmws_t;
310
311/*
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -0700312 * HMAT (Heterogeneous Memory Attribute Table)
313 * ACPI spec 6.4 section 5.2.27
314 */
315typedef struct acpi_hmat {
316 acpi_header_t header;
317 u32 resv;
318 /* Followed by HMAT table structure[n] */
319} __packed acpi_hmat_t;
320
321/* HMAT: Memory Proximity Domain Attributes structure */
322typedef struct acpi_hmat_mpda {
323 u16 type; /* Type (0) */
324 u16 resv;
325 u32 length; /* Length in bytes (40) */
326 u16 flags;
327 u16 resv1;
328 u32 proximity_domain_initiator;
329 u32 proximity_domain_memory;
330 u32 resv2;
331 u64 resv3;
332 u64 resv4;
333} __packed acpi_hmat_mpda_t;
334
335/* HMAT: System Locality Latency and Bandwidth Information structure */
336typedef struct acpi_hmat_sllbi {
337 u16 type; /* Type (1) */
338 u16 resv;
339 u32 length; /* Length in bytes */
340 u8 flags;
341 u8 data_type;
342 /*
343 * Transfer size defined as a 5-biased power of 2 exponent,
344 * when the bandwidth/latency value is achieved.
345 */
346 u8 min_transfer_size;
347 u8 resv1;
348 u32 num_initiator_domains;
349 u32 num_target_domains;
350 u32 resv2;
351 u64 entry_base_unit;
352 /* Followed by initiator proximity domain list */
353 /* Followed by target proximity domain list */
354 /* Followed by latency / bandwidth values */
355} __packed acpi_hmat_sllbi_t;
356
357/* HMAT: Memory Side Cache Information structure */
358typedef struct acpi_hmat_msci {
359 u16 type; /* Type (2) */
360 u16 resv;
361 u32 length; /* Length in bytes */
362 u32 domain; /* Proximity domain for the memory */
363 u32 resv1;
364 u64 cache_size;
365 /* Describes level, associativity, write policy, cache line size */
366 u32 cache_attributes;
367 u16 resv2;
368 /*
369 * Number of SMBIOS handlers that contribute to the
370 * memory side cache physical devices
371 */
372 u16 num_handlers;
373 /* Followed by SMBIOS handlers*/
374} __packed acpi_hmat_msci_t;
375
Furquan Shaikhe0844632020-05-02 10:23:37 -0700376/* SRAT (System Resource Affinity Table) */
377typedef struct acpi_srat {
378 acpi_header_t header;
379 u32 resv;
380 u64 resv1;
381 /* Followed by static resource allocation structure[n] */
382} __packed acpi_srat_t;
383
Jonathan Zhang3164b642021-04-21 17:51:31 -0700384#define ACPI_SRAT_STRUCTURE_LAPIC 0
385#define ACPI_SRAT_STRUCTURE_MEM 1
386#define ACPI_SRAT_STRUCTURE_GIA 5
387
Naresh Solanki76835cc2023-01-20 19:13:02 +0100388/* SRAT: Processor x2APIC Structure */
389typedef struct acpi_srat_x2apic {
390 u8 type; /* Type (0) */
391 u8 length; /* Length in bytes (16) */
392 u16 reserved; /* Reserved - Must be zero */
393 u32 proximity_domain; /* Proximity domain */
394 u32 x2apic_id; /* x2APIC ID */
395 u32 flags; /* Enable bit 0 = 1, other bits reserved to 0 */
396 u32 clock_domain; /* _CDM Clock Domain */
397 u32 reserved1; /* Reserved */
398} __packed acpi_srat_x2apic_t;
399
Furquan Shaikhe0844632020-05-02 10:23:37 -0700400/* SRAT: Processor Local APIC/SAPIC Affinity Structure */
401typedef struct acpi_srat_lapic {
402 u8 type; /* Type (0) */
403 u8 length; /* Length in bytes (16) */
404 u8 proximity_domain_7_0; /* Proximity domain bits[7:0] */
405 u8 apic_id; /* Local APIC ID */
406 u32 flags; /* Enable bit 0 = 1, other bits reserved to 0 */
407 u8 local_sapic_eid; /* Local SAPIC EID */
408 u8 proximity_domain_31_8[3]; /* Proximity domain bits[31:8] */
409 u32 clock_domain; /* _CDM Clock Domain */
410} __packed acpi_srat_lapic_t;
411
Shuo Liu3108ba52022-07-05 22:56:28 +0800412#define ACPI_SRAT_MEMORY_ENABLED (1 << 0)
413#define ACPI_SRAT_MEMORY_HOT_PLUGGABLE (1 << 1)
414#define ACPI_SRAT_MEMORY_NONVOLATILE (1 << 2)
415
Furquan Shaikhe0844632020-05-02 10:23:37 -0700416/* SRAT: Memory Affinity Structure */
417typedef struct acpi_srat_mem {
418 u8 type; /* Type (1) */
419 u8 length; /* Length in bytes (40) */
420 u32 proximity_domain; /* Proximity domain */
421 u16 resv;
422 u32 base_address_low; /* Mem range base address, low */
423 u32 base_address_high; /* Mem range base address, high */
424 u32 length_low; /* Mem range length, low */
425 u32 length_high; /* Mem range length, high */
426 u32 resv1;
427 u32 flags; /* Enable bit 0, hot pluggable bit 1; Non Volatile bit 2,
428 * other bits reserved to 0
429 */
430 u32 resv2[2];
431} __packed acpi_srat_mem_t;
432
Jonathan Zhang3164b642021-04-21 17:51:31 -0700433/* SRAT: Generic Initiator Affinity Structure (ACPI spec 6.4 section 5.2.16.6) */
434typedef struct acpi_srat_gia {
435 u8 type; /* Type (5) */
436 u8 length; /* Length in bytes (32) */
437 u8 resv;
438 u8 dev_handle_type; /* Device handle type */
439 u32 proximity_domain; /*Proximity domain */
440 u8 dev_handle[16]; /* Device handle */
441 u32 flags;
442 u32 resv1;
443} __packed acpi_srat_gia_t;
444
445#define ACPI_SRAT_GIA_DEV_HANDLE_ACPI 0
446#define ACPI_SRAT_GIA_DEV_HANDLE_PCI 1
447
Furquan Shaikhe0844632020-05-02 10:23:37 -0700448/* SLIT (System Locality Distance Information Table) */
449typedef struct acpi_slit {
450 acpi_header_t header;
451 /* Followed by static resource allocation 8+byte[num*num] */
452} __packed acpi_slit_t;
453
454/* MADT (Multiple APIC Description Table) */
455typedef struct acpi_madt {
456 acpi_header_t header;
457 u32 lapic_addr; /* Local APIC address */
458 u32 flags; /* Multiple APIC flags */
459} __packed acpi_madt_t;
460
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +0100461/*
462 * LPIT (Low Power Idle Table)
463 * Conforms to "Intel Low Power S0 Idle" specification, rev 002 from July 2017.
464 */
465typedef struct acpi_lpit {
466 acpi_header_t header;
467} __packed acpi_lpit_t;
468
469/* LPIT: LPI descriptor flags */
470typedef struct acpi_lpi_flags {
471 uint32_t disabled : 1;
472 uint32_t counter_not_available : 1;
473 uint32_t reserved : 30;
474} __packed acpi_lpi_desc_flags_t;
475
476/* LPIT: LPI descriptor types */
477enum acpi_lpi_desc_type {
478 ACPI_LPI_DESC_TYPE_NATIVE_CSTATE = 0x00,
479 /* type >= 1 reserved */
480};
481
482/* LPIT: LPI descriptor header */
483typedef struct acpi_lpi_desc_hdr {
484 uint32_t type;
485 uint32_t length;
486 uint16_t uid;
487 uint16_t reserved;
488} __packed acpi_lpi_desc_hdr_t;
489
Sukumar Ghoraied1c03a2023-09-28 23:44:30 -0700490#define ACPI_LPIT_CTR_FREQ_TSC 0
Sukumar Ghoraibd9c5622023-10-07 23:19:34 -0700491
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +0100492
493/* LPIT: Native C-state instruction based LPI structure */
494typedef struct acpi_lpi_desc_ncst {
495 acpi_lpi_desc_hdr_t header;
496 acpi_lpi_desc_flags_t flags;
497 acpi_addr_t entry_trigger; /* Entry trigger C-state */
498 uint32_t min_residency; /* Minimum residency or "break-even" in microseconds */
499 uint32_t max_latency; /* Worst case exit latency in microseconds */
500 acpi_addr_t residency_counter;
501 uint64_t counter_frequency; /* Frequency in cycles per second - 0 means TSC freq */
502} __packed acpi_lpi_desc_ncst_t;
503
Matt DeVillier7c04d0e2023-09-03 12:51:58 -0500504#define VFCT_VBIOS_CHECKSUM_OFFSET 0x21
505
Furquan Shaikhe0844632020-05-02 10:23:37 -0700506/* VFCT image header */
507typedef struct acpi_vfct_image_hdr {
508 u32 PCIBus;
509 u32 PCIDevice;
510 u32 PCIFunction;
511 u16 VendorID;
512 u16 DeviceID;
513 u16 SSVID;
514 u16 SSID;
515 u32 Revision;
516 u32 ImageLength;
Matt DeVillier7c04d0e2023-09-03 12:51:58 -0500517 u8 VbiosContent[]; // dummy - copy VBIOS here
Furquan Shaikhe0844632020-05-02 10:23:37 -0700518} __packed acpi_vfct_image_hdr_t;
519
520/* VFCT (VBIOS Fetch Table) */
521typedef struct acpi_vfct {
522 acpi_header_t header;
523 u8 TableUUID[16];
524 u32 VBIOSImageOffset;
525 u32 Lib1ImageOffset;
526 u32 Reserved[4];
527 acpi_vfct_image_hdr_t image_hdr;
528} __packed acpi_vfct_t;
529
530typedef struct acpi_ivrs_info {
531} __packed acpi_ivrs_info_t;
532
533/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 10h */
534typedef struct acpi_ivrs_ivhd {
535 uint8_t type;
536 uint8_t flags;
537 uint16_t length;
538 uint16_t device_id;
539 uint16_t capability_offset;
540 uint32_t iommu_base_low;
541 uint32_t iommu_base_high;
542 uint16_t pci_segment_group;
543 uint16_t iommu_info;
544 uint32_t iommu_feature_info;
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200545 uint8_t entry[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700546} __packed acpi_ivrs_ivhd_t;
547
548/* IVRS (I/O Virtualization Reporting Structure) Type 10h */
549typedef struct acpi_ivrs {
550 acpi_header_t header;
551 uint32_t iv_info;
552 uint32_t reserved[2];
553 struct acpi_ivrs_ivhd ivhd;
554} __packed acpi_ivrs_t;
555
Jason Glenesk61624b22020-11-02 20:06:23 -0800556/* CRAT (Component Resource Affinity Table Structure) */
557struct acpi_crat_header {
558 acpi_header_t header;
559 uint32_t total_entries;
560 uint16_t num_nodes;
561 uint8_t reserved[6];
562} __packed;
563
Furquan Shaikhe0844632020-05-02 10:23:37 -0700564/* IVHD Type 11h IOMMU Attributes */
565typedef struct ivhd11_iommu_attr {
566 uint32_t reserved1 : 13;
567 uint32_t perf_counters : 4;
568 uint32_t perf_counter_banks : 6;
569 uint32_t msi_num_ppr : 5;
570 uint32_t reserved2 : 4;
571} __packed ivhd11_iommu_attr_t;
572
573/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 11h */
574typedef struct acpi_ivrs_ivhd_11 {
575 uint8_t type;
576 uint8_t flags;
577 uint16_t length;
578 uint16_t device_id;
579 uint16_t capability_offset;
580 uint32_t iommu_base_low;
581 uint32_t iommu_base_high;
582 uint16_t pci_segment_group;
583 uint16_t iommu_info;
584 struct ivhd11_iommu_attr iommu_attributes;
585 uint32_t efr_reg_image_low;
586 uint32_t efr_reg_image_high;
587 uint32_t reserved[2];
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200588 uint8_t entry[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700589} __packed acpi_ivrs_ivhd11_t;
590
591enum dev_scope_type {
592 SCOPE_PCI_ENDPOINT = 1,
593 SCOPE_PCI_SUB = 2,
594 SCOPE_IOAPIC = 3,
595 SCOPE_MSI_HPET = 4,
596 SCOPE_ACPI_NAMESPACE_DEVICE = 5
597};
598
599typedef struct dev_scope {
600 u8 type;
601 u8 length;
602 u8 reserved[2];
603 u8 enumeration;
604 u8 start_bus;
605 struct {
606 u8 dev;
607 u8 fn;
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200608 } __packed path[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700609} __packed dev_scope_t;
610
611enum dmar_type {
612 DMAR_DRHD = 0,
613 DMAR_RMRR = 1,
614 DMAR_ATSR = 2,
615 DMAR_RHSA = 3,
John Zhao6edbb182021-03-24 11:55:09 -0700616 DMAR_ANDD = 4,
617 DMAR_SATC = 5
Furquan Shaikhe0844632020-05-02 10:23:37 -0700618};
619
620enum {
621 DRHD_INCLUDE_PCI_ALL = 1
622};
623
John Zhao091532d2021-04-17 16:03:21 -0700624enum {
625 ATC_REQUIRED = 1
626};
627
Furquan Shaikhe0844632020-05-02 10:23:37 -0700628enum dmar_flags {
629 DMAR_INTR_REMAP = 1 << 0,
630 DMAR_X2APIC_OPT_OUT = 1 << 1,
631 DMA_CTRL_PLATFORM_OPT_IN_FLAG = 1 << 2,
632};
633
634typedef struct dmar_entry {
635 u16 type;
636 u16 length;
637 u8 flags;
638 u8 reserved;
639 u16 segment;
640 u64 bar;
641} __packed dmar_entry_t;
642
643typedef struct dmar_rmrr_entry {
644 u16 type;
645 u16 length;
646 u16 reserved;
647 u16 segment;
648 u64 bar;
649 u64 limit;
650} __packed dmar_rmrr_entry_t;
651
652typedef struct dmar_atsr_entry {
653 u16 type;
654 u16 length;
655 u8 flags;
656 u8 reserved;
657 u16 segment;
658} __packed dmar_atsr_entry_t;
659
660typedef struct dmar_rhsa_entry {
661 u16 type;
662 u16 length;
663 u32 reserved;
664 u64 base_address;
665 u32 proximity_domain;
666} __packed dmar_rhsa_entry_t;
667
668typedef struct dmar_andd_entry {
669 u16 type;
670 u16 length;
671 u8 reserved[3];
672 u8 device_number;
673 u8 device_name[];
674} __packed dmar_andd_entry_t;
675
John Zhao6edbb182021-03-24 11:55:09 -0700676typedef struct dmar_satc_entry {
677 u16 type;
678 u16 length;
679 u8 flags;
680 u8 reserved;
681 u16 segment_number;
John Zhao6edbb182021-03-24 11:55:09 -0700682} __packed dmar_satc_entry_t;
683
Furquan Shaikhe0844632020-05-02 10:23:37 -0700684/* DMAR (DMA Remapping Reporting Structure) */
685typedef struct acpi_dmar {
686 acpi_header_t header;
687 u8 host_address_width;
688 u8 flags;
689 u8 reserved[10];
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200690 dmar_entry_t structure[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700691} __packed acpi_dmar_t;
692
693/* MADT: APIC Structure Types */
694enum acpi_apic_types {
695 LOCAL_APIC, /* Processor local APIC */
696 IO_APIC, /* I/O APIC */
697 IRQ_SOURCE_OVERRIDE, /* Interrupt source override */
698 NMI_TYPE, /* NMI source */
699 LOCAL_APIC_NMI, /* Local APIC NMI */
700 LAPIC_ADDRESS_OVERRIDE, /* Local APIC address override */
701 IO_SAPIC, /* I/O SAPIC */
702 LOCAL_SAPIC, /* Local SAPIC */
703 PLATFORM_IRQ_SOURCES, /* Platform interrupt sources */
704 LOCAL_X2APIC, /* Processor local x2APIC */
705 LOCAL_X2APIC_NMI, /* Local x2APIC NMI */
706 GICC, /* GIC CPU Interface */
707 GICD, /* GIC Distributor */
708 GIC_MSI_FRAME, /* GIC MSI Frame */
709 GICR, /* GIC Redistributor */
710 GIC_ITS, /* Interrupt Translation Service */
711 /* 0x10-0x7f: Reserved */
712 /* 0x80-0xff: Reserved for OEM use */
713};
714
715/* MADT: Processor Local APIC Structure */
716typedef struct acpi_madt_lapic {
717 u8 type; /* Type (0) */
718 u8 length; /* Length in bytes (8) */
719 u8 processor_id; /* ACPI processor ID */
720 u8 apic_id; /* Local APIC ID */
721 u32 flags; /* Local APIC flags */
722} __packed acpi_madt_lapic_t;
723
Kyösti Mälkki2e9f0d32023-04-07 23:05:46 +0300724#define ACPI_MADT_MAX_LAPIC_ID 0xfe
725
Furquan Shaikhe0844632020-05-02 10:23:37 -0700726/* MADT: Local APIC NMI Structure */
727typedef struct acpi_madt_lapic_nmi {
728 u8 type; /* Type (4) */
729 u8 length; /* Length in bytes (6) */
730 u8 processor_id; /* ACPI processor ID */
731 u16 flags; /* MPS INTI flags */
732 u8 lint; /* Local APIC LINT# */
733} __packed acpi_madt_lapic_nmi_t;
734
Kyösti Mälkki66b5e1b2022-11-12 21:13:45 +0200735#define ACPI_MADT_LAPIC_NMI_ALL_PROCESSORS 0xff
736#define ACPI_MADT_LX2APIC_NMI_ALL_PROCESSORS ((u32)-1)
Raul E Rangelf5552ce2021-02-11 11:27:56 -0700737
Furquan Shaikhe0844632020-05-02 10:23:37 -0700738/* MADT: I/O APIC Structure */
739typedef struct acpi_madt_ioapic {
740 u8 type; /* Type (1) */
741 u8 length; /* Length in bytes (12) */
742 u8 ioapic_id; /* I/O APIC ID */
743 u8 reserved;
744 u32 ioapic_addr; /* I/O APIC address */
745 u32 gsi_base; /* Global system interrupt base */
746} __packed acpi_madt_ioapic_t;
747
Raul E Rangel169302a2022-04-25 14:59:05 -0600748#define MP_IRQ_POLARITY_DEFAULT 0x0
749#define MP_IRQ_POLARITY_HIGH 0x1
750#define MP_IRQ_POLARITY_LOW 0x3
751#define MP_IRQ_POLARITY_MASK 0x3
752#define MP_IRQ_TRIGGER_DEFAULT 0x0
753#define MP_IRQ_TRIGGER_EDGE 0x4
754#define MP_IRQ_TRIGGER_LEVEL 0xc
755#define MP_IRQ_TRIGGER_MASK 0xc
756
Furquan Shaikhe0844632020-05-02 10:23:37 -0700757/* MADT: Interrupt Source Override Structure */
758typedef struct acpi_madt_irqoverride {
759 u8 type; /* Type (2) */
760 u8 length; /* Length in bytes (10) */
761 u8 bus; /* ISA (0) */
762 u8 source; /* Bus-relative int. source (IRQ) */
763 u32 gsirq; /* Global system interrupt */
764 u16 flags; /* MPS INTI flags */
765} __packed acpi_madt_irqoverride_t;
766
767/* MADT: Processor Local x2APIC Structure */
768typedef struct acpi_madt_lx2apic {
769 u8 type; /* Type (9) */
770 u8 length; /* Length in bytes (16) */
771 u16 reserved;
772 u32 x2apic_id; /* Local x2APIC ID */
773 u32 flags; /* Same as Local APIC flags */
774 u32 processor_id; /* ACPI processor ID */
775} __packed acpi_madt_lx2apic_t;
776
777/* MADT: Processor Local x2APIC NMI Structure */
778typedef struct acpi_madt_lx2apic_nmi {
779 u8 type; /* Type (10) */
780 u8 length; /* Length in bytes (12) */
781 u16 flags; /* Same as MPS INTI flags */
782 u32 processor_id; /* ACPI processor ID */
783 u8 lint; /* Local APIC LINT# */
784 u8 reserved[3];
785} __packed acpi_madt_lx2apic_nmi_t;
786
Arthur Heymans51d94c72023-06-27 15:37:37 +0200787/* MADT: GIC CPU Interface (GICC) Structure 6.5 */
788struct gicc_flags {
789 uint32_t enabled : 1;
790 /* 0 - Level-triggered | 1 - Edge-Triggered */
791 uint32_t performance_interrupt_mode : 1;
792 uint32_t vgic_maintenance_interrupt_mode : 1;
793 uint32_t online_capable : 1;
794 uint32_t reserved : 28;
795};
796_Static_assert(sizeof(struct gicc_flags) == sizeof(uint32_t), "Wrong gicc_flags size\n");
797
798typedef struct acpi_gicc {
799 uint8_t type;
800 uint8_t length;
801 uint16_t reserved;
802 uint32_t cpu_interface_number;
803 uint32_t acpi_processor_uid;
804 struct gicc_flags flags;
805 uint32_t parking_protocol_version;
806 uint32_t performance_interrupt_gsiv;
807 uint64_t parked_address;
808 uint64_t physical_base_address; /* GIC v1/v2 or GIC v3/v4 in v2 compat mode */
809 uint64_t gicv;
810 uint64_t gich;
811 uint32_t vgic_maintenance_interrupt;
812 uint64_t gicr_base_address; /* Only GIC v3 and above */
813 uint64_t mpidr;
814 uint8_t processor_power_efficiency_class;
815 uint8_t reserved1;
816 uint16_t spe_overflow_interrupt;
817 uint16_t trbe_interrupt;
818} __packed acpi_madt_gicc_t;
819_Static_assert(sizeof(acpi_madt_gicc_t) == 82, "Wrong acpi_madt_gicc_t size\n");
820
821/* MADT: GIC Distributor (GICD) Structure */
822typedef struct acpi_gicd {
823 uint8_t type;
824 uint8_t length;
825 uint16_t reserved1;
826 uint32_t gic_id;
827 uint64_t physical_base_address;
828 uint32_t system_vector_base;
829 uint8_t gic_version;
830 uint8_t reserved2[3];
831} __packed acpi_madt_gicd_t;
832_Static_assert(sizeof(acpi_madt_gicd_t) == 24, "Wrong acpi_madt_gicd_t size\n");
833
834/* MADT: GIC MSI Frame Structure */
835struct gic_msi_flags {
836 uint32_t spi_count_select : 1;
837 uint32_t reserved : 31;
838};
839_Static_assert(sizeof(struct gic_msi_flags) == sizeof(uint32_t), "Wrong gic_msi_flags size\n");
840
841typedef struct acpi_gic_msi {
842 uint8_t type;
843 uint8_t length;
844 uint16_t reserved;
845 uint32_t gic_msi_frame_id;
846 uint64_t physical_base_address;
847 struct gic_msi_flags flags;
848 uint16_t spi_count;
849 uint16_t spi_base;
850} __packed acpi_gic_msi_t;
851_Static_assert(sizeof(acpi_gic_msi_t) == 24, "Wrong acpi_gic_msi_t size\n");
852
853/* MADT: GIC Redistributor (GICR) Structure */
854typedef struct acpi_girr {
855 uint8_t type;
856 uint8_t length;
857 uint16_t reserved;
858 uint64_t discovery_range_base_address;
859 uint32_t discovery_range_length;
860} __packed acpi_madt_gicr_t;
861_Static_assert(sizeof(acpi_madt_gicr_t) == 16, "Wrong acpi_madt_gicr_t size\n");
862
863/* MADT: GIC Interrupt Translation Service (ITS) Structure */
864typedef struct acpi_gic_its {
865 uint8_t type;
866 uint8_t length;
867 uint16_t reserved;
868 uint32_t gic_its_id;
869 uint64_t physical_base_address;
870 uint32_t reserved2;
871} __packed acpi_madt_gic_its_t;
872_Static_assert(sizeof(acpi_madt_gic_its_t) == 20, "Wrong MADT acpi_madt_gic_its_t size\n");
873
Furquan Shaikhe0844632020-05-02 10:23:37 -0700874#define ACPI_DBG2_PORT_SERIAL 0x8000
Felix Held2eaebfc2023-11-22 00:31:37 +0100875#define ACPI_DBG2_PORT_SERIAL_16550_IO_ONLY 0x0000
Furquan Shaikhe0844632020-05-02 10:23:37 -0700876#define ACPI_DBG2_PORT_SERIAL_16550_DBGP 0x0001
877#define ACPI_DBG2_PORT_SERIAL_ARM_PL011 0x0003
878#define ACPI_DBG2_PORT_SERIAL_ARM_SBSA 0x000e
879#define ACPI_DBG2_PORT_SERIAL_ARM_DDC 0x000f
880#define ACPI_DBG2_PORT_SERIAL_BCM2835 0x0010
Felix Held2eaebfc2023-11-22 00:31:37 +0100881#define ACPI_DBG2_PORT_SERIAL_16550 0x0012
Furquan Shaikhe0844632020-05-02 10:23:37 -0700882#define ACPI_DBG2_PORT_IEEE1394 0x8001
883#define ACPI_DBG2_PORT_IEEE1394_STANDARD 0x0000
884#define ACPI_DBG2_PORT_USB 0x8002
885#define ACPI_DBG2_PORT_USB_XHCI 0x0000
886#define ACPI_DBG2_PORT_USB_EHCI 0x0001
887#define ACPI_DBG2_PORT_NET 0x8003
888
889/* DBG2: Microsoft Debug Port Table 2 header */
890typedef struct acpi_dbg2_header {
891 acpi_header_t header;
892 uint32_t devices_offset;
893 uint32_t devices_count;
Elyes Haouas139cb062023-08-26 17:04:21 +0200894} __packed acpi_dbg2_header_t;
Furquan Shaikhe0844632020-05-02 10:23:37 -0700895
896/* DBG2: Microsoft Debug Port Table 2 device entry */
897typedef struct acpi_dbg2_device {
898 uint8_t revision;
899 uint16_t length;
900 uint8_t address_count;
901 uint16_t namespace_string_length;
902 uint16_t namespace_string_offset;
903 uint16_t oem_data_length;
904 uint16_t oem_data_offset;
905 uint16_t port_type;
906 uint16_t port_subtype;
907 uint8_t reserved[2];
908 uint16_t base_address_offset;
909 uint16_t address_size_offset;
Elyes Haouas139cb062023-08-26 17:04:21 +0200910} __packed acpi_dbg2_device_t;
Furquan Shaikhe0844632020-05-02 10:23:37 -0700911
912/* FADT (Fixed ACPI Description Table) */
913typedef struct acpi_fadt {
914 acpi_header_t header;
915 u32 firmware_ctrl;
916 u32 dsdt;
917 u8 reserved; /* Should be 0 */
918 u8 preferred_pm_profile;
919 u16 sci_int;
920 u32 smi_cmd;
921 u8 acpi_enable;
922 u8 acpi_disable;
923 u8 s4bios_req;
924 u8 pstate_cnt;
925 u32 pm1a_evt_blk;
926 u32 pm1b_evt_blk;
927 u32 pm1a_cnt_blk;
928 u32 pm1b_cnt_blk;
929 u32 pm2_cnt_blk;
930 u32 pm_tmr_blk;
931 u32 gpe0_blk;
932 u32 gpe1_blk;
933 u8 pm1_evt_len;
934 u8 pm1_cnt_len;
935 u8 pm2_cnt_len;
936 u8 pm_tmr_len;
937 u8 gpe0_blk_len;
938 u8 gpe1_blk_len;
939 u8 gpe1_base;
940 u8 cst_cnt;
941 u16 p_lvl2_lat;
942 u16 p_lvl3_lat;
943 u16 flush_size;
944 u16 flush_stride;
945 u8 duty_offset;
946 u8 duty_width;
947 u8 day_alrm;
948 u8 mon_alrm;
949 u8 century;
950 u16 iapc_boot_arch;
951 u8 res2;
952 u32 flags;
953 acpi_addr_t reset_reg;
954 u8 reset_value;
Elyes Haouasb55ac092022-02-16 14:42:19 +0100955 u16 ARM_boot_arch; /* Must be zero if ACPI Revision <= 5.0 */
Elyes Haouas8b950f42022-02-16 12:08:16 +0100956 u8 FADT_MinorVersion; /* Must be zero if ACPI Revision <= 5.0 */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700957 u32 x_firmware_ctl_l;
958 u32 x_firmware_ctl_h;
959 u32 x_dsdt_l;
960 u32 x_dsdt_h;
961 acpi_addr_t x_pm1a_evt_blk;
962 acpi_addr_t x_pm1b_evt_blk;
963 acpi_addr_t x_pm1a_cnt_blk;
964 acpi_addr_t x_pm1b_cnt_blk;
965 acpi_addr_t x_pm2_cnt_blk;
966 acpi_addr_t x_pm_tmr_blk;
967 acpi_addr_t x_gpe0_blk;
968 acpi_addr_t x_gpe1_blk;
969 /* Revision 5 */
970 acpi_addr_t sleep_control_reg;
971 acpi_addr_t sleep_status_reg;
972 /* Revision 6 */
973 u64 hypervisor_vendor_identity;
974} __packed acpi_fadt_t;
975
976/* FADT TABLE Revision values */
Elyes Haouas8b950f42022-02-16 12:08:16 +0100977#define ACPI_FADT_REV_ACPI_1 1
978#define ACPI_FADT_REV_ACPI_2 3
979#define ACPI_FADT_REV_ACPI_3 4
980#define ACPI_FADT_REV_ACPI_4 4
981#define ACPI_FADT_REV_ACPI_5 5
982#define ACPI_FADT_REV_ACPI_6 6
983
984/* FADT Minor Version value:
985 * Bits 0-3: minor version
986 * Bits 4-7: Errata
987 * value of 1 means this is compatible with Errata A,
988 * value of 2 would be compatible with Errata B, and so on
989 * Version 6.3 Errata A would be: (1 << 4) | 3
990 */
991#define ACPI_FADT_MINOR_VERSION_0 0 /* coreboot currently use this version */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700992
993/* Flags for p_lvl2_lat and p_lvl3_lat */
994#define ACPI_FADT_C2_NOT_SUPPORTED 101
995#define ACPI_FADT_C3_NOT_SUPPORTED 1001
996
997/* FADT Feature Flags */
998#define ACPI_FADT_WBINVD (1 << 0)
999#define ACPI_FADT_WBINVD_FLUSH (1 << 1)
1000#define ACPI_FADT_C1_SUPPORTED (1 << 2)
1001#define ACPI_FADT_C2_MP_SUPPORTED (1 << 3)
1002#define ACPI_FADT_POWER_BUTTON (1 << 4)
1003#define ACPI_FADT_SLEEP_BUTTON (1 << 5)
1004#define ACPI_FADT_FIXED_RTC (1 << 6)
1005#define ACPI_FADT_S4_RTC_WAKE (1 << 7)
1006#define ACPI_FADT_32BIT_TIMER (1 << 8)
1007#define ACPI_FADT_DOCKING_SUPPORTED (1 << 9)
1008#define ACPI_FADT_RESET_REGISTER (1 << 10)
1009#define ACPI_FADT_SEALED_CASE (1 << 11)
1010#define ACPI_FADT_HEADLESS (1 << 12)
1011#define ACPI_FADT_SLEEP_TYPE (1 << 13)
1012#define ACPI_FADT_PCI_EXPRESS_WAKE (1 << 14)
1013#define ACPI_FADT_PLATFORM_CLOCK (1 << 15)
1014#define ACPI_FADT_S4_RTC_VALID (1 << 16)
1015#define ACPI_FADT_REMOTE_POWER_ON (1 << 17)
1016#define ACPI_FADT_APIC_CLUSTER (1 << 18)
1017#define ACPI_FADT_APIC_PHYSICAL (1 << 19)
1018/* Bits 20-31: reserved ACPI 3.0 & 4.0 */
1019#define ACPI_FADT_HW_REDUCED_ACPI (1 << 20)
1020#define ACPI_FADT_LOW_PWR_IDLE_S0 (1 << 21)
1021/* bits 22-31: reserved since ACPI 5.0 */
1022
1023/* FADT Boot Architecture Flags */
1024#define ACPI_FADT_LEGACY_DEVICES (1 << 0)
1025#define ACPI_FADT_8042 (1 << 1)
1026#define ACPI_FADT_VGA_NOT_PRESENT (1 << 2)
1027#define ACPI_FADT_MSI_NOT_SUPPORTED (1 << 3)
1028#define ACPI_FADT_NO_PCIE_ASPM_CONTROL (1 << 4)
1029#define ACPI_FADT_NO_CMOS_RTC (1 << 5)
1030#define ACPI_FADT_LEGACY_FREE 0x00 /* No legacy devices (including 8042) */
1031
1032/* FADT ARM Boot Architecture Flags */
1033#define ACPI_FADT_ARM_PSCI_COMPLIANT (1 << 0)
1034#define ACPI_FADT_ARM_PSCI_USE_HVC (1 << 1)
1035/* bits 2-16: reserved since ACPI 5.1 */
1036
1037/* FADT Preferred Power Management Profile */
1038enum acpi_preferred_pm_profiles {
1039 PM_UNSPECIFIED = 0,
1040 PM_DESKTOP = 1,
1041 PM_MOBILE = 2,
1042 PM_WORKSTATION = 3,
1043 PM_ENTERPRISE_SERVER = 4,
1044 PM_SOHO_SERVER = 5,
1045 PM_APPLIANCE_PC = 6,
1046 PM_PERFORMANCE_SERVER = 7,
1047 PM_TABLET = 8, /* ACPI 5.0 & greater */
1048};
1049
1050/* FACS (Firmware ACPI Control Structure) */
1051typedef struct acpi_facs {
1052 char signature[4]; /* "FACS" */
1053 u32 length; /* Length in bytes (>= 64) */
1054 u32 hardware_signature; /* Hardware signature */
1055 u32 firmware_waking_vector; /* Firmware waking vector */
1056 u32 global_lock; /* Global lock */
1057 u32 flags; /* FACS flags */
1058 u32 x_firmware_waking_vector_l; /* X FW waking vector, low */
1059 u32 x_firmware_waking_vector_h; /* X FW waking vector, high */
1060 u8 version; /* FACS version */
1061 u8 resv1[3]; /* This value is 0 */
1062 u32 ospm_flags; /* 64BIT_WAKE_F */
1063 u8 resv2[24]; /* This value is 0 */
1064} __packed acpi_facs_t;
1065
1066/* FACS flags */
1067#define ACPI_FACS_S4BIOS_F (1 << 0)
1068#define ACPI_FACS_64BIT_WAKE_F (1 << 1)
1069/* Bits 31..2: reserved */
1070
1071/* ECDT (Embedded Controller Boot Resources Table) */
1072typedef struct acpi_ecdt {
1073 acpi_header_t header;
1074 acpi_addr_t ec_control; /* EC control register */
1075 acpi_addr_t ec_data; /* EC data register */
1076 u32 uid; /* UID */
1077 u8 gpe_bit; /* GPE bit */
1078 u8 ec_id[]; /* EC ID */
1079} __packed acpi_ecdt_t;
1080
1081/* HEST (Hardware Error Source Table) */
1082typedef struct acpi_hest {
1083 acpi_header_t header;
1084 u32 error_source_count;
1085 /* error_source_struct(s) */
1086} __packed acpi_hest_t;
1087
1088/* Error Source Descriptors */
1089typedef struct acpi_hest_esd {
1090 u16 type;
1091 u16 source_id;
1092 u16 resv;
1093 u8 flags;
1094 u8 enabled;
1095 u32 prealloc_erecords; /* The number of error records to
1096 * pre-allocate for this error source.
1097 */
1098 u32 max_section_per_record;
1099} __packed acpi_hest_esd_t;
1100
1101/* Hardware Error Notification */
1102typedef struct acpi_hest_hen {
1103 u8 type;
1104 u8 length;
1105 u16 conf_we; /* Configuration Write Enable */
1106 u32 poll_interval;
1107 u32 vector;
1108 u32 sw2poll_threshold_val;
1109 u32 sw2poll_threshold_win;
1110 u32 error_threshold_val;
1111 u32 error_threshold_win;
1112} __packed acpi_hest_hen_t;
1113
1114/* BERT (Boot Error Record Table) */
1115typedef struct acpi_bert {
1116 acpi_header_t header;
1117 u32 region_length;
1118 u64 error_region;
1119} __packed acpi_bert_t;
1120
1121/* Generic Error Data Entry */
1122typedef struct acpi_hest_generic_data {
1123 guid_t section_type;
1124 u32 error_severity;
1125 u16 revision;
1126 u8 validation_bits;
1127 u8 flags;
1128 u32 data_length;
1129 guid_t fru_id;
1130 u8 fru_text[20];
1131 /* error data */
1132} __packed acpi_hest_generic_data_t;
1133
1134/* Generic Error Data Entry v300 */
1135typedef struct acpi_hest_generic_data_v300 {
1136 guid_t section_type;
1137 u32 error_severity;
1138 u16 revision;
1139 u8 validation_bits;
1140 u8 flags; /* see CPER Section Descriptor, Flags field */
1141 u32 data_length;
1142 guid_t fru_id;
1143 u8 fru_text[20];
1144 cper_timestamp_t timestamp;
1145 /* error data */
1146} __packed acpi_hest_generic_data_v300_t;
1147#define HEST_GENERIC_ENTRY_V300 0x300
1148
1149/* Both Generic Error Status & Generic Error Data Entry, Error Severity field */
1150#define ACPI_GENERROR_SEV_RECOVERABLE 0
1151#define ACPI_GENERROR_SEV_FATAL 1
1152#define ACPI_GENERROR_SEV_CORRECTED 2
1153#define ACPI_GENERROR_SEV_NONE 3
1154
1155/* Generic Error Data Entry, Validation Bits field */
1156#define ACPI_GENERROR_VALID_FRUID BIT(0)
1157#define ACPI_GENERROR_VALID_FRUID_TEXT BIT(1)
1158#define ACPI_GENERROR_VALID_TIMESTAMP BIT(2)
1159
Felix Held403fa862021-07-26 22:43:00 +02001160/*
1161 * Generic Error Status Block
1162 *
1163 * If there is a raw data section at the end of the generic error status block after the
1164 * zero or more generic error data entries, raw_data_length indicates the length of the raw
1165 * section and raw_data_offset is the offset of the beginning of the raw data section from
1166 * the start of the acpi_generic_error_status block it is contained in. So if raw_data_length
1167 * is non-zero, raw_data_offset must be at least sizeof(acpi_generic_error_status_t).
1168 */
Furquan Shaikhe0844632020-05-02 10:23:37 -07001169typedef struct acpi_generic_error_status {
1170 u32 block_status;
1171 u32 raw_data_offset; /* must follow any generic entries */
1172 u32 raw_data_length;
1173 u32 data_length; /* generic data */
1174 u32 error_severity;
1175 /* Generic Error Data structures, zero or more entries */
1176} __packed acpi_generic_error_status_t;
1177
1178/* Generic Status Block, Block Status values */
1179#define GENERIC_ERR_STS_UNCORRECTABLE_VALID BIT(0)
1180#define GENERIC_ERR_STS_CORRECTABLE_VALID BIT(1)
1181#define GENERIC_ERR_STS_MULT_UNCORRECTABLE BIT(2)
1182#define GENERIC_ERR_STS_MULT_CORRECTABLE BIT(3)
1183#define GENERIC_ERR_STS_ENTRY_COUNT_SHIFT 4
1184#define GENERIC_ERR_STS_ENTRY_COUNT_MAX 0x3ff
1185#define GENERIC_ERR_STS_ENTRY_COUNT_MASK \
1186 (GENERIC_ERR_STS_ENTRY_COUNT_MAX \
1187 << GENERIC_ERR_STS_ENTRY_COUNT_SHIFT)
1188
1189typedef struct acpi_cstate {
1190 u8 ctype;
1191 u16 latency;
1192 u32 power;
1193 acpi_addr_t resource;
1194} __packed acpi_cstate_t;
1195
Jason Gleneskca36aed2020-09-15 21:01:57 -07001196struct acpi_sw_pstate {
1197 u32 core_freq;
1198 u32 power;
1199 u32 transition_latency;
1200 u32 bus_master_latency;
1201 u32 control_value;
1202 u32 status_value;
1203} __packed;
1204
1205struct acpi_xpss_sw_pstate {
1206 u64 core_freq;
1207 u64 power;
1208 u64 transition_latency;
1209 u64 bus_master_latency;
1210 u64 control_value;
1211 u64 status_value;
1212 u64 control_mask;
1213 u64 status_mask;
1214} __packed;
1215
Furquan Shaikhe0844632020-05-02 10:23:37 -07001216typedef struct acpi_tstate {
1217 u32 percent;
1218 u32 power;
1219 u32 latency;
1220 u32 control;
1221 u32 status;
1222} __packed acpi_tstate_t;
1223
Raul E Rangelc7048322021-04-19 15:58:25 -06001224enum acpi_lpi_state_flags {
1225 ACPI_LPI_STATE_DISABLED = 0,
1226 ACPI_LPI_STATE_ENABLED
1227};
1228
1229/* Low Power Idle State */
1230struct acpi_lpi_state {
1231 u32 min_residency_us;
1232 u32 worst_case_wakeup_latency_us;
1233 u32 flags;
1234 u32 arch_context_lost_flags;
1235 u32 residency_counter_frequency_hz;
1236 u32 enabled_parent_state;
1237 acpi_addr_t entry_method;
1238 acpi_addr_t residency_counter_register;
1239 acpi_addr_t usage_counter_register;
1240 const char *state_name;
1241};
1242
Furquan Shaikhe0844632020-05-02 10:23:37 -07001243/* Port types for ACPI _UPC object */
1244enum acpi_upc_type {
1245 UPC_TYPE_A,
1246 UPC_TYPE_MINI_AB,
1247 UPC_TYPE_EXPRESSCARD,
1248 UPC_TYPE_USB3_A,
1249 UPC_TYPE_USB3_B,
1250 UPC_TYPE_USB3_MICRO_B,
1251 UPC_TYPE_USB3_MICRO_AB,
1252 UPC_TYPE_USB3_POWER_B,
1253 UPC_TYPE_C_USB2_ONLY,
1254 UPC_TYPE_C_USB2_SS_SWITCH,
1255 UPC_TYPE_C_USB2_SS,
1256 UPC_TYPE_PROPRIETARY = 0xff,
1257 /*
1258 * The following types are not directly defined in the ACPI
1259 * spec but are used by coreboot to identify a USB device type.
1260 */
1261 UPC_TYPE_INTERNAL = 0xff,
1262 UPC_TYPE_UNUSED,
1263 UPC_TYPE_HUB
1264};
1265
1266enum acpi_ipmi_interface_type {
1267 IPMI_INTERFACE_RESERVED = 0,
1268 IPMI_INTERFACE_KCS,
1269 IPMI_INTERFACE_SMIC,
1270 IPMI_INTERFACE_BT,
1271 IPMI_INTERFACE_SSIF,
1272};
1273
1274#define ACPI_IPMI_PCI_DEVICE_FLAG (1 << 0)
1275#define ACPI_IPMI_INT_TYPE_SCI (1 << 0)
1276#define ACPI_IPMI_INT_TYPE_APIC (1 << 1)
1277
1278/* ACPI IPMI 2.0 */
1279struct acpi_spmi {
1280 acpi_header_t header;
1281 u8 interface_type;
1282 u8 reserved;
1283 u16 specification_revision;
1284 u8 interrupt_type;
1285 u8 gpe;
1286 u8 reserved2;
1287 u8 pci_device_flag;
1288
1289 u32 global_system_interrupt;
1290 acpi_addr_t base_address;
1291 union {
1292 struct {
1293 u8 pci_segment_group;
1294 u8 pci_bus;
1295 u8 pci_device;
1296 u8 pci_function;
1297 };
1298 u8 uid[4];
1299 };
1300 u8 reserved3;
1301} __packed;
1302
Rocky Phaguraeff07132021-01-10 15:42:50 -08001303/* EINJ APEI Standard Definitions */
1304/* EINJ Error Types
1305 Refer to the ACPI spec, EINJ section, for more info on bit definitions
1306*/
1307#define ACPI_EINJ_CPU_CE (1 << 0)
1308#define ACPI_EINJ_CPU_UCE (1 << 1)
1309#define ACPI_EINJ_CPU_UCE_FATAL (1 << 2)
1310#define ACPI_EINJ_MEM_CE (1 << 3)
1311#define ACPI_EINJ_MEM_UCE (1 << 4)
1312#define ACPI_EINJ_MEM_UCE_FATAL (1 << 5)
1313#define ACPI_EINJ_PCIE_CE (1 << 6)
1314#define ACPI_EINJ_PCIE_UCE_NON_FATAL (1 << 7)
1315#define ACPI_EINJ_PCIE_UCE_FATAL (1 << 8)
1316#define ACPI_EINJ_PLATFORM_CE (1 << 9)
1317#define ACPI_EINJ_PLATFORM_UCE (1 << 10)
1318#define ACPI_EINJ_PLATFORM_UCE_FATAL (1 << 11)
1319#define ACPI_EINJ_VENDOR_DEFINED (1 << 31)
1320#define ACPI_EINJ_DEFAULT_CAP (ACPI_EINJ_MEM_CE | ACPI_EINJ_MEM_UCE | \
1321 ACPI_EINJ_PCIE_CE | ACPI_EINJ_PCIE_UCE_FATAL)
1322
1323/* EINJ actions */
1324#define ACTION_COUNT 9
1325#define BEGIN_INJECT_OP 0x00
1326#define GET_TRIGGER_ACTION_TABLE 0x01
1327#define SET_ERROR_TYPE 0x02
1328#define GET_ERROR_TYPE 0x03
1329#define END_INJECT_OP 0x04
1330#define EXECUTE_INJECT_OP 0x05
1331#define CHECK_BUSY_STATUS 0x06
1332#define GET_CMD_STATUS 0x07
1333#define SET_ERROR_TYPE_WITH_ADDRESS 0x08
1334#define TRIGGER_ERROR 0xFF
1335
1336/* EINJ Instructions */
1337#define READ_REGISTER 0x00
1338#define READ_REGISTER_VALUE 0x01
1339#define WRITE_REGISTER 0x02
1340#define WRITE_REGISTER_VALUE 0x03
1341#define NO_OP 0x04
1342
1343/* EINJ (Error Injection Table) */
1344typedef struct acpi_gen_regaddr1 {
1345 u8 space_id; /* Address space ID */
1346 u8 bit_width; /* Register size in bits */
1347 u8 bit_offset; /* Register bit offset */
1348 u8 access_size; /* Access size since ACPI 2.0c */
1349 u64 addr; /* Register address */
1350} __packed acpi_addr64_t;
1351
1352/* Instruction entry */
1353typedef struct acpi_einj_action_table {
1354 u8 action;
1355 u8 instruction;
1356 u16 flags;
1357 acpi_addr64_t reg;
1358 u64 value;
1359 u64 mask;
1360} __packed acpi_einj_action_table_t;
1361
1362typedef struct acpi_injection_header {
1363 u32 einj_header_size;
1364 u32 flags;
1365 u32 entry_count;
1366} __packed acpi_injection_header_t;
1367
1368typedef struct acpi_einj_trigger_table {
1369 u32 header_size;
1370 u32 revision;
1371 u32 table_size;
1372 u32 entry_count;
Elyes Haouasa4aa169a2023-07-30 12:59:50 +02001373 acpi_einj_action_table_t trigger_action[];
Rocky Phaguraeff07132021-01-10 15:42:50 -08001374} __packed acpi_einj_trigger_table_t;
1375
1376typedef struct set_error_type {
1377 u32 errtype;
1378 u32 vendorerrortype;
1379 u32 flags;
1380 u32 apicid;
1381 u64 memaddr;
1382 u64 memrange;
1383 u32 pciesbdf;
1384} __packed set_error_type_t;
1385
1386#define EINJ_PARAM_NUM 6
1387typedef struct acpi_einj_smi {
1388 u64 op_state;
1389 u64 err_inject[EINJ_PARAM_NUM];
1390 u64 trigger_action_table;
1391 u64 err_inj_cap;
1392 u64 op_status;
1393 u64 cmd_sts;
1394 u64 einj_addr;
1395 u64 einj_addr_msk;
1396 set_error_type_t setaddrtable;
1397 u64 reserved[50];
1398} __packed acpi_einj_smi_t;
1399
1400/* EINJ Flags */
1401#define EINJ_DEF_TRIGGER_PORT 0xb2
1402#define FLAG_PRESERVE 0x01
1403#define FLAG_IGNORE 0x00
1404
1405/* EINJ Registers */
1406#define EINJ_REG_MEMORY(address) \
1407 { \
1408 .space_id = ACPI_ADDRESS_SPACE_MEMORY, \
1409 .bit_width = 64, \
1410 .bit_offset = 0, \
1411 .access_size = ACPI_ACCESS_SIZE_QWORD_ACCESS, \
1412 .addr = address}
1413
1414#define EINJ_REG_IO() \
1415 { \
1416 .space_id = ACPI_ADDRESS_SPACE_IO, \
1417 .bit_width = 0x10, \
1418 .bit_offset = 0, \
1419 .access_size = ACPI_ACCESS_SIZE_WORD_ACCESS, \
1420 .addr = EINJ_DEF_TRIGGER_PORT} /* HW dependent code can override this also */
1421
1422typedef struct acpi_einj {
1423 acpi_header_t header;
1424 acpi_injection_header_t inj_header;
1425 acpi_einj_action_table_t action_table[ACTION_COUNT];
1426} __packed acpi_einj_t;
1427
David Milosevicd9822742023-09-22 14:34:28 +02001428/* PPTT definitions */
1429
1430#define PPTT_NODE_TYPE_CPU 0
1431#define PPTT_NODE_TYPE_CACHE 1
1432
1433/* PPTT structures for ACPI generation */
1434
1435typedef struct acpi_pptt_cpu_node {
1436 u8 type; // type = 0 (processor structure specification)
1437 u8 length; // in bytes
1438 u8 reserved[2]; // reserved, must be zero
1439 u32 flags; // processor hierarchy node structure flags
1440 u32 parent; // reference (delta of pptt-start and node) to parent node, must be zero if no parent
1441 u32 processor_id; // must match id in MADT, if actual processor
1442 u32 n_resources; // number of resource structure references
1443 u32 resources[]; // resource structure references
1444} acpi_pptt_cpu_node_t;
1445
1446typedef struct acpi_pptt_cache_node {
1447 u8 type; // type = 1 (cache type structure)
1448 u8 length; // length = 28
1449 u8 reserved[2]; // reserved, must be zero
1450 u32 flags; // cache structure flags
1451 u32 next_level; // reference to next level cache, null if last cache level
1452 u32 size; // cache size in bytes
1453 u32 n_sets; // number of sets in the cache
1454 u8 associativity; // integer number of ways
1455 u8 attributes; // bits[7:5] reserved, must be zero
1456 u16 line_size; // in bytes
1457 u32 cache_id; // unique, non-zero
1458} acpi_pptt_cache_node_t;
1459
1460union acpi_pptt_body {
1461 acpi_pptt_cpu_node_t cpu;
1462 acpi_pptt_cache_node_t cache;
1463};
1464
1465typedef struct acpi_pptt {
1466 acpi_header_t header;
1467
1468 /*
1469 * followed by a variable length body
1470 * consisting of processor topology structures.
1471 *
1472 * see acpi_pptt_cpu_node and
1473 * acpi_pptt_cache_node.
1474 */
1475 union acpi_pptt_body body[];
1476} __packed acpi_pptt_t;
1477
1478/* PPTT structures for topology description */
1479
1480union pptt_cache_flags {
1481 struct {
1482 u32 size_valid : 1;
1483 u32 n_sets_valid : 1;
1484 u32 associativity_valid : 1;
1485 u32 alloc_type_valid : 1;
1486 u32 cache_type_valid : 1;
1487 u32 write_policy_valid : 1;
1488 u32 line_size_valid : 1;
1489 u32 cache_id_valid : 1;
1490 u32 reserved : 24;
1491 };
1492
1493 u32 raw;
1494};
1495
1496union pptt_cpu_flags {
1497 struct {
1498 u32 is_physical_package : 1;
1499 u32 processor_id_valid : 1;
1500 u32 is_thread : 1;
1501 u32 is_leaf : 1;
1502 u32 is_identical_impl : 1;
1503 u32 reserved : 27;
1504 };
1505
1506 u32 raw;
1507};
1508
1509struct pptt_cache {
1510 u32 size;
1511 u32 numsets;
1512 u8 associativity;
1513 u8 attributes;
1514 u16 line_size;
1515 union pptt_cache_flags flags;
1516 struct pptt_cache *next_level;
1517};
1518
1519struct pptt_cpu_resources {
1520 struct pptt_cache *cache;
1521 struct pptt_cpu_resources *next;
1522};
1523
1524struct pptt_topology {
1525 u32 processor_id;
1526 union pptt_cpu_flags flags;
1527 struct pptt_cpu_resources *resources;
1528 struct pptt_topology *sibling;
1529 struct pptt_topology *child;
1530};
1531
Arthur Heymanse7aaf042023-06-07 12:12:45 +02001532/* SPCR (Serial Port Console Redirection Table) */
1533typedef struct acpi_spcr {
1534 acpi_header_t header;
1535 uint8_t interface_type;
1536 uint8_t reserved[3];
1537 acpi_addr_t base_address;
1538 uint8_t interrupt_type;
1539 uint8_t irq;
1540 uint32_t global_system_interrupt;
1541 uint8_t configured_baudrate;
1542 uint8_t parity;
1543 uint8_t stop_bits;
1544 uint8_t flow_control;
1545 uint8_t terminal_type;
1546 uint8_t language;
1547 uint16_t pci_did;
1548 uint16_t pci_vid;
1549 uint8_t pci_bus;
1550 uint8_t pci_dev;
1551 uint8_t pci_fun;
1552 uint32_t pci_flags;
1553 uint8_t pci_segment;
1554 uint32_t uart_clock;
1555 uint32_t precise_baud_rate;
1556 uint16_t namespace_string_length;
1557 uint16_t namespace_string_offset;
1558 char namespacestring[];
1559} __packed acpi_spcr_t;
1560_Static_assert(sizeof(acpi_spcr_t) == 88, "acpi_spcr_t must have an 88 byte size\n");
1561
Arthur Heymans90464072023-06-07 12:53:50 +02001562#define PC_AT_COMPATIBLE_INTERRUPT (1 << 0)
1563#define IO_APIC_COMPATIBLE_INTERRUPT (1 << 1)
1564#define IO_SAPIC_COMPATIBLE_INTERRUPT (1 << 2)
1565#define ARMH_GIC_COMPATIBLE_INTERRUPT (1 << 3)
1566#define RISCV_PLIC_COMPATIBLE_INTERRUPT (1 << 4)
1567
Arthur Heymans8193eab2023-06-20 10:17:23 +02001568/* GTDT - Generic Timer Description Table (ACPI 5.1) Version 2 */
1569typedef struct acpi_table_gtdt {
1570 acpi_header_t header; /* Common ACPI table header */
Naresh Solanki75f0b602023-09-25 13:59:25 +02001571 u64 counter_block_address;
Arthur Heymans8193eab2023-06-20 10:17:23 +02001572 u32 reserved;
1573 u32 secure_el1_interrupt;
1574 u32 secure_el1_flags;
1575 u32 non_secure_el1_interrupt;
1576 u32 non_secure_el1_flags;
1577 u32 virtual_timer_interrupt;
1578 u32 virtual_timer_flags;
1579 u32 non_secure_el2_interrupt;
1580 u32 non_secure_el2_flags;
1581 u64 counter_read_block_address;
1582 u32 platform_timer_count;
1583 u32 platform_timer_offset;
1584} __packed acpi_gtdt_t;
1585
1586/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
1587
1588#define ACPI_GTDT_INTERRUPT_MODE (1)
1589#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
1590#define ACPI_GTDT_ALWAYS_ON (1<<2)
1591
1592struct acpi_gtdt_el2 {
1593 u32 virtual_el2_timer_gsiv;
1594 u32 virtual_el2_timer_flags;
1595};
1596
1597/* Common GTDT subtable header */
1598
1599struct acpi_gtdt_header {
1600 u8 type;
1601 u16 length;
1602} __packed;
1603
1604/* Values for GTDT subtable type above */
1605
1606enum acpi_gtdt_type {
1607 ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
1608 ACPI_GTDT_TYPE_WATCHDOG = 1,
1609 ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
1610};
1611
1612/* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
1613
1614/* 0: Generic Timer Block */
1615
1616struct acpi_gtdt_timer_block {
1617 struct acpi_gtdt_header header;
1618 u8 reserved;
1619 u64 block_address;
1620 u32 timer_count;
1621 u32 timer_offset;
1622} __packed;
1623
1624/* Timer Sub-Structure, one per timer */
1625
1626struct acpi_gtdt_timer_entry {
1627 u8 frame_number;
1628 u8 reserved[3];
1629 u64 base_address;
1630 u64 el0_base_address;
1631 u32 timer_interrupt;
1632 u32 timer_flags;
1633 u32 virtual_timer_interrupt;
1634 u32 virtual_timer_flags;
1635 u32 common_flags;
1636} __packed;
1637
1638/* Flag Definitions: timer_flags and virtual_timer_flags above */
1639
1640#define ACPI_GTDT_GT_IRQ_MODE (1)
1641#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
1642
1643/* Flag Definitions: common_flags above */
1644
1645#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
1646#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
1647
1648/* 1: SBSA Generic Watchdog Structure */
1649
1650struct acpi_gtdt_watchdog {
1651 struct acpi_gtdt_header header;
1652 u8 reserved;
1653 u64 refresh_frame_address;
1654 u64 control_frame_address;
1655 u32 timer_interrupt;
1656 u32 timer_flags;
1657} __packed;
1658
1659/* Flag Definitions: timer_flags above */
1660
1661#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
1662#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
1663#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
1664
Marek Maslanka017003c2023-12-07 13:21:35 +00001665enum acpi_wdat_actions {
1666 ACPI_WDAT_RESET = 1,
1667 ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1668 ACPI_WDAT_GET_COUNTDOWN = 5,
1669 ACPI_WDAT_SET_COUNTDOWN = 6,
1670 ACPI_WDAT_GET_RUNNING_STATE = 8,
1671 ACPI_WDAT_SET_RUNNING_STATE = 9,
1672 ACPI_WDAT_GET_STOPPED_STATE = 10,
1673 ACPI_WDAT_SET_STOPPED_STATE = 11,
1674 ACPI_WDAT_GET_REBOOT = 16,
1675 ACPI_WDAT_SET_REBOOT = 17,
1676 ACPI_WDAT_GET_SHUTDOWN = 18,
1677 ACPI_WDAT_SET_SHUTDOWN = 19,
1678 ACPI_WDAT_GET_STATUS = 32,
1679 ACPI_WDAT_SET_STATUS = 33,
1680 ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
1681};
1682
1683enum acpi_wdat_instructions {
1684 ACPI_WDAT_READ_VALUE = 0,
1685 ACPI_WDAT_READ_COUNTDOWN = 1,
1686 ACPI_WDAT_WRITE_VALUE = 2,
1687 ACPI_WDAT_WRITE_COUNTDOWN = 3,
1688 ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
1689 ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
1690};
1691
1692enum acpi_wdat_flags {
1693 ACPI_WDAT_FLAG_DISABLED = 0,
1694 ACPI_WDAT_FLAG_ENABLED = 1
1695};
1696
1697enum acpi_wdat_access_size {
1698 ACPI_WDAT_ACCESS_SIZE_BYTE = 1,
1699 ACPI_WDAT_ACCESS_SIZE_WORD = 2,
1700 ACPI_WDAT_ACCESS_SIZE_DWORD = 3
1701};
1702
1703/* ACPI WDAT */
1704typedef struct acpi_wdat_entry {
1705 u8 action;
1706 u8 instruction;
1707 u16 reserved;
1708 struct acpi_gen_regaddr register_region;
1709 u32 value;
1710 u32 mask;
1711} __packed acpi_wdat_entry_t;
1712
1713typedef struct acpi_table_wdat {
1714 acpi_header_t header; /* Common ACPI table header */
1715 u32 header_length;
1716 u16 pci_segment;
1717 u8 pci_bus;
1718 u8 pci_device;
1719 u8 pci_function;
1720 u8 reserved[3];
1721 u32 timer_period;
1722 u32 max_count;
1723 u32 min_count;
1724 u8 flags;
1725 u8 reserved2[3];
1726 u32 entries;
1727} __packed acpi_wdat_t;
1728
Arthur Heymans2e7e2d92022-03-03 22:28:27 +01001729uintptr_t get_coreboot_rsdp(void);
Rocky Phaguraeff07132021-01-10 15:42:50 -08001730void acpi_create_einj(acpi_einj_t *einj, uintptr_t addr, u8 actions);
1731
Furquan Shaikhe0844632020-05-02 10:23:37 -07001732unsigned long fw_cfg_acpi_tables(unsigned long start);
1733
1734/* These are implemented by the target port or north/southbridge. */
Raul E Rangel6b446b92021-11-19 11:38:35 -07001735void preload_acpi_dsdt(void);
Arthur Heymans7ebebf72023-06-17 14:08:46 +02001736unsigned long write_acpi_tables(const unsigned long addr);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001737unsigned long acpi_fill_madt(unsigned long current);
Arthur Heymanscd46e5f2023-06-22 21:34:16 +02001738unsigned long acpi_arch_fill_madt(acpi_madt_t *madt, unsigned long current);
Kyösti Mälkkif9aac922020-05-30 16:16:28 +03001739
Furquan Shaikhe0844632020-05-02 10:23:37 -07001740void acpi_fill_fadt(acpi_fadt_t *fadt);
Angel Pons79572e42020-07-13 00:17:43 +02001741void arch_fill_fadt(acpi_fadt_t *fadt);
Kyösti Mälkkif9aac922020-05-30 16:16:28 +03001742void soc_fill_fadt(acpi_fadt_t *fadt);
Kyösti Mälkki02fd15d2020-06-02 03:34:43 +03001743void mainboard_fill_fadt(acpi_fadt_t *fadt);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001744
Kyösti Mälkki88decca2023-04-28 07:04:34 +03001745void fill_fadt_extended_pm_io(acpi_fadt_t *fadt);
1746
Kyösti Mälkki2ab4a962020-06-30 11:41:47 +03001747void acpi_fill_gnvs(void);
Kyösti Mälkki3dc17922021-03-16 19:01:48 +02001748void acpi_fill_cnvs(void);
Kyösti Mälkki2ab4a962020-06-30 11:41:47 +03001749
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +01001750unsigned long acpi_fill_lpit(unsigned long current);
1751
Furquan Shaikhe0844632020-05-02 10:23:37 -07001752/* These can be used by the target port. */
1753u8 acpi_checksum(u8 *table, u32 length);
1754
1755void acpi_add_table(acpi_rsdp_t *rsdp, void *table);
1756
Jonathan Zhang3dcafa82022-05-11 13:11:20 -07001757/* Create CXL Early Discovery Table */
1758void acpi_create_cedt(acpi_cedt_t *cedt,
1759 unsigned long (*acpi_fill_cedt)(unsigned long current));
1760/* Create a CXL Host Bridge Structure for CEDT */
1761int acpi_create_cedt_chbs(acpi_cedt_chbs_t *chbs, u32 uid, u32 cxl_ver, u64 base);
1762/* Create a CXL Fixed Memory Window Structure for CEDT */
1763int acpi_create_cedt_cfmws(acpi_cedt_cfmws_t *cfmws, u64 base_hpa, u64 window_size,
1764 u8 eniw, u32 hbig, u16 restriction, u16 qtg_id, const u32 *interleave_target);
1765
David Milosevicd9822742023-09-22 14:34:28 +02001766/* PPTT related functions */
1767void acpi_create_pptt_body(acpi_pptt_t *pptt);
1768struct pptt_topology *acpi_get_pptt_topology(void);
Arthur Heymans92a3b672023-06-22 21:30:58 +02001769
Kyösti Mälkkic7da0272021-06-08 11:37:08 +03001770int acpi_create_madt_ioapic_from_hw(acpi_madt_ioapic_t *ioapic, u32 addr);
Kyösti Mälkki9ac1fb72023-04-07 22:39:53 +03001771
Kyösti Mälkki2e9f0d32023-04-07 23:05:46 +03001772unsigned long acpi_create_madt_one_lapic(unsigned long current, u32 cpu, u32 apic);
Kyösti Mälkki9ac1fb72023-04-07 22:39:53 +03001773
1774unsigned long acpi_create_madt_lapic_nmis(unsigned long current);
1775
Arthur Heymans3df6cc92023-06-27 16:44:59 +02001776uintptr_t platform_get_gicd_base(void);
1777uintptr_t platform_get_gicr_base(void);
Naresh Solanki1fe19042023-09-25 14:24:34 +02001778int platform_get_gic_its(uintptr_t **base);
Arthur Heymans3df6cc92023-06-27 16:44:59 +02001779
Furquan Shaikhe0844632020-05-02 10:23:37 -07001780int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic);
Naresh Solanki76835cc2023-01-20 19:13:02 +01001781int acpi_create_srat_x2apic(acpi_srat_x2apic_t *x2apic, u32 node, u32 apic);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001782int acpi_create_srat_mem(acpi_srat_mem_t *mem, u8 node, u32 basek, u32 sizek,
1783 u32 flags);
Jonathan Zhang3164b642021-04-21 17:51:31 -07001784/*
1785 * Given the Generic Initiator device's BDF, the proximity domain's ID
1786 * and flag, create Generic Initiator Affinity structure in SRAT.
1787 */
1788int acpi_create_srat_gia_pci(acpi_srat_gia_t *gia, u32 proximity_domain,
Patrick Rudolph344ebf12024-01-31 11:38:38 +01001789 struct device *dev, u32 flags);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001790unsigned long acpi_create_srat_lapics(unsigned long current);
1791void acpi_create_srat(acpi_srat_t *srat,
1792 unsigned long (*acpi_fill_srat)(unsigned long current));
1793
1794void acpi_create_slit(acpi_slit_t *slit,
1795 unsigned long (*acpi_fill_slit)(unsigned long current));
1796
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -07001797/*
1798 * Create a Memory Proximity Domain Attributes structure for HMAT,
Martin Roth3e25f852023-09-04 15:37:07 -06001799 * given proximity domain for the attached initiator, and
1800 * proximity domain for the memory.
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -07001801 */
1802int acpi_create_hmat_mpda(acpi_hmat_mpda_t *mpda, u32 initiator, u32 memory);
Martin Roth0949e732021-10-01 14:28:22 -06001803/* Create Heterogeneous Memory Attribute Table */
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -07001804void acpi_create_hmat(acpi_hmat_t *hmat,
1805 unsigned long (*acpi_fill_hmat)(unsigned long current));
1806
Furquan Shaikhe0844632020-05-02 10:23:37 -07001807void acpi_create_vfct(const struct device *device,
1808 acpi_vfct_t *vfct,
1809 unsigned long (*acpi_fill_vfct)(const struct device *device,
1810 acpi_vfct_t *vfct_struct,
1811 unsigned long current));
1812
1813void acpi_create_ipmi(const struct device *device,
1814 struct acpi_spmi *spmi,
1815 const u16 ipmi_revision,
1816 const acpi_addr_t *addr,
1817 const enum acpi_ipmi_interface_type type,
1818 const s8 gpe_interrupt,
1819 const u32 apic_interrupt,
1820 const u32 uid);
1821
1822void acpi_create_ivrs(acpi_ivrs_t *ivrs,
1823 unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t *ivrs_struct,
1824 unsigned long current));
1825
Jason Glenesk61624b22020-11-02 20:06:23 -08001826void acpi_create_crat(struct acpi_crat_header *crat,
1827 unsigned long (*acpi_fill_crat)(struct acpi_crat_header *crat_struct,
1828 unsigned long current));
1829
Furquan Shaikhe0844632020-05-02 10:23:37 -07001830unsigned long acpi_write_hpet(const struct device *device, unsigned long start,
1831 acpi_rsdp_t *rsdp);
1832
1833/* cpu/intel/speedstep/acpi.c */
1834void generate_cpu_entries(const struct device *device);
1835
Furquan Shaikhe0844632020-05-02 10:23:37 -07001836unsigned long acpi_write_dbg2_pci_uart(acpi_rsdp_t *rsdp, unsigned long current,
Arthur Heymans736d4d22023-06-30 15:37:38 +02001837 const struct device *dev, uint8_t access_size);
1838unsigned long acpi_pl011_write_dbg2_uart(acpi_rsdp_t *rsdp, unsigned long current,
1839 uint64_t base, const char *name);
Zheng Bao3ea3fbe2023-11-20 14:17:25 +08001840unsigned long acpi_16550_mmio32_write_dbg2_uart(acpi_rsdp_t *rsdp, unsigned long current,
1841 uint64_t base, const char *name);
Arthur Heymans736d4d22023-06-30 15:37:38 +02001842
Furquan Shaikhe0844632020-05-02 10:23:37 -07001843void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags,
1844 unsigned long (*acpi_fill_dmar)(unsigned long));
1845unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
1846 u16 segment, u64 bar);
1847unsigned long acpi_create_dmar_rmrr(unsigned long current, u16 segment,
1848 u64 bar, u64 limit);
1849unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
1850 u16 segment);
1851unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr,
1852 u32 proximity_domain);
1853unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number,
1854 const char *device_name);
John Zhao6edbb182021-03-24 11:55:09 -07001855unsigned long acpi_create_dmar_satc(unsigned long current, u8 flags,
John Zhao091532d2021-04-17 16:03:21 -07001856 u16 segment);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001857void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current);
1858void acpi_dmar_rmrr_fixup(unsigned long base, unsigned long current);
1859void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current);
John Zhao6edbb182021-03-24 11:55:09 -07001860void acpi_dmar_satc_fixup(unsigned long base, unsigned long current);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001861unsigned long acpi_create_dmar_ds_pci_br(unsigned long current,
1862 u8 bus, u8 dev, u8 fn);
1863unsigned long acpi_create_dmar_ds_pci(unsigned long current,
1864 u8 bus, u8 dev, u8 fn);
1865unsigned long acpi_create_dmar_ds_ioapic(unsigned long current,
1866 u8 enumeration_id,
1867 u8 bus, u8 dev, u8 fn);
Arthur Heymansbc8f8592022-12-02 13:17:39 +01001868unsigned long acpi_create_dmar_ds_ioapic_from_hw(unsigned long current,
1869 u32 addr, u8 bus, u8 dev, u8 fn);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001870unsigned long acpi_create_dmar_ds_msi_hpet(unsigned long current,
1871 u8 enumeration_id,
1872 u8 bus, u8 dev, u8 fn);
1873void acpi_write_hest(acpi_hest_t *hest,
1874 unsigned long (*acpi_fill_hest)(acpi_hest_t *hest));
1875
1876unsigned long acpi_create_hest_error_source(acpi_hest_t *hest,
1877 acpi_hest_esd_t *esd, u16 type, void *data, u16 len);
1878
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +01001879unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t uid);
1880
Felix Heldf7dbf4a2021-06-07 16:56:04 +02001881/* chipsets that select ACPI_BERT must implement this function */
Felix Held29405482021-05-28 16:01:57 +02001882enum cb_err acpi_soc_get_bert_region(void **region, size_t *length);
Francois Toguo522e0db2021-01-21 09:55:19 -08001883
Arthur Heymans2e3cb632023-06-30 15:01:08 +02001884void acpi_soc_fill_gtdt(acpi_gtdt_t *gtdt);
1885unsigned long acpi_soc_gtdt_add_timers(uint32_t *count, unsigned long current);
1886unsigned long acpi_gtdt_add_timer_block(unsigned long current, const uint64_t address,
1887 struct acpi_gtdt_timer_entry *timers, size_t number);
1888unsigned long acpi_gtdt_add_watchdog(unsigned long current, uint64_t refresh_frame,
1889 uint64_t control_frame, uint32_t gsiv, uint32_t flags);
1890
Marek Maslanka017003c2023-12-07 13:21:35 +00001891/*
1892 * Populate primary acpi_wdat_t struct to provide basic information about watchdog and
1893 * associated acpi_wdat_entry_t structures, which correspond to watchdog-related
1894 * actions such as start/stop watchdog, set timeout, ping watchdog, get remaining time,
1895 * etc. Each acpi_wdat_entry_t entry indicates what needs to be written to a specific
1896 * address to perform a specific action or at which address the watchdog-related
1897 * information is stored.
1898 *
1899 * The acpi_wdat_entry_t structures follow the acpi_wdat_t, so the table layout is as
1900 * follows:
1901 * +---------------------+
1902 * | acpi_wdat_t { |
1903 * | ... |
1904 * | } |
1905 * | acpi_wdat_entry_t { |
1906 * | ... |
1907 * | } |
1908 * | acpi_wdat_entry_t { |
1909 * | ... |
1910 * | } |
1911 * +---------------------+
1912 *
1913 * @param wdat Pointer to populate acpi_wdat_t struct
1914 * @param current Position in memory after the acpi_wdat_t struct which also indicates
1915 * the position where the first acpi_wdat_entry_t must be placed.
1916 * @return Position after last acpi_wdat_entry_t struct
1917 */
1918unsigned long acpi_soc_fill_wdat(acpi_wdat_t *wdat, unsigned long current);
1919
Furquan Shaikhe0844632020-05-02 10:23:37 -07001920/* For ACPI S3 support. */
Kyösti Mälkkia4c0e1a2020-06-18 08:28:12 +03001921void __noreturn acpi_resume(void *wake_vec);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001922void mainboard_suspend_resume(void);
1923void *acpi_find_wakeup_vector(void);
1924
1925/* ACPI_Sn assignments are defined to always equal the sleep state numbers */
1926enum {
1927 ACPI_S0 = 0,
1928 ACPI_S1 = 1,
1929 ACPI_S2 = 2,
1930 ACPI_S3 = 3,
1931 ACPI_S4 = 4,
1932 ACPI_S5 = 5,
1933};
1934
1935#if CONFIG(ACPI_INTEL_HARDWARE_SLEEP_VALUES) \
1936 || CONFIG(ACPI_AMD_HARDWARE_SLEEP_VALUES)
1937/* Given the provided PM1 control register return the ACPI sleep type. */
1938static inline int acpi_sleep_from_pm1(uint32_t pm1_cnt)
1939{
1940 switch (((pm1_cnt) & SLP_TYP) >> SLP_TYP_SHIFT) {
1941 case SLP_TYP_S0: return ACPI_S0;
1942 case SLP_TYP_S1: return ACPI_S1;
1943 case SLP_TYP_S3: return ACPI_S3;
1944 case SLP_TYP_S4: return ACPI_S4;
1945 case SLP_TYP_S5: return ACPI_S5;
1946 }
1947 return -1;
1948}
1949#endif
1950
Kyösti Mälkkie0d38682020-06-07 12:01:58 +03001951uint8_t acpi_get_preferred_pm_profile(void);
1952
Furquan Shaikhe0844632020-05-02 10:23:37 -07001953/* Returns ACPI_Sx values. */
1954int acpi_get_sleep_type(void);
1955
1956/* Read and clear GPE status */
1957int acpi_get_gpe(int gpe);
1958
Kyösti Mälkki0a9e72e2019-08-11 01:22:28 +03001959/* Once we enter payload, is SMI handler installed and capable of
1960 responding to APM_CNT Advanced Power Management Control commands. */
1961static inline int permanent_smi_handler(void)
1962{
1963 return CONFIG(HAVE_SMI_HANDLER);
1964}
1965
Furquan Shaikhe0844632020-05-02 10:23:37 -07001966static inline int acpi_s3_resume_allowed(void)
1967{
1968 return CONFIG(HAVE_ACPI_RESUME);
1969}
1970
Furquan Shaikhe0844632020-05-02 10:23:37 -07001971static inline int acpi_is_wakeup_s3(void)
1972{
Kyösti Mälkki4a3f67a2020-06-18 13:44:29 +03001973 if (!acpi_s3_resume_allowed())
1974 return 0;
Furquan Shaikhe0844632020-05-02 10:23:37 -07001975
Kyösti Mälkki4a3f67a2020-06-18 13:44:29 +03001976 if (ENV_ROMSTAGE_OR_BEFORE)
1977 return (acpi_get_sleep_type() == ACPI_S3);
1978
Kyösti Mälkkiac0dc4a2020-11-18 07:40:21 +02001979 return romstage_handoff_is_resume();
Kyösti Mälkki4a3f67a2020-06-18 13:44:29 +03001980}
Furquan Shaikhe0844632020-05-02 10:23:37 -07001981
1982static inline uintptr_t acpi_align_current(uintptr_t current)
1983{
1984 return ALIGN_UP(current, 16);
1985}
1986
1987/* ACPI table revisions should match the revision of the ACPI spec
1988 * supported. This function keeps the table versions synced. This could
1989 * be made into a weak function if there is ever a need to override the
1990 * coreboot default ACPI spec version supported. */
1991int get_acpi_table_revision(enum acpi_tables table);
Elyes Haouas8b950f42022-02-16 12:08:16 +01001992u8 get_acpi_fadt_minor_version(void);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001993
Kyösti Mälkki94e04652020-06-01 13:26:22 +03001994#endif // !defined(__ASSEMBLER__) && !defined(__ACPI__)
Furquan Shaikhe0844632020-05-02 10:23:37 -07001995
Furquan Shaikh56eafbb2020-04-30 18:38:55 -07001996#endif /* __ACPI_ACPI_H__ */