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 | |
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>
-rw-r--r-- | src/arch/x86/smbios.c | 28 | ||||
-rw-r--r-- | src/include/smbios.h | 116 |
2 files changed, 144 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, diff --git a/src/include/smbios.h b/src/include/smbios.h index 9edf284cc3..8283a4c73c 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -54,6 +54,12 @@ const char *smbios_chassis_version(void); const char *smbios_chassis_serial_number(void); const char *smbios_processor_serial_number(void); +/* Used by mainboard to add port information of type 8 */ +struct port_information; +int smbios_write_type8(unsigned long *current, int *handle, + const struct port_information *port, + size_t num_ports); + #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) #define BIOS_CHARACTERISTICS_PNP (1 << 9) @@ -211,6 +217,7 @@ typedef enum { SMBIOS_SYSTEM_ENCLOSURE = 3, SMBIOS_PROCESSOR_INFORMATION = 4, SMBIOS_CACHE_INFORMATION = 7, + SMBIOS_PORT_CONNECTOR_INFORMATION = 8, SMBIOS_SYSTEM_SLOTS = 9, SMBIOS_OEM_STRINGS = 11, SMBIOS_EVENT_LOG = 15, @@ -485,6 +492,115 @@ struct smbios_type7 { u8 eos[2]; } __packed; +/* enum for connector types */ +typedef enum { + CONN_NONE = 0x00, + CONN_CENTRONICS = 0x01, + CONN_MINI_CENTRONICS = 0x02, + CONN_PROPRIETARY = 0x03, + CONN_DB_25_PIN_MALE = 0x04, + CONN_DB_25_PIN_FEMALE = 0x05, + CONN_DB_15_PIN_MALE = 0x06, + CONN_DB_15_PIN_FEMALE = 0x07, + CONN_DB_9_PIN_MALE = 0x08, + CONN_DB_9_PIN_FEMALE = 0x09, + CONN_RJ_11 = 0x0A, + CONN_RJ_45 = 0x0B, + CONN_50_PIN_MINI_SCSI = 0x0C, + CONN_MINI_DIN = 0x0D, + CONN_MICRO_DIN = 0x0E, + CONN_PS_2 = 0x0F, + CONN_INFRARED = 0x10, + CONN_HP_HIL = 0x11, + CONN_ACCESS_BUS_USB = 0x12, + CONN_SSA_SCSI = 0x13, + CONN_CIRCULAR_DIN_8_MALE = 0x14, + CONN_CIRCULAR_DIN_8_FEMALE = 0x15, + CONN_ON_BOARD_IDE = 0x16, + CONN_ON_BOARD_FLOPPY = 0x17, + CONN_9_PIN_DUAL_INLINE = 0x18, + CONN_25_PIN_DUAL_INLINE = 0x19, + CONN_50_PIN_DUAL_INLINE = 0x1A, + CONN_68_PIN_DUAL_INLINE = 0x1B, + CONN_ON_BOARD_SOUND_INPUT_FROM_CD_ROM = 0x1C, + CONN_MINI_CENTRONICS_TYPE14 = 0x1D, + CONN_MINI_CENTRONICS_TYPE26 = 0x1E, + CONN_MINI_JACK_HEADPHONES = 0x1F, + CONN_BNC = 0x20, + CONN_1394 = 0x21, + CONN_SAS_SATA = 0x22, + CONN_USB_TYPE_C = 0x23, + CONN_PC_98 = 0xA0, + CONN_PC_98_HIRESO = 0xA1, + CONN_PC_H98 = 0xA2, + CONN_PC98_NOTE = 0xA3, + CONN_PC_98_FULL = 0xA4, + CONN_OTHER = 0xFF, +} type8_connector_types; + +/* enum for port types */ +typedef enum { + TYPE_NONE = 0x00, + TYPE_PARALLEL_PORT_XT_AT_COMPATIBLE = 0x01, + TYPE_PARALLEL_PORT_PS_2 = 0x02, + TYPE_PARALLEL_PORT_ECP = 0x03, + TYPE_PARALLEL_PORT_EPP = 0x04, + TYPE_PARALLEL_PORT_ECP_EPP = 0x05, + TYPE_SERIAL_PORT_XT_AT_COMPATIBLE = 0x06, + TYPE_SERIAL_PORT_16450_COMPATIBLE = 0x07, + TYPE_SERIAL_PORT_16550_COMPATIBLE = 0x08, + TYPE_SERIAL_PORT_16550A_COMPATIBLE = 0x09, + TYPE_SCSI_PORT = 0x0A, + TYPE_MIDI_PORT = 0x0B, + TYPE_JOY_STICK_PORT = 0x0C, + TYPE_KEYBOARD_PORT = 0x0D, + TYPE_MOUSE_PORT = 0x0E, + TYPE_SSA_SCSI = 0x0F, + TYPE_USB = 0x10, + TYPE_FIREWIRE_IEEE_P1394 = 0x11, + TYPE_PCMCIA_TYPE_I = 0x12, + TYPE_PCMCIA_TYPE_II = 0x13, + TYPE_PCMCIA_TYPE_III = 0x14, + TYPE_CARDBUS = 0x15, + TYPE_ACCESS_BUS_PORT = 0x16, + TYPE_SCSI_II = 0x17, + TYPE_SCSI_WIDE = 0x18, + TYPE_PC_98 = 0x19, + TYPE_PC_98_HIRESO = 0x1A, + TYPE_PC_H98 = 0x1B, + TYPE_VIDEO_PORT = 0x1C, + TYPE_AUDIO_PORT = 0x1D, + TYPE_MODEM_PORT = 0x1E, + TYPE_NETWORK_PORT = 0x1F, + TYPE_SATA = 0x20, + TYPE_SAS = 0x21, + TYPE_MFDP = 0x22, + TYPE_THUNDERBOLT = 0x23, + TYPE_8251_COMPATIBLE = 0xA0, + TYPE_8251_FIFO_COMPATIBLE = 0xA1, + TYPE_OTHER = 0xFF, +} type8_port_types; + +struct port_information { + const char *internal_reference_designator; + type8_connector_types internal_connector_type; + const char *external_reference_designator; + type8_connector_types external_connector_type; + type8_port_types port_type; +}; + +struct smbios_type8 { + u8 type; + u8 length; + u16 handle; + u8 internal_reference_designator; + u8 internal_connector_type; + u8 external_reference_designator; + u8 external_connector_type; + u8 port_type; + u8 eos[2]; +} __packed; + /* System Slots - Slot Type */ enum misc_slot_type { SlotTypeOther = 0x01, |