Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/pci_ops.h> |
| 4 | #include <acpi/acpi.h> |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 5 | #include <southbridge/intel/lynxpoint/pch.h> |
| 6 | #include "chip.h" |
| 7 | |
| 8 | void acpi_fill_fadt(acpi_fadt_t *fadt) |
| 9 | { |
| 10 | struct device *dev = pcidev_on_root(0x1f, 0); |
| 11 | struct southbridge_intel_lynxpoint_config *cfg = dev->chip_info; |
| 12 | u16 pmbase = get_pmbase(); |
| 13 | |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 14 | |
| 15 | fadt->pm1a_evt_blk = pmbase + PM1_STS; |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 16 | fadt->pm1a_cnt_blk = pmbase + PM1_CNT; |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 17 | fadt->pm2_cnt_blk = pmbase + PM2_CNT; |
| 18 | fadt->pm_tmr_blk = pmbase + PM1_TMR; |
| 19 | if (pch_is_lp()) |
| 20 | fadt->gpe0_blk = pmbase + LP_GPE0_STS_1; |
| 21 | else |
| 22 | fadt->gpe0_blk = pmbase + GPE0_STS; |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 23 | |
Kyösti Mälkki | 88decca | 2023-04-28 07:04:34 +0300 | [diff] [blame] | 24 | fill_fadt_extended_pm_io(fadt); |
| 25 | |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 26 | /* |
| 27 | * Some of the lengths here are doubled. This is because they describe |
| 28 | * blocks containing two registers, where the size of each register |
| 29 | * is found by halving the block length. See Table 5-34 and section |
| 30 | * 4.8.3 of the ACPI specification for details. |
| 31 | */ |
| 32 | fadt->pm1_evt_len = 2 * 2; |
| 33 | fadt->pm1_cnt_len = 2; |
| 34 | fadt->pm2_cnt_len = 1; |
| 35 | fadt->pm_tmr_len = 4; |
| 36 | if (pch_is_lp()) |
| 37 | fadt->gpe0_blk_len = 2 * 16; |
| 38 | else |
| 39 | fadt->gpe0_blk_len = 2 * 8; |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 40 | |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 41 | fadt->iapc_boot_arch = ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042; |
| 42 | |
Angel Pons | a208c6c | 2020-07-13 00:02:34 +0200 | [diff] [blame] | 43 | fadt->flags |= ACPI_FADT_WBINVD | |
| 44 | ACPI_FADT_C1_SUPPORTED | |
Angel Pons | a208c6c | 2020-07-13 00:02:34 +0200 | [diff] [blame] | 45 | ACPI_FADT_SLEEP_BUTTON | |
Angel Pons | a208c6c | 2020-07-13 00:02:34 +0200 | [diff] [blame] | 46 | ACPI_FADT_SEALED_CASE | |
| 47 | ACPI_FADT_S4_RTC_WAKE | |
| 48 | ACPI_FADT_PLATFORM_CLOCK; |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 49 | |
Angel Pons | cbcbb67 | 2020-10-23 00:11:26 +0200 | [diff] [blame] | 50 | if (cfg && cfg->docking_supported) |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 51 | fadt->flags |= ACPI_FADT_DOCKING_SUPPORTED; |
Angel Pons | 2bd25bf | 2020-07-12 14:13:40 +0200 | [diff] [blame] | 52 | } |