lib: Add support for different bootsplash types

This commit introduces an enumerated type `bootsplash_type` to
differentiate between various bootsplash logos, such as
`BOOTSPLASH_LOW_BATTERY` and `BOOTSPLASH_CENTER`.

A `bootsplash_list` array is added to map these types to their
corresponding default filenames. A new function,
`bmp_get_logo_filename`, is provided to retrieve the correct logo
filename based on the specified bootsplash type. This function also
handles overriding the `BOOTSPLASH_CENTER` logo name if
`CONFIG(HAVE_CUSTOM_BMP_LOGO)` is enabled.

The `bmp_load_logo` function is updated to utilize the new
`bootsplash_type` and `bmp_get_logo_filename` to dynamically select the
appropriate logo for display. This change streamlines logo management
and improves flexibility for different boot scenarios.

BUG=b:423591644
TEST=Able to build and boot google/fatcat. FW splash screen looks
proper.

Change-Id: I882deda56b5d30bb15cc7def408c4ea479ffd6ba
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88052
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
Subrata Banik 2025-06-11 14:29:16 +05:30
commit a1dbb4076c
2 changed files with 31 additions and 7 deletions

View file

@ -5,6 +5,16 @@
#include <types.h>
enum bootsplash_type {
/* Indicates a low battery bootsplash logo. */
BOOTSPLASH_LOW_BATTERY,
/* Indicates a Main OEM defined bootsplash logo for center of the splash screen. */
BOOTSPLASH_CENTER,
/* It's used to determine the total number of bootsplash types. */
BOOTSPLASH_MAX_NUM,
};
/**
* Sets up the framebuffer with the bootsplash.jpg from cbfs.
* Returns 0 on success