blob: e78ba4283aa7c5518b9c669f373f71538f154596 [file] [log] [blame]
Elyes HAOUAS132384a2020-05-07 07:19:50 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
Tobias Diedriche87c38e2010-11-27 09:40:16 +00003/*
Tobias Diedriche87c38e2010-11-27 09:40:16 +00004 * Based on src/southbridge/via/vt8237r/vt8237_fadt.c
Tobias Diedriche87c38e2010-11-27 09:40:16 +00005 */
6
Furquan Shaikh76cedd22020-05-02 10:24:23 -07007#include <acpi/acpi.h>
Tobias Diedriche87c38e2010-11-27 09:40:16 +00008#include <device/device.h>
9#include <device/pci.h>
Elyes HAOUAS26071aa2019-02-15 08:21:33 +010010
Tobias Diedriche87c38e2010-11-27 09:40:16 +000011#include "i82371eb.h"
12
13/**
14 * Create the Fixed ACPI Description Tables (FADT) for any board with this SB.
15 * Reference: ACPIspec40a, 5.2.9, page 118
16 */
Kyösti Mälkki8ad52ff2020-05-30 14:50:50 +030017void acpi_fill_fadt(acpi_fadt_t *fadt)
Tobias Diedriche87c38e2010-11-27 09:40:16 +000018{
Tobias Diedriche87c38e2010-11-27 09:40:16 +000019
20 fadt->pm1a_evt_blk = DEFAULT_PMBASE;
Tobias Diedriche87c38e2010-11-27 09:40:16 +000021 fadt->pm1a_cnt_blk = DEFAULT_PMBASE + PMCNTRL;
Tobias Diedriche87c38e2010-11-27 09:40:16 +000022
Tobias Diedriche87c38e2010-11-27 09:40:16 +000023 fadt->pm_tmr_blk = DEFAULT_PMBASE + PMTMR;
24 fadt->gpe0_blk = DEFAULT_PMBASE + GPSTS;
Tobias Diedriche87c38e2010-11-27 09:40:16 +000025
26 /* *_len define register width in bytes */
27 fadt->pm1_evt_len = 4;
28 fadt->pm1_cnt_len = 2;
Tobias Diedriche87c38e2010-11-27 09:40:16 +000029 fadt->pm_tmr_len = 4;
30 fadt->gpe0_blk_len = 4;
31
Kyösti Mälkki88decca2023-04-28 07:04:34 +030032 fill_fadt_extended_pm_io(fadt);
33
Tobias Diedriche87c38e2010-11-27 09:40:16 +000034 /*
35 * bit meaning
36 * 0 1: We have user-visible legacy devices
37 * 1 1: 8042
38 * 2 0: VGA is ok to probe
39 * 3 1: MSI are not supported
40 */
Elyes HAOUAS653eb152020-08-17 12:15:12 +020041 fadt->iapc_boot_arch = ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042 |
42 ACPI_FADT_MSI_NOT_SUPPORTED;
Tobias Diedriche87c38e2010-11-27 09:40:16 +000043 /*
44 * bit meaning
45 * 0 WBINVD
46 * Processors in new ACPI-compatible systems are required to
47 * support this function and indicate this to OSPM by setting
48 * this field.
49 * 1 WBINVD_FLUSH
50 * If set, indicates that the hardware flushes all caches on the
51 * WBINVD instruction and maintains memory coherency, but does
52 * not guarantee the caches are invalidated.
53 * 2 PROC_C1
54 * C1 power state (x86 hlt instruction) is supported on all cpus
55 * 3 P_LVL2_UP
56 * 0: C2 only on uniprocessor, 1: C2 on uni- and multiprocessor
57 * 4 PWR_BUTTON
58 * 0: pwr button is fixed feature
59 * 1: pwr button has control method device if present
60 * 5 SLP_BUTTON
61 * 0: sleep button is fixed feature
62 * 1: sleep button has control method device if present
63 * 6 FIX_RTC
64 * 0: RTC wake status supported in fixed register spce
65 * 7 RTC_S4
66 * 1: RTC can wake from S4
67 * 8 TMR_VAL_EXT
68 * 1: pmtimer is 32bit, 0: pmtimer is 24bit
69 * 9 DCK_CAP
70 * 1: system supports docking station
71 * 10 RESET_REG_SUPPORT
72 * 1: fadt describes reset register for system reset
73 * 11 SEALED_CASE
74 * 1: No expansion possible, sealed case
75 * 12 HEADLESS
76 * 1: Video output, keyboard and mouse are not connected
77 * 13 CPU_SW_SLP
78 * 1: Special processor instruction needs to be executed
79 * after writing SLP_TYP
80 * 14 PCI_EXP_WAK
81 * 1: PM1 regs support PCIEXP_WAKE_(STS|EN), must be set
82 * on platforms with pci express support
83 * 15 USE_PLATFORM_CLOCK
84 * 1: OS should prefer platform clock over processor internal
85 * clock.
86 * 16 S4_RTC_STS_VALID
87 * 17 REMOTE_POWER_ON_CAPABLE
88 * 1: platform correctly supports OSPM leaving GPE wake events
89 * armed prior to an S5 transition.
90 * 18 FORCE_APIC_CLUSTER_MODEL
91 * 19 FORCE_APIC_PHYSICAL_DESTINATION_MODE
92 */
Elyes HAOUAS37ac3682020-08-17 12:08:25 +020093 fadt->flags |= ACPI_FADT_WBINVD | ACPI_FADT_C1_SUPPORTED | ACPI_FADT_SLEEP_BUTTON |
94 ACPI_FADT_S4_RTC_WAKE;
Tobias Diedriche87c38e2010-11-27 09:40:16 +000095}