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)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user