Skip to content

Commit ce45457

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 a322cd2 commit ce45457

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

zephyr/program/framework/marigold/src/power_button_x86.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,19 @@ static void state_machine(uint64_t tnow)
317317
tnext_state = tnow + PWRBTN_DELAY_T0;
318318
pwrbtn_state = PWRBTN_STATE_T0;
319319
set_pwrbtn_to_pch(0, 0);
320-
cancel_diagnostics();
320+
if (chipset_in_state(CHIPSET_STATE_ON)) {
321+
/**
322+
* System in EFI mode (S0), press power button to shutdown
323+
* the system and cancel the diagnostics.
324+
*/
325+
cancel_diagnostics();
326+
} else if (chipset_in_state(CHIPSET_STATE_SOFT_OFF))
327+
/**
328+
* System in S5 state, press power button to start up the
329+
* system and reset the diagnostics.
330+
*/
331+
reset_diagnostics();
332+
321333
}
322334
}
323335
break;

0 commit comments

Comments
 (0)