mb/google/nissa/var/rull: Add 6W and 15W DPTF parameters
[coreboot2.git] / src / southbridge / intel / i82371eb / wakeup.c
blob4cad3223b1d2722cb0fddc8a471707657fb02d72
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <stdint.h>
4 #include <acpi/acpi.h>
5 #include <arch/io.h>
6 #include <console/console.h>
7 #include "i82371eb.h"
9 /*
10 * Intel 82371EB (PIIX4E) datasheet, section 7.2.3, page 142
12 * 0: soft off/suspend to disk S5
13 * 1: suspend to ram S3
14 * 2: powered on suspend, context lost S2
15 * Note: 'context lost' means the CPU restarts at the reset
16 * vector
17 * 3: powered on suspend, CPU context lost S1
18 * Note: Looks like 'CPU context lost' does _not_ mean the
19 * CPU restarts at the reset vector. Most likely only
20 * caches are lost, so both 0x3 and 0x4 map to acpi S1
21 * 4: powered on suspend, context maintained S1
22 * 5: working (clock control) S0
23 * 6: reserved
24 * 7: reserved
26 static const u8 acpi_sus_to_slp_typ[8] = {
27 5, 3, 2, 1, 1, 0, 0, 0
30 int acpi_get_sleep_type(void)
32 u16 reg, result;
34 reg = inw(DEFAULT_PMBASE + PMCNTRL);
35 result = acpi_sus_to_slp_typ[(reg >> 10) & 7];
37 printk(BIOS_DEBUG, "Wakeup from ACPI sleep type S%d (PMCNTRL=%04x)\n", result, reg);
39 return result;