|
84 | 84 | #define HAVE_PD_EN 0 |
85 | 85 | #endif |
86 | 86 |
|
| 87 | +// Introduced with Panther Lake, disabled by default |
| 88 | +#ifndef HAVE_VCCST_EN |
| 89 | +#define HAVE_VCCST_EN 0 |
| 90 | +#endif |
| 91 | + |
87 | 92 | #ifndef HAVE_XLP_OUT |
88 | 93 | #define HAVE_XLP_OUT 1 |
89 | 94 | #endif |
@@ -138,12 +143,12 @@ enum PowerState calculate_power_state(void) { |
138 | 143 | #if CONFIG_BUS_ESPI |
139 | 144 | // Use eSPI virtual wires if available |
140 | 145 |
|
141 | | - if (vw_get(&VW_SLP_S4_N) != VWS_HIGH) { |
| 146 | + if (vw_get_ignore_invalid(&VW_SLP_S4_N) != VWS_HIGH) { |
142 | 147 | // S4 plane not powered |
143 | 148 | return POWER_STATE_S5; |
144 | 149 | } |
145 | 150 |
|
146 | | - if (vw_get(&VW_SLP_S3_N) != VWS_HIGH) { |
| 151 | + if (vw_get_ignore_invalid(&VW_SLP_S3_N) != VWS_HIGH) { |
147 | 152 | // S3 plane not powered |
148 | 153 | return POWER_STATE_S3; |
149 | 154 | } |
@@ -201,6 +206,27 @@ void power_init(void) { |
201 | 206 | update_power_state(); |
202 | 207 | } |
203 | 208 |
|
| 209 | +#if HAVE_VCCST_EN |
| 210 | +static void power_vccst_update(void) { |
| 211 | + //TODO: verify against panther lake design guide |
| 212 | + static bool last_vccst_en = false; |
| 213 | + bool vccst_en = gpio_get(&VCCST_EN); |
| 214 | + if (vccst_en != last_vccst_en) { |
| 215 | + if (vccst_en) { |
| 216 | + DEBUG("%02X: VCCST_EN asserted\n", main_cycle); |
| 217 | + |
| 218 | + // Delay for power good |
| 219 | + //TODO: determine ideal delay |
| 220 | + delay_ms(200); |
| 221 | + } else { |
| 222 | + DEBUG("%02X: VCCST_EN de-asserted\n", main_cycle); |
| 223 | + } |
| 224 | + GPIO_SET_DEBUG(VCCST_EN_PG, vccst_en); |
| 225 | + last_vccst_en = vccst_en; |
| 226 | + } |
| 227 | +} |
| 228 | +#endif |
| 229 | + |
204 | 230 | void power_on(void) { |
205 | 231 | // Configure WLAN GPIOs before powering on |
206 | 232 | wireless_power(true); |
@@ -266,6 +292,10 @@ void power_on(void) { |
266 | 292 | break; |
267 | 293 | } |
268 | 294 |
|
| 295 | +#if HAVE_VCCST_EN |
| 296 | + power_vccst_update(); |
| 297 | +#endif |
| 298 | + |
269 | 299 | #if CONFIG_BUS_ESPI |
270 | 300 | // Check for VW changes |
271 | 301 | espi_event(); |
@@ -524,6 +554,10 @@ void power_event(void) { |
524 | 554 | #endif |
525 | 555 | #endif // HAVE_SLP_SUS_N |
526 | 556 |
|
| 557 | +#if HAVE_VCCST_EN |
| 558 | + power_vccst_update(); |
| 559 | +#endif |
| 560 | + |
527 | 561 | #if CONFIG_BUS_ESPI |
528 | 562 | // ESPI systems must keep S5 planes powered unless VW_SUS_PWRDN_ACK is high |
529 | 563 | if (vw_get(&VW_SUS_PWRDN_ACK) == VWS_HIGH) |
|
0 commit comments