soc/intel: Remove blank lines before '}' and after '{'
[coreboot2.git] / src / soc / intel / xeon_sp / pmutil.c
blob336e867a96c028e7329edb688367da9b4c834ff1
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /*
4 * Helper functions for dealing with power management registers
5 * and the differences between PCH variants.
6 */
8 #define __SIMPLE_DEVICE__
10 #include <console/console.h>
11 #include <device/pci.h>
12 #include <intelblocks/pmclib.h>
13 #include <intelblocks/rtc.h>
14 #include <soc/pci_devs.h>
15 #include <soc/pm.h>
16 #include <soc/pmc.h>
17 #include <types.h>
20 * SMI
23 const char *const *soc_smi_sts_array(size_t *smi_arr)
25 static const char *const smi_sts_bits[] = {
26 [2] = "BIOS",
27 [3] = "LEGACY_USB",
28 [4] = "SLP_SMI",
29 [5] = "APM",
30 [6] = "SWSMI_TMR",
31 [7] = "BIOS_RLS",
32 [8] = "PM1",
33 [9] = "GPE0",
34 [10] = "GPI",
35 [11] = "MCSMI",
36 [12] = "DEVMON",
37 [13] = "TCO",
38 [14] = "PERIODIC",
39 [20] = "PCI_EXP_SMI",
40 [23] = "IE_SMI",
41 [25] = "SCC_SMI",
42 [26] = "SPI",
43 [27] = "GPIO_UNLOCK",
44 [28] = "ESPI_SMI",
45 [29] = "SERIAL_I/O",
46 [30] = "ME_SMI",
47 [31] = "XHCI",
50 *smi_arr = ARRAY_SIZE(smi_sts_bits);
51 return smi_sts_bits;
55 * TCO
58 const char *const *soc_tco_sts_array(size_t *tco_arr)
60 static const char *const tco_sts_bits[] = {
61 [0] = "NMI2SMI",
62 [1] = "OS_TCO",
63 [2] = "TCO_INT",
64 [3] = "TIMEOUT",
65 [7] = "NEWCENTURY",
66 [8] = "BIOSWR",
67 [9] = "CPUSCI",
68 [10] = "CPUSMI",
69 [12] = "CPUSERR",
70 [13] = "SLVSEL",
71 [16] = "INTRD_DET",
72 [17] = "SECOND_TO",
73 [20] = "SMLINK_SLV"
76 *tco_arr = ARRAY_SIZE(tco_sts_bits);
77 return tco_sts_bits;
81 * GPE0
84 const char *const *soc_std_gpe_sts_array(size_t *gpe_arr)
86 static const char *const gpe_sts_bits[] = {
89 *gpe_arr = ARRAY_SIZE(gpe_sts_bits);
90 return gpe_sts_bits;
93 void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2)
95 /* No functionality for this yet */
98 /* Return 0, 3, or 5 to indicate the previous sleep state. */
99 int soc_prev_sleep_state(const struct chipset_power_state *ps, int prev_sleep_state)
102 * Check for any power failure to determine if this a wake from
103 * S5 because the PCH does not set the WAK_STS bit when waking
104 * from a true G3 state.
106 if (!(ps->pm1_sts & WAK_STS) &&
107 (ps->gen_pmcon_b & (PWR_FLR | SUS_PWR_FLR)))
108 prev_sleep_state = ACPI_S5;
110 return prev_sleep_state;
113 /* STM Support */
114 uint16_t get_pmbase(void)
116 return ACPI_BASE_ADDRESS;