Skip to content

Commit

Permalink
lib/coreboot_table: optional UEFI capsules support
Browse files Browse the repository at this point in the history
Add weak lb_uefi_capsules() to be used to optionally add LB_TAG_CAPSULE
entries to coreboot table.

Change-Id: Ic4161e9c6fb503463efa30674af0b3e6ad845456
Signed-off-by: Sergii Dmytruk <[email protected]>
  • Loading branch information
SergiiDmytruk committed May 18, 2024
1 parent ce0e69f commit 45984e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/commonlib/include/commonlib/coreboot_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ enum {
LB_TAG_ACPI_RSDP = 0x0043,
LB_TAG_PCIE = 0x0044,
LB_TAG_LOGO = 0x00a0,
LB_TAG_CAPSULE = 0x00b0, /* far from upstream values */
/* The following options are CMOS-related */
LB_TAG_CMOS_OPTION_TABLE = 0x00c8,
LB_TAG_OPTION = 0x00c9,
Expand Down
3 changes: 3 additions & 0 deletions src/include/boot/coreboot_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ enum cb_err fill_lb_pcie(struct lb_pcie *pcie);
/* Define this in mainboard.c to add board-specific table entries. */
void lb_board(struct lb_header *header);

/* Define this somewhere to add LB_TAG_CAPSULE table entries. */
void lb_uefi_capsules(struct lb_header *header);

/* Define this function to fill in the frame buffer returning 0 on success and
< 0 on error. */
int fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
Expand Down
5 changes: 5 additions & 0 deletions src/lib/coreboot_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ static void lb_record_version_timestamp(struct lb_header *header)

void __weak lb_board(struct lb_header *header) { /* NOOP */ }

void __weak lb_uefi_capsules(struct lb_header *header) { /* NOOP */ }

/*
* It's possible that the system is using a SPI flash as the boot device,
* however it is not probing for devices to fill in specifics. In that
Expand Down Expand Up @@ -573,6 +575,9 @@ static uintptr_t write_coreboot_table(uintptr_t rom_table_end)
/* Add board-specific table entries, if any. */
lb_board(head);

/* Possibly add UEFI capsules. */
lb_uefi_capsules(head);

if (CONFIG(CHROMEOS_RAMOOPS))
lb_ramoops(head);

Expand Down

0 comments on commit 45984e8

Please sign in to comment.