From 4a8e58fd93c9e3c7fe353026da9c9c2787ccd44b Mon Sep 17 00:00:00 2001 From: BryantOu Date: Mon, 20 Apr 2020 19:45:20 -0700 Subject: arch/x86/smbios: Add SMBIOS type8 data Refer to section 7.9 Port Connector Information of DSP0134_3.3.0 to add type 8 data, the table of data should be ported according to platform design and MB silkscreen. Change-Id: I81e25d27c9c6717750edf1d547e5f4cfb8f1da14 Signed-off-by: BryantOu Reviewed-on: https://review.coreboot.org/c/coreboot/+/40545 Tested-by: build bot (Jenkins) Reviewed-by: HAOUAS Elyes Reviewed-by: Patrick Rudolph --- src/arch/x86/smbios.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/arch/x86') diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index d102d10758..3c5799bca8 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -964,6 +964,34 @@ static int smbios_write_type7_cache_parameters(unsigned long *current, return len; } + +int smbios_write_type8(unsigned long *current, int *handle, + const struct port_information *port, + size_t num_ports) +{ + int len = sizeof(struct smbios_type8); + unsigned int totallen = 0, i; + + for (i = 0; i < num_ports; i++, port++) { + struct smbios_type8 *t = (struct smbios_type8 *)*current; + memset(t, 0, sizeof(struct smbios_type8)); + t->type = SMBIOS_PORT_CONNECTOR_INFORMATION; + t->handle = *handle; + t->length = len - 2; + t->internal_reference_designator = + smbios_add_string(t->eos, port->internal_reference_designator); + t->internal_connector_type = port->internal_connector_type; + t->external_reference_designator = + smbios_add_string(t->eos, port->external_reference_designator); + t->external_connector_type = port->external_connector_type; + t->port_type = port->port_type; + *handle += 1; + *current += t->length + smbios_string_table_len(t->eos); + totallen += t->length + smbios_string_table_len(t->eos); + } + return totallen; +} + int smbios_write_type9(unsigned long *current, int *handle, const char *name, const enum misc_slot_type type, const enum slot_data_bus_bandwidth bandwidth, -- cgit v1.2.3