1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* ACPI - create the Fixed ACPI Description Tables (FADT) */
6 #include <amdblocks/acpi.h>
7 #include <amdblocks/acpimmio.h>
8 #include <amdblocks/cpu.h>
9 #include <arch/ioapic.h>
10 #include <device/device.h>
11 #include <vendorcode/amd/opensil/opensil.h>
13 void acpi_fill_fadt(acpi_fadt_t
*fadt
)
15 /* Fill in pm1_evt, pm1_cnt, pm_tmr, gpe0_blk from openSIL input structure */
16 opensil_fill_fadt_io_ports(fadt
);
18 fadt
->pm1_evt_len
= 4; /* 32 bits */
19 fadt
->pm1_cnt_len
= 2; /* 16 bits */
20 fadt
->pm_tmr_len
= 4; /* 32 bits */
21 fadt
->gpe0_blk_len
= 8; /* 64 bits */
23 fill_fadt_extended_pm_io(fadt
);
25 fadt
->iapc_boot_arch
= ACPI_FADT_LEGACY_FREE
; /* legacy free default */
26 fadt
->flags
|= ACPI_FADT_WBINVD
| /* See table 5-34 ACPI 6.3 spec */
27 ACPI_FADT_C1_SUPPORTED
|
28 ACPI_FADT_S4_RTC_WAKE
|
29 ACPI_FADT_32BIT_TIMER
|
30 ACPI_FADT_PCI_EXPRESS_WAKE
|
31 ACPI_FADT_PLATFORM_CLOCK
|
32 ACPI_FADT_S4_RTC_VALID
|
33 ACPI_FADT_REMOTE_POWER_ON
;
35 fadt
->x_firmware_ctl_l
= 0; /* set to 0 if firmware_ctrl is used */
36 fadt
->x_firmware_ctl_h
= 0;
39 unsigned long soc_acpi_write_tables(const struct device
*device
, unsigned long current
,
40 struct acpi_rsdp
*rsdp
)
43 current
= acpi_add_ivrs_table(current
, rsdp
);
48 /* There are only the following 2 C-states reported by the reference firmware */
49 const acpi_cstate_t cstate_cfg_table
[] = {
62 const acpi_cstate_t
*get_cstate_config_data(size_t *size
)
64 *size
= ARRAY_SIZE(cstate_cfg_table
);
65 return cstate_cfg_table
;