Angel Pons | 79572e4 | 2020-07-13 00:17:43 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <acpi/acpi.h> |
| 4 | #include <cf9_reset.h> |
Kyösti Mälkki | 121d3d5 | 2023-04-21 13:44:43 +0300 | [diff] [blame] | 5 | #include <cpu/x86/smm.h> |
Kyösti Mälkki | 240baa3 | 2023-04-17 15:20:40 +0300 | [diff] [blame] | 6 | #include <pc80/mc146818rtc.h> |
Angel Pons | 79572e4 | 2020-07-13 00:17:43 +0200 | [diff] [blame] | 7 | |
| 8 | void arch_fill_fadt(acpi_fadt_t *fadt) |
| 9 | { |
| 10 | if (CONFIG(HAVE_CF9_RESET)) { |
| 11 | fadt->reset_reg.space_id = ACPI_ADDRESS_SPACE_IO; |
| 12 | fadt->reset_reg.bit_width = 8; |
| 13 | fadt->reset_reg.bit_offset = 0; |
| 14 | fadt->reset_reg.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS; |
| 15 | fadt->reset_reg.addrl = RST_CNT; |
| 16 | fadt->reset_reg.addrh = 0; |
| 17 | |
| 18 | fadt->reset_value = RST_CPU | SYS_RST; |
| 19 | |
| 20 | fadt->flags |= ACPI_FADT_RESET_REGISTER; |
| 21 | } |
Kyösti Mälkki | 121d3d5 | 2023-04-21 13:44:43 +0300 | [diff] [blame] | 22 | |
| 23 | if (permanent_smi_handler()) { |
| 24 | fadt->smi_cmd = APM_CNT; |
| 25 | fadt->acpi_enable = APM_CNT_ACPI_ENABLE; |
| 26 | fadt->acpi_disable = APM_CNT_ACPI_DISABLE; |
| 27 | } |
Kyösti Mälkki | 240baa3 | 2023-04-17 15:20:40 +0300 | [diff] [blame] | 28 | |
| 29 | if (CONFIG(PC80_SYSTEM)) { |
| 30 | /* Currently these are defined to support date alarm only. */ |
| 31 | fadt->day_alrm = RTC_DATE_ALARM; |
| 32 | fadt->mon_alrm = RTC_MONTH_ALARM; |
| 33 | } |
| 34 | |
| 35 | /* Careful with USE_OPTION_TABLE. */ |
| 36 | if (CONFIG(USE_PC_CMOS_ALTCENTURY)) |
| 37 | fadt->century = RTC_CLK_ALTCENTURY; |
Angel Pons | 79572e4 | 2020-07-13 00:17:43 +0200 | [diff] [blame] | 38 | } |