diff options
Diffstat (limited to 'payloads/libpayload/arch')
-rw-r--r-- | payloads/libpayload/arch/arm/coreboot.c | 15 | ||||
-rw-r--r-- | payloads/libpayload/arch/arm64/coreboot.c | 15 | ||||
-rw-r--r-- | payloads/libpayload/arch/x86/coreboot.c | 15 |
3 files changed, 45 insertions, 0 deletions
diff --git a/payloads/libpayload/arch/arm/coreboot.c b/payloads/libpayload/arch/arm/coreboot.c index c7f371e908..a1c3675ab9 100644 --- a/payloads/libpayload/arch/arm/coreboot.c +++ b/payloads/libpayload/arch/arm/coreboot.c @@ -143,6 +143,12 @@ static void cb_parse_mrc_cache(unsigned char *ptr, struct sysinfo_t *info) info->mrc_cache = phys_to_virt(cbmem->cbmem_tab); } +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; +} + #ifdef CONFIG_LP_NVRAM static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info) { @@ -196,6 +202,12 @@ static int cb_parse_header(void *addr, struct sysinfo_t *info) info->header = header; + /* + * Valid board IDs are small numbers, preset this to an invalid value + * for the case when firmware does not supply the board ID. + */ + info->board_id = ~0; + /* Now, walk the tables. */ ptr += header->header_bytes; @@ -288,6 +300,9 @@ static int cb_parse_header(void *addr, struct sysinfo_t *info) case CB_TAG_MRC_CACHE: cb_parse_mrc_cache(ptr, info); break; + case CB_TAG_BOARD_ID: + cb_parse_board_id(ptr, info); + break; } ptr += rec->size; diff --git a/payloads/libpayload/arch/arm64/coreboot.c b/payloads/libpayload/arch/arm64/coreboot.c index 6c671c8628..6d7c95580a 100644 --- a/payloads/libpayload/arch/arm64/coreboot.c +++ b/payloads/libpayload/arch/arm64/coreboot.c @@ -143,6 +143,12 @@ static void cb_parse_mrc_cache(unsigned char *ptr, struct sysinfo_t *info) info->mrc_cache = phys_to_virt(cbmem->cbmem_tab); } +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; +} + #ifdef CONFIG_LP_NVRAM static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info) { @@ -196,6 +202,12 @@ static int cb_parse_header(void *addr, struct sysinfo_t *info) info->header = header; + /* + * Valid board IDs are small numbers, preset this to an invalid value + * for the case when firmware does not supply the board ID. + */ + info->board_id = ~0; + /* Now, walk the tables. */ ptr += header->header_bytes; @@ -288,6 +300,9 @@ static int cb_parse_header(void *addr, struct sysinfo_t *info) case CB_TAG_MRC_CACHE: cb_parse_mrc_cache(ptr, info); break; + case CB_TAG_BOARD_ID: + cb_parse_board_id(ptr, info); + break; } ptr += rec->size; diff --git a/payloads/libpayload/arch/x86/coreboot.c b/payloads/libpayload/arch/x86/coreboot.c index a4635576a3..43fde9f660 100644 --- a/payloads/libpayload/arch/x86/coreboot.c +++ b/payloads/libpayload/arch/x86/coreboot.c @@ -141,6 +141,12 @@ static void cb_parse_acpi_gnvs(unsigned char *ptr, struct sysinfo_t *info) info->acpi_gnvs = phys_to_virt(cbmem->cbmem_tab); } +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; +} + #ifdef CONFIG_LP_NVRAM static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info) { @@ -206,6 +212,12 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info) info->header = header; + /* + * Valid board IDs are small numbers, preset this to an invalid value + * for the case when firmware does not supply the board ID. + */ + info->board_id = ~0; + /* Now, walk the tables. */ ptr += header->header_bytes; @@ -300,6 +312,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info) case CB_TAG_X86_ROM_MTRR: cb_parse_x86_rom_var_mtrr(ptr, info); break; + case CB_TAG_BOARD_ID: + cb_parse_board_id(ptr, info); + break; } ptr += rec->size; |