diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-10-09 17:07:45 -0600 |
---|---|---|
committer | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-10-30 15:25:28 +0000 |
commit | e1a7a26f5e8bcc95d94ae9aec8df5b5226a77f56 (patch) | |
tree | a7b07715b84e2f9936b4b34c1a26776320a42ef8 /payloads/libpayload/libc | |
parent | c70505acee27c7efad4eaa6d18542f794ff98298 (diff) |
lib/libpayload: Replace strapping_ids with new board configuration entry
There are currently 3 different strapping ID entries in the coreboot
table, which adds overhead. The new fw_config field is also desired in
the coreboot table, which is another kind of strapping id. Therefore,
this patch deprecates the 3 current strapping ID entries (board ID, RAM
code, and SKU ID), and adds a new entry ("board_config") which provides
board ID, RAM code, SKU ID, as well as FW_CONFIG together.
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I1ecec847ee77b72233587c1ad7f124e2027470bf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46605
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r-- | payloads/libpayload/libc/coreboot.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index c48b6cffd8..b7d2a537b5 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -143,22 +143,13 @@ static void cb_parse_acpi_gnvs(unsigned char *ptr, struct sysinfo_t *info) info->acpi_gnvs = get_cbmem_addr(ptr); } -static void cb_parse_board_id(unsigned char *ptr, struct sysinfo_t *info) +static void cb_parse_board_config(unsigned char *ptr, struct sysinfo_t *info) { - struct cb_strapping_id *const cbbid = (struct cb_strapping_id *)ptr; - info->board_id = cbbid->id_code; -} - -static void cb_parse_ram_code(unsigned char *ptr, struct sysinfo_t *info) -{ - struct cb_strapping_id *const ram_code = (struct cb_strapping_id *)ptr; - info->ram_code = ram_code->id_code; -} - -static void cb_parse_sku_id(unsigned char *ptr, struct sysinfo_t *info) -{ - struct cb_strapping_id *const sku_id = (struct cb_strapping_id *)ptr; - info->sku_id = sku_id->id_code; + struct cb_board_config *const config = (struct cb_board_config *)ptr; + info->fw_config = cb_unpack64(config->fw_config); + info->board_id = config->board_id; + info->ram_code = config->ram_code; + info->sku_id = config->sku_id; } #if CONFIG(LP_NVRAM) @@ -290,6 +281,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info) info->board_id = UNDEFINED_STRAPPING_ID; info->ram_code = UNDEFINED_STRAPPING_ID; info->sku_id = UNDEFINED_STRAPPING_ID; + info->fw_config = UNDEFINED_FW_CONFIG; /* Now, walk the tables. */ ptr += header->header_bytes; @@ -381,14 +373,8 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info) case CB_TAG_ACPI_GNVS: cb_parse_acpi_gnvs(ptr, info); break; - case CB_TAG_BOARD_ID: - cb_parse_board_id(ptr, info); - break; - case CB_TAG_RAM_CODE: - cb_parse_ram_code(ptr, info); - break; - case CB_TAG_SKU_ID: - cb_parse_sku_id(ptr, info); + case CB_TAG_BOARD_CONFIG: + cb_parse_board_config(ptr, info); break; case CB_TAG_WIFI_CALIBRATION: cb_parse_wifi_calibration(ptr, info); |