drv/intel/fsp2_0: Add FW Splash Screen event log entries

This patch adds logic for logging the FW splash screen event to
the event log.

There could be three possible scenarios as below:

1. Platform w/o FW splash screen (i.e., either HAVE_FSP_LOGO_SUPPORT
or BMP_LOGO configs not enabled)

Expectation: Firmware Splash Screen (ELOG_TYPE_FW_SPLASH_SCREEN) not
present in the event log.

39 | 2023-08-27 12:42:54-0700 | System boot | 12
40 | 2023-08-27 12:42:54-0700 | ACPI Wake | S5
41 | 2023-08-27 12:42:54-0700 | Wake Source | Power Button | 0

2. Platform w/ FW splash screen (i.e., both HAVE_FSP_LOGO_SUPPORT
and BMP_LOGO configs are enabled)

Expectation: Firmware Splash Screen (ELOG_TYPE_FW_SPLASH_SCREEN) is
enabled in the event log.

34 | 2023-08-27 12:07:29-0700 | System boot | 11
35 | 2023-08-27 12:07:29-0700 | Firmware Splash Screen | Enabled
36 | 2023-08-27 12:07:31-0700 | ACPI Wake | S5
37 | 2023-08-27 12:07:31-0700 | Wake Source | Power Button | 0

3. Failed to render FW splash screen (due to any reason if FSP failed
to render the splash screen)

Expectation: Firmware Splash Screen (ELOG_TYPE_FW_SPLASH_SCREEN) is
disabled in the event log.

43 | 2023-08-27 13:06:10-0700 | System boot | 13
44 | 2023-08-27 13:06:10-0700 | Firmware Splash Screen | Disabled
45 | 2023-08-27 13:06:11-0700 | ACPI Wake | S5
46 | 2023-08-27 13:06:11-0700 | Wake Source | Power Button | 0

BUG=b:284799726
TEST=Verify that the event shows up in the event log when the user
selects the HAVE_FSP_LOGO_SUPPORT and BMP_LOGO configs to display
the firmware splash screen.

Change-Id: Ie9e09acff5443c31b881c300134bc0bb06c490c6
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77509
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
This commit is contained in:
Subrata Banik 2023-08-27 20:42:26 +00:00
parent 1cfb28612e
commit 68e642f5cb
1 changed files with 27 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#include <boot/coreboot_tables.h>
#include <console/console.h>
#include <elog.h>
#include <fsp/graphics.h>
#include <fsp/util.h>
#include <soc/intel/common/vbt.h>
@ -48,6 +49,28 @@ static const struct fsp_framebuffer {
[pixel_bgrx_8bpc] = { {16, 8}, {8, 8}, {0, 8}, {24, 8} },
};
enum fw_splash_screen_status {
FW_SPLASH_SCREEN_DISABLED,
FW_SPLASH_SCREEN_ENABLED,
};
/*
* Update elog with Firmware Splash Screen related information
* based on enum fw_splash_screen_status.
*
* Possible values for input argument are:
* TRUE - FSP initializes display when BMP_LOGO config is enabled.
* FALSE - Failed to initialize display although BMP_LOGO config is selected.
*
* Ignore if BMP_LOGO config is not selected.
*/
static void update_fw_splash_screen_event(enum fw_splash_screen_status status)
{
if (!CONFIG(BMP_LOGO))
return;
elog_add_event_byte(ELOG_TYPE_FW_SPLASH_SCREEN, status);
}
void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar,
enum lb_fb_orientation orientation)
@ -62,6 +85,7 @@ void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar,
*/
if (!framebuffer_bar) {
printk(BIOS_ALERT, "Framebuffer BAR invalid\n");
update_fw_splash_screen_event(FW_SPLASH_SCREEN_DISABLED);
return;
}
@ -69,15 +93,18 @@ void fsp_report_framebuffer_info(const uintptr_t framebuffer_bar,
if (!ginfo) {
printk(BIOS_ALERT, "Graphics hand-off block not found\n");
update_fw_splash_screen_event(FW_SPLASH_SCREEN_DISABLED);
return;
}
if (ginfo->pixel_format >= ARRAY_SIZE(fsp_framebuffer_format_map)) {
printk(BIOS_ALERT, "FSP set unknown framebuffer format: %d\n",
ginfo->pixel_format);
update_fw_splash_screen_event(FW_SPLASH_SCREEN_DISABLED);
return;
}
update_fw_splash_screen_event(FW_SPLASH_SCREEN_ENABLED);
fbinfo = fsp_framebuffer_format_map + ginfo->pixel_format;
const struct lb_framebuffer fb = {