drivers/elog,pc80: Move cmos_post_log()

Do this to remove elog header dependency from pc80/ and
remove some preprocessor guards.

Change-Id: I98044a28c29a2b1756fb25fb593f505e914a71c0
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38189
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki
2020-01-04 15:30:55 +02:00
committed by Patrick Georgi
parent da42724549
commit 8920ee0dcc
4 changed files with 36 additions and 24 deletions

View File

@ -748,16 +748,35 @@ static bool elog_do_add_boot_count(void)
#endif
}
/* Check and log POST codes from previous boot */
static void log_last_boot_post(void)
{
#if CONFIG(ARCH_X86)
u8 code;
u32 extra;
if (!CONFIG(CMOS_POST))
return;
if (cmos_post_previous_boot(&code, &extra) == 0)
return;
printk(BIOS_WARNING, "POST: Unexpected post code/extra "
"in previous boot: 0x%02x/0x%04x\n", code, extra);
elog_add_event_word(ELOG_TYPE_LAST_POST_CODE, code);
/* Always zero with !CMOS_POST_EXTRA. */
if (extra)
elog_add_event_dword(ELOG_TYPE_POST_EXTRA, extra);
#endif
}
static void elog_add_boot_count(void)
{
if (elog_do_add_boot_count()) {
elog_add_event_dword(ELOG_TYPE_BOOT, boot_count_read());
#if CONFIG(ARCH_X86)
/* Check and log POST codes from previous boot */
if (CONFIG(CMOS_POST))
cmos_post_log();
#endif
log_last_boot_post();
}
}