Skip to content

Commit 00220bf

Browse files
Josh-Tsaiamstan
authored andcommitted
fwk: minipc-diagnostic: execute the diagnostic if boot fail
If the mainboard issue causes the system to fail not boot successfully, EC should execute the diagnostic. BRANCH=fwk-dogwood-27111 BUG=EC does not execute the diagnostic if boot fail TEST=check the EC log will print diagnostic log if boot fail ec:~> [296.619200 Boot issue: HW 0x00000524 BIOS: 0x0000] [296.622800 Power] [296.624600 PSU POK: No ] [296.628600 12V OK: Yes] [296.632500 SLP S5: No ] [296.636400 SLP S4: No ] [296.640300 HW PGOOD VR: Yes] [296.644300 HW power glitch: Yes] [296.648500 Peripheral Device] [296.651100 No Fan: No ] [296.655000 No Thermal Sensor: No ] [296.659000 No DDR: No ] [296.662900 Miscellaneous] [296.665400 No S0: Yes] [296.669400 Device (Diag) Complete: No ] [296.673300 BIOS Complete: No ] Signed-off-by: Josh Tsai <Josh_Tsai@compal.com>
1 parent 530f66c commit 00220bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

zephyr/program/framework/src/diagnostics_minipc.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,21 @@ static bool diagnostics_tick(void)
193193

194194
}
195195

196+
void diagnostics_check_boot_fail(void)
197+
{
198+
/* If the system boot fail, we should run the diagnostics to show the errer */
199+
if ((hw_diagnostics & BIT(DIAGNOSTICS_NO_S0)) == BIT(DIAGNOSTICS_NO_S0))
200+
return;
201+
202+
if (device_diagnostic_is_completed)
203+
return;
204+
205+
/* Call deferred hook to check the device */
206+
CPRINTS("dbg: run project diagnostics");
207+
project_diagnostics();
208+
}
209+
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, diagnostics_check_boot_fail, HOOK_PRIO_DEFAULT);
210+
196211
static void diagnostics_check(void)
197212
{
198213
if (device_diagnostic_is_completed)

0 commit comments

Comments
 (0)