Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <acpi/acpi.h> |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 4 | #include <soc/iomap.h> |
| 5 | #include <soc/pm.h> |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 6 | |
| 7 | void acpi_fill_fadt(acpi_fadt_t *fadt) |
| 8 | { |
| 9 | const uint16_t pmbase = ACPI_BASE_ADDRESS; |
| 10 | |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 11 | |
| 12 | fadt->pm1a_evt_blk = pmbase + PM1_STS; |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 13 | fadt->pm1a_cnt_blk = pmbase + PM1_CNT; |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 14 | fadt->pm2_cnt_blk = pmbase + PM2A_CNT_BLK; |
| 15 | fadt->pm_tmr_blk = pmbase + PM1_TMR; |
| 16 | fadt->gpe0_blk = pmbase + GPE0_STS; |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 17 | |
| 18 | fadt->pm1_evt_len = 4; |
| 19 | fadt->pm1_cnt_len = 2; |
| 20 | fadt->pm2_cnt_len = 1; |
| 21 | fadt->pm_tmr_len = 4; |
| 22 | fadt->gpe0_blk_len = 2 * (GPE0_EN - GPE0_STS); |
Kyösti Mälkki | 88decca | 2023-04-28 07:04:34 +0300 | [diff] [blame] | 23 | |
| 24 | fill_fadt_extended_pm_io(fadt); |
| 25 | |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 26 | fadt->iapc_boot_arch = ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042; |
| 27 | |
Angel Pons | a208c6c | 2020-07-13 00:02:34 +0200 | [diff] [blame] | 28 | fadt->flags |= ACPI_FADT_WBINVD | ACPI_FADT_C1_SUPPORTED | |
Michael Niewöhner | 2353cd9 | 2021-10-04 16:59:49 +0200 | [diff] [blame] | 29 | ACPI_FADT_SLEEP_BUTTON | |
Angel Pons | 79572e4 | 2020-07-13 00:17:43 +0200 | [diff] [blame] | 30 | ACPI_FADT_SEALED_CASE | ACPI_FADT_S4_RTC_WAKE | |
| 31 | ACPI_FADT_PLATFORM_CLOCK; |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 32 | |
Angel Pons | 91ca2dd | 2020-07-12 14:24:48 +0200 | [diff] [blame] | 33 | } |