11 #include <soc/smbus.h>
16 #define WAK_STS (1 << 15)
17 #define PCIEXPWAK_STS (1 << 14)
18 #define PRBTNOR_STS (1 << 11)
19 #define RTC_STS (1 << 10)
20 #define PWRBTN_STS (1 << 8)
21 #define GBL_STS (1 << 5)
22 #define BM_STS (1 << 4)
23 #define TMROF_STS (1 << 0)
25 #define PCIEXPWAK_DIS (1 << 14)
26 #define RTC_EN (1 << 10)
27 #define PWRBTN_EN (1 << 8)
28 #define GBL_EN (1 << 5)
29 #define TMROF_EN (1 << 0)
31 #define GBL_RLS (1 << 2)
32 #define BM_RLD (1 << 1)
33 #define SCI_EN (1 << 0)
36 #define XHCI_SMI_EN (1 << 31)
37 #define ME_SMI_EN (1 << 30)
38 #define ESPI_SMI_EN (1 << 28)
39 #define GPIO_UNLOCK_SMI_EN (1 << 27)
40 #define INTEL_USB2_EN (1 << 18)
41 #define LEGACY_USB2_EN (1 << 17)
42 #define PERIODIC_EN (1 << 14)
43 #define TCO_SMI_EN (1 << 13)
44 #define MCSMI_EN (1 << 11)
45 #define BIOS_RLS (1 << 7)
46 #define SWSMI_TMR_EN (1 << 6)
47 #define APMC_EN (1 << 5)
48 #define SLP_SMI_EN (1 << 4)
49 #define LEGACY_USB_EN (1 << 3)
50 #define BIOS_EN (1 << 2)
52 #define GBL_SMI_EN (1 << 0)
54 #define SMI_STS_BITS 32
55 #define XHCI_SMI_STS_BIT 31
56 #define ME_SMI_STS_BIT 30
57 #define SERIAL_IO_SMI_STS_BIT 29
58 #define ESPI_SMI_STS_BIT 28
59 #define GPIO_UNLOCK_SMI_STS_BIT 27
60 #define SPI_SMI_STS_BIT 26
61 #define SCC_SMI_STS_BIT 25
62 #define MONITOR_STS_BIT 21
63 #define PCI_EXP_SMI_STS_BIT 20
64 #define SMBUS_SMI_STS_BIT 16
65 #define SERIRQ_SMI_STS_BIT 15
66 #define PERIODIC_STS_BIT 14
67 #define TCO_STS_BIT 13
68 #define DEVMON_STS_BIT 12
69 #define MCSMI_STS_BIT 11
70 #define GPIO_STS_BIT 10
71 #define GPE0_STS_BIT 9
73 #define SWSMI_TMR_STS_BIT 6
75 #define SMI_ON_SLP_EN_STS_BIT 4
76 #define LEGACY_USB_STS_BIT 3
77 #define BIOS_STS_BIT 2
79 #define UPWRC_WS (1 << 8)
80 #define UPWRC_WE (1 << 1)
81 #define UPWRC_SMI (1 << 0)
83 #define SWGPE_CTRL (1 << 1)
84 #define DEVACT_STS 0x44
87 #define GPE0_REG_MAX 4
88 #define GPE0_REG_SIZE 32
89 #define GPE0_STS(x) (0x80 + ((x) * 4))
94 #define GPE_STS_RSVD GPE_STD
95 #define WADT_STS (1 << 18)
96 #define LAN_WAK_STS (1 << 16)
97 #define GPIO_T2_STS (1 << 15)
98 #define ESPI_STS (1 << 14)
99 #define PME_B0_STS (1 << 13)
100 #define ME_SCI_STS (1 << 12)
101 #define PME_STS (1 << 11)
102 #define BATLOW_STS (1 << 10)
103 #define PCI_EXP_STS (1 << 9)
104 #define SMB_WAK_STS (1 << 7)
105 #define TCOSCI_STS (1 << 6)
106 #define SWGPE_STS (1 << 2)
107 #define HOT_PLUG_STS (1 << 1)
108 #define GPE0_EN(x) (0x90 + ((x) * 4))
109 #define WADT_EN (1 << 18)
110 #define LAN_WAK_EN (1 << 16)
111 #define GPIO_T2_EN (1 << 15)
112 #define ESPI_EN (1 << 14)
113 #define PME_B0_EN (1 << 13)
114 #define ME_SCI_EN (1 << 12)
115 #define PME_EN (1 << 11)
116 #define BATLOW_EN (1 << 10)
117 #define PCI_EXP_EN (1 << 9)
118 #define TCOSCI_EN (1 << 6)
119 #define SWGPE_EN (1 << 2)
120 #define HOT_PLUG_EN (1 << 1)
122 #define GBLRST_CAUSE0_THERMTRIP (1 << 5)
134 #define ENABLE_SMI_PARAMS \
135 (APMC_EN | SLP_SMI_EN | GBL_SMI_EN | ESPI_SMI_EN | EOS)
139 #define CF9_LOCK (1 << 31)
140 #define CF9_GLB_RST (1 << 20)
145 #define PSS_MAX_ENTRIES 8
146 #define PSS_RATIO_STEP 2
147 #define PSS_LATENCY_TRANSITION 10
148 #define PSS_LATENCY_BUSMASTER 10
uint16_t get_pmbase(void)
struct chipset_power_state __packed
uint8_t * pmc_mmio_regs(void)
static uint32_t read32(const void *addr)
static int deep_s5_enabled(void)
static int deep_s3_enabled(void)
uint32_t prev_sleep_state