Skip to content

Commit 098e6ce

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 <Josh_Tsai@compal.com> (cherry picked from commit a8237eb)
1 parent 076ccef commit 098e6ce

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
@@ -366,7 +366,19 @@ static void state_machine(uint64_t tnow)
366366
tnext_state = tnow + PWRBTN_DELAY_T0;
367367
pwrbtn_state = PWRBTN_STATE_T0;
368368
set_pwrbtn_to_pch(0, 0);
369-
cancel_diagnostics();
369+
if (chipset_in_state(CHIPSET_STATE_ON)) {
370+
/**
371+
* System in EFI mode (S0), press power button to shutdown
372+
* the system and cancel the diagnostics.
373+
*/
374+
cancel_diagnostics();
375+
} else if (chipset_in_state(CHIPSET_STATE_SOFT_OFF))
376+
/**
377+
* System in S5 state, press power button to start up the
378+
* system and reset the diagnostics.
379+
*/
380+
reset_diagnostics();
381+
370382
}
371383
}
372384
break;

0 commit comments

Comments
 (0)