Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Saket Sinha | 331141a | 2015-08-22 12:20:55 +0530 | [diff] [blame] | 2 | /* |
| 3 | * Based on acpi.c from coreboot |
| 4 | * |
| 5 | * Copyright (C) 2015, Saket Sinha <saket.sinha89@gmail.com> |
Bin Meng | bbcff8d | 2016-05-07 07:46:22 -0700 | [diff] [blame] | 6 | * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com> |
Saket Sinha | 331141a | 2015-08-22 12:20:55 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
Bin Meng | 3f04707 | 2018-07-18 21:42:17 -0700 | [diff] [blame] | 9 | #ifndef __ASM_ACPI_TABLE_H__ |
| 10 | #define __ASM_ACPI_TABLE_H__ |
| 11 | |
Simon Glass | 858fed1 | 2020-04-08 16:57:36 -0600 | [diff] [blame] | 12 | struct acpi_facs; |
| 13 | struct acpi_fadt; |
Bin Meng | d9050c6 | 2016-06-17 02:13:16 -0700 | [diff] [blame] | 14 | struct acpi_global_nvs; |
Simon Glass | 858fed1 | 2020-04-08 16:57:36 -0600 | [diff] [blame] | 15 | struct acpi_madt_ioapic; |
| 16 | struct acpi_madt_irqoverride; |
| 17 | struct acpi_madt_lapic_nmi; |
| 18 | struct acpi_mcfg_mmconfig; |
| 19 | struct acpi_table_header; |
Andy Shevchenko | 6e84f087 | 2018-11-20 23:52:37 +0200 | [diff] [blame] | 20 | |
Saket Sinha | 331141a | 2015-08-22 12:20:55 +0530 | [diff] [blame] | 21 | /* These can be used by the target port */ |
| 22 | |
Bin Meng | b063d5f | 2016-05-07 07:46:24 -0700 | [diff] [blame] | 23 | void acpi_fill_header(struct acpi_table_header *header, char *signature); |
Bin Meng | 44256b0 | 2016-05-07 07:46:25 -0700 | [diff] [blame] | 24 | void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs, |
| 25 | void *dsdt); |
Bin Meng | 3c5234e | 2016-05-07 07:46:30 -0700 | [diff] [blame] | 26 | int acpi_create_madt_lapics(u32 current); |
Bin Meng | 44256b0 | 2016-05-07 07:46:25 -0700 | [diff] [blame] | 27 | int acpi_create_madt_ioapic(struct acpi_madt_ioapic *ioapic, u8 id, |
| 28 | u32 addr, u32 gsi_base); |
Saket Sinha | 331141a | 2015-08-22 12:20:55 +0530 | [diff] [blame] | 29 | int acpi_create_madt_irqoverride(struct acpi_madt_irqoverride *irqoverride, |
Bin Meng | 44256b0 | 2016-05-07 07:46:25 -0700 | [diff] [blame] | 30 | u8 bus, u8 source, u32 gsirq, u16 flags); |
| 31 | int acpi_create_madt_lapic_nmi(struct acpi_madt_lapic_nmi *lapic_nmi, |
| 32 | u8 cpu, u16 flags, u8 lint); |
Bin Meng | a1ec7db | 2016-05-07 07:46:26 -0700 | [diff] [blame] | 33 | u32 acpi_fill_madt(u32 current); |
Andy Shevchenko | c1ae980 | 2017-07-21 22:32:05 +0300 | [diff] [blame] | 34 | int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base, |
| 35 | u16 seg_nr, u8 start, u8 end); |
| 36 | u32 acpi_fill_mcfg(u32 current); |
Andy Shevchenko | 607dbd1 | 2019-07-14 19:23:57 +0300 | [diff] [blame] | 37 | u32 acpi_fill_csrt(u32 current); |
Simon Glass | 9ed41e7 | 2020-07-07 21:32:05 -0600 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * acpi_create_gnvs() - Create a GNVS (Global Non Volatile Storage) table |
| 41 | * |
| 42 | * @gnvs: Table to fill in |
| 43 | * @return 0 if OK, -ve on error |
| 44 | */ |
| 45 | int acpi_create_gnvs(struct acpi_global_nvs *gnvs); |
| 46 | |
Simon Glass | ca37a39 | 2017-01-16 07:03:35 -0700 | [diff] [blame] | 47 | ulong write_acpi_tables(ulong start); |
Bin Meng | 34bc74a | 2017-04-21 07:24:36 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
Bin Meng | e102925 | 2018-01-30 05:01:16 -0800 | [diff] [blame] | 50 | * acpi_get_rsdp_addr() - get ACPI RSDP table address |
| 51 | * |
| 52 | * This routine returns the ACPI RSDP table address in the system memory. |
| 53 | * |
| 54 | * @return: ACPI RSDP table address |
| 55 | */ |
| 56 | ulong acpi_get_rsdp_addr(void); |
Bin Meng | 3f04707 | 2018-07-18 21:42:17 -0700 | [diff] [blame] | 57 | |
| 58 | #endif /* __ASM_ACPI_TABLE_H__ */ |