Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protectli vault ehl/f9 and boot logo #354

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/config.protectli_vp2420
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CONFIG_POST_DEVICE_LPC=y
CONFIG_POST_IO_PORT=0x80
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_REPOSITORY="https://github.com/Dasharo/edk2"
CONFIG_EDK2_TAG_OR_REV="19bf14b42b5705d9737cb4cba273fc80534de740"
CONFIG_EDK2_TAG_OR_REV="746b760876708faf438b2d89cfeb4b3798606d5f"
CONFIG_EDK2_USE_EDK2_PLATFORMS=y
CONFIG_EDK2_PLATFORMS_REPOSITORY="https://github.com/Dasharo/edk2-platforms"
CONFIG_EDK2_PLATFORMS_TAG_OR_REV="3323ed481d35096fb6a7eae7b49f35eff00f86cf"
Expand Down
4 changes: 3 additions & 1 deletion src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#define CBMEM_ID_SMM_COMBUFFER 0x53534d32
#define CBMEM_ID_TYPE_C_INFO 0x54595045
#define CBMEM_ID_MEM_CHIP_INFO 0x5048434D
#define CBMEM_ID_TIANOCORE_LOGO 0x42475254

#define CBMEM_ID_TO_NAME_TABLE \
{ CBMEM_ID_ACPI, "ACPI " }, \
Expand Down Expand Up @@ -157,5 +158,6 @@
{ CBMEM_ID_FSP_LOGO, "FSP LOGO "}, \
{ CBMEM_ID_SMM_COMBUFFER, "SMM COMBUFFER"}, \
{ CBMEM_ID_TYPE_C_INFO, "TYPE_C INFO"},\
{ CBMEM_ID_MEM_CHIP_INFO, "MEM CHIP INFO"}
{ CBMEM_ID_MEM_CHIP_INFO, "MEM CHIP INFO"},\
{ CBMEM_ID_TIANOCORE_LOGO, "UEFI LOGO "}
#endif /* _CBMEM_ID_H_ */
9 changes: 9 additions & 0 deletions src/commonlib/include/commonlib/coreboot_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ enum {
LB_TAG_TYPE_C_INFO = 0x0042,
LB_TAG_ACPI_RSDP = 0x0043,
LB_TAG_PCIE = 0x0044,
LB_TAG_LOGO = 0x00a0,
/* The following options are CMOS-related */
LB_TAG_CMOS_OPTION_TABLE = 0x00c8,
LB_TAG_OPTION = 0x00c9,
Expand Down Expand Up @@ -573,4 +574,12 @@ struct lb_acpi_rsdp {
lb_uint64_t rsdp_pointer; /* Address of the ACPI RSDP */
};

/*
* Bootlogo header for TianoCore boot logo
* * size Contains the size of the BMP file
*/
struct bootlogo_header {
uint64_t size;
} __packed;

#endif
32 changes: 32 additions & 0 deletions src/lib/coreboot_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ static void add_cbmem_pointers(struct lb_header *header)
{CBMEM_ID_FMAP, LB_TAG_FMAP},
{CBMEM_ID_VBOOT_WORKBUF, LB_TAG_VBOOT_WORKBUF},
{CBMEM_ID_TYPE_C_INFO, LB_TAG_TYPE_C_INFO},
{CBMEM_ID_TIANOCORE_LOGO, LB_TAG_LOGO},
};
int i;

Expand Down Expand Up @@ -403,6 +404,37 @@ void __weak lb_board(struct lb_header *header) { /* NOOP */ }
*/
void __weak lb_spi_flash(struct lb_header *header) { /* NOOP */ }


/*
* Allocator for bootlogo that prepends a header to the logo CBMEM entry
*/
static void *logo_cbmem_allocator(void *arg, size_t size, const union cbfs_mdata *unused)
{
struct bootlogo_header header;
void *logo_loc;

header.size = size;
logo_loc = cbmem_entry_start(cbmem_entry_add((uintptr_t)arg, size + sizeof(header)));
memcpy(logo_loc, &header, sizeof(header));
return logo_loc + sizeof(header);
}

/*
* Loads the logo bitmap file from the BOOTSPLASH fmap region into CBMEM
*/
static void tianocore_logo_load(int ignored)
{
size_t logo_size;

cbfs_unverified_area_alloc("BOOTSPLASH",
"logo.bmp",
logo_cbmem_allocator,
(void *)CBMEM_ID_TIANOCORE_LOGO,
&logo_size);
}

CBMEM_READY_HOOK(tianocore_logo_load);

static struct lb_forward *lb_forward(struct lb_header *header,
struct lb_header *next_header)
{
Expand Down
2 changes: 2 additions & 0 deletions src/mainboard/protectli/vault_ehl/vboot-rwa.fmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ FLASH 16M {

CONSOLE 0x20000

BOOTSPLASH(CBFS) 1M

RW_SECTION_A {
VBLOCK_A 0x2000
FW_MAIN_A(CBFS)
Expand Down