diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2014-08-27 23:42:45 +0200 |
---|---|---|
committer | Vladimir Serbinenko <phcoder@gmail.com> | 2014-08-30 20:47:16 +0200 |
commit | 6abb33c7ba5f18ec3e3578cb1f804cbe60e49c49 (patch) | |
tree | e8f1d51157d3c402e6b5a3c78727ed353d52b26a /src/arch/x86 | |
parent | 8603513540f2d0016546db7e03292d4d70424b00 (diff) |
smbios: reorganise OEM strings handling.
OEM strings should not be handled by mobo code but by common code with strings
collected from all devices.
Change-Id: Ibde61a1ca79845670bc0df87dc6c67fa868d48a9
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/6788
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/boot/smbios.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c index 1e720ec87a..9eea38fefb 100644 --- a/src/arch/x86/boot/smbios.c +++ b/src/arch/x86/boot/smbios.c @@ -253,7 +253,7 @@ static int smbios_write_type3(unsigned long *current, int handle) t->bootup_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE; t->thermal_state = SMBIOS_STATE_SAFE; - t->_type = SMBIOS_ENCLOSURE_DESKTOP; + t->_type = SMBIOS_ENCLOSURE_NOTEBOOK; t->security_status = SMBIOS_STATE_SAFE; len = t->length + smbios_string_table_len(t->eos); *current += len; @@ -295,21 +295,31 @@ static int smbios_write_type4(unsigned long *current, int handle) return len; } -int smbios_write_type11(unsigned long *current, int handle, const char **oem_strings, int count) +static int smbios_write_type11(unsigned long *current, int *handle) { struct smbios_type11 *t = (struct smbios_type11 *)*current; - int i, len; + int len; + device_t dev; memset(t, 0, sizeof *t); t->type = SMBIOS_OEM_STRINGS; - t->handle = handle; + t->handle = *handle; t->length = len = sizeof *t - 2; - for (i = 0; i < count; i++) - t->count = smbios_add_string(t->eos, oem_strings[i]); + for(dev = all_devices; dev; dev = dev->next) { + if (dev->ops && dev->ops->get_smbios_strings) + dev->ops->get_smbios_strings(dev, t); + } + + if (t->count == 0) { + memset(t, 0, sizeof *t); + return 0; + } len += smbios_string_table_len(t->eos); + *current += len; + (*handle)++; return len; } @@ -398,6 +408,7 @@ unsigned long smbios_write_tables(unsigned long current) len += smbios_write_type2(¤t, handle++); len += smbios_write_type3(¤t, handle++); len += smbios_write_type4(¤t, handle++); + len += smbios_write_type11(¤t, &handle); #if CONFIG_ELOG len += elog_smbios_write_type15(¤t, handle++); #endif |