2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
/*
|
|
|
|
* Based on acpi.c from coreboot
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015, Saket Sinha <saket.sinha89@gmail.com>
|
2016-05-07 14:46:22 +00:00
|
|
|
* Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
*/
|
|
|
|
|
2018-07-19 04:42:17 +00:00
|
|
|
#ifndef __ASM_ACPI_TABLE_H__
|
|
|
|
#define __ASM_ACPI_TABLE_H__
|
|
|
|
|
2020-04-08 22:57:36 +00:00
|
|
|
struct acpi_facs;
|
|
|
|
struct acpi_fadt;
|
2016-06-17 09:13:16 +00:00
|
|
|
struct acpi_global_nvs;
|
2020-04-08 22:57:36 +00:00
|
|
|
struct acpi_madt_ioapic;
|
|
|
|
struct acpi_madt_irqoverride;
|
|
|
|
struct acpi_madt_lapic_nmi;
|
|
|
|
struct acpi_mcfg_mmconfig;
|
|
|
|
struct acpi_table_header;
|
2018-11-20 21:52:37 +00:00
|
|
|
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
/* These can be used by the target port */
|
|
|
|
|
2016-05-07 14:46:24 +00:00
|
|
|
void acpi_fill_header(struct acpi_table_header *header, char *signature);
|
2016-05-07 14:46:25 +00:00
|
|
|
void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
|
|
|
|
void *dsdt);
|
2016-05-07 14:46:30 +00:00
|
|
|
int acpi_create_madt_lapics(u32 current);
|
2016-05-07 14:46:25 +00:00
|
|
|
int acpi_create_madt_ioapic(struct acpi_madt_ioapic *ioapic, u8 id,
|
|
|
|
u32 addr, u32 gsi_base);
|
x86: Generate a valid ACPI table
Implement write_acpi_table() to create a minimal working ACPI table.
This includes writing FACS, XSDT, RSDP, FADT, MCFG, MADT, DSDT & SSDT
ACPI table entries.
Use a Kconfig option GENERATE_ACPI_TABLE to tell U-Boot whether we need
actually write the APCI table just like we did for PIRQ routing, MP table
and SFI tables. With ACPI table existence, linux kernel gets control of
power management, thermal management, configuration management and
monitoring in hardware.
Signed-off-by: Saket Sinha <saket.sinha89@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tidied up whitespace and aligned some tabs:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-22 06:50:55 +00:00
|
|
|
int acpi_create_madt_irqoverride(struct acpi_madt_irqoverride *irqoverride,
|
2016-05-07 14:46:25 +00:00
|
|
|
u8 bus, u8 source, u32 gsirq, u16 flags);
|
|
|
|
int acpi_create_madt_lapic_nmi(struct acpi_madt_lapic_nmi *lapic_nmi,
|
|
|
|
u8 cpu, u16 flags, u8 lint);
|
2016-05-07 14:46:26 +00:00
|
|
|
u32 acpi_fill_madt(u32 current);
|
2017-07-21 19:32:05 +00:00
|
|
|
int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base,
|
|
|
|
u16 seg_nr, u8 start, u8 end);
|
|
|
|
u32 acpi_fill_mcfg(u32 current);
|
2019-07-14 16:23:57 +00:00
|
|
|
u32 acpi_fill_csrt(u32 current);
|
2020-07-08 03:32:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* acpi_create_gnvs() - Create a GNVS (Global Non Volatile Storage) table
|
|
|
|
*
|
|
|
|
* @gnvs: Table to fill in
|
|
|
|
* @return 0 if OK, -ve on error
|
|
|
|
*/
|
|
|
|
int acpi_create_gnvs(struct acpi_global_nvs *gnvs);
|
|
|
|
|
2017-01-16 14:03:35 +00:00
|
|
|
ulong write_acpi_tables(ulong start);
|
2017-04-21 14:24:36 +00:00
|
|
|
|
2018-01-30 13:01:16 +00:00
|
|
|
/**
|
|
|
|
* acpi_get_rsdp_addr() - get ACPI RSDP table address
|
|
|
|
*
|
|
|
|
* This routine returns the ACPI RSDP table address in the system memory.
|
|
|
|
*
|
|
|
|
* @return: ACPI RSDP table address
|
|
|
|
*/
|
|
|
|
ulong acpi_get_rsdp_addr(void);
|
2018-07-19 04:42:17 +00:00
|
|
|
|
|
|
|
#endif /* __ASM_ACPI_TABLE_H__ */
|