From 2e029ac6a67a3d4ceb6e4825217e60f062ab7e65 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 5 Dec 2017 13:43:56 -0800 Subject: libpayload: Minor board ID / RAM code cleanups This patch mirrors recent cleanups in coreboot regarding the strapping ID entries in the coreboot table. Change-Id: Ia5c3728daf2cb317f8e2bc72c6f1714d6cb4d080 Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/22742 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- payloads/libpayload/libc/coreboot.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'payloads/libpayload/libc') diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index 10b801c5ed..1efde9a332 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -147,14 +147,14 @@ static void cb_parse_acpi_gnvs(unsigned char *ptr, struct sysinfo_t *info) static void cb_parse_board_id(unsigned char *ptr, struct sysinfo_t *info) { - struct cb_board_id *const cbbid = (struct cb_board_id *)ptr; - info->board_id = cbbid->board_id; + 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_ram_code *const ram_code = (struct cb_ram_code *)ptr; - info->ram_code = ram_code->ram_code; + struct cb_strapping_id *const ram_code = (struct cb_strapping_id *)ptr; + info->ram_code = ram_code->id_code; } #if IS_ENABLED(CONFIG_LP_NVRAM) @@ -277,13 +277,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info) info->header = header; - /* - * Board straps represented by numerical values are small numbers. - * Preset them to an invalid value in case the firmware does not - * supply the info. - */ - info->board_id = ~0; - info->ram_code = ~0; + /* Initialize IDs as undefined in case they don't show up in table. */ + info->board_id = UNDEFINED_STRAPPING_ID; + info->ram_code = UNDEFINED_STRAPPING_ID; /* Now, walk the tables. */ ptr += header->header_bytes; -- cgit v1.2.3