]> git.ipfire.org Git - thirdparty/u-boot.git/blob - include/acpi/acpi_table.h
acpi: tpm: Add a TPM2 table
[thirdparty/u-boot.git] / include / acpi / acpi_table.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Helpers for ACPI table generation
4 *
5 * Based on acpi.c from coreboot
6 *
7 * Copyright 2019 Google LLC
8 *
9 * Copyright (C) 2015, Saket Sinha <saket.sinha89@gmail.com>
10 * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
11 */
12
13 #ifndef __ACPI_TABLE_H__
14 #define __ACPI_TABLE_H__
15
16 #include <linux/bitops.h>
17
18 #define RSDP_SIG "RSD PTR " /* RSDP pointer signature */
19 #define OEM_ID "U-BOOT" /* U-Boot */
20 #define OEM_TABLE_ID "U-BOOTBL" /* U-Boot Table */
21 #define ASLC_ID "INTL" /* Intel ASL Compiler */
22
23 /* TODO(sjg@chromium.org): Figure out how to get compiler revision */
24 #define ASL_REVISION 0
25
26 #define ACPI_RSDP_REV_ACPI_1_0 0
27 #define ACPI_RSDP_REV_ACPI_2_0 2
28
29 #if !defined(__ACPI__)
30
31 struct acpi_ctx;
32
33 /*
34 * RSDP (Root System Description Pointer)
35 * Note: ACPI 1.0 didn't have length, xsdt_address, and ext_checksum
36 */
37 struct acpi_rsdp {
38 char signature[8]; /* RSDP signature */
39 u8 checksum; /* Checksum of the first 20 bytes */
40 char oem_id[6]; /* OEM ID */
41 u8 revision; /* 0 for ACPI 1.0, others 2 */
42 u32 rsdt_address; /* Physical address of RSDT (32 bits) */
43 u32 length; /* Total RSDP length (incl. extended part) */
44 u64 xsdt_address; /* Physical address of XSDT (64 bits) */
45 u8 ext_checksum; /* Checksum of the whole table */
46 u8 reserved[3];
47 };
48
49 /* Generic ACPI header, provided by (almost) all tables */
50 struct __packed acpi_table_header {
51 char signature[4]; /* ACPI signature (4 ASCII characters) */
52 u32 length; /* Table length in bytes (incl. header) */
53 u8 revision; /* Table version (not ACPI version!) */
54 volatile u8 checksum; /* To make sum of entire table == 0 */
55 char oem_id[6]; /* OEM identification */
56 char oem_table_id[8]; /* OEM table identification */
57 u32 oem_revision; /* OEM revision number */
58 char aslc_id[4]; /* ASL compiler vendor ID */
59 u32 aslc_revision; /* ASL compiler revision number */
60 };
61
62 struct acpi_gen_regaddr {
63 u8 space_id; /* Address space ID */
64 u8 bit_width; /* Register size in bits */
65 u8 bit_offset; /* Register bit offset */
66 u8 access_size; /* Access size */
67 u32 addrl; /* Register address, low 32 bits */
68 u32 addrh; /* Register address, high 32 bits */
69 };
70
71 /* A maximum number of 32 ACPI tables ought to be enough for now */
72 #define MAX_ACPI_TABLES 32
73
74 /* RSDT (Root System Description Table) */
75 struct acpi_rsdt {
76 struct acpi_table_header header;
77 u32 entry[MAX_ACPI_TABLES];
78 };
79
80 /* XSDT (Extended System Description Table) */
81 struct acpi_xsdt {
82 struct acpi_table_header header;
83 u64 entry[MAX_ACPI_TABLES];
84 };
85
86 /* HPET timers */
87 struct __packed acpi_hpet {
88 struct acpi_table_header header;
89 u32 id;
90 struct acpi_gen_regaddr addr;
91 u8 number;
92 u16 min_tick;
93 u8 attributes;
94 };
95
96 struct __packed acpi_tpm2 {
97 struct acpi_table_header header;
98 u16 platform_class;
99 u8 reserved[2];
100 u64 control_area;
101 u32 start_method;
102 u8 msp[12];
103 u32 laml;
104 u64 lasa;
105 };
106
107 /* FADT Preferred Power Management Profile */
108 enum acpi_pm_profile {
109 ACPI_PM_UNSPECIFIED = 0,
110 ACPI_PM_DESKTOP,
111 ACPI_PM_MOBILE,
112 ACPI_PM_WORKSTATION,
113 ACPI_PM_ENTERPRISE_SERVER,
114 ACPI_PM_SOHO_SERVER,
115 ACPI_PM_APPLIANCE_PC,
116 ACPI_PM_PERFORMANCE_SERVER,
117 ACPI_PM_TABLET
118 };
119
120 /* FADT flags for p_lvl2_lat and p_lvl3_lat */
121 #define ACPI_FADT_C2_NOT_SUPPORTED 101
122 #define ACPI_FADT_C3_NOT_SUPPORTED 1001
123
124 /* FADT Boot Architecture Flags */
125 #define ACPI_FADT_LEGACY_FREE 0x00
126 #define ACPI_FADT_LEGACY_DEVICES BIT(0)
127 #define ACPI_FADT_8042 BIT(1)
128 #define ACPI_FADT_VGA_NOT_PRESENT BIT(2)
129 #define ACPI_FADT_MSI_NOT_SUPPORTED BIT(3)
130 #define ACPI_FADT_NO_PCIE_ASPM_CONTROL BIT(4)
131
132 /* FADT Feature Flags */
133 #define ACPI_FADT_WBINVD BIT(0)
134 #define ACPI_FADT_WBINVD_FLUSH BIT(1)
135 #define ACPI_FADT_C1_SUPPORTED BIT(2)
136 #define ACPI_FADT_C2_MP_SUPPORTED BIT(3)
137 #define ACPI_FADT_POWER_BUTTON BIT(4)
138 #define ACPI_FADT_SLEEP_BUTTON BIT(5)
139 #define ACPI_FADT_FIXED_RTC BIT(6)
140 #define ACPI_FADT_S4_RTC_WAKE BIT(7)
141 #define ACPI_FADT_32BIT_TIMER BIT(8)
142 #define ACPI_FADT_DOCKING_SUPPORTED BIT(9)
143 #define ACPI_FADT_RESET_REGISTER BIT(10)
144 #define ACPI_FADT_SEALED_CASE BIT(11)
145 #define ACPI_FADT_HEADLESS BIT(12)
146 #define ACPI_FADT_SLEEP_TYPE BIT(13)
147 #define ACPI_FADT_PCI_EXPRESS_WAKE BIT(14)
148 #define ACPI_FADT_PLATFORM_CLOCK BIT(15)
149 #define ACPI_FADT_S4_RTC_VALID BIT(16)
150 #define ACPI_FADT_REMOTE_POWER_ON BIT(17)
151 #define ACPI_FADT_APIC_CLUSTER BIT(18)
152 #define ACPI_FADT_APIC_PHYSICAL BIT(19)
153 #define ACPI_FADT_HW_REDUCED_ACPI BIT(20)
154 #define ACPI_FADT_LOW_PWR_IDLE_S0 BIT(21)
155
156 enum acpi_address_space_type {
157 ACPI_ADDRESS_SPACE_MEMORY = 0, /* System memory */
158 ACPI_ADDRESS_SPACE_IO, /* System I/O */
159 ACPI_ADDRESS_SPACE_PCI, /* PCI config space */
160 ACPI_ADDRESS_SPACE_EC, /* Embedded controller */
161 ACPI_ADDRESS_SPACE_SMBUS, /* SMBus */
162 ACPI_ADDRESS_SPACE_PCC = 0x0a, /* Platform Comm. Channel */
163 ACPI_ADDRESS_SPACE_FIXED = 0x7f /* Functional fixed hardware */
164 };
165
166 enum acpi_address_space_size {
167 ACPI_ACCESS_SIZE_UNDEFINED = 0,
168 ACPI_ACCESS_SIZE_BYTE_ACCESS,
169 ACPI_ACCESS_SIZE_WORD_ACCESS,
170 ACPI_ACCESS_SIZE_DWORD_ACCESS,
171 ACPI_ACCESS_SIZE_QWORD_ACCESS
172 };
173
174 /* FADT (Fixed ACPI Description Table) */
175 struct __packed acpi_fadt {
176 struct acpi_table_header header;
177 u32 firmware_ctrl;
178 u32 dsdt;
179 u8 res1;
180 u8 preferred_pm_profile;
181 u16 sci_int;
182 u32 smi_cmd;
183 u8 acpi_enable;
184 u8 acpi_disable;
185 u8 s4bios_req;
186 u8 pstate_cnt;
187 u32 pm1a_evt_blk;
188 u32 pm1b_evt_blk;
189 u32 pm1a_cnt_blk;
190 u32 pm1b_cnt_blk;
191 u32 pm2_cnt_blk;
192 u32 pm_tmr_blk;
193 u32 gpe0_blk;
194 u32 gpe1_blk;
195 u8 pm1_evt_len;
196 u8 pm1_cnt_len;
197 u8 pm2_cnt_len;
198 u8 pm_tmr_len;
199 u8 gpe0_blk_len;
200 u8 gpe1_blk_len;
201 u8 gpe1_base;
202 u8 cst_cnt;
203 u16 p_lvl2_lat;
204 u16 p_lvl3_lat;
205 u16 flush_size;
206 u16 flush_stride;
207 u8 duty_offset;
208 u8 duty_width;
209 u8 day_alrm;
210 u8 mon_alrm;
211 u8 century;
212 u16 iapc_boot_arch;
213 u8 res2;
214 u32 flags;
215 struct acpi_gen_regaddr reset_reg;
216 u8 reset_value;
217 u16 arm_boot_arch;
218 u8 minor_revision;
219 u32 x_firmware_ctl_l;
220 u32 x_firmware_ctl_h;
221 u32 x_dsdt_l;
222 u32 x_dsdt_h;
223 struct acpi_gen_regaddr x_pm1a_evt_blk;
224 struct acpi_gen_regaddr x_pm1b_evt_blk;
225 struct acpi_gen_regaddr x_pm1a_cnt_blk;
226 struct acpi_gen_regaddr x_pm1b_cnt_blk;
227 struct acpi_gen_regaddr x_pm2_cnt_blk;
228 struct acpi_gen_regaddr x_pm_tmr_blk;
229 struct acpi_gen_regaddr x_gpe0_blk;
230 struct acpi_gen_regaddr x_gpe1_blk;
231 };
232
233 /* FADT TABLE Revision values - note these do not match the ACPI revision */
234 #define ACPI_FADT_REV_ACPI_1_0 1
235 #define ACPI_FADT_REV_ACPI_2_0 3
236 #define ACPI_FADT_REV_ACPI_3_0 4
237 #define ACPI_FADT_REV_ACPI_4_0 4
238 #define ACPI_FADT_REV_ACPI_5_0 5
239 #define ACPI_FADT_REV_ACPI_6_0 6
240
241 /* MADT TABLE Revision values - note these do not match the ACPI revision */
242 #define ACPI_MADT_REV_ACPI_3_0 2
243 #define ACPI_MADT_REV_ACPI_4_0 3
244 #define ACPI_MADT_REV_ACPI_5_0 3
245 #define ACPI_MADT_REV_ACPI_6_0 5
246
247 #define ACPI_MCFG_REV_ACPI_3_0 1
248
249 /* IVRS Revision Field */
250 #define IVRS_FORMAT_FIXED 0x01 /* Type 10h & 11h only */
251 #define IVRS_FORMAT_MIXED 0x02 /* Type 10h, 11h, & 40h */
252
253 /* FACS flags */
254 #define ACPI_FACS_S4BIOS_F BIT(0)
255 #define ACPI_FACS_64BIT_WAKE_F BIT(1)
256
257 /* FACS (Firmware ACPI Control Structure) */
258 struct acpi_facs {
259 char signature[4]; /* "FACS" */
260 u32 length; /* Length in bytes (>= 64) */
261 u32 hardware_signature; /* Hardware signature */
262 u32 firmware_waking_vector; /* Firmware waking vector */
263 u32 global_lock; /* Global lock */
264 u32 flags; /* FACS flags */
265 u32 x_firmware_waking_vector_l; /* X FW waking vector, low */
266 u32 x_firmware_waking_vector_h; /* X FW waking vector, high */
267 u8 version; /* Version 2 */
268 u8 res1[3];
269 u32 ospm_flags; /* OSPM enabled flags */
270 u8 res2[24];
271 };
272
273 /* MADT flags */
274 #define ACPI_MADT_PCAT_COMPAT BIT(0)
275
276 /* MADT (Multiple APIC Description Table) */
277 struct acpi_madt {
278 struct acpi_table_header header;
279 u32 lapic_addr; /* Local APIC address */
280 u32 flags; /* Multiple APIC flags */
281 };
282
283 /* MADT: APIC Structure Type*/
284 enum acpi_apic_types {
285 ACPI_APIC_LAPIC = 0, /* Processor local APIC */
286 ACPI_APIC_IOAPIC, /* I/O APIC */
287 ACPI_APIC_IRQ_SRC_OVERRIDE, /* Interrupt source override */
288 ACPI_APIC_NMI_SRC, /* NMI source */
289 ACPI_APIC_LAPIC_NMI, /* Local APIC NMI */
290 ACPI_APIC_LAPIC_ADDR_OVERRIDE, /* Local APIC address override */
291 ACPI_APIC_IOSAPIC, /* I/O SAPIC */
292 ACPI_APIC_LSAPIC, /* Local SAPIC */
293 ACPI_APIC_PLATFORM_IRQ_SRC, /* Platform interrupt sources */
294 ACPI_APIC_LX2APIC, /* Processor local x2APIC */
295 ACPI_APIC_LX2APIC_NMI, /* Local x2APIC NMI */
296 };
297
298 /* MADT: Processor Local APIC Structure */
299
300 #define LOCAL_APIC_FLAG_ENABLED BIT(0)
301
302 struct acpi_madt_lapic {
303 u8 type; /* Type (0) */
304 u8 length; /* Length in bytes (8) */
305 u8 processor_id; /* ACPI processor ID */
306 u8 apic_id; /* Local APIC ID */
307 u32 flags; /* Local APIC flags */
308 };
309
310 /* MADT: I/O APIC Structure */
311 struct acpi_madt_ioapic {
312 u8 type; /* Type (1) */
313 u8 length; /* Length in bytes (12) */
314 u8 ioapic_id; /* I/O APIC ID */
315 u8 reserved;
316 u32 ioapic_addr; /* I/O APIC address */
317 u32 gsi_base; /* Global system interrupt base */
318 };
319
320 /* MADT: Interrupt Source Override Structure */
321 struct __packed acpi_madt_irqoverride {
322 u8 type; /* Type (2) */
323 u8 length; /* Length in bytes (10) */
324 u8 bus; /* ISA (0) */
325 u8 source; /* Bus-relative int. source (IRQ) */
326 u32 gsirq; /* Global system interrupt */
327 u16 flags; /* MPS INTI flags */
328 };
329
330 /* MADT: Local APIC NMI Structure */
331 struct __packed acpi_madt_lapic_nmi {
332 u8 type; /* Type (4) */
333 u8 length; /* Length in bytes (6) */
334 u8 processor_id; /* ACPI processor ID */
335 u16 flags; /* MPS INTI flags */
336 u8 lint; /* Local APIC LINT# */
337 };
338
339 /* MCFG (PCI Express MMIO config space BAR description table) */
340 struct acpi_mcfg {
341 struct acpi_table_header header;
342 u8 reserved[8];
343 };
344
345 struct acpi_mcfg_mmconfig {
346 u32 base_address_l;
347 u32 base_address_h;
348 u16 pci_segment_group_number;
349 u8 start_bus_number;
350 u8 end_bus_number;
351 u8 reserved[4];
352 };
353
354 /* PM1_CNT bit defines */
355 #define PM1_CNT_SCI_EN BIT(0)
356
357 /* ACPI global NVS structure */
358 struct acpi_global_nvs;
359
360 /* CSRT (Core System Resource Table) */
361 struct acpi_csrt {
362 struct acpi_table_header header;
363 };
364
365 struct acpi_csrt_group {
366 u32 length;
367 u32 vendor_id;
368 u32 subvendor_id;
369 u16 device_id;
370 u16 subdevice_id;
371 u16 revision;
372 u16 reserved;
373 u32 shared_info_length;
374 };
375
376 struct acpi_csrt_shared_info {
377 u16 major_version;
378 u16 minor_version;
379 u32 mmio_base_low;
380 u32 mmio_base_high;
381 u32 gsi_interrupt;
382 u8 interrupt_polarity;
383 u8 interrupt_mode;
384 u8 num_channels;
385 u8 dma_address_width;
386 u16 base_request_line;
387 u16 num_handshake_signals;
388 u32 max_block_size;
389 };
390
391 /* Port types for ACPI _UPC object */
392 enum acpi_upc_type {
393 UPC_TYPE_A,
394 UPC_TYPE_MINI_AB,
395 UPC_TYPE_EXPRESSCARD,
396 UPC_TYPE_USB3_A,
397 UPC_TYPE_USB3_B,
398 UPC_TYPE_USB3_MICRO_B,
399 UPC_TYPE_USB3_MICRO_AB,
400 UPC_TYPE_USB3_POWER_B,
401 UPC_TYPE_C_USB2_ONLY,
402 UPC_TYPE_C_USB2_SS_SWITCH,
403 UPC_TYPE_C_USB2_SS,
404 UPC_TYPE_PROPRIETARY = 0xff,
405 /*
406 * The following types are not directly defined in the ACPI
407 * spec but are used by coreboot to identify a USB device type.
408 */
409 UPC_TYPE_INTERNAL = 0xff,
410 UPC_TYPE_UNUSED,
411 UPC_TYPE_HUB
412 };
413
414 enum dev_scope_type {
415 SCOPE_PCI_ENDPOINT = 1,
416 SCOPE_PCI_SUB = 2,
417 SCOPE_IOAPIC = 3,
418 SCOPE_MSI_HPET = 4,
419 SCOPE_ACPI_NAMESPACE_DEVICE = 5
420 };
421
422 struct __packed dev_scope {
423 u8 type;
424 u8 length;
425 u8 reserved[2];
426 u8 enumeration;
427 u8 start_bus;
428 struct {
429 u8 dev;
430 u8 fn;
431 } __packed path[0];
432 };
433
434 enum dmar_type {
435 DMAR_DRHD = 0,
436 DMAR_RMRR = 1,
437 DMAR_ATSR = 2,
438 DMAR_RHSA = 3,
439 DMAR_ANDD = 4
440 };
441
442 enum {
443 DRHD_INCLUDE_PCI_ALL = BIT(0)
444 };
445
446 enum dmar_flags {
447 DMAR_INTR_REMAP = BIT(0),
448 DMAR_X2APIC_OPT_OUT = BIT(1),
449 DMAR_CTRL_PLATFORM_OPT_IN_FLAG = BIT(2),
450 };
451
452 struct dmar_entry {
453 u16 type;
454 u16 length;
455 u8 flags;
456 u8 reserved;
457 u16 segment;
458 u64 bar;
459 };
460
461 struct dmar_rmrr_entry {
462 u16 type;
463 u16 length;
464 u16 reserved;
465 u16 segment;
466 u64 bar;
467 u64 limit;
468 };
469
470 /* DMAR (DMA Remapping Reporting Structure) */
471 struct __packed acpi_dmar {
472 struct acpi_table_header header;
473 u8 host_address_width;
474 u8 flags;
475 u8 reserved[10];
476 struct dmar_entry structure[0];
477 };
478
479 /* DBG2 definitions are partially used for SPCR interface_type */
480
481 /* Types for port_type field */
482
483 #define ACPI_DBG2_SERIAL_PORT 0x8000
484 #define ACPI_DBG2_1394_PORT 0x8001
485 #define ACPI_DBG2_USB_PORT 0x8002
486 #define ACPI_DBG2_NET_PORT 0x8003
487
488 /* Subtypes for port_subtype field */
489
490 #define ACPI_DBG2_16550_COMPATIBLE 0x0000
491 #define ACPI_DBG2_16550_SUBSET 0x0001
492 #define ACPI_DBG2_ARM_PL011 0x0003
493 #define ACPI_DBG2_ARM_SBSA_32BIT 0x000D
494 #define ACPI_DBG2_ARM_SBSA_GENERIC 0x000E
495 #define ACPI_DBG2_ARM_DCC 0x000F
496 #define ACPI_DBG2_BCM2835 0x0010
497
498 #define ACPI_DBG2_1394_STANDARD 0x0000
499
500 #define ACPI_DBG2_USB_XHCI 0x0000
501 #define ACPI_DBG2_USB_EHCI 0x0001
502
503 #define ACPI_DBG2_UNKNOWN 0x00FF
504
505 /* DBG2: Microsoft Debug Port Table 2 header */
506 struct __packed acpi_dbg2_header {
507 struct acpi_table_header header;
508 u32 devices_offset;
509 u32 devices_count;
510 };
511
512 /* DBG2: Microsoft Debug Port Table 2 device entry */
513 struct __packed acpi_dbg2_device {
514 u8 revision;
515 u16 length;
516 u8 address_count;
517 u16 namespace_string_length;
518 u16 namespace_string_offset;
519 u16 oem_data_length;
520 u16 oem_data_offset;
521 u16 port_type;
522 u16 port_subtype;
523 u8 reserved[2];
524 u16 base_address_offset;
525 u16 address_size_offset;
526 };
527
528 /* SPCR (Serial Port Console Redirection table) */
529 struct __packed acpi_spcr {
530 struct acpi_table_header header;
531 u8 interface_type;
532 u8 reserved[3];
533 struct acpi_gen_regaddr serial_port;
534 u8 interrupt_type;
535 u8 pc_interrupt;
536 u32 interrupt; /* Global system interrupt */
537 u8 baud_rate;
538 u8 parity;
539 u8 stop_bits;
540 u8 flow_control;
541 u8 terminal_type;
542 u8 reserved1;
543 u16 pci_device_id; /* Must be 0xffff if not PCI device */
544 u16 pci_vendor_id; /* Must be 0xffff if not PCI device */
545 u8 pci_bus;
546 u8 pci_device;
547 u8 pci_function;
548 u32 pci_flags;
549 u8 pci_segment;
550 u32 reserved2;
551 };
552
553 /* Tables defined/reserved by ACPI and generated by U-Boot */
554 enum acpi_tables {
555 ACPITAB_BERT,
556 ACPITAB_DBG2,
557 ACPITAB_DMAR,
558 ACPITAB_DSDT,
559 ACPITAB_ECDT,
560 ACPITAB_FACS,
561 ACPITAB_FADT,
562 ACPITAB_HEST,
563 ACPITAB_HPET,
564 ACPITAB_IVRS,
565 ACPITAB_MADT,
566 ACPITAB_MCFG,
567 ACPITAB_NHLT,
568 ACPITAB_RSDP,
569 ACPITAB_RSDT,
570 ACPITAB_SLIT,
571 ACPITAB_SPCR,
572 ACPITAB_SPMI,
573 ACPITAB_SRAT,
574 ACPITAB_SSDT,
575 ACPITAB_TCPA,
576 ACPITAB_TPM2,
577 ACPITAB_VFCT,
578 ACPITAB_XSDT,
579
580 ACPITAB_COUNT,
581 };
582
583 /**
584 * acpi_get_table_revision() - Get the revision number generated for a table
585 *
586 * This keeps the version-number information in one place
587 *
588 * @table: ACPI table to check
589 * @return version number that U-Boot generates
590 */
591 int acpi_get_table_revision(enum acpi_tables table);
592
593 /**
594 * acpi_create_dmar() - Create a DMA Remapping Reporting (DMAR) table
595 *
596 * @dmar: Place to put the table
597 * @flags: DMAR flags to use
598 * @return 0 if OK, -ve on error
599 */
600 int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags);
601
602 /**
603 * acpi_create_dbg2() - Create a DBG2 table
604 *
605 * This table describes how to access the debug UART
606 *
607 * @dbg2: Place to put information
608 * @port_type: Serial port type (see ACPI_DBG2_...)
609 * @port_subtype: Serial port sub-type (see ACPI_DBG2_...)
610 * @address: ACPI address of port
611 * @address_size: Size of address space
612 * @device_path: Path of device (created using acpi_device_path())
613 */
614 void acpi_create_dbg2(struct acpi_dbg2_header *dbg2,
615 int port_type, int port_subtype,
616 struct acpi_gen_regaddr *address, uint32_t address_size,
617 const char *device_path);
618
619 /**
620 * acpi_fill_header() - Set up a new table header
621 *
622 * This sets all fields except length, revision, checksum and aslc_revision
623 *
624 * @header: ACPI header to update
625 * @signature: Table signature to use (4 characters)
626 */
627 void acpi_fill_header(struct acpi_table_header *header, char *signature);
628
629 /**
630 * acpi_align() - Align the ACPI output pointer to a 16-byte boundary
631 *
632 * @ctx: ACPI context
633 */
634 void acpi_align(struct acpi_ctx *ctx);
635
636 /**
637 * acpi_align64() - Align the ACPI output pointer to a 64-byte boundary
638 *
639 * @ctx: ACPI context
640 */
641 void acpi_align64(struct acpi_ctx *ctx);
642
643 /**
644 * acpi_inc() - Increment the ACPI output pointer by a bit
645 *
646 * The pointer is NOT aligned afterwards.
647 *
648 * @ctx: ACPI context
649 * @amount: Amount to increment by
650 */
651 void acpi_inc(struct acpi_ctx *ctx, uint amount);
652
653 /**
654 * acpi_inc_align() - Increment the ACPI output pointer by a bit and align
655 *
656 * The pointer is aligned afterwards to a 16-byte boundary
657 *
658 * @ctx: ACPI context
659 * @amount: Amount to increment by
660 */
661 void acpi_inc_align(struct acpi_ctx *ctx, uint amount);
662
663 /**
664 * acpi_add_table() - Add a new table to the RSDP and XSDT
665 *
666 * @ctx: ACPI context
667 * @table: Table to add
668 * @return 0 if OK, -E2BIG if too many tables
669 */
670 int acpi_add_table(struct acpi_ctx *ctx, void *table);
671
672 /**
673 * acpi_setup_base_tables() - Set up context along with RSDP, RSDT and XSDT
674 *
675 * Set up the context with the given start position. Some basic tables are
676 * always needed, so set them up as well.
677 *
678 * @ctx: Context to set up
679 */
680 void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start);
681
682 #endif /* !__ACPI__*/
683
684 #include <asm/acpi_table.h>
685
686 #endif /* __ACPI_TABLE_H__ */