blob: 0e5b4b280fdbac928bdfc7ad443b75f536e6a927 [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
Felix Held824d9302024-05-24 13:58:34 +0200461/* MADT Feature Flags */
462#define ACPI_MADT_PCAT_COMPAT (1 << 0)
463
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +0100464/*
465 * LPIT (Low Power Idle Table)
466 * Conforms to "Intel Low Power S0 Idle" specification, rev 002 from July 2017.
467 */
468typedef struct acpi_lpit {
469 acpi_header_t header;
470} __packed acpi_lpit_t;
471
472/* LPIT: LPI descriptor flags */
473typedef struct acpi_lpi_flags {
474 uint32_t disabled : 1;
475 uint32_t counter_not_available : 1;
476 uint32_t reserved : 30;
477} __packed acpi_lpi_desc_flags_t;
478
479/* LPIT: LPI descriptor types */
480enum acpi_lpi_desc_type {
481 ACPI_LPI_DESC_TYPE_NATIVE_CSTATE = 0x00,
482 /* type >= 1 reserved */
483};
484
485/* LPIT: LPI descriptor header */
486typedef struct acpi_lpi_desc_hdr {
487 uint32_t type;
488 uint32_t length;
489 uint16_t uid;
490 uint16_t reserved;
491} __packed acpi_lpi_desc_hdr_t;
492
Sukumar Ghoraied1c03a2023-09-28 23:44:30 -0700493#define ACPI_LPIT_CTR_FREQ_TSC 0
Sukumar Ghoraibd9c5622023-10-07 23:19:34 -0700494
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +0100495
496/* LPIT: Native C-state instruction based LPI structure */
497typedef struct acpi_lpi_desc_ncst {
498 acpi_lpi_desc_hdr_t header;
499 acpi_lpi_desc_flags_t flags;
500 acpi_addr_t entry_trigger; /* Entry trigger C-state */
501 uint32_t min_residency; /* Minimum residency or "break-even" in microseconds */
502 uint32_t max_latency; /* Worst case exit latency in microseconds */
503 acpi_addr_t residency_counter;
504 uint64_t counter_frequency; /* Frequency in cycles per second - 0 means TSC freq */
505} __packed acpi_lpi_desc_ncst_t;
506
Matt DeVillier7c04d0e2023-09-03 12:51:58 -0500507#define VFCT_VBIOS_CHECKSUM_OFFSET 0x21
508
Furquan Shaikhe0844632020-05-02 10:23:37 -0700509/* VFCT image header */
510typedef struct acpi_vfct_image_hdr {
511 u32 PCIBus;
512 u32 PCIDevice;
513 u32 PCIFunction;
514 u16 VendorID;
515 u16 DeviceID;
516 u16 SSVID;
517 u16 SSID;
518 u32 Revision;
519 u32 ImageLength;
Matt DeVillier7c04d0e2023-09-03 12:51:58 -0500520 u8 VbiosContent[]; // dummy - copy VBIOS here
Furquan Shaikhe0844632020-05-02 10:23:37 -0700521} __packed acpi_vfct_image_hdr_t;
522
523/* VFCT (VBIOS Fetch Table) */
524typedef struct acpi_vfct {
525 acpi_header_t header;
526 u8 TableUUID[16];
527 u32 VBIOSImageOffset;
528 u32 Lib1ImageOffset;
529 u32 Reserved[4];
530 acpi_vfct_image_hdr_t image_hdr;
531} __packed acpi_vfct_t;
532
533typedef struct acpi_ivrs_info {
534} __packed acpi_ivrs_info_t;
535
536/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 10h */
537typedef struct acpi_ivrs_ivhd {
538 uint8_t type;
539 uint8_t flags;
540 uint16_t length;
541 uint16_t device_id;
542 uint16_t capability_offset;
543 uint32_t iommu_base_low;
544 uint32_t iommu_base_high;
545 uint16_t pci_segment_group;
546 uint16_t iommu_info;
547 uint32_t iommu_feature_info;
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200548 uint8_t entry[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700549} __packed acpi_ivrs_ivhd_t;
550
551/* IVRS (I/O Virtualization Reporting Structure) Type 10h */
552typedef struct acpi_ivrs {
553 acpi_header_t header;
554 uint32_t iv_info;
555 uint32_t reserved[2];
556 struct acpi_ivrs_ivhd ivhd;
557} __packed acpi_ivrs_t;
558
Jason Glenesk61624b22020-11-02 20:06:23 -0800559/* CRAT (Component Resource Affinity Table Structure) */
560struct acpi_crat_header {
561 acpi_header_t header;
562 uint32_t total_entries;
563 uint16_t num_nodes;
564 uint8_t reserved[6];
565} __packed;
566
Furquan Shaikhe0844632020-05-02 10:23:37 -0700567/* IVHD Type 11h IOMMU Attributes */
568typedef struct ivhd11_iommu_attr {
569 uint32_t reserved1 : 13;
570 uint32_t perf_counters : 4;
571 uint32_t perf_counter_banks : 6;
572 uint32_t msi_num_ppr : 5;
573 uint32_t reserved2 : 4;
574} __packed ivhd11_iommu_attr_t;
575
576/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 11h */
577typedef struct acpi_ivrs_ivhd_11 {
578 uint8_t type;
579 uint8_t flags;
580 uint16_t length;
581 uint16_t device_id;
582 uint16_t capability_offset;
583 uint32_t iommu_base_low;
584 uint32_t iommu_base_high;
585 uint16_t pci_segment_group;
586 uint16_t iommu_info;
587 struct ivhd11_iommu_attr iommu_attributes;
588 uint32_t efr_reg_image_low;
589 uint32_t efr_reg_image_high;
590 uint32_t reserved[2];
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200591 uint8_t entry[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700592} __packed acpi_ivrs_ivhd11_t;
593
594enum dev_scope_type {
595 SCOPE_PCI_ENDPOINT = 1,
596 SCOPE_PCI_SUB = 2,
597 SCOPE_IOAPIC = 3,
598 SCOPE_MSI_HPET = 4,
599 SCOPE_ACPI_NAMESPACE_DEVICE = 5
600};
601
602typedef struct dev_scope {
603 u8 type;
604 u8 length;
605 u8 reserved[2];
606 u8 enumeration;
607 u8 start_bus;
608 struct {
609 u8 dev;
610 u8 fn;
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200611 } __packed path[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700612} __packed dev_scope_t;
613
614enum dmar_type {
615 DMAR_DRHD = 0,
616 DMAR_RMRR = 1,
617 DMAR_ATSR = 2,
618 DMAR_RHSA = 3,
John Zhao6edbb182021-03-24 11:55:09 -0700619 DMAR_ANDD = 4,
620 DMAR_SATC = 5
Furquan Shaikhe0844632020-05-02 10:23:37 -0700621};
622
623enum {
624 DRHD_INCLUDE_PCI_ALL = 1
625};
626
John Zhao091532d2021-04-17 16:03:21 -0700627enum {
628 ATC_REQUIRED = 1
629};
630
Furquan Shaikhe0844632020-05-02 10:23:37 -0700631enum dmar_flags {
632 DMAR_INTR_REMAP = 1 << 0,
633 DMAR_X2APIC_OPT_OUT = 1 << 1,
634 DMA_CTRL_PLATFORM_OPT_IN_FLAG = 1 << 2,
635};
636
637typedef struct dmar_entry {
638 u16 type;
639 u16 length;
640 u8 flags;
641 u8 reserved;
642 u16 segment;
643 u64 bar;
644} __packed dmar_entry_t;
645
646typedef struct dmar_rmrr_entry {
647 u16 type;
648 u16 length;
649 u16 reserved;
650 u16 segment;
651 u64 bar;
652 u64 limit;
653} __packed dmar_rmrr_entry_t;
654
655typedef struct dmar_atsr_entry {
656 u16 type;
657 u16 length;
658 u8 flags;
659 u8 reserved;
660 u16 segment;
661} __packed dmar_atsr_entry_t;
662
663typedef struct dmar_rhsa_entry {
664 u16 type;
665 u16 length;
666 u32 reserved;
667 u64 base_address;
668 u32 proximity_domain;
669} __packed dmar_rhsa_entry_t;
670
671typedef struct dmar_andd_entry {
672 u16 type;
673 u16 length;
674 u8 reserved[3];
675 u8 device_number;
676 u8 device_name[];
677} __packed dmar_andd_entry_t;
678
John Zhao6edbb182021-03-24 11:55:09 -0700679typedef struct dmar_satc_entry {
680 u16 type;
681 u16 length;
682 u8 flags;
683 u8 reserved;
684 u16 segment_number;
John Zhao6edbb182021-03-24 11:55:09 -0700685} __packed dmar_satc_entry_t;
686
Furquan Shaikhe0844632020-05-02 10:23:37 -0700687/* DMAR (DMA Remapping Reporting Structure) */
688typedef struct acpi_dmar {
689 acpi_header_t header;
690 u8 host_address_width;
691 u8 flags;
692 u8 reserved[10];
Elyes Haouasa4aa169a2023-07-30 12:59:50 +0200693 dmar_entry_t structure[];
Furquan Shaikhe0844632020-05-02 10:23:37 -0700694} __packed acpi_dmar_t;
695
696/* MADT: APIC Structure Types */
697enum acpi_apic_types {
698 LOCAL_APIC, /* Processor local APIC */
699 IO_APIC, /* I/O APIC */
700 IRQ_SOURCE_OVERRIDE, /* Interrupt source override */
701 NMI_TYPE, /* NMI source */
702 LOCAL_APIC_NMI, /* Local APIC NMI */
703 LAPIC_ADDRESS_OVERRIDE, /* Local APIC address override */
704 IO_SAPIC, /* I/O SAPIC */
705 LOCAL_SAPIC, /* Local SAPIC */
706 PLATFORM_IRQ_SOURCES, /* Platform interrupt sources */
707 LOCAL_X2APIC, /* Processor local x2APIC */
708 LOCAL_X2APIC_NMI, /* Local x2APIC NMI */
709 GICC, /* GIC CPU Interface */
710 GICD, /* GIC Distributor */
711 GIC_MSI_FRAME, /* GIC MSI Frame */
712 GICR, /* GIC Redistributor */
713 GIC_ITS, /* Interrupt Translation Service */
714 /* 0x10-0x7f: Reserved */
715 /* 0x80-0xff: Reserved for OEM use */
716};
717
718/* MADT: Processor Local APIC Structure */
719typedef struct acpi_madt_lapic {
720 u8 type; /* Type (0) */
721 u8 length; /* Length in bytes (8) */
722 u8 processor_id; /* ACPI processor ID */
723 u8 apic_id; /* Local APIC ID */
724 u32 flags; /* Local APIC flags */
725} __packed acpi_madt_lapic_t;
726
Kyösti Mälkki2e9f0d32023-04-07 23:05:46 +0300727#define ACPI_MADT_MAX_LAPIC_ID 0xfe
728
Furquan Shaikhe0844632020-05-02 10:23:37 -0700729/* MADT: Local APIC NMI Structure */
730typedef struct acpi_madt_lapic_nmi {
731 u8 type; /* Type (4) */
732 u8 length; /* Length in bytes (6) */
733 u8 processor_id; /* ACPI processor ID */
734 u16 flags; /* MPS INTI flags */
735 u8 lint; /* Local APIC LINT# */
736} __packed acpi_madt_lapic_nmi_t;
737
Kyösti Mälkki66b5e1b2022-11-12 21:13:45 +0200738#define ACPI_MADT_LAPIC_NMI_ALL_PROCESSORS 0xff
739#define ACPI_MADT_LX2APIC_NMI_ALL_PROCESSORS ((u32)-1)
Raul E Rangelf5552ce2021-02-11 11:27:56 -0700740
Furquan Shaikhe0844632020-05-02 10:23:37 -0700741/* MADT: I/O APIC Structure */
742typedef struct acpi_madt_ioapic {
743 u8 type; /* Type (1) */
744 u8 length; /* Length in bytes (12) */
745 u8 ioapic_id; /* I/O APIC ID */
746 u8 reserved;
747 u32 ioapic_addr; /* I/O APIC address */
748 u32 gsi_base; /* Global system interrupt base */
749} __packed acpi_madt_ioapic_t;
750
Raul E Rangel169302a2022-04-25 14:59:05 -0600751#define MP_IRQ_POLARITY_DEFAULT 0x0
752#define MP_IRQ_POLARITY_HIGH 0x1
753#define MP_IRQ_POLARITY_LOW 0x3
754#define MP_IRQ_POLARITY_MASK 0x3
755#define MP_IRQ_TRIGGER_DEFAULT 0x0
756#define MP_IRQ_TRIGGER_EDGE 0x4
757#define MP_IRQ_TRIGGER_LEVEL 0xc
758#define MP_IRQ_TRIGGER_MASK 0xc
759
Furquan Shaikhe0844632020-05-02 10:23:37 -0700760/* MADT: Interrupt Source Override Structure */
761typedef struct acpi_madt_irqoverride {
762 u8 type; /* Type (2) */
763 u8 length; /* Length in bytes (10) */
764 u8 bus; /* ISA (0) */
765 u8 source; /* Bus-relative int. source (IRQ) */
766 u32 gsirq; /* Global system interrupt */
767 u16 flags; /* MPS INTI flags */
768} __packed acpi_madt_irqoverride_t;
769
770/* MADT: Processor Local x2APIC Structure */
771typedef struct acpi_madt_lx2apic {
772 u8 type; /* Type (9) */
773 u8 length; /* Length in bytes (16) */
774 u16 reserved;
775 u32 x2apic_id; /* Local x2APIC ID */
776 u32 flags; /* Same as Local APIC flags */
777 u32 processor_id; /* ACPI processor ID */
778} __packed acpi_madt_lx2apic_t;
779
780/* MADT: Processor Local x2APIC NMI Structure */
781typedef struct acpi_madt_lx2apic_nmi {
782 u8 type; /* Type (10) */
783 u8 length; /* Length in bytes (12) */
784 u16 flags; /* Same as MPS INTI flags */
785 u32 processor_id; /* ACPI processor ID */
786 u8 lint; /* Local APIC LINT# */
787 u8 reserved[3];
788} __packed acpi_madt_lx2apic_nmi_t;
789
Arthur Heymans51d94c72023-06-27 15:37:37 +0200790/* MADT: GIC CPU Interface (GICC) Structure 6.5 */
791struct gicc_flags {
792 uint32_t enabled : 1;
793 /* 0 - Level-triggered | 1 - Edge-Triggered */
794 uint32_t performance_interrupt_mode : 1;
795 uint32_t vgic_maintenance_interrupt_mode : 1;
796 uint32_t online_capable : 1;
797 uint32_t reserved : 28;
798};
799_Static_assert(sizeof(struct gicc_flags) == sizeof(uint32_t), "Wrong gicc_flags size\n");
800
801typedef struct acpi_gicc {
802 uint8_t type;
803 uint8_t length;
804 uint16_t reserved;
805 uint32_t cpu_interface_number;
806 uint32_t acpi_processor_uid;
807 struct gicc_flags flags;
808 uint32_t parking_protocol_version;
809 uint32_t performance_interrupt_gsiv;
810 uint64_t parked_address;
811 uint64_t physical_base_address; /* GIC v1/v2 or GIC v3/v4 in v2 compat mode */
812 uint64_t gicv;
813 uint64_t gich;
814 uint32_t vgic_maintenance_interrupt;
815 uint64_t gicr_base_address; /* Only GIC v3 and above */
816 uint64_t mpidr;
817 uint8_t processor_power_efficiency_class;
818 uint8_t reserved1;
819 uint16_t spe_overflow_interrupt;
820 uint16_t trbe_interrupt;
821} __packed acpi_madt_gicc_t;
822_Static_assert(sizeof(acpi_madt_gicc_t) == 82, "Wrong acpi_madt_gicc_t size\n");
823
824/* MADT: GIC Distributor (GICD) Structure */
825typedef struct acpi_gicd {
826 uint8_t type;
827 uint8_t length;
828 uint16_t reserved1;
829 uint32_t gic_id;
830 uint64_t physical_base_address;
831 uint32_t system_vector_base;
832 uint8_t gic_version;
833 uint8_t reserved2[3];
834} __packed acpi_madt_gicd_t;
835_Static_assert(sizeof(acpi_madt_gicd_t) == 24, "Wrong acpi_madt_gicd_t size\n");
836
837/* MADT: GIC MSI Frame Structure */
838struct gic_msi_flags {
839 uint32_t spi_count_select : 1;
840 uint32_t reserved : 31;
841};
842_Static_assert(sizeof(struct gic_msi_flags) == sizeof(uint32_t), "Wrong gic_msi_flags size\n");
843
844typedef struct acpi_gic_msi {
845 uint8_t type;
846 uint8_t length;
847 uint16_t reserved;
848 uint32_t gic_msi_frame_id;
849 uint64_t physical_base_address;
850 struct gic_msi_flags flags;
851 uint16_t spi_count;
852 uint16_t spi_base;
853} __packed acpi_gic_msi_t;
854_Static_assert(sizeof(acpi_gic_msi_t) == 24, "Wrong acpi_gic_msi_t size\n");
855
856/* MADT: GIC Redistributor (GICR) Structure */
857typedef struct acpi_girr {
858 uint8_t type;
859 uint8_t length;
860 uint16_t reserved;
861 uint64_t discovery_range_base_address;
862 uint32_t discovery_range_length;
863} __packed acpi_madt_gicr_t;
864_Static_assert(sizeof(acpi_madt_gicr_t) == 16, "Wrong acpi_madt_gicr_t size\n");
865
866/* MADT: GIC Interrupt Translation Service (ITS) Structure */
867typedef struct acpi_gic_its {
868 uint8_t type;
869 uint8_t length;
870 uint16_t reserved;
871 uint32_t gic_its_id;
872 uint64_t physical_base_address;
873 uint32_t reserved2;
874} __packed acpi_madt_gic_its_t;
875_Static_assert(sizeof(acpi_madt_gic_its_t) == 20, "Wrong MADT acpi_madt_gic_its_t size\n");
876
Furquan Shaikhe0844632020-05-02 10:23:37 -0700877#define ACPI_DBG2_PORT_SERIAL 0x8000
Felix Held2eaebfc2023-11-22 00:31:37 +0100878#define ACPI_DBG2_PORT_SERIAL_16550_IO_ONLY 0x0000
Furquan Shaikhe0844632020-05-02 10:23:37 -0700879#define ACPI_DBG2_PORT_SERIAL_16550_DBGP 0x0001
880#define ACPI_DBG2_PORT_SERIAL_ARM_PL011 0x0003
881#define ACPI_DBG2_PORT_SERIAL_ARM_SBSA 0x000e
882#define ACPI_DBG2_PORT_SERIAL_ARM_DDC 0x000f
883#define ACPI_DBG2_PORT_SERIAL_BCM2835 0x0010
Felix Held2eaebfc2023-11-22 00:31:37 +0100884#define ACPI_DBG2_PORT_SERIAL_16550 0x0012
Furquan Shaikhe0844632020-05-02 10:23:37 -0700885#define ACPI_DBG2_PORT_IEEE1394 0x8001
886#define ACPI_DBG2_PORT_IEEE1394_STANDARD 0x0000
887#define ACPI_DBG2_PORT_USB 0x8002
888#define ACPI_DBG2_PORT_USB_XHCI 0x0000
889#define ACPI_DBG2_PORT_USB_EHCI 0x0001
890#define ACPI_DBG2_PORT_NET 0x8003
891
892/* DBG2: Microsoft Debug Port Table 2 header */
893typedef struct acpi_dbg2_header {
894 acpi_header_t header;
895 uint32_t devices_offset;
896 uint32_t devices_count;
Elyes Haouas139cb062023-08-26 17:04:21 +0200897} __packed acpi_dbg2_header_t;
Furquan Shaikhe0844632020-05-02 10:23:37 -0700898
899/* DBG2: Microsoft Debug Port Table 2 device entry */
900typedef struct acpi_dbg2_device {
901 uint8_t revision;
902 uint16_t length;
903 uint8_t address_count;
904 uint16_t namespace_string_length;
905 uint16_t namespace_string_offset;
906 uint16_t oem_data_length;
907 uint16_t oem_data_offset;
908 uint16_t port_type;
909 uint16_t port_subtype;
910 uint8_t reserved[2];
911 uint16_t base_address_offset;
912 uint16_t address_size_offset;
Elyes Haouas139cb062023-08-26 17:04:21 +0200913} __packed acpi_dbg2_device_t;
Furquan Shaikhe0844632020-05-02 10:23:37 -0700914
915/* FADT (Fixed ACPI Description Table) */
916typedef struct acpi_fadt {
917 acpi_header_t header;
918 u32 firmware_ctrl;
919 u32 dsdt;
920 u8 reserved; /* Should be 0 */
921 u8 preferred_pm_profile;
922 u16 sci_int;
923 u32 smi_cmd;
924 u8 acpi_enable;
925 u8 acpi_disable;
926 u8 s4bios_req;
927 u8 pstate_cnt;
928 u32 pm1a_evt_blk;
929 u32 pm1b_evt_blk;
930 u32 pm1a_cnt_blk;
931 u32 pm1b_cnt_blk;
932 u32 pm2_cnt_blk;
933 u32 pm_tmr_blk;
934 u32 gpe0_blk;
935 u32 gpe1_blk;
936 u8 pm1_evt_len;
937 u8 pm1_cnt_len;
938 u8 pm2_cnt_len;
939 u8 pm_tmr_len;
940 u8 gpe0_blk_len;
941 u8 gpe1_blk_len;
942 u8 gpe1_base;
943 u8 cst_cnt;
944 u16 p_lvl2_lat;
945 u16 p_lvl3_lat;
946 u16 flush_size;
947 u16 flush_stride;
948 u8 duty_offset;
949 u8 duty_width;
950 u8 day_alrm;
951 u8 mon_alrm;
952 u8 century;
953 u16 iapc_boot_arch;
954 u8 res2;
955 u32 flags;
956 acpi_addr_t reset_reg;
957 u8 reset_value;
Elyes Haouasb55ac092022-02-16 14:42:19 +0100958 u16 ARM_boot_arch; /* Must be zero if ACPI Revision <= 5.0 */
Elyes Haouas8b950f42022-02-16 12:08:16 +0100959 u8 FADT_MinorVersion; /* Must be zero if ACPI Revision <= 5.0 */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700960 u32 x_firmware_ctl_l;
961 u32 x_firmware_ctl_h;
962 u32 x_dsdt_l;
963 u32 x_dsdt_h;
964 acpi_addr_t x_pm1a_evt_blk;
965 acpi_addr_t x_pm1b_evt_blk;
966 acpi_addr_t x_pm1a_cnt_blk;
967 acpi_addr_t x_pm1b_cnt_blk;
968 acpi_addr_t x_pm2_cnt_blk;
969 acpi_addr_t x_pm_tmr_blk;
970 acpi_addr_t x_gpe0_blk;
971 acpi_addr_t x_gpe1_blk;
972 /* Revision 5 */
973 acpi_addr_t sleep_control_reg;
974 acpi_addr_t sleep_status_reg;
975 /* Revision 6 */
976 u64 hypervisor_vendor_identity;
977} __packed acpi_fadt_t;
978
979/* FADT TABLE Revision values */
Elyes Haouas8b950f42022-02-16 12:08:16 +0100980#define ACPI_FADT_REV_ACPI_1 1
981#define ACPI_FADT_REV_ACPI_2 3
982#define ACPI_FADT_REV_ACPI_3 4
983#define ACPI_FADT_REV_ACPI_4 4
984#define ACPI_FADT_REV_ACPI_5 5
985#define ACPI_FADT_REV_ACPI_6 6
986
987/* FADT Minor Version value:
988 * Bits 0-3: minor version
989 * Bits 4-7: Errata
990 * value of 1 means this is compatible with Errata A,
991 * value of 2 would be compatible with Errata B, and so on
992 * Version 6.3 Errata A would be: (1 << 4) | 3
993 */
994#define ACPI_FADT_MINOR_VERSION_0 0 /* coreboot currently use this version */
Furquan Shaikhe0844632020-05-02 10:23:37 -0700995
996/* Flags for p_lvl2_lat and p_lvl3_lat */
997#define ACPI_FADT_C2_NOT_SUPPORTED 101
998#define ACPI_FADT_C3_NOT_SUPPORTED 1001
999
1000/* FADT Feature Flags */
1001#define ACPI_FADT_WBINVD (1 << 0)
1002#define ACPI_FADT_WBINVD_FLUSH (1 << 1)
1003#define ACPI_FADT_C1_SUPPORTED (1 << 2)
1004#define ACPI_FADT_C2_MP_SUPPORTED (1 << 3)
1005#define ACPI_FADT_POWER_BUTTON (1 << 4)
1006#define ACPI_FADT_SLEEP_BUTTON (1 << 5)
1007#define ACPI_FADT_FIXED_RTC (1 << 6)
1008#define ACPI_FADT_S4_RTC_WAKE (1 << 7)
1009#define ACPI_FADT_32BIT_TIMER (1 << 8)
1010#define ACPI_FADT_DOCKING_SUPPORTED (1 << 9)
1011#define ACPI_FADT_RESET_REGISTER (1 << 10)
1012#define ACPI_FADT_SEALED_CASE (1 << 11)
1013#define ACPI_FADT_HEADLESS (1 << 12)
1014#define ACPI_FADT_SLEEP_TYPE (1 << 13)
1015#define ACPI_FADT_PCI_EXPRESS_WAKE (1 << 14)
1016#define ACPI_FADT_PLATFORM_CLOCK (1 << 15)
1017#define ACPI_FADT_S4_RTC_VALID (1 << 16)
1018#define ACPI_FADT_REMOTE_POWER_ON (1 << 17)
1019#define ACPI_FADT_APIC_CLUSTER (1 << 18)
1020#define ACPI_FADT_APIC_PHYSICAL (1 << 19)
1021/* Bits 20-31: reserved ACPI 3.0 & 4.0 */
1022#define ACPI_FADT_HW_REDUCED_ACPI (1 << 20)
1023#define ACPI_FADT_LOW_PWR_IDLE_S0 (1 << 21)
1024/* bits 22-31: reserved since ACPI 5.0 */
1025
1026/* FADT Boot Architecture Flags */
1027#define ACPI_FADT_LEGACY_DEVICES (1 << 0)
1028#define ACPI_FADT_8042 (1 << 1)
1029#define ACPI_FADT_VGA_NOT_PRESENT (1 << 2)
1030#define ACPI_FADT_MSI_NOT_SUPPORTED (1 << 3)
1031#define ACPI_FADT_NO_PCIE_ASPM_CONTROL (1 << 4)
1032#define ACPI_FADT_NO_CMOS_RTC (1 << 5)
1033#define ACPI_FADT_LEGACY_FREE 0x00 /* No legacy devices (including 8042) */
1034
1035/* FADT ARM Boot Architecture Flags */
1036#define ACPI_FADT_ARM_PSCI_COMPLIANT (1 << 0)
1037#define ACPI_FADT_ARM_PSCI_USE_HVC (1 << 1)
1038/* bits 2-16: reserved since ACPI 5.1 */
1039
1040/* FADT Preferred Power Management Profile */
1041enum acpi_preferred_pm_profiles {
1042 PM_UNSPECIFIED = 0,
1043 PM_DESKTOP = 1,
1044 PM_MOBILE = 2,
1045 PM_WORKSTATION = 3,
1046 PM_ENTERPRISE_SERVER = 4,
1047 PM_SOHO_SERVER = 5,
1048 PM_APPLIANCE_PC = 6,
1049 PM_PERFORMANCE_SERVER = 7,
1050 PM_TABLET = 8, /* ACPI 5.0 & greater */
1051};
1052
1053/* FACS (Firmware ACPI Control Structure) */
1054typedef struct acpi_facs {
1055 char signature[4]; /* "FACS" */
1056 u32 length; /* Length in bytes (>= 64) */
1057 u32 hardware_signature; /* Hardware signature */
1058 u32 firmware_waking_vector; /* Firmware waking vector */
1059 u32 global_lock; /* Global lock */
1060 u32 flags; /* FACS flags */
1061 u32 x_firmware_waking_vector_l; /* X FW waking vector, low */
1062 u32 x_firmware_waking_vector_h; /* X FW waking vector, high */
1063 u8 version; /* FACS version */
1064 u8 resv1[3]; /* This value is 0 */
1065 u32 ospm_flags; /* 64BIT_WAKE_F */
1066 u8 resv2[24]; /* This value is 0 */
1067} __packed acpi_facs_t;
1068
1069/* FACS flags */
1070#define ACPI_FACS_S4BIOS_F (1 << 0)
1071#define ACPI_FACS_64BIT_WAKE_F (1 << 1)
1072/* Bits 31..2: reserved */
1073
1074/* ECDT (Embedded Controller Boot Resources Table) */
1075typedef struct acpi_ecdt {
1076 acpi_header_t header;
1077 acpi_addr_t ec_control; /* EC control register */
1078 acpi_addr_t ec_data; /* EC data register */
1079 u32 uid; /* UID */
1080 u8 gpe_bit; /* GPE bit */
1081 u8 ec_id[]; /* EC ID */
1082} __packed acpi_ecdt_t;
1083
1084/* HEST (Hardware Error Source Table) */
1085typedef struct acpi_hest {
1086 acpi_header_t header;
1087 u32 error_source_count;
1088 /* error_source_struct(s) */
1089} __packed acpi_hest_t;
1090
1091/* Error Source Descriptors */
1092typedef struct acpi_hest_esd {
1093 u16 type;
1094 u16 source_id;
1095 u16 resv;
1096 u8 flags;
1097 u8 enabled;
1098 u32 prealloc_erecords; /* The number of error records to
1099 * pre-allocate for this error source.
1100 */
1101 u32 max_section_per_record;
1102} __packed acpi_hest_esd_t;
1103
1104/* Hardware Error Notification */
1105typedef struct acpi_hest_hen {
1106 u8 type;
1107 u8 length;
1108 u16 conf_we; /* Configuration Write Enable */
1109 u32 poll_interval;
1110 u32 vector;
1111 u32 sw2poll_threshold_val;
1112 u32 sw2poll_threshold_win;
1113 u32 error_threshold_val;
1114 u32 error_threshold_win;
1115} __packed acpi_hest_hen_t;
1116
1117/* BERT (Boot Error Record Table) */
1118typedef struct acpi_bert {
1119 acpi_header_t header;
1120 u32 region_length;
1121 u64 error_region;
1122} __packed acpi_bert_t;
1123
1124/* Generic Error Data Entry */
1125typedef struct acpi_hest_generic_data {
1126 guid_t section_type;
1127 u32 error_severity;
1128 u16 revision;
1129 u8 validation_bits;
1130 u8 flags;
1131 u32 data_length;
1132 guid_t fru_id;
1133 u8 fru_text[20];
1134 /* error data */
1135} __packed acpi_hest_generic_data_t;
1136
1137/* Generic Error Data Entry v300 */
1138typedef struct acpi_hest_generic_data_v300 {
1139 guid_t section_type;
1140 u32 error_severity;
1141 u16 revision;
1142 u8 validation_bits;
1143 u8 flags; /* see CPER Section Descriptor, Flags field */
1144 u32 data_length;
1145 guid_t fru_id;
1146 u8 fru_text[20];
1147 cper_timestamp_t timestamp;
1148 /* error data */
1149} __packed acpi_hest_generic_data_v300_t;
1150#define HEST_GENERIC_ENTRY_V300 0x300
1151
1152/* Both Generic Error Status & Generic Error Data Entry, Error Severity field */
1153#define ACPI_GENERROR_SEV_RECOVERABLE 0
1154#define ACPI_GENERROR_SEV_FATAL 1
1155#define ACPI_GENERROR_SEV_CORRECTED 2
1156#define ACPI_GENERROR_SEV_NONE 3
1157
1158/* Generic Error Data Entry, Validation Bits field */
1159#define ACPI_GENERROR_VALID_FRUID BIT(0)
1160#define ACPI_GENERROR_VALID_FRUID_TEXT BIT(1)
1161#define ACPI_GENERROR_VALID_TIMESTAMP BIT(2)
1162
Felix Held403fa862021-07-26 22:43:00 +02001163/*
1164 * Generic Error Status Block
1165 *
1166 * If there is a raw data section at the end of the generic error status block after the
1167 * zero or more generic error data entries, raw_data_length indicates the length of the raw
1168 * section and raw_data_offset is the offset of the beginning of the raw data section from
1169 * the start of the acpi_generic_error_status block it is contained in. So if raw_data_length
1170 * is non-zero, raw_data_offset must be at least sizeof(acpi_generic_error_status_t).
1171 */
Furquan Shaikhe0844632020-05-02 10:23:37 -07001172typedef struct acpi_generic_error_status {
1173 u32 block_status;
1174 u32 raw_data_offset; /* must follow any generic entries */
1175 u32 raw_data_length;
1176 u32 data_length; /* generic data */
1177 u32 error_severity;
1178 /* Generic Error Data structures, zero or more entries */
1179} __packed acpi_generic_error_status_t;
1180
1181/* Generic Status Block, Block Status values */
1182#define GENERIC_ERR_STS_UNCORRECTABLE_VALID BIT(0)
1183#define GENERIC_ERR_STS_CORRECTABLE_VALID BIT(1)
1184#define GENERIC_ERR_STS_MULT_UNCORRECTABLE BIT(2)
1185#define GENERIC_ERR_STS_MULT_CORRECTABLE BIT(3)
1186#define GENERIC_ERR_STS_ENTRY_COUNT_SHIFT 4
1187#define GENERIC_ERR_STS_ENTRY_COUNT_MAX 0x3ff
1188#define GENERIC_ERR_STS_ENTRY_COUNT_MASK \
1189 (GENERIC_ERR_STS_ENTRY_COUNT_MAX \
1190 << GENERIC_ERR_STS_ENTRY_COUNT_SHIFT)
1191
1192typedef struct acpi_cstate {
1193 u8 ctype;
1194 u16 latency;
1195 u32 power;
1196 acpi_addr_t resource;
1197} __packed acpi_cstate_t;
1198
Jason Gleneskca36aed2020-09-15 21:01:57 -07001199struct acpi_sw_pstate {
1200 u32 core_freq;
1201 u32 power;
1202 u32 transition_latency;
1203 u32 bus_master_latency;
1204 u32 control_value;
1205 u32 status_value;
1206} __packed;
1207
1208struct acpi_xpss_sw_pstate {
1209 u64 core_freq;
1210 u64 power;
1211 u64 transition_latency;
1212 u64 bus_master_latency;
1213 u64 control_value;
1214 u64 status_value;
1215 u64 control_mask;
1216 u64 status_mask;
1217} __packed;
1218
Furquan Shaikhe0844632020-05-02 10:23:37 -07001219typedef struct acpi_tstate {
1220 u32 percent;
1221 u32 power;
1222 u32 latency;
1223 u32 control;
1224 u32 status;
1225} __packed acpi_tstate_t;
1226
Raul E Rangelc7048322021-04-19 15:58:25 -06001227enum acpi_lpi_state_flags {
1228 ACPI_LPI_STATE_DISABLED = 0,
1229 ACPI_LPI_STATE_ENABLED
1230};
1231
1232/* Low Power Idle State */
1233struct acpi_lpi_state {
1234 u32 min_residency_us;
1235 u32 worst_case_wakeup_latency_us;
1236 u32 flags;
1237 u32 arch_context_lost_flags;
1238 u32 residency_counter_frequency_hz;
1239 u32 enabled_parent_state;
1240 acpi_addr_t entry_method;
1241 acpi_addr_t residency_counter_register;
1242 acpi_addr_t usage_counter_register;
1243 const char *state_name;
1244};
1245
Furquan Shaikhe0844632020-05-02 10:23:37 -07001246/* Port types for ACPI _UPC object */
1247enum acpi_upc_type {
1248 UPC_TYPE_A,
1249 UPC_TYPE_MINI_AB,
1250 UPC_TYPE_EXPRESSCARD,
1251 UPC_TYPE_USB3_A,
1252 UPC_TYPE_USB3_B,
1253 UPC_TYPE_USB3_MICRO_B,
1254 UPC_TYPE_USB3_MICRO_AB,
1255 UPC_TYPE_USB3_POWER_B,
1256 UPC_TYPE_C_USB2_ONLY,
1257 UPC_TYPE_C_USB2_SS_SWITCH,
1258 UPC_TYPE_C_USB2_SS,
1259 UPC_TYPE_PROPRIETARY = 0xff,
1260 /*
1261 * The following types are not directly defined in the ACPI
1262 * spec but are used by coreboot to identify a USB device type.
1263 */
1264 UPC_TYPE_INTERNAL = 0xff,
1265 UPC_TYPE_UNUSED,
1266 UPC_TYPE_HUB
1267};
1268
1269enum acpi_ipmi_interface_type {
1270 IPMI_INTERFACE_RESERVED = 0,
1271 IPMI_INTERFACE_KCS,
1272 IPMI_INTERFACE_SMIC,
1273 IPMI_INTERFACE_BT,
1274 IPMI_INTERFACE_SSIF,
1275};
1276
1277#define ACPI_IPMI_PCI_DEVICE_FLAG (1 << 0)
1278#define ACPI_IPMI_INT_TYPE_SCI (1 << 0)
1279#define ACPI_IPMI_INT_TYPE_APIC (1 << 1)
1280
1281/* ACPI IPMI 2.0 */
1282struct acpi_spmi {
1283 acpi_header_t header;
1284 u8 interface_type;
1285 u8 reserved;
1286 u16 specification_revision;
1287 u8 interrupt_type;
1288 u8 gpe;
1289 u8 reserved2;
1290 u8 pci_device_flag;
1291
1292 u32 global_system_interrupt;
1293 acpi_addr_t base_address;
1294 union {
1295 struct {
1296 u8 pci_segment_group;
1297 u8 pci_bus;
1298 u8 pci_device;
1299 u8 pci_function;
1300 };
1301 u8 uid[4];
1302 };
1303 u8 reserved3;
1304} __packed;
1305
Rocky Phaguraeff07132021-01-10 15:42:50 -08001306/* EINJ APEI Standard Definitions */
1307/* EINJ Error Types
1308 Refer to the ACPI spec, EINJ section, for more info on bit definitions
1309*/
1310#define ACPI_EINJ_CPU_CE (1 << 0)
1311#define ACPI_EINJ_CPU_UCE (1 << 1)
1312#define ACPI_EINJ_CPU_UCE_FATAL (1 << 2)
1313#define ACPI_EINJ_MEM_CE (1 << 3)
1314#define ACPI_EINJ_MEM_UCE (1 << 4)
1315#define ACPI_EINJ_MEM_UCE_FATAL (1 << 5)
1316#define ACPI_EINJ_PCIE_CE (1 << 6)
1317#define ACPI_EINJ_PCIE_UCE_NON_FATAL (1 << 7)
1318#define ACPI_EINJ_PCIE_UCE_FATAL (1 << 8)
1319#define ACPI_EINJ_PLATFORM_CE (1 << 9)
1320#define ACPI_EINJ_PLATFORM_UCE (1 << 10)
1321#define ACPI_EINJ_PLATFORM_UCE_FATAL (1 << 11)
1322#define ACPI_EINJ_VENDOR_DEFINED (1 << 31)
1323#define ACPI_EINJ_DEFAULT_CAP (ACPI_EINJ_MEM_CE | ACPI_EINJ_MEM_UCE | \
1324 ACPI_EINJ_PCIE_CE | ACPI_EINJ_PCIE_UCE_FATAL)
1325
1326/* EINJ actions */
1327#define ACTION_COUNT 9
1328#define BEGIN_INJECT_OP 0x00
1329#define GET_TRIGGER_ACTION_TABLE 0x01
1330#define SET_ERROR_TYPE 0x02
1331#define GET_ERROR_TYPE 0x03
1332#define END_INJECT_OP 0x04
1333#define EXECUTE_INJECT_OP 0x05
1334#define CHECK_BUSY_STATUS 0x06
1335#define GET_CMD_STATUS 0x07
1336#define SET_ERROR_TYPE_WITH_ADDRESS 0x08
1337#define TRIGGER_ERROR 0xFF
1338
1339/* EINJ Instructions */
1340#define READ_REGISTER 0x00
1341#define READ_REGISTER_VALUE 0x01
1342#define WRITE_REGISTER 0x02
1343#define WRITE_REGISTER_VALUE 0x03
1344#define NO_OP 0x04
1345
1346/* EINJ (Error Injection Table) */
1347typedef struct acpi_gen_regaddr1 {
1348 u8 space_id; /* Address space ID */
1349 u8 bit_width; /* Register size in bits */
1350 u8 bit_offset; /* Register bit offset */
1351 u8 access_size; /* Access size since ACPI 2.0c */
1352 u64 addr; /* Register address */
1353} __packed acpi_addr64_t;
1354
1355/* Instruction entry */
1356typedef struct acpi_einj_action_table {
1357 u8 action;
1358 u8 instruction;
1359 u16 flags;
1360 acpi_addr64_t reg;
1361 u64 value;
1362 u64 mask;
1363} __packed acpi_einj_action_table_t;
1364
1365typedef struct acpi_injection_header {
1366 u32 einj_header_size;
1367 u32 flags;
1368 u32 entry_count;
1369} __packed acpi_injection_header_t;
1370
1371typedef struct acpi_einj_trigger_table {
1372 u32 header_size;
1373 u32 revision;
1374 u32 table_size;
1375 u32 entry_count;
Elyes Haouasa4aa169a2023-07-30 12:59:50 +02001376 acpi_einj_action_table_t trigger_action[];
Rocky Phaguraeff07132021-01-10 15:42:50 -08001377} __packed acpi_einj_trigger_table_t;
1378
1379typedef struct set_error_type {
1380 u32 errtype;
1381 u32 vendorerrortype;
1382 u32 flags;
1383 u32 apicid;
1384 u64 memaddr;
1385 u64 memrange;
1386 u32 pciesbdf;
1387} __packed set_error_type_t;
1388
1389#define EINJ_PARAM_NUM 6
1390typedef struct acpi_einj_smi {
1391 u64 op_state;
1392 u64 err_inject[EINJ_PARAM_NUM];
1393 u64 trigger_action_table;
1394 u64 err_inj_cap;
1395 u64 op_status;
1396 u64 cmd_sts;
1397 u64 einj_addr;
1398 u64 einj_addr_msk;
1399 set_error_type_t setaddrtable;
1400 u64 reserved[50];
1401} __packed acpi_einj_smi_t;
1402
1403/* EINJ Flags */
1404#define EINJ_DEF_TRIGGER_PORT 0xb2
1405#define FLAG_PRESERVE 0x01
1406#define FLAG_IGNORE 0x00
1407
1408/* EINJ Registers */
1409#define EINJ_REG_MEMORY(address) \
1410 { \
1411 .space_id = ACPI_ADDRESS_SPACE_MEMORY, \
1412 .bit_width = 64, \
1413 .bit_offset = 0, \
1414 .access_size = ACPI_ACCESS_SIZE_QWORD_ACCESS, \
1415 .addr = address}
1416
1417#define EINJ_REG_IO() \
1418 { \
1419 .space_id = ACPI_ADDRESS_SPACE_IO, \
1420 .bit_width = 0x10, \
1421 .bit_offset = 0, \
1422 .access_size = ACPI_ACCESS_SIZE_WORD_ACCESS, \
1423 .addr = EINJ_DEF_TRIGGER_PORT} /* HW dependent code can override this also */
1424
1425typedef struct acpi_einj {
1426 acpi_header_t header;
1427 acpi_injection_header_t inj_header;
1428 acpi_einj_action_table_t action_table[ACTION_COUNT];
1429} __packed acpi_einj_t;
1430
David Milosevicd9822742023-09-22 14:34:28 +02001431/* PPTT definitions */
1432
1433#define PPTT_NODE_TYPE_CPU 0
1434#define PPTT_NODE_TYPE_CACHE 1
1435
1436/* PPTT structures for ACPI generation */
1437
1438typedef struct acpi_pptt_cpu_node {
1439 u8 type; // type = 0 (processor structure specification)
1440 u8 length; // in bytes
1441 u8 reserved[2]; // reserved, must be zero
1442 u32 flags; // processor hierarchy node structure flags
1443 u32 parent; // reference (delta of pptt-start and node) to parent node, must be zero if no parent
1444 u32 processor_id; // must match id in MADT, if actual processor
1445 u32 n_resources; // number of resource structure references
1446 u32 resources[]; // resource structure references
1447} acpi_pptt_cpu_node_t;
1448
1449typedef struct acpi_pptt_cache_node {
1450 u8 type; // type = 1 (cache type structure)
1451 u8 length; // length = 28
1452 u8 reserved[2]; // reserved, must be zero
1453 u32 flags; // cache structure flags
1454 u32 next_level; // reference to next level cache, null if last cache level
1455 u32 size; // cache size in bytes
1456 u32 n_sets; // number of sets in the cache
1457 u8 associativity; // integer number of ways
1458 u8 attributes; // bits[7:5] reserved, must be zero
1459 u16 line_size; // in bytes
1460 u32 cache_id; // unique, non-zero
1461} acpi_pptt_cache_node_t;
1462
1463union acpi_pptt_body {
1464 acpi_pptt_cpu_node_t cpu;
1465 acpi_pptt_cache_node_t cache;
1466};
1467
1468typedef struct acpi_pptt {
1469 acpi_header_t header;
1470
1471 /*
1472 * followed by a variable length body
1473 * consisting of processor topology structures.
1474 *
1475 * see acpi_pptt_cpu_node and
1476 * acpi_pptt_cache_node.
1477 */
1478 union acpi_pptt_body body[];
1479} __packed acpi_pptt_t;
1480
1481/* PPTT structures for topology description */
1482
1483union pptt_cache_flags {
1484 struct {
1485 u32 size_valid : 1;
1486 u32 n_sets_valid : 1;
1487 u32 associativity_valid : 1;
1488 u32 alloc_type_valid : 1;
1489 u32 cache_type_valid : 1;
1490 u32 write_policy_valid : 1;
1491 u32 line_size_valid : 1;
1492 u32 cache_id_valid : 1;
1493 u32 reserved : 24;
1494 };
1495
1496 u32 raw;
1497};
1498
1499union pptt_cpu_flags {
1500 struct {
1501 u32 is_physical_package : 1;
1502 u32 processor_id_valid : 1;
1503 u32 is_thread : 1;
1504 u32 is_leaf : 1;
1505 u32 is_identical_impl : 1;
1506 u32 reserved : 27;
1507 };
1508
1509 u32 raw;
1510};
1511
1512struct pptt_cache {
1513 u32 size;
1514 u32 numsets;
1515 u8 associativity;
1516 u8 attributes;
1517 u16 line_size;
1518 union pptt_cache_flags flags;
1519 struct pptt_cache *next_level;
1520};
1521
1522struct pptt_cpu_resources {
1523 struct pptt_cache *cache;
1524 struct pptt_cpu_resources *next;
1525};
1526
1527struct pptt_topology {
1528 u32 processor_id;
1529 union pptt_cpu_flags flags;
1530 struct pptt_cpu_resources *resources;
1531 struct pptt_topology *sibling;
1532 struct pptt_topology *child;
1533};
1534
Arthur Heymanse7aaf042023-06-07 12:12:45 +02001535/* SPCR (Serial Port Console Redirection Table) */
1536typedef struct acpi_spcr {
1537 acpi_header_t header;
1538 uint8_t interface_type;
1539 uint8_t reserved[3];
1540 acpi_addr_t base_address;
1541 uint8_t interrupt_type;
1542 uint8_t irq;
1543 uint32_t global_system_interrupt;
1544 uint8_t configured_baudrate;
1545 uint8_t parity;
1546 uint8_t stop_bits;
1547 uint8_t flow_control;
1548 uint8_t terminal_type;
1549 uint8_t language;
1550 uint16_t pci_did;
1551 uint16_t pci_vid;
1552 uint8_t pci_bus;
1553 uint8_t pci_dev;
1554 uint8_t pci_fun;
1555 uint32_t pci_flags;
1556 uint8_t pci_segment;
1557 uint32_t uart_clock;
1558 uint32_t precise_baud_rate;
1559 uint16_t namespace_string_length;
1560 uint16_t namespace_string_offset;
1561 char namespacestring[];
1562} __packed acpi_spcr_t;
1563_Static_assert(sizeof(acpi_spcr_t) == 88, "acpi_spcr_t must have an 88 byte size\n");
1564
Arthur Heymans90464072023-06-07 12:53:50 +02001565#define PC_AT_COMPATIBLE_INTERRUPT (1 << 0)
1566#define IO_APIC_COMPATIBLE_INTERRUPT (1 << 1)
1567#define IO_SAPIC_COMPATIBLE_INTERRUPT (1 << 2)
1568#define ARMH_GIC_COMPATIBLE_INTERRUPT (1 << 3)
1569#define RISCV_PLIC_COMPATIBLE_INTERRUPT (1 << 4)
1570
Arthur Heymans8193eab2023-06-20 10:17:23 +02001571/* GTDT - Generic Timer Description Table (ACPI 5.1) Version 2 */
1572typedef struct acpi_table_gtdt {
1573 acpi_header_t header; /* Common ACPI table header */
Naresh Solanki75f0b602023-09-25 13:59:25 +02001574 u64 counter_block_address;
Arthur Heymans8193eab2023-06-20 10:17:23 +02001575 u32 reserved;
1576 u32 secure_el1_interrupt;
1577 u32 secure_el1_flags;
1578 u32 non_secure_el1_interrupt;
1579 u32 non_secure_el1_flags;
1580 u32 virtual_timer_interrupt;
1581 u32 virtual_timer_flags;
1582 u32 non_secure_el2_interrupt;
1583 u32 non_secure_el2_flags;
1584 u64 counter_read_block_address;
1585 u32 platform_timer_count;
1586 u32 platform_timer_offset;
1587} __packed acpi_gtdt_t;
1588
1589/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
1590
1591#define ACPI_GTDT_INTERRUPT_MODE (1)
1592#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
1593#define ACPI_GTDT_ALWAYS_ON (1<<2)
1594
1595struct acpi_gtdt_el2 {
1596 u32 virtual_el2_timer_gsiv;
1597 u32 virtual_el2_timer_flags;
1598};
1599
1600/* Common GTDT subtable header */
1601
1602struct acpi_gtdt_header {
1603 u8 type;
1604 u16 length;
1605} __packed;
1606
1607/* Values for GTDT subtable type above */
1608
1609enum acpi_gtdt_type {
1610 ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
1611 ACPI_GTDT_TYPE_WATCHDOG = 1,
1612 ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
1613};
1614
1615/* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
1616
1617/* 0: Generic Timer Block */
1618
1619struct acpi_gtdt_timer_block {
1620 struct acpi_gtdt_header header;
1621 u8 reserved;
1622 u64 block_address;
1623 u32 timer_count;
1624 u32 timer_offset;
1625} __packed;
1626
1627/* Timer Sub-Structure, one per timer */
1628
1629struct acpi_gtdt_timer_entry {
1630 u8 frame_number;
1631 u8 reserved[3];
1632 u64 base_address;
1633 u64 el0_base_address;
1634 u32 timer_interrupt;
1635 u32 timer_flags;
1636 u32 virtual_timer_interrupt;
1637 u32 virtual_timer_flags;
1638 u32 common_flags;
1639} __packed;
1640
1641/* Flag Definitions: timer_flags and virtual_timer_flags above */
1642
1643#define ACPI_GTDT_GT_IRQ_MODE (1)
1644#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
1645
1646/* Flag Definitions: common_flags above */
1647
1648#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
1649#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
1650
1651/* 1: SBSA Generic Watchdog Structure */
1652
1653struct acpi_gtdt_watchdog {
1654 struct acpi_gtdt_header header;
1655 u8 reserved;
1656 u64 refresh_frame_address;
1657 u64 control_frame_address;
1658 u32 timer_interrupt;
1659 u32 timer_flags;
1660} __packed;
1661
1662/* Flag Definitions: timer_flags above */
1663
1664#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
1665#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
1666#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
1667
Marek Maslanka017003c2023-12-07 13:21:35 +00001668enum acpi_wdat_actions {
1669 ACPI_WDAT_RESET = 1,
1670 ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1671 ACPI_WDAT_GET_COUNTDOWN = 5,
1672 ACPI_WDAT_SET_COUNTDOWN = 6,
1673 ACPI_WDAT_GET_RUNNING_STATE = 8,
1674 ACPI_WDAT_SET_RUNNING_STATE = 9,
1675 ACPI_WDAT_GET_STOPPED_STATE = 10,
1676 ACPI_WDAT_SET_STOPPED_STATE = 11,
1677 ACPI_WDAT_GET_REBOOT = 16,
1678 ACPI_WDAT_SET_REBOOT = 17,
1679 ACPI_WDAT_GET_SHUTDOWN = 18,
1680 ACPI_WDAT_SET_SHUTDOWN = 19,
1681 ACPI_WDAT_GET_STATUS = 32,
1682 ACPI_WDAT_SET_STATUS = 33,
1683 ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
1684};
1685
1686enum acpi_wdat_instructions {
1687 ACPI_WDAT_READ_VALUE = 0,
1688 ACPI_WDAT_READ_COUNTDOWN = 1,
1689 ACPI_WDAT_WRITE_VALUE = 2,
1690 ACPI_WDAT_WRITE_COUNTDOWN = 3,
1691 ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
1692 ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
1693};
1694
1695enum acpi_wdat_flags {
1696 ACPI_WDAT_FLAG_DISABLED = 0,
1697 ACPI_WDAT_FLAG_ENABLED = 1
1698};
1699
1700enum acpi_wdat_access_size {
1701 ACPI_WDAT_ACCESS_SIZE_BYTE = 1,
1702 ACPI_WDAT_ACCESS_SIZE_WORD = 2,
1703 ACPI_WDAT_ACCESS_SIZE_DWORD = 3
1704};
1705
1706/* ACPI WDAT */
1707typedef struct acpi_wdat_entry {
1708 u8 action;
1709 u8 instruction;
1710 u16 reserved;
1711 struct acpi_gen_regaddr register_region;
1712 u32 value;
1713 u32 mask;
1714} __packed acpi_wdat_entry_t;
1715
1716typedef struct acpi_table_wdat {
1717 acpi_header_t header; /* Common ACPI table header */
1718 u32 header_length;
1719 u16 pci_segment;
1720 u8 pci_bus;
1721 u8 pci_device;
1722 u8 pci_function;
1723 u8 reserved[3];
1724 u32 timer_period;
1725 u32 max_count;
1726 u32 min_count;
1727 u8 flags;
1728 u8 reserved2[3];
1729 u32 entries;
1730} __packed acpi_wdat_t;
1731
Arthur Heymans2e7e2d92022-03-03 22:28:27 +01001732uintptr_t get_coreboot_rsdp(void);
Rocky Phaguraeff07132021-01-10 15:42:50 -08001733void acpi_create_einj(acpi_einj_t *einj, uintptr_t addr, u8 actions);
1734
Furquan Shaikhe0844632020-05-02 10:23:37 -07001735unsigned long fw_cfg_acpi_tables(unsigned long start);
1736
1737/* These are implemented by the target port or north/southbridge. */
Raul E Rangel6b446b92021-11-19 11:38:35 -07001738void preload_acpi_dsdt(void);
Arthur Heymans7ebebf72023-06-17 14:08:46 +02001739unsigned long write_acpi_tables(const unsigned long addr);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001740unsigned long acpi_fill_madt(unsigned long current);
Arthur Heymanscd46e5f2023-06-22 21:34:16 +02001741unsigned long acpi_arch_fill_madt(acpi_madt_t *madt, unsigned long current);
Kyösti Mälkkif9aac922020-05-30 16:16:28 +03001742
Furquan Shaikhe0844632020-05-02 10:23:37 -07001743void acpi_fill_fadt(acpi_fadt_t *fadt);
Angel Pons79572e42020-07-13 00:17:43 +02001744void arch_fill_fadt(acpi_fadt_t *fadt);
Kyösti Mälkkif9aac922020-05-30 16:16:28 +03001745void soc_fill_fadt(acpi_fadt_t *fadt);
Kyösti Mälkki02fd15d2020-06-02 03:34:43 +03001746void mainboard_fill_fadt(acpi_fadt_t *fadt);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001747
Kyösti Mälkki88decca2023-04-28 07:04:34 +03001748void fill_fadt_extended_pm_io(acpi_fadt_t *fadt);
1749
Kyösti Mälkki2ab4a962020-06-30 11:41:47 +03001750void acpi_fill_gnvs(void);
Kyösti Mälkki3dc17922021-03-16 19:01:48 +02001751void acpi_fill_cnvs(void);
Kyösti Mälkki2ab4a962020-06-30 11:41:47 +03001752
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +01001753unsigned long acpi_fill_lpit(unsigned long current);
1754
Furquan Shaikhe0844632020-05-02 10:23:37 -07001755/* These can be used by the target port. */
1756u8 acpi_checksum(u8 *table, u32 length);
1757
1758void acpi_add_table(acpi_rsdp_t *rsdp, void *table);
1759
Jonathan Zhang3dcafa82022-05-11 13:11:20 -07001760/* Create CXL Early Discovery Table */
1761void acpi_create_cedt(acpi_cedt_t *cedt,
1762 unsigned long (*acpi_fill_cedt)(unsigned long current));
1763/* Create a CXL Host Bridge Structure for CEDT */
1764int acpi_create_cedt_chbs(acpi_cedt_chbs_t *chbs, u32 uid, u32 cxl_ver, u64 base);
1765/* Create a CXL Fixed Memory Window Structure for CEDT */
1766int acpi_create_cedt_cfmws(acpi_cedt_cfmws_t *cfmws, u64 base_hpa, u64 window_size,
1767 u8 eniw, u32 hbig, u16 restriction, u16 qtg_id, const u32 *interleave_target);
1768
David Milosevicd9822742023-09-22 14:34:28 +02001769/* PPTT related functions */
1770void acpi_create_pptt_body(acpi_pptt_t *pptt);
1771struct pptt_topology *acpi_get_pptt_topology(void);
Arthur Heymans92a3b672023-06-22 21:30:58 +02001772
Kyösti Mälkkic7da0272021-06-08 11:37:08 +03001773int acpi_create_madt_ioapic_from_hw(acpi_madt_ioapic_t *ioapic, u32 addr);
Kyösti Mälkki9ac1fb72023-04-07 22:39:53 +03001774
Kyösti Mälkki2e9f0d32023-04-07 23:05:46 +03001775unsigned long acpi_create_madt_one_lapic(unsigned long current, u32 cpu, u32 apic);
Kyösti Mälkki9ac1fb72023-04-07 22:39:53 +03001776
1777unsigned long acpi_create_madt_lapic_nmis(unsigned long current);
1778
Arthur Heymans3df6cc92023-06-27 16:44:59 +02001779uintptr_t platform_get_gicd_base(void);
1780uintptr_t platform_get_gicr_base(void);
Naresh Solanki1fe19042023-09-25 14:24:34 +02001781int platform_get_gic_its(uintptr_t **base);
Arthur Heymans3df6cc92023-06-27 16:44:59 +02001782
Furquan Shaikhe0844632020-05-02 10:23:37 -07001783int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic);
Naresh Solanki76835cc2023-01-20 19:13:02 +01001784int acpi_create_srat_x2apic(acpi_srat_x2apic_t *x2apic, u32 node, u32 apic);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001785int acpi_create_srat_mem(acpi_srat_mem_t *mem, u8 node, u32 basek, u32 sizek,
1786 u32 flags);
Jonathan Zhang3164b642021-04-21 17:51:31 -07001787/*
1788 * Given the Generic Initiator device's BDF, the proximity domain's ID
1789 * and flag, create Generic Initiator Affinity structure in SRAT.
1790 */
1791int acpi_create_srat_gia_pci(acpi_srat_gia_t *gia, u32 proximity_domain,
Patrick Rudolph344ebf12024-01-31 11:38:38 +01001792 struct device *dev, u32 flags);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001793unsigned long acpi_create_srat_lapics(unsigned long current);
1794void acpi_create_srat(acpi_srat_t *srat,
1795 unsigned long (*acpi_fill_srat)(unsigned long current));
1796
1797void acpi_create_slit(acpi_slit_t *slit,
1798 unsigned long (*acpi_fill_slit)(unsigned long current));
1799
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -07001800/*
1801 * Create a Memory Proximity Domain Attributes structure for HMAT,
Martin Roth3e25f852023-09-04 15:37:07 -06001802 * given proximity domain for the attached initiator, and
1803 * proximity domain for the memory.
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -07001804 */
1805int acpi_create_hmat_mpda(acpi_hmat_mpda_t *mpda, u32 initiator, u32 memory);
Martin Roth0949e732021-10-01 14:28:22 -06001806/* Create Heterogeneous Memory Attribute Table */
Jonathan Zhang2a4e1f42021-04-01 11:43:37 -07001807void acpi_create_hmat(acpi_hmat_t *hmat,
1808 unsigned long (*acpi_fill_hmat)(unsigned long current));
1809
Furquan Shaikhe0844632020-05-02 10:23:37 -07001810void acpi_create_vfct(const struct device *device,
1811 acpi_vfct_t *vfct,
1812 unsigned long (*acpi_fill_vfct)(const struct device *device,
1813 acpi_vfct_t *vfct_struct,
1814 unsigned long current));
1815
1816void acpi_create_ipmi(const struct device *device,
1817 struct acpi_spmi *spmi,
1818 const u16 ipmi_revision,
1819 const acpi_addr_t *addr,
1820 const enum acpi_ipmi_interface_type type,
1821 const s8 gpe_interrupt,
1822 const u32 apic_interrupt,
1823 const u32 uid);
1824
1825void acpi_create_ivrs(acpi_ivrs_t *ivrs,
1826 unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t *ivrs_struct,
1827 unsigned long current));
1828
Jason Glenesk61624b22020-11-02 20:06:23 -08001829void acpi_create_crat(struct acpi_crat_header *crat,
1830 unsigned long (*acpi_fill_crat)(struct acpi_crat_header *crat_struct,
1831 unsigned long current));
1832
Furquan Shaikhe0844632020-05-02 10:23:37 -07001833unsigned long acpi_write_hpet(const struct device *device, unsigned long start,
1834 acpi_rsdp_t *rsdp);
1835
1836/* cpu/intel/speedstep/acpi.c */
1837void generate_cpu_entries(const struct device *device);
1838
Furquan Shaikhe0844632020-05-02 10:23:37 -07001839unsigned long acpi_write_dbg2_pci_uart(acpi_rsdp_t *rsdp, unsigned long current,
Arthur Heymans736d4d22023-06-30 15:37:38 +02001840 const struct device *dev, uint8_t access_size);
1841unsigned long acpi_pl011_write_dbg2_uart(acpi_rsdp_t *rsdp, unsigned long current,
1842 uint64_t base, const char *name);
Zheng Bao3ea3fbe2023-11-20 14:17:25 +08001843unsigned long acpi_16550_mmio32_write_dbg2_uart(acpi_rsdp_t *rsdp, unsigned long current,
1844 uint64_t base, const char *name);
Arthur Heymans736d4d22023-06-30 15:37:38 +02001845
Furquan Shaikhe0844632020-05-02 10:23:37 -07001846void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags,
1847 unsigned long (*acpi_fill_dmar)(unsigned long));
1848unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
1849 u16 segment, u64 bar);
1850unsigned long acpi_create_dmar_rmrr(unsigned long current, u16 segment,
1851 u64 bar, u64 limit);
1852unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
1853 u16 segment);
1854unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr,
1855 u32 proximity_domain);
1856unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number,
1857 const char *device_name);
John Zhao6edbb182021-03-24 11:55:09 -07001858unsigned long acpi_create_dmar_satc(unsigned long current, u8 flags,
John Zhao091532d2021-04-17 16:03:21 -07001859 u16 segment);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001860void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current);
1861void acpi_dmar_rmrr_fixup(unsigned long base, unsigned long current);
1862void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current);
John Zhao6edbb182021-03-24 11:55:09 -07001863void acpi_dmar_satc_fixup(unsigned long base, unsigned long current);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001864unsigned long acpi_create_dmar_ds_pci_br(unsigned long current,
1865 u8 bus, u8 dev, u8 fn);
1866unsigned long acpi_create_dmar_ds_pci(unsigned long current,
1867 u8 bus, u8 dev, u8 fn);
1868unsigned long acpi_create_dmar_ds_ioapic(unsigned long current,
1869 u8 enumeration_id,
1870 u8 bus, u8 dev, u8 fn);
Arthur Heymansbc8f8592022-12-02 13:17:39 +01001871unsigned long acpi_create_dmar_ds_ioapic_from_hw(unsigned long current,
1872 u32 addr, u8 bus, u8 dev, u8 fn);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001873unsigned long acpi_create_dmar_ds_msi_hpet(unsigned long current,
1874 u8 enumeration_id,
1875 u8 bus, u8 dev, u8 fn);
1876void acpi_write_hest(acpi_hest_t *hest,
1877 unsigned long (*acpi_fill_hest)(acpi_hest_t *hest));
1878
1879unsigned long acpi_create_hest_error_source(acpi_hest_t *hest,
1880 acpi_hest_esd_t *esd, u16 type, void *data, u16 len);
1881
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +01001882unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t uid);
1883
Felix Heldf7dbf4a2021-06-07 16:56:04 +02001884/* chipsets that select ACPI_BERT must implement this function */
Felix Held29405482021-05-28 16:01:57 +02001885enum cb_err acpi_soc_get_bert_region(void **region, size_t *length);
Francois Toguo522e0db2021-01-21 09:55:19 -08001886
Arthur Heymans2e3cb632023-06-30 15:01:08 +02001887void acpi_soc_fill_gtdt(acpi_gtdt_t *gtdt);
1888unsigned long acpi_soc_gtdt_add_timers(uint32_t *count, unsigned long current);
1889unsigned long acpi_gtdt_add_timer_block(unsigned long current, const uint64_t address,
1890 struct acpi_gtdt_timer_entry *timers, size_t number);
1891unsigned long acpi_gtdt_add_watchdog(unsigned long current, uint64_t refresh_frame,
1892 uint64_t control_frame, uint32_t gsiv, uint32_t flags);
1893
Marek Maslanka017003c2023-12-07 13:21:35 +00001894/*
1895 * Populate primary acpi_wdat_t struct to provide basic information about watchdog and
1896 * associated acpi_wdat_entry_t structures, which correspond to watchdog-related
1897 * actions such as start/stop watchdog, set timeout, ping watchdog, get remaining time,
1898 * etc. Each acpi_wdat_entry_t entry indicates what needs to be written to a specific
1899 * address to perform a specific action or at which address the watchdog-related
1900 * information is stored.
1901 *
1902 * The acpi_wdat_entry_t structures follow the acpi_wdat_t, so the table layout is as
1903 * follows:
1904 * +---------------------+
1905 * | acpi_wdat_t { |
1906 * | ... |
1907 * | } |
1908 * | acpi_wdat_entry_t { |
1909 * | ... |
1910 * | } |
1911 * | acpi_wdat_entry_t { |
1912 * | ... |
1913 * | } |
1914 * +---------------------+
1915 *
1916 * @param wdat Pointer to populate acpi_wdat_t struct
1917 * @param current Position in memory after the acpi_wdat_t struct which also indicates
1918 * the position where the first acpi_wdat_entry_t must be placed.
1919 * @return Position after last acpi_wdat_entry_t struct
1920 */
1921unsigned long acpi_soc_fill_wdat(acpi_wdat_t *wdat, unsigned long current);
1922
Furquan Shaikhe0844632020-05-02 10:23:37 -07001923/* For ACPI S3 support. */
Kyösti Mälkkia4c0e1a2020-06-18 08:28:12 +03001924void __noreturn acpi_resume(void *wake_vec);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001925void mainboard_suspend_resume(void);
1926void *acpi_find_wakeup_vector(void);
1927
1928/* ACPI_Sn assignments are defined to always equal the sleep state numbers */
1929enum {
1930 ACPI_S0 = 0,
1931 ACPI_S1 = 1,
1932 ACPI_S2 = 2,
1933 ACPI_S3 = 3,
1934 ACPI_S4 = 4,
1935 ACPI_S5 = 5,
1936};
1937
1938#if CONFIG(ACPI_INTEL_HARDWARE_SLEEP_VALUES) \
1939 || CONFIG(ACPI_AMD_HARDWARE_SLEEP_VALUES)
1940/* Given the provided PM1 control register return the ACPI sleep type. */
1941static inline int acpi_sleep_from_pm1(uint32_t pm1_cnt)
1942{
1943 switch (((pm1_cnt) & SLP_TYP) >> SLP_TYP_SHIFT) {
1944 case SLP_TYP_S0: return ACPI_S0;
1945 case SLP_TYP_S1: return ACPI_S1;
1946 case SLP_TYP_S3: return ACPI_S3;
1947 case SLP_TYP_S4: return ACPI_S4;
1948 case SLP_TYP_S5: return ACPI_S5;
1949 }
1950 return -1;
1951}
1952#endif
1953
Kyösti Mälkkie0d38682020-06-07 12:01:58 +03001954uint8_t acpi_get_preferred_pm_profile(void);
1955
Furquan Shaikhe0844632020-05-02 10:23:37 -07001956/* Returns ACPI_Sx values. */
1957int acpi_get_sleep_type(void);
1958
1959/* Read and clear GPE status */
1960int acpi_get_gpe(int gpe);
1961
Kyösti Mälkki0a9e72e2019-08-11 01:22:28 +03001962/* Once we enter payload, is SMI handler installed and capable of
1963 responding to APM_CNT Advanced Power Management Control commands. */
1964static inline int permanent_smi_handler(void)
1965{
1966 return CONFIG(HAVE_SMI_HANDLER);
1967}
1968
Furquan Shaikhe0844632020-05-02 10:23:37 -07001969static inline int acpi_s3_resume_allowed(void)
1970{
1971 return CONFIG(HAVE_ACPI_RESUME);
1972}
1973
Furquan Shaikhe0844632020-05-02 10:23:37 -07001974static inline int acpi_is_wakeup_s3(void)
1975{
Kyösti Mälkki4a3f67a2020-06-18 13:44:29 +03001976 if (!acpi_s3_resume_allowed())
1977 return 0;
Furquan Shaikhe0844632020-05-02 10:23:37 -07001978
Kyösti Mälkki4a3f67a2020-06-18 13:44:29 +03001979 if (ENV_ROMSTAGE_OR_BEFORE)
1980 return (acpi_get_sleep_type() == ACPI_S3);
1981
Kyösti Mälkkiac0dc4a2020-11-18 07:40:21 +02001982 return romstage_handoff_is_resume();
Kyösti Mälkki4a3f67a2020-06-18 13:44:29 +03001983}
Furquan Shaikhe0844632020-05-02 10:23:37 -07001984
1985static inline uintptr_t acpi_align_current(uintptr_t current)
1986{
1987 return ALIGN_UP(current, 16);
1988}
1989
1990/* ACPI table revisions should match the revision of the ACPI spec
1991 * supported. This function keeps the table versions synced. This could
1992 * be made into a weak function if there is ever a need to override the
1993 * coreboot default ACPI spec version supported. */
1994int get_acpi_table_revision(enum acpi_tables table);
Elyes Haouas8b950f42022-02-16 12:08:16 +01001995u8 get_acpi_fadt_minor_version(void);
Furquan Shaikhe0844632020-05-02 10:23:37 -07001996
Kyösti Mälkki94e04652020-06-01 13:26:22 +03001997#endif // !defined(__ASSEMBLER__) && !defined(__ACPI__)
Furquan Shaikhe0844632020-05-02 10:23:37 -07001998
Furquan Shaikh56eafbb2020-04-30 18:38:55 -07001999#endif /* __ACPI_ACPI_H__ */