1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* TODO: Check if this is still correct */
5 /* ACPI - create the Fixed ACPI Description Tables (FADT) */
8 #include <acpi/acpigen.h>
9 #include <amdblocks/acpi.h>
10 #include <amdblocks/cppc.h>
11 #include <amdblocks/cpu.h>
12 #include <amdblocks/acpimmio.h>
13 #include <amdblocks/ioapic.h>
14 #include <arch/ioapic.h>
15 #include <arch/smp/mpspec.h>
16 #include <console/console.h>
17 #include <cpu/amd/cpuid.h>
18 #include <device/device.h>
19 #include <soc/iomap.h>
25 * Reference section 5.2.9 Fixed ACPI Description Table (FADT)
26 * in the ACPI 3.0b specification.
28 void acpi_fill_fadt(acpi_fadt_t
*fadt
)
30 const struct soc_amd_mendocino_config
*cfg
= config_of_soc();
32 printk(BIOS_DEBUG
, "pm_base: 0x%04x\n", ACPI_IO_BASE
);
34 fadt
->pm1a_evt_blk
= ACPI_PM_EVT_BLK
;
35 fadt
->pm1a_cnt_blk
= ACPI_PM1_CNT_BLK
;
36 fadt
->pm_tmr_blk
= ACPI_PM_TMR_BLK
;
37 fadt
->gpe0_blk
= ACPI_GPE0_BLK
;
39 fadt
->pm1_evt_len
= 4; /* 32 bits */
40 fadt
->pm1_cnt_len
= 2; /* 16 bits */
41 fadt
->pm_tmr_len
= 4; /* 32 bits */
42 fadt
->gpe0_blk_len
= 8; /* 64 bits */
44 fill_fadt_extended_pm_io(fadt
);
46 fadt
->iapc_boot_arch
= cfg
->common_config
.fadt_boot_arch
; /* legacy free default */
47 fadt
->flags
|= ACPI_FADT_WBINVD
| /* See table 5-34 ACPI 6.3 spec */
48 ACPI_FADT_C1_SUPPORTED
|
49 ACPI_FADT_S4_RTC_WAKE
|
50 ACPI_FADT_32BIT_TIMER
|
51 ACPI_FADT_PCI_EXPRESS_WAKE
|
52 ACPI_FADT_PLATFORM_CLOCK
|
53 ACPI_FADT_S4_RTC_VALID
|
54 ACPI_FADT_REMOTE_POWER_ON
;
56 fadt
->flags
|= ACPI_FADT_LOW_PWR_IDLE_S0
;
58 fadt
->flags
|= cfg
->common_config
.fadt_flags
; /* additional board-specific flags */
61 unsigned long soc_acpi_write_tables(const struct device
*device
, unsigned long current
,
65 current
= acpi_add_ivrs_table(current
, rsdp
);
67 if (CONFIG(PLATFORM_USES_FSP2_0
))
68 current
= acpi_add_fsp_tables(current
, rsdp
);
73 const acpi_cstate_t cstate_cfg_table
[] = {
91 const acpi_cstate_t
*get_cstate_config_data(size_t *size
)
93 *size
= ARRAY_SIZE(cstate_cfg_table
);
94 return cstate_cfg_table
;