aboutsummaryrefslogtreecommitdiff
path: root/src/lib/coreboot_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/coreboot_table.c')
-rw-r--r--src/lib/coreboot_table.c79
1 files changed, 23 insertions, 56 deletions
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index 857f5a52c3..69ded3c700 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -12,6 +12,7 @@
#include <boardid.h>
#include <device/device.h>
#include <fmap.h>
+#include <fw_config.h>
#include <stdlib.h>
#include <cbfs.h>
#include <cbmem.h>
@@ -213,23 +214,7 @@ static void lb_vbnv(struct lb_header *header)
__weak uint32_t board_id(void) { return UNDEFINED_STRAPPING_ID; }
__weak uint32_t ram_code(void) { return UNDEFINED_STRAPPING_ID; }
__weak uint32_t sku_id(void) { return UNDEFINED_STRAPPING_ID; }
-
-static void lb_board_id(struct lb_header *header)
-{
- struct lb_strapping_id *rec;
- uint32_t bid = board_id();
-
- if (bid == UNDEFINED_STRAPPING_ID)
- return;
-
- rec = (struct lb_strapping_id *)lb_new_record(header);
-
- rec->tag = LB_TAG_BOARD_ID;
- rec->size = sizeof(*rec);
- rec->id_code = bid;
-
- printk(BIOS_INFO, "Board ID: %d\n", bid);
-}
+__weak uint64_t fw_config_get(void) { return UNDEFINED_FW_CONFIG; }
static void lb_boot_media_params(struct lb_header *header)
{
@@ -257,40 +242,6 @@ static void lb_boot_media_params(struct lb_header *header)
bmp->fmap_offset = get_fmap_flash_offset();
}
-static void lb_ram_code(struct lb_header *header)
-{
- struct lb_strapping_id *rec;
- uint32_t code = ram_code();
-
- if (code == UNDEFINED_STRAPPING_ID)
- return;
-
- rec = (struct lb_strapping_id *)lb_new_record(header);
-
- rec->tag = LB_TAG_RAM_CODE;
- rec->size = sizeof(*rec);
- rec->id_code = code;
-
- printk(BIOS_INFO, "RAM code: %d\n", code);
-}
-
-static void lb_sku_id(struct lb_header *header)
-{
- struct lb_strapping_id *rec;
- uint32_t sid = sku_id();
-
- if (sid == UNDEFINED_STRAPPING_ID)
- return;
-
- rec = (struct lb_strapping_id *)lb_new_record(header);
-
- rec->tag = LB_TAG_SKU_ID;
- rec->size = sizeof(*rec);
- rec->id_code = sid;
-
- printk(BIOS_INFO, "SKU ID: %d\n", sid);
-}
-
static void lb_mmc_info(struct lb_header *header)
{
struct lb_mmc_info *rec;
@@ -370,6 +321,24 @@ static struct lb_mainboard *lb_mainboard(struct lb_header *header)
return mainboard;
}
+static struct lb_board_config *lb_board_config(struct lb_header *header)
+{
+ struct lb_record *rec;
+ struct lb_board_config *config;
+ rec = lb_new_record(header);
+ config = (struct lb_board_config *)rec;
+
+ config->tag = LB_TAG_BOARD_CONFIG;
+ config->size = sizeof(*config);
+
+ config->board_id = board_id();
+ config->ram_code = ram_code();
+ config->sku_id = sku_id();
+ config->fw_config = pack_lb64(fw_config_get());
+
+ return config;
+}
+
#if CONFIG(USE_OPTION_TABLE)
static struct cmos_checksum *lb_cmos_checksum(struct lb_header *header)
{
@@ -536,11 +505,6 @@ static uintptr_t write_coreboot_table(uintptr_t rom_table_end)
lb_vbnv(head);
#endif
- /* Add strapping IDs if available */
- lb_board_id(head);
- lb_ram_code(head);
- lb_sku_id(head);
-
/* Pass mmc early init status */
lb_mmc_info(head);
@@ -563,6 +527,9 @@ static uintptr_t write_coreboot_table(uintptr_t rom_table_end)
lb_boot_media_params(head);
+ /* Board configuration information (including straps) */
+ lb_board_config(head);
+
/* Add architecture records. */
lb_arch_add_records(head);