Skip to content

Commit 2a9f77e

Browse files
Josh-Tsaikiram9
authored andcommitted
fwk: diagnostic: should reset the diagnostic when power on the system
EC should reset the diagnostic wheh pressing the power button to power on the system. The current EC code only resets the diagnostic when the chipset state in G3. This change adds the condition to reset the diagnostic if the chipset state is S5. BRANCH=fwk-main BUG=https://app.clickup.com/t/86eu0bmgj TEST=Boot into BIOS setup menu and press power button to shutdown the system. The multifunctional LEDs do not blink the diagnostic. TEST=Remove the c cover and press the power button to power on the system 1. Power on from G3 and wait for 90s. The multifunctional LEDs start blinking the diagnostic 2. Power on from S5 and wait for 90s. The multifunctional LEDs start blinking the diagnostic Signed-off-by: Josh Tsai <[email protected]> (cherry picked from commit a8237eb60281d5d90c7557068db5b32df9a5c40d)
1 parent de3833d commit 2a9f77e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

zephyr/program/framework/src/power_button_x86.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,19 @@ static void state_machine(uint64_t tnow)
325325
tnext_state = tnow + PWRBTN_DELAY_T0;
326326
pwrbtn_state = PWRBTN_STATE_T0;
327327
set_pwrbtn_to_pch(0, 0);
328-
cancel_diagnostics();
328+
if (chipset_in_state(CHIPSET_STATE_ON)) {
329+
/**
330+
* System in EFI mode (S0), press power button to shutdown
331+
* the system and cancel the diagnostics.
332+
*/
333+
cancel_diagnostics();
334+
} else if (chipset_in_state(CHIPSET_STATE_SOFT_OFF))
335+
/**
336+
* System in S5 state, press power button to start up the
337+
* system and reset the diagnostics.
338+
*/
339+
reset_diagnostics();
340+
329341
}
330342
}
331343
break;

0 commit comments

Comments
 (0)