Bryant Ou has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 149 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index c047d75..eb383b2 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -890,6 +890,41 @@
return len; } + +const struct port_information *__weak smbios_get_port_info(size_t *num_port) +{ + *num_port = 0; + return NULL; +} + +static int smbios_write_type8(unsigned long *current, int *handle) +{ + int len = sizeof(struct smbios_type8); + int totallen = 0, i; + const struct port_information *port; + size_t num_port; + + port = smbios_get_port_info(&num_port); + for (i = 0; i < num_port; 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, @@ -1187,6 +1222,8 @@ handle++)); len += smbios_write_type7_cache_parameters(¤t, &handle, &max_struct_size, type4); + update_max(len, max_struct_size, smbios_write_type8(¤t, + &handle)); update_max(len, max_struct_size, smbios_write_type11(¤t, &handle)); if (CONFIG(ELOG)) diff --git a/src/include/smbios.h b/src/include/smbios.h index 184b2c8..60d9364 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -52,6 +52,8 @@ u8 smbios_mainboard_feature_flags(void); const char *smbios_mainboard_location_in_chassis(void);
+const struct port_information *smbios_get_port_info(size_t *num_port); + #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) #define BIOS_CHARACTERISTICS_PNP (1 << 9) @@ -209,6 +211,7 @@ 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, @@ -483,6 +486,115 @@ u8 eos[2]; } __packed;
+/* enum for connector types */ +enum type8_connector_types { + 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, +}; + +/* enum for port types */ +enum type8_port_types { + 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, +}; + +struct port_information { + const char *internal_reference_designator; + uint8_t internal_connector_type; + const char *external_reference_designator; + uint8_t external_connector_type; + uint8_t port_type; +}; + +struct smbios_type8 { + uint8_t type; + uint8_t length; + uint16_t handle; + uint8_t internal_reference_designator; + uint8_t internal_connector_type; + uint8_t external_reference_designator; + uint8_t external_connector_type; + uint8_t port_type; + uint8_t eos[2]; +} __packed; + /* System Slots - Slot Type */ enum misc_slot_type { SlotTypeOther = 0x01,
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40545/1/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/1/src/include/smbios.h@583 PS1, Line 583: uint8_t port_type; trailing whitespace
Hello build bot (Jenkins), Andrey Petrov, Jonathan Zhang, Ryback Hung, Tim Chen, David Hendricks,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#2).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- A 0003-arch-x86-smbios-Add-SMBIOS-type8-data.patch M src/arch/x86/smbios.c M src/include/smbios.h 3 files changed, 360 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 2:
(5 comments)
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... File 0003-arch-x86-smbios-Add-SMBIOS-type8-data.patch:
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 22: trailing whitespace
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 79: trailing whitespace
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 96: trailing whitespace
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 191: + uint8_t port_type; trailing whitespace
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 209: -- trailing whitespace
Hello build bot (Jenkins), Andrey Petrov, Jonathan Zhang, Ryback Hung, Tim Chen, David Hendricks,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#3).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 149 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/3
Bryant Ou has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 3:
(6 comments)
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... File 0003-arch-x86-smbios-Add-SMBIOS-type8-data.patch:
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 22:
trailing whitespace
Done
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 79:
trailing whitespace
Done
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 96:
trailing whitespace
Done
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 191: + uint8_t port_type;
trailing whitespace
Done
https://review.coreboot.org/c/coreboot/+/40545/2/0003-arch-x86-smbios-Add-SM... PS2, Line 209: --
trailing whitespace
Done
https://review.coreboot.org/c/coreboot/+/40545/1/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/1/src/include/smbios.h@583 PS1, Line 583: uint8_t port_type;
trailing whitespace
Done
Bryant Ou has removed Tim Chen from this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Removed reviewer Tim Chen.
Bryant Ou has removed Tim Chen from this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Removed reviewer Tim Chen.
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 3:
(4 comments)
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c@894 PS3, Line 894: const struct port_information *__weak smbios_get_port_info(size_t *num_port) Let's use num_ports instead of num_port.
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c@918 PS3, Line 918: smbios_add_string(t->eos, port->external_reference_designator); Should t->eos be changed? Does this collide with internal_reference_designator?
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h@55 PS3, Line 55: const struct port_information *smbios_get_port_info(size_t *num_port); Please add comments on what's expected for this function.
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h@583 PS3, Line 583: uint8_t port_type; These two members have typo for the space character?
Hello build bot (Jenkins), Andrey Petrov, Jonathan Zhang, Ryback Hung, David Hendricks, Tim Chu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#4).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 150 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/4
Bryant Ou has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 4:
(4 comments)
Patch Set 3:
(4 comments)
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c@894 PS3, Line 894: const struct port_information *__weak smbios_get_port_info(size_t *num_port)
Let's use num_ports instead of num_port.
Done
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c@918 PS3, Line 918: smbios_add_string(t->eos, port->external_reference_designator);
Should t->eos be changed? Does this collide with internal_reference_designator?
smbios_add_string function would increase the start value according to last pointer. The data looks good for my testing.
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h@55 PS3, Line 55: const struct port_information *smbios_get_port_info(size_t *num_port);
Please add comments on what's expected for this function.
Done
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h@583 PS3, Line 583: uint8_t port_type;
These two members have typo for the space character?
It looks good, but I don't know why they have error here. I've updated it again.
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 4: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/3/src/arch/x86/smbios.c@918 PS3, Line 918: smbios_add_string(t->eos, port->external_reference_designator);
smbios_add_string function would increase the start value according to last pointer. […]
Ack
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/3/src/include/smbios.h@583 PS3, Line 583: uint8_t port_type;
It looks good, but I don't know why they have error here. I've updated it again.
Ack
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/40545/4/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/4/src/arch/x86/smbios.c@894 PS4, Line 894: const struct port_information *__weak smbios_get_port_info(size_t *num_ports) that's usually used to option a single string or object
https://review.coreboot.org/c/coreboot/+/40545/4/src/arch/x86/smbios.c@900 PS4, Line 900: static int smbios_write_type8(unsigned long *current, int *handle) I'd prefer a "type9" or "type38" solution. That is either implement smbios_walk_device_tree_type8 or call smbios_write_type8 in the mainboard.c by iterating over the connectors, like it's done for smbios_write_type38.
Hello build bot (Jenkins), Andrey Petrov, Jonathan Zhang, Ryback Hung, David Hendricks, Tim Chu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#5).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 144 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/5
Hello build bot (Jenkins), Andrey Petrov, Jonathan Zhang, Ryback Hung, David Hendricks, Tim Chu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#6).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 144 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/6
Bryant Ou has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 6:
(2 comments)
Patch Set 4:
(2 comments)
I've updated it.
https://review.coreboot.org/c/coreboot/+/40545/4/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/4/src/arch/x86/smbios.c@894 PS4, Line 894: const struct port_information *__weak smbios_get_port_info(size_t *num_ports)
that's usually used to option a single string or object
Ack
https://review.coreboot.org/c/coreboot/+/40545/4/src/arch/x86/smbios.c@900 PS4, Line 900: static int smbios_write_type8(unsigned long *current, int *handle)
I'd prefer a "type9" or "type38" solution. […]
Done
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40545/6/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/6/src/arch/x86/smbios.c@899 PS6, Line 899: int unsigned int
Hello build bot (Jenkins), Andrey Petrov, Jonathan Zhang, Ryback Hung, David Hendricks, Tim Chu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#7).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 144 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/7
Bryant Ou has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 7:
(1 comment)
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/40545/6/src/arch/x86/smbios.c File src/arch/x86/smbios.c:
https://review.coreboot.org/c/coreboot/+/40545/6/src/arch/x86/smbios.c@899 PS6, Line 899: int
unsigned int
Done
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 7: Code-Review+1
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 7: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@586 PS7, Line 586: uint8_t why are you not using the enums defined above? You need to include this header anyway.
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@591 PS7, Line 591: uint8_t other struct use the kernel notation u8
Bryant Ou has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 7:
(2 comments)
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@586 PS7, Line 586: uint8_t
why are you not using the enums defined above? […]
I just follow other's way
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@591 PS7, Line 591: uint8_t
other struct use the kernel notation u8
Someone ask me not to use C99 type, I'm not so sure which one I need to use for typedef, it seems both them are fine in coreboot's coding style, could you instruct me how to use it? thanks.
Jonathan Zhang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 7:
(2 comments)
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@586 PS7, Line 586: uint8_t
I just follow other's way
it is better to use enums defined above here.
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@591 PS7, Line 591: uint8_t
Someone ask me not to use C99 type, I'm not so sure which one I need to use for typedef, it seems bo […]
Hi Bryant, a rule is to use/follow same style in a file. So you could use kernel notation for your additions to follow existing style, but then have another commit to change the style.
Hello Philipp Deppenwiese, build bot (Jenkins), Andrey Petrov, Patrick Rudolph, Jonathan Zhang, Ryback Hung, David Hendricks, Tim Chu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40545
to look at the new patch set (#8).
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 144 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/40545/8
Bryant Ou has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 8:
(2 comments)
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h File src/include/smbios.h:
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@586 PS7, Line 586: uint8_t
it is better to use enums defined above here.
Done
https://review.coreboot.org/c/coreboot/+/40545/7/src/include/smbios.h@591 PS7, Line 591: uint8_t
Hi Bryant, a rule is to use/follow same style in a file. […]
Done
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 8: Code-Review+1
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
Patch Set 8: Code-Review+2
Philipp Deppenwiese has submitted this change. ( https://review.coreboot.org/c/coreboot/+/40545 )
Change subject: arch/x86/smbios: Add SMBIOS type8 data ......................................................................
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 --- M src/arch/x86/smbios.c M src/include/smbios.h 2 files changed, 144 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified HAOUAS Elyes: Looks good to me, but someone else must approve Patrick Rudolph: Looks good to me, approved
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index d102d10..3c5799b 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -964,6 +964,34 @@
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 9edf284..8283a4c 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -54,6 +54,12 @@ 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 @@ 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 @@ 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,