From e175c4a364801ffc3cd5a1012d920cb2beb6bd6b Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 26 Oct 2011 23:33:16 +0000 Subject: Use new VBNV section in coreboot table ... rather than parsing the coreboot option table BUG=none TEST=boot tested on Stumpy Signed-off-by: Stefan Reinauer Change-Id: I0814dd6c37cf826fda55a0f4acd6a1763b0626db Reviewed-on: https://gerrit.chromium.org/gerrit/10758 Reviewed-by: Duncan Laurie --- arch/x86/cpu/coreboot/tables.c | 36 ++++++------------------------- arch/x86/include/asm/ic/coreboot/tables.h | 8 +++++++ 2 files changed, 15 insertions(+), 29 deletions(-) (limited to 'arch/x86') diff --git a/arch/x86/cpu/coreboot/tables.c b/arch/x86/cpu/coreboot/tables.c index 90994aed15..5d4fd66a51 100644 --- a/arch/x86/cpu/coreboot/tables.c +++ b/arch/x86/cpu/coreboot/tables.c @@ -78,31 +78,12 @@ static void cb_parse_serial(unsigned char *ptr, struct sysinfo_t *info) info->ser_ioport = ser->baseaddr; } -static void cb_parse_optiontable(unsigned char *ptr, struct sysinfo_t *info) +static void cb_parse_vbnv(unsigned char *ptr, struct sysinfo_t *info) { - struct cb_cmos_option_table *otp = (struct cb_cmos_option_table *)ptr; - struct cb_cmos_entries* cme; - - info->option_table = otp; - cme = (struct cb_cmos_entries*) ((u32) otp + otp->header_length); - /* find the offset and size of the vbnv area */ - while ((((char*) cme - (char*)otp) < otp->size) && - (cme->tag == CB_TAG_OPTION)) { - if (!strncmp("vbnv", (char*) cme->name, sizeof(cme->name))) { - info->vbnv_start = cme->bit >> 3; - info->vbnv_size = cme->length >> 3; - break; - } - cme = (struct cb_cmos_entries*) ((char*)cme + cme->size); - } -} + struct cb_vbnv *vbnv = (struct cb_vbnv *)ptr; -static void cb_parse_checksum(unsigned char *ptr, struct sysinfo_t *info) -{ - struct cb_cmos_checksum *cmos_cksum = (struct cb_cmos_checksum *)ptr; - info->cmos_range_start = cmos_cksum->range_start; - info->cmos_range_end = cmos_cksum->range_end; - info->cmos_checksum_location = cmos_cksum->location; + info->vbnv_start = vbnv->vbnv_start; + info->vbnv_size = vbnv->vbnv_size; } static void cb_parse_gpios(unsigned char *ptr, struct sysinfo_t *info) @@ -202,12 +183,6 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info) case CB_TAG_SERIAL: cb_parse_serial(ptr, info); break; - case CB_TAG_CMOS_OPTION_TABLE: - cb_parse_optiontable(ptr, info); - break; - case CB_TAG_OPTION_CHECKSUM: - cb_parse_checksum(ptr, info); - break; case CB_TAG_VERSION: cb_parse_string(ptr, &info->version); break; @@ -261,6 +236,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info) case CB_TAG_MRC_CACHE: cb_parse_mrc_cache(ptr, info); break; + case CB_TAG_VBNV: + cb_parse_vbnv(ptr, info); + break; } ptr += rec->size; diff --git a/arch/x86/include/asm/ic/coreboot/tables.h b/arch/x86/include/asm/ic/coreboot/tables.h index fb14ccd39f..31eaab02c4 100644 --- a/arch/x86/include/asm/ic/coreboot/tables.h +++ b/arch/x86/include/asm/ic/coreboot/tables.h @@ -205,6 +205,14 @@ struct cb_cbmem_tab { void *cbmem_tab; }; +#define CB_TAG_VBNV 0x0019 +struct cb_vbnv { + uint32_t tag; + uint32_t size; + uint32_t vbnv_start; + uint32_t vbnv_size; +}; + #define CB_TAG_CMOS_OPTION_TABLE 0x00c8 struct cb_cmos_option_table { u32 tag; -- cgit v1.2.3