|
36 | 36 | #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) |
37 | 37 |
|
38 | 38 | static int forcing_shutdown; /* Forced shutdown in progress? */ |
| 39 | +static int custom_forcing_shutdown; |
39 | 40 |
|
40 | 41 | /* |
41 | 42 | * define wake source for keep PCH power |
@@ -75,6 +76,7 @@ void chipset_force_shutdown(enum chipset_shutdown_reason reason) |
75 | 76 | if (!chipset_in_state(CHIPSET_STATE_ANY_OFF)) { |
76 | 77 | report_ap_reset(reason); |
77 | 78 | forcing_shutdown = 1; |
| 79 | + custom_forcing_shutdown = 1; |
78 | 80 | chipset_force_g3(); |
79 | 81 | /* we need to clear the wake source to avoid the wrong power state */ |
80 | 82 | *host_get_customer_memmap(0x02) = 0x00; |
@@ -114,8 +116,10 @@ int keep_pch_power(void) |
114 | 116 |
|
115 | 117 | system_get_bbram(SYSTEM_BBRAM_IDX_VPRO_STATUS, &vpro_change); |
116 | 118 |
|
117 | | - if (forcing_shutdown) |
| 119 | + if (custom_forcing_shutdown && power_get_state() == POWER_S5G3) { |
| 120 | + custom_forcing_shutdown = 0; |
118 | 121 | return false; |
| 122 | + } |
119 | 123 | else if (version & BIT(0) && extpower_is_present() && vpro_change) |
120 | 124 | return true; |
121 | 125 | #ifdef CONFIG_EMI_REGION1 |
@@ -397,11 +401,9 @@ enum power_state power_handle_state(enum power_state state) |
397 | 401 | case POWER_S5: |
398 | 402 | CPRINTS("PH S5"); |
399 | 403 |
|
400 | | - if (forcing_shutdown) { |
| 404 | + if (custom_forcing_shutdown) |
401 | 405 | /* force shutdown process shouldn't keep PCH power */ |
402 | | - forcing_shutdown = 0; |
403 | 406 | return POWER_S5G3; |
404 | | - } |
405 | 407 |
|
406 | 408 | if (power_s5_up || stress_test_enable) { |
407 | 409 | /* Wait S5 signal when power up from S5 */ |
|
0 commit comments