MAINTAINERS: Add Matt as a maintainer for Star Labs
[coreboot2.git] / src / soc / amd / common / block / include / amdblocks / acpi.h
blobf791c257493280ac550d09ccce3d6e96df58e267
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef AMD_BLOCK_ACPI_H
4 #define AMD_BLOCK_ACPI_H
6 #include <acpi/acpi.h>
7 #include <amdblocks/gpio.h>
8 #include <device/device.h>
9 #include <types.h>
11 #define ACPI_SCI_IRQ 9
13 /* ACPI MMIO registers 0xfed80800 */
14 #define MMIO_ACPI_PM1_EVT_BLK 0x00
15 #define MMIO_ACPI_PM1_STS 0x00
16 #define MMIO_ACPI_PM1_EN 0x02
17 #define MMIO_ACPI_PM1_CNT_BLK 0x04
18 /* sleep types defined in include/acpi/acpi.h */
19 #define ACPI_PM1_CNT_SCIEN BIT(0)
20 #define MMIO_ACPI_PM_TMR_BLK 0x08
21 #define MMIO_ACPI_GPE0_BLK 0x14
22 #define MMIO_ACPI_GPE0_STS 0x14
23 #define MMIO_ACPI_GPE0_EN 0x18
25 /* Structure to maintain standard ACPI register state for reporting purposes. */
26 struct acpi_pm_gpe_state {
27 uint16_t pm1_sts;
28 uint16_t pm1_en;
29 uint32_t gpe0_sts;
30 uint32_t gpe0_en;
31 uint16_t previous_sx_state;
32 uint16_t aligning_field;
35 /* Fill object with the ACPI PM and GPE state. */
36 void acpi_fill_pm_gpe_state(struct acpi_pm_gpe_state *state);
37 /* Save events to eventlog log and also print information on console. */
38 void acpi_pm_gpe_add_events_print_events(void);
39 /* Clear PM and GPE status registers. */
40 void acpi_clear_pm_gpe_status(void);
43 * If a system reset is about to be requested, modify the PM1 register so it
44 * will never be misinterpreted as an S3 resume.
46 void set_pm1cnt_s5(void);
47 void acpi_enable_sci(void);
48 void acpi_disable_sci(void);
50 struct chipset_power_state {
51 struct acpi_pm_gpe_state gpe_state;
52 struct gpio_wake_state gpio_state;
55 unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current,
56 acpi_rsdp_t *rsdp);
58 unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp);
59 unsigned long acpi_add_opensil_tables(unsigned long current, acpi_rsdp_t *rsdp);
61 unsigned long southbridge_write_acpi_tables(const struct device *device, unsigned long current,
62 struct acpi_rsdp *rsdp);
64 void acpi_log_events(const struct chipset_power_state *ps);
66 unsigned long acpi_add_crat_table(unsigned long current, acpi_rsdp_t *rsdp);
67 unsigned long acpi_add_ivrs_table(unsigned long current, acpi_rsdp_t *rsdp);
69 #endif /* AMD_BLOCK_ACPI_H */