diff options
author | BryantOu <Bryant.Ou.Q@gmail.com> | 2020-04-20 19:45:20 -0700 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2020-07-04 11:21:18 +0000 |
commit | 4a8e58fd93c9e3c7fe353026da9c9c2787ccd44b (patch) | |
tree | 39a12b5ecc737a98506d4537188bcece54030e55 /src/arch/x86 | |
parent | b8899ef7e733bb6232a04990c1f55e098a2e37ae (diff) |
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 <Bryant.Ou.Q@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40545
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/smbios.c | 28 |
1 files changed, 28 insertions, 0 deletions
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, |