3 #ifndef _SOC_APOLLOLAKE_PM_H_
4 #define _SOC_APOLLOLAKE_PM_H_
14 #define WAK_STS (1 << 15)
15 #define PCIEXPWAK_STS (1 << 14)
16 #define PRBTNOR_STS (1 << 11)
17 #define RTC_STS (1 << 10)
18 #define PWRBTN_STS (1 << 8)
19 #define GBL_STS (1 << 5)
22 #define PCIEXPWAK_DIS (1 << 14)
23 #define RTC_EN (1 << 10)
24 #define PWRBTN_EN (1 << 8)
25 #define GBL_EN (1 << 5)
28 #define SCI_EN (1 << 0)
35 #define SMI_OCP_CSE 27
37 #define SMI_SPI_SSMI 25
41 #define SMI_HOST_SMBUS 18
45 #define SMI_PERIODIC 14
48 #define SMI_GPIO_UNLOCK_SSMI 11
50 #define SMI_BIOS_RLS 7
51 #define SMI_SWSMI_TMR 6
54 #define SMI_LEGACY_USB 3
60 #define ESPI_SMI_EN (1 << SMI_ESPI)
64 #define USB_EN (1 << SMI_XHCI)
65 #define PERIODIC_EN (1 << SMI_PERIODIC)
66 #define TCO_SMI_EN (1 << SMI_TCO)
67 #define GPIO_EN (1 << SMI_GPIO)
68 #define BIOS_RLS (1 << SMI_BIOS_RLS)
70 #define SWSMI_TMR_EN (1 << SMI_SWSMI_TMR)
71 #define APMC_EN (1 << SMI_APMC)
73 #define SLP_SMI_EN (1 << SMI_SLP)
74 #define BIOS_EN (1 << SMI_BIOS)
75 #define EOS (1 << SMI_EOS)
76 #define GBL_SMI_EN (1 << SMI_GBL)
89 #define ENABLE_SMI_PARAMS \
90 (ESPI_SMI_EN | APMC_EN | SLP_SMI_EN | GBL_SMI_EN | EOS | GPIO_EN)
93 #define SMI_STS_BITS 32
95 #define ESPI_SMI_STS_BIT 28
96 #define PMC_OCP_SMI_STS_BIT 27
97 #define SPI_SMI_STS_BIT 26
98 #define SPI_SSMI_STS_BIT 25
99 #define SCC2_SMI_STS_BIT 21
100 #define PCI_EXP_SMI_STS_BIT 20
101 #define SCS_SMI_STS_BIT 19
102 #define HSMBUS_SMI_STS_BIT 18
103 #define XHCI_SMI_STS_BIT 17
104 #define SMBUS_SMI_STS_BIT 16
105 #define SERIRQ_SMI_STS_BIT 15
106 #define PERIODIC_STS_BIT 14
107 #define TCO_STS_BIT 13
108 #define MC_SMI_STS_BIT 12
109 #define GPIO_UNLOCK_SMI_STS_BIT 11
110 #define GPIO_STS_BIT 10
111 #define GPE0_STS_BIT 9
112 #define PM1_STS_BIT 8
113 #define SWSMI_TMR_STS_BIT 6
114 #define APM_STS_BIT 5
115 #define SMI_ON_SLP_EN_STS_BIT 4
116 #define LEGACY_USB_STS_BIT 3
117 #define BIOS_STS_BIT 2
119 #define GPE_CNTL 0x50
120 #define DEVACT_STS 0x4c
122 #define GPE0_REG_MAX 4
123 #define GPE0_REG_SIZE 32
124 #define GPE0_STS(x) (0x20 + ((x) * 4))
129 #define GPE_STD GPE0_A
130 #define ESPI_STS (1 << 20)
131 #define SATA_PME_STS (1 << 17)
132 #define SMB_WAK_STS (1 << 16)
133 #define AVS_PME_STS (1 << 14)
134 #define XHCI_PME_STS (1 << 13)
135 #define XDCI_PME_STS (1 << 12)
136 #define CSE_PME_STS (1 << 11)
137 #define BATLOW_STS (1 << 10)
138 #define PCIE_GPE_STS (1 << 9)
139 #define SWGPE_STS (1 << 2)
140 #define GPE0_EN(x) (0x30 + ((x) * 4))
141 #define ESPI_EN (1 << 20)
142 #define SATA_PME_EN (1 << 17)
143 #define SMB_WAK_EN (1 << 16)
144 #define AVS_PME_EN (1 << 14)
145 #define PME_B0_EN (1 << 13)
146 #define XDCI_PME_EN (1 << 12)
147 #define CSE_PME_EN (1 << 11)
148 #define BATLOW_EN (1 << 10)
149 #define PCIE_GPE_EN (1 << 9)
150 #define SWGPE_EN (1 << 2)
154 #define GEN_PMCON1 0x1020
155 #define GEN_PMCON_A GEN_PMCON1
156 #define COLD_BOOT_STS (1 << 27)
157 #define COLD_RESET_STS (1 << 26)
158 #define WARM_RESET_STS (1 << 25)
159 #define GLOBAL_RESET_STS (1 << 24)
160 #define SRS (1 << 20)
161 #define MS4V (1 << 18)
163 #define SLEEP_AFTER_POWER_FAIL (1 << 0)
164 #define GEN_PMCON1_CLR1_BITS (COLD_BOOT_STS | COLD_RESET_STS | \
165 WARM_RESET_STS | GLOBAL_RESET_STS | \
167 #define GEN_PMCON2 0x1024
168 #define GEN_PMCON3 0x1028
169 # define SLP_S3_ASSERT_WIDTH_SHIFT 10
170 # define SLP_S3_ASSERT_MASK (0x3 << SLP_S3_ASSERT_WIDTH_SHIFT)
171 # define SLP_S3_ASSERT_60_USEC 0x0
172 # define SLP_S3_ASSERT_1_MSEC 0x1
173 # define SLP_S3_ASSERT_50_MSEC 0x2
174 # define SLP_S3_ASSERT_2_SEC 0x3
176 # define CF9_LOCK (1 << 31)
177 # define CF9_GLB_RST (1 << 20)
178 #define GPIO_GPE_CFG 0x1050
179 #define GPE0_DWX_MASK 0xf
180 #define GPE0_DW_SHIFT(x) (4 + 4*(x))
182 #if CONFIG(SOC_INTEL_GEMINILAKE)
183 #define PMC_GPE_AUDIO_31_0 9
184 #define PMC_GPE_N_95_64 8
185 #define PMC_GPE_N_63_32 7
186 #define PMC_GPE_N_31_0 6
187 #define PMC_GPE_NW_127_96 5
188 #define PMC_GPE_NW_95_64 4
189 #define PMC_GPE_NW_63_32 3
190 #define PMC_GPE_NW_31_0 2
191 #define PMC_GPE_SCC_63_32 1
192 #define PMC_GPE_SCC_31_0 0
194 #define PMC_GPE_SW_31_0 0
195 #define PMC_GPE_SW_63_32 1
196 #define PMC_GPE_NW_31_0 3
197 #define PMC_GPE_NW_63_32 4
198 #define PMC_GPE_NW_95_64 5
199 #define PMC_GPE_N_31_0 6
200 #define PMC_GPE_N_63_32 7
201 #define PMC_GPE_W_31_0 9
204 #define IRQ_REG 0x106C
205 #define SCI_IRQ_ADJUST 24
206 #define SCI_IRQ_SEL (255 << SCI_IRQ_ADJUST)
208 #define SCIS_IRQ10 10
209 #define SCIS_IRQ11 11
210 #define SCIS_IRQ20 20
211 #define SCIS_IRQ21 21
212 #define SCIS_IRQ22 22
213 #define SCIS_IRQ23 23
216 #define PSS_MAX_ENTRIES 8
217 #define PSS_RATIO_STEP 2
218 #define PSS_LATENCY_TRANSITION 10
219 #define PSS_LATENCY_BUSMASTER 10
uint16_t get_pmbase(void)
struct chipset_power_state __packed
uint8_t * pmc_mmio_regs(void)
uint32_t prev_sleep_state