Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 2 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 3 | #ifndef SMBIOS_H |
| 4 | #define SMBIOS_H |
| 5 | |
| 6 | #include <types.h> |
Lijian Zhao | 10ea93c | 2019-04-11 00:45:10 -0700 | [diff] [blame] | 7 | #include <memory_info.h> |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 8 | |
| 9 | unsigned long smbios_write_tables(unsigned long start); |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 10 | int smbios_add_string(u8 *start, const char *str); |
| 11 | int smbios_string_table_len(u8 *start); |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 12 | |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 13 | /* Used by mainboard to add an on-board device */ |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 14 | enum misc_slot_type; |
| 15 | enum misc_slot_length; |
| 16 | enum misc_slot_usage; |
| 17 | enum slot_data_bus_bandwidth; |
| 18 | int smbios_write_type9(unsigned long *current, int *handle, |
| 19 | const char *name, const enum misc_slot_type type, |
| 20 | const enum slot_data_bus_bandwidth bandwidth, |
| 21 | const enum misc_slot_usage usage, |
| 22 | const enum misc_slot_length length, |
| 23 | u8 slot_char1, u8 slot_char2, u8 bus, u8 dev_func); |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 24 | enum smbios_bmc_interface_type; |
| 25 | int smbios_write_type38(unsigned long *current, int *handle, |
| 26 | const enum smbios_bmc_interface_type interface_type, |
| 27 | const u8 ipmi_rev, const u8 i2c_addr, const u8 nv_addr, |
| 28 | const u64 base_addr, const u8 base_modifier, |
| 29 | const u8 irq); |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 30 | int smbios_write_type41(unsigned long *current, int *handle, |
| 31 | const char *name, u8 instance, u16 segment, |
Christian Walter | e6afab1 | 2019-05-21 17:22:49 +0200 | [diff] [blame] | 32 | u8 bus, u8 device, u8 function, u8 device_type); |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 33 | |
Nico Huber | ebd8a4f | 2017-11-01 09:49:16 +0100 | [diff] [blame] | 34 | const char *smbios_system_manufacturer(void); |
| 35 | const char *smbios_system_product_name(void); |
| 36 | const char *smbios_system_serial_number(void); |
| 37 | const char *smbios_system_version(void); |
| 38 | void smbios_system_set_uuid(u8 *uuid); |
| 39 | const char *smbios_system_sku(void); |
| 40 | |
Andrey Petrov | 2e032f0 | 2019-10-23 15:31:51 -0700 | [diff] [blame] | 41 | unsigned int smbios_cpu_get_max_speed_mhz(void); |
| 42 | unsigned int smbios_cpu_get_current_speed_mhz(void); |
| 43 | |
Gerd Hoffmann | 0626274 | 2013-11-13 13:37:23 +0100 | [diff] [blame] | 44 | const char *smbios_mainboard_manufacturer(void); |
| 45 | const char *smbios_mainboard_product_name(void); |
Christian Gmeiner | ac3aa09 | 2012-07-25 13:42:40 +0200 | [diff] [blame] | 46 | const char *smbios_mainboard_serial_number(void); |
| 47 | const char *smbios_mainboard_version(void); |
Nico Huber | ebd8a4f | 2017-11-01 09:49:16 +0100 | [diff] [blame] | 48 | |
Vladimir Serbinenko | 63acd22 | 2014-06-01 00:26:48 +0200 | [diff] [blame] | 49 | const char *smbios_mainboard_bios_version(void); |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 50 | const char *smbios_mainboard_asset_tag(void); |
| 51 | u8 smbios_mainboard_feature_flags(void); |
| 52 | const char *smbios_mainboard_location_in_chassis(void); |
Christian Gmeiner | ac3aa09 | 2012-07-25 13:42:40 +0200 | [diff] [blame] | 53 | |
Elyes HAOUAS | 3233cf4 | 2019-02-14 17:46:02 +0100 | [diff] [blame] | 54 | #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) |
| 55 | #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) |
| 56 | #define BIOS_CHARACTERISTICS_PNP (1 << 9) |
| 57 | #define BIOS_CHARACTERISTICS_APM (1 << 10) |
| 58 | #define BIOS_CHARACTERISTICS_UPGRADEABLE (1 << 11) |
| 59 | #define BIOS_CHARACTERISTICS_SHADOW (1 << 12) |
| 60 | #define BIOS_CHARACTERISTICS_BOOT_FROM_CD (1 << 15) |
| 61 | #define BIOS_CHARACTERISTICS_SELECTABLE_BOOT (1 << 16) |
| 62 | #define BIOS_CHARACTERISTICS_BIOS_SOCKETED (1 << 17) |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 63 | |
Elyes HAOUAS | 3233cf4 | 2019-02-14 17:46:02 +0100 | [diff] [blame] | 64 | #define BIOS_EXT1_CHARACTERISTICS_ACPI (1 << 0) |
| 65 | #define BIOS_EXT2_CHARACTERISTICS_TARGET (1 << 2) |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 66 | |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 67 | #define BIOS_MEMORY_ECC_SINGLE_BIT_CORRECTING (1 << 3) |
| 68 | #define BIOS_MEMORY_ECC_DOUBLE_BIT_CORRECTING (1 << 4) |
| 69 | #define BIOS_MEMORY_ECC_SCRUBBING (1 << 5) |
| 70 | |
| 71 | #define MEMORY_TYPE_DETAIL_OTHER (1 << 1) |
| 72 | #define MEMORY_TYPE_DETAIL_UNKNOWN (1 << 2) |
| 73 | #define MEMORY_TYPE_DETAIL_FAST_PAGED (1 << 3) |
| 74 | #define MEMORY_TYPE_DETAIL_STATIC_COLUMN (1 << 4) |
| 75 | #define MEMORY_TYPE_DETAIL_PSEUDO_STATIC (1 << 5) |
| 76 | #define MEMORY_TYPE_DETAIL_RAMBUS (1 << 6) |
| 77 | #define MEMORY_TYPE_DETAIL_SYNCHRONOUS (1 << 7) |
| 78 | #define MEMORY_TYPE_DETAIL_CMOS (1 << 8) |
| 79 | #define MEMORY_TYPE_DETAIL_EDO (1 << 9) |
| 80 | #define MEMORY_TYPE_DETAIL_WINDOW_DRAM (1 << 10) |
| 81 | #define MEMORY_TYPE_DETAIL_CACHE_DRAM (1 << 11) |
| 82 | #define MEMORY_TYPE_DETAIL_NON_VOLATILE (1 << 12) |
| 83 | #define MEMORY_TYPE_DETAIL_REGISTERED (1 << 13) |
| 84 | #define MEMORY_TYPE_DETAIL_UNBUFFERED (1 << 14) |
Elyes HAOUAS | 1db2346 | 2019-02-14 17:49:47 +0100 | [diff] [blame] | 85 | #define MEMORY_TYPE_DETAIL_LRDIMM (1 << 15) |
| 86 | |
| 87 | #define MEMORY_TECHNOLOGY_OTHER 0x01 |
| 88 | #define MEMORY_TECHNOLOGY_UNKNOWN 0x02 |
| 89 | #define MEMORY_TECHNOLOGY_DRAM 0x03 |
| 90 | #define MEMORY_TECHNOLOGY_NVDIMM_N 0x04 |
| 91 | #define MEMORY_TECHNOLOGY_NVDIMM_F 0x05 |
| 92 | #define MEMORY_TECHNOLOGY_NVDIMM_P 0x06 |
| 93 | #define MEMORY_TECHNOLOGY_INTEL_PERSISTENT 0x07 |
| 94 | |
| 95 | #define MEMORY_OPERATING_MODE_CAP_OTHER (1 << 1) |
| 96 | #define MEMORY_OPERATING_MODE_CAP_UNKNOWN (1 << 2) |
| 97 | #define MEMORY_OPERATING_MODE_CAP_VOLATILE (1 << 3) |
| 98 | #define MEMORY_OPERATING_MODE_CAP_BYTE_ACCESS_PERSISTENT (1 << 4) |
| 99 | #define MEMORY_OPERATING_MODE_CAP_BLOCK_ACCESS_PERSISTENT (1 << 5) |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 100 | |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 101 | typedef enum { |
Lee Leahy | 0be6d93 | 2015-06-26 11:15:42 -0700 | [diff] [blame] | 102 | MEMORY_BUS_WIDTH_8 = 0, |
| 103 | MEMORY_BUS_WIDTH_16 = 1, |
| 104 | MEMORY_BUS_WIDTH_32 = 2, |
| 105 | MEMORY_BUS_WIDTH_64 = 3, |
| 106 | MEMORY_BUS_WIDTH_128 = 4, |
| 107 | MEMORY_BUS_WIDTH_256 = 5, |
| 108 | MEMORY_BUS_WIDTH_512 = 6, |
| 109 | MEMORY_BUS_WIDTH_1024 = 7, |
| 110 | MEMORY_BUS_WIDTH_MAX = 7, |
| 111 | } smbios_memory_bus_width; |
| 112 | |
| 113 | typedef enum { |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 114 | MEMORY_FORMFACTOR_OTHER = 0x01, |
| 115 | MEMORY_FORMFACTOR_UNKNOWN = 0x02, |
| 116 | MEMORY_FORMFACTOR_SIMM = 0x03, |
| 117 | MEMORY_FORMFACTOR_SIP = 0x04, |
| 118 | MEMORY_FORMFACTOR_CHIP = 0x05, |
| 119 | MEMORY_FORMFACTOR_DIP = 0x06, |
| 120 | MEMORY_FORMFACTOR_ZIP = 0x07, |
| 121 | MEMORY_FORMFACTOR_PROPRIETARY_CARD = 0x08, |
| 122 | MEMORY_FORMFACTOR_DIMM = 0x09, |
| 123 | MEMORY_FORMFACTOR_TSOP = 0x0a, |
| 124 | MEMORY_FORMFACTOR_ROC = 0x0b, |
| 125 | MEMORY_FORMFACTOR_RIMM = 0x0c, |
| 126 | MEMORY_FORMFACTOR_SODIMM = 0x0d, |
| 127 | MEMORY_FORMFACTOR_SRIMM = 0x0e, |
| 128 | MEMORY_FORMFACTOR_FBDIMM = 0x0f, |
Elyes HAOUAS | 86b683a | 2019-10-08 16:30:43 +0200 | [diff] [blame] | 129 | MEMORY_FORMFACTOR_DIE = 0x10, |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 130 | } smbios_memory_form_factor; |
| 131 | |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 132 | typedef enum { |
| 133 | MEMORY_TYPE_OTHER = 0x01, |
| 134 | MEMORY_TYPE_UNKNOWN = 0x02, |
| 135 | MEMORY_TYPE_DRAM = 0x03, |
| 136 | MEMORY_TYPE_EDRAM = 0x04, |
| 137 | MEMORY_TYPE_VRAM = 0x05, |
| 138 | MEMORY_TYPE_SRAM = 0x06, |
| 139 | MEMORY_TYPE_RAM = 0x07, |
| 140 | MEMORY_TYPE_ROM = 0x08, |
| 141 | MEMORY_TYPE_FLASH = 0x09, |
| 142 | MEMORY_TYPE_EEPROM = 0x0a, |
| 143 | MEMORY_TYPE_FEPROM = 0x0b, |
| 144 | MEMORY_TYPE_EPROM = 0x0c, |
| 145 | MEMORY_TYPE_CDRAM = 0x0d, |
| 146 | MEMORY_TYPE_3DRAM = 0x0e, |
| 147 | MEMORY_TYPE_SDRAM = 0x0f, |
| 148 | MEMORY_TYPE_SGRAM = 0x10, |
| 149 | MEMORY_TYPE_RDRAM = 0x11, |
| 150 | MEMORY_TYPE_DDR = 0x12, |
| 151 | MEMORY_TYPE_DDR2 = 0x13, |
| 152 | MEMORY_TYPE_DDR2_FBDIMM = 0x14, |
| 153 | MEMORY_TYPE_DDR3 = 0x18, |
| 154 | MEMORY_TYPE_FBD2 = 0x19, |
Elyes HAOUAS | 28114ae | 2018-11-14 17:51:00 +0100 | [diff] [blame] | 155 | MEMORY_TYPE_DDR4 = 0x1a, |
| 156 | MEMORY_TYPE_LPDDR = 0x1b, |
| 157 | MEMORY_TYPE_LPDDR2 = 0x1c, |
| 158 | MEMORY_TYPE_LPDDR3 = 0x1d, |
| 159 | MEMORY_TYPE_LPDDR4 = 0x1e, |
| 160 | MEMORY_TYPE_LOGICAL_NON_VOLATILE_DEVICE = 0x1f, |
Elyes HAOUAS | 86b683a | 2019-10-08 16:30:43 +0200 | [diff] [blame] | 161 | MEMORY_TYPE_HBM = 0x20, |
| 162 | MEMORY_TYPE_HBM2 = 0x21, |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 163 | } smbios_memory_type; |
| 164 | |
| 165 | typedef enum { |
| 166 | MEMORY_ARRAY_LOCATION_OTHER = 0x01, |
| 167 | MEMORY_ARRAY_LOCATION_UNKNOWN = 0x02, |
| 168 | MEMORY_ARRAY_LOCATION_SYSTEM_BOARD = 0x03, |
| 169 | MEMORY_ARRAY_LOCATION_ISA_ADD_ON = 0x04, |
| 170 | MEMORY_ARRAY_LOCATION_EISA_ADD_ON = 0x05, |
| 171 | MEMORY_ARRAY_LOCATION_PCI_ADD_ON = 0x06, |
| 172 | MEMORY_ARRAY_LOCATION_MCA_ADD_ON = 0x07, |
| 173 | MEMORY_ARRAY_LOCATION_PCMCIA_ADD_ON = 0x08, |
| 174 | MEMORY_ARRAY_LOCATION_PROPRIETARY_ADD_ON = 0x09, |
| 175 | MEMORY_ARRAY_LOCATION_NUBUS = 0x0a, |
| 176 | MEMORY_ARRAY_LOCATION_PC_98_C20_ADD_ON = 0xa0, |
| 177 | MEMORY_ARRAY_LOCATION_PC_98_C24_ADD_ON = 0xa1, |
| 178 | MEMORY_ARRAY_LOCATION_PC_98_E_ADD_ON = 0xa2, |
| 179 | MEMORY_ARRAY_LOCATION_PC_98_LOCAL_BUS_ADD_ON = 0xa3, |
Elyes HAOUAS | 77fe213 | 2019-10-29 08:42:03 +0100 | [diff] [blame] | 180 | MEMORY_ARRAY_LOCATION_CXL_FLEXBUS_1_0_ADD_ON = 0xa4, |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 181 | } smbios_memory_array_location; |
| 182 | |
| 183 | typedef enum { |
| 184 | MEMORY_ARRAY_USE_OTHER = 0x01, |
| 185 | MEMORY_ARRAY_USE_UNKNOWN = 0x02, |
| 186 | MEMORY_ARRAY_USE_SYSTEM = 0x03, |
| 187 | MEMORY_ARRAY_USE_VIDEO = 0x04, |
| 188 | MEMORY_ARRAY_USE_FLASH = 0x05, |
| 189 | MEMORY_ARRAY_USE_NVRAM = 0x06, |
| 190 | MEMORY_ARRAY_USE_CACHE = 0x07, |
| 191 | } smbios_memory_array_use; |
| 192 | |
| 193 | typedef enum { |
| 194 | MEMORY_ARRAY_ECC_OTHER = 0x01, |
| 195 | MEMORY_ARRAY_ECC_UNKNOWN = 0x02, |
| 196 | MEMORY_ARRAY_ECC_NONE = 0x03, |
| 197 | MEMORY_ARRAY_ECC_PARITY = 0x04, |
| 198 | MEMORY_ARRAY_ECC_SINGLE_BIT = 0x05, |
| 199 | MEMORY_ARRAY_ECC_MULTI_BIT = 0x06, |
| 200 | MEMORY_ARRAY_ECC_CRC = 0x07, |
| 201 | } smbios_memory_array_ecc; |
| 202 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 203 | #define SMBIOS_STATE_SAFE 3 |
| 204 | typedef enum { |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 205 | SMBIOS_BIOS_INFORMATION = 0, |
| 206 | SMBIOS_SYSTEM_INFORMATION = 1, |
| 207 | SMBIOS_BOARD_INFORMATION = 2, |
| 208 | SMBIOS_SYSTEM_ENCLOSURE = 3, |
| 209 | SMBIOS_PROCESSOR_INFORMATION = 4, |
| 210 | SMBIOS_CACHE_INFORMATION = 7, |
| 211 | SMBIOS_SYSTEM_SLOTS = 9, |
| 212 | SMBIOS_OEM_STRINGS = 11, |
| 213 | SMBIOS_EVENT_LOG = 15, |
| 214 | SMBIOS_PHYS_MEMORY_ARRAY = 16, |
| 215 | SMBIOS_MEMORY_DEVICE = 17, |
| 216 | SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS = 19, |
| 217 | SMBIOS_SYSTEM_BOOT_INFORMATION = 32, |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 218 | SMBIOS_IPMI_DEVICE_INFORMATION = 38, |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 219 | SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION = 41, |
| 220 | SMBIOS_END_OF_TABLE = 127, |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 221 | } smbios_struct_type_t; |
| 222 | |
| 223 | struct smbios_entry { |
| 224 | u8 anchor[4]; |
| 225 | u8 checksum; |
| 226 | u8 length; |
| 227 | u8 major_version; |
| 228 | u8 minor_version; |
| 229 | u16 max_struct_size; |
| 230 | u8 entry_point_rev; |
| 231 | u8 formwatted_area[5]; |
| 232 | u8 intermediate_anchor_string[5]; |
| 233 | u8 intermediate_checksum; |
| 234 | u16 struct_table_length; |
| 235 | u32 struct_table_address; |
| 236 | u16 struct_count; |
| 237 | u8 smbios_bcd_revision; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 238 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 239 | |
| 240 | struct smbios_type0 { |
| 241 | u8 type; |
| 242 | u8 length; |
| 243 | u16 handle; |
| 244 | u8 vendor; |
| 245 | u8 bios_version; |
| 246 | u16 bios_start_segment; |
| 247 | u8 bios_release_date; |
| 248 | u8 bios_rom_size; |
| 249 | u64 bios_characteristics; |
| 250 | u8 bios_characteristics_ext1; |
| 251 | u8 bios_characteristics_ext2; |
| 252 | u8 system_bios_major_release; |
| 253 | u8 system_bios_minor_release; |
| 254 | u8 ec_major_release; |
| 255 | u8 ec_minor_release; |
Elyes HAOUAS | 358cbb3 | 2019-02-14 14:19:22 +0100 | [diff] [blame] | 256 | u16 extended_bios_rom_size; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 257 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 258 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 259 | |
| 260 | struct smbios_type1 { |
| 261 | u8 type; |
| 262 | u8 length; |
| 263 | u16 handle; |
| 264 | u8 manufacturer; |
| 265 | u8 product_name; |
| 266 | u8 version; |
| 267 | u8 serial_number; |
| 268 | u8 uuid[16]; |
| 269 | u8 wakeup_type; |
| 270 | u8 sku; |
| 271 | u8 family; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 272 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 273 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 274 | |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 275 | typedef enum { |
| 276 | SMBIOS_BOARD_TYPE_UNKNOWN = 0x01, |
| 277 | SMBIOS_BOARD_TYPE_OTHER = 0x02, |
| 278 | SMBIOS_BOARD_TYPE_SERVER_BLADE = 0x03, |
| 279 | SMBIOS_BOARD_TYPE_CONNECTIVITY_SWITCH = 0x04, |
| 280 | SMBIOS_BOARD_TYPE_SYSTEM_MANAGEMENT_MODULE = 0x05, |
| 281 | SMBIOS_BOARD_TYPE_PROCESSOR_MODULE = 0x06, |
| 282 | SMBIOS_BOARD_TYPE_IO_MODULE = 0x07, |
| 283 | SMBIOS_BOARD_TYPE_MEMORY_MODULE = 0x08, |
| 284 | SMBIOS_BOARD_TYPE_DAUGHTER_BOARD = 0x09, |
| 285 | SMBIOS_BOARD_TYPE_MOTHERBOARD = 0x0a, |
| 286 | SMBIOS_BOARD_TYPE_PROCESSOR_MEMORY_MODULE = 0x0b, |
| 287 | SMBIOS_BOARD_TYPE_PROCESSOR_IO_MODULE = 0x0c, |
| 288 | SMBIOS_BOARD_TYPE_INTERCONNECT_BOARD = 0x0d, |
| 289 | } smbios_board_type; |
| 290 | |
Vladimir Serbinenko | 47089f2 | 2014-03-02 19:14:44 +0100 | [diff] [blame] | 291 | struct smbios_type2 { |
| 292 | u8 type; |
| 293 | u8 length; |
| 294 | u16 handle; |
| 295 | u8 manufacturer; |
| 296 | u8 product_name; |
| 297 | u8 version; |
| 298 | u8 serial_number; |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 299 | u8 asset_tag; |
| 300 | u8 feature_flags; |
| 301 | u8 location_in_chassis; |
| 302 | u16 chassis_handle; |
| 303 | u8 board_type; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 304 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 305 | } __packed; |
Vladimir Serbinenko | 47089f2 | 2014-03-02 19:14:44 +0100 | [diff] [blame] | 306 | |
Mathew King | be820b3 | 2019-10-31 12:10:44 -0600 | [diff] [blame] | 307 | typedef enum { |
Elyes HAOUAS | 25dbc17 | 2017-07-04 21:38:03 +0200 | [diff] [blame] | 308 | SMBIOS_ENCLOSURE_OTHER = 0x01, |
| 309 | SMBIOS_ENCLOSURE_UNKNOWN = 0x02, |
| 310 | SMBIOS_ENCLOSURE_DESKTOP = 0x03, |
| 311 | SMBIOS_ENCLOSURE_LOW_PROFILE_DESKTOP = 0x04, |
| 312 | SMBIOS_ENCLOSURE_PIZZA_BOX = 0x05, |
| 313 | SMBIOS_ENCLOSURE_MINI_TOWER = 0x06, |
| 314 | SMBIOS_ENCLOSURE_TOWER = 0x07, |
| 315 | SMBIOS_ENCLOSURE_PORTABLE = 0x08, |
| 316 | SMBIOS_ENCLOSURE_LAPTOP = 0x09, |
| 317 | SMBIOS_ENCLOSURE_NOTEBOOK = 0x0a, |
| 318 | SMBIOS_ENCLOSURE_HAND_HELD = 0x0b, |
| 319 | SMBIOS_ENCLOSURE_DOCKING_STATION = 0x0c, |
| 320 | SMBIOS_ENCLOSURE_ALL_IN_ONE = 0x0d, |
| 321 | SMBIOS_ENCLOSURE_SUB_NOTEBOOK = 0x0e, |
| 322 | SMBIOS_ENCLOSURE_SPACE_SAVING = 0x0f, |
| 323 | SMBIOS_ENCLOSURE_LUNCH_BOX = 0x10, |
| 324 | SMBIOS_ENCLOSURE_MAIN_SERVER_CHASSIS = 0x11, |
| 325 | SMBIOS_ENCLOSURE_EXPANSION_CHASSIS = 0x12, |
| 326 | SMBIOS_ENCLOSURE_SUBCHASSIS = 0x13, |
| 327 | SMBIOS_ENCLOSURE_BUS_EXPANSION_CHASSIS = 0x14, |
| 328 | SMBIOS_ENCLOSURE_PERIPHERAL_CHASSIS = 0x15, |
| 329 | SMBIOS_ENCLOSURE_RAID_CHASSIS = 0x16, |
| 330 | SMBIOS_ENCLOSURE_RACK_MOUNT_CHASSIS = 0x17, |
| 331 | SMBIOS_ENCLOSURE_SEALED_CASE_PC = 0x18, |
| 332 | SMBIOS_ENCLOSURE_MULTI_SYSTEM_CHASSIS = 0x19, |
| 333 | SMBIOS_ENCLOSURE_COMPACT_PCI = 0x1a, |
| 334 | SMBIOS_ENCLOSURE_ADVANCED_TCA = 0x1b, |
| 335 | SMBIOS_ENCLOSURE_BLADE = 0x1c, |
| 336 | SMBIOS_ENCLOSURE_BLADE_ENCLOSURE = 0x1d, |
| 337 | SMBIOS_ENCLOSURE_TABLET = 0x1e, |
| 338 | SMBIOS_ENCLOSURE_CONVERTIBLE = 0x1f, |
| 339 | SMBIOS_ENCLOSURE_DETACHABLE = 0x20, |
| 340 | SMBIOS_ENCLOSURE_IOT_GATEWAY = 0x21, |
| 341 | SMBIOS_ENCLOSURE_EMBEDDED_PC = 0x22, |
| 342 | SMBIOS_ENCLOSURE_MINI_PC = 0x23, |
| 343 | SMBIOS_ENCLOSURE_STICK_PC = 0x24, |
Mathew King | be820b3 | 2019-10-31 12:10:44 -0600 | [diff] [blame] | 344 | } smbios_enclosure_type; |
Vladimir Serbinenko | 71c0bf6 | 2014-08-27 23:23:14 +0200 | [diff] [blame] | 345 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 346 | struct smbios_type3 { |
| 347 | u8 type; |
| 348 | u8 length; |
| 349 | u16 handle; |
| 350 | u8 manufacturer; |
| 351 | u8 _type; |
| 352 | u8 version; |
| 353 | u8 serial_number; |
| 354 | u8 asset_tag_number; |
| 355 | u8 bootup_state; |
| 356 | u8 power_supply_state; |
| 357 | u8 thermal_state; |
| 358 | u8 security_status; |
| 359 | u32 oem_defined; |
| 360 | u8 height; |
| 361 | u8 number_of_power_cords; |
| 362 | u8 element_count; |
| 363 | u8 element_record_length; |
Matt DeVillier | 4863cc4 | 2016-09-01 00:55:40 -0500 | [diff] [blame] | 364 | u8 sku_number; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 365 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 366 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 367 | |
| 368 | struct smbios_type4 { |
| 369 | u8 type; |
| 370 | u8 length; |
| 371 | u16 handle; |
| 372 | u8 socket_designation; |
| 373 | u8 processor_type; |
| 374 | u8 processor_family; |
| 375 | u8 processor_manufacturer; |
| 376 | u32 processor_id[2]; |
| 377 | u8 processor_version; |
| 378 | u8 voltage; |
| 379 | u16 external_clock; |
| 380 | u16 max_speed; |
| 381 | u16 current_speed; |
| 382 | u8 status; |
| 383 | u8 processor_upgrade; |
| 384 | u16 l1_cache_handle; |
| 385 | u16 l2_cache_handle; |
| 386 | u16 l3_cache_handle; |
| 387 | u8 serial_number; |
| 388 | u8 asset_tag; |
| 389 | u8 part_number; |
| 390 | u8 core_count; |
| 391 | u8 core_enabled; |
| 392 | u8 thread_count; |
| 393 | u16 processor_characteristics; |
| 394 | u16 processor_family2; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 395 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 396 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 397 | |
Patrick Rudolph | fc5b809 | 2019-03-30 17:37:28 +0100 | [diff] [blame] | 398 | /* defines for supported_sram_type/current_sram_type */ |
| 399 | |
| 400 | #define SMBIOS_CACHE_SRAM_TYPE_OTHER (1 << 0) |
| 401 | #define SMBIOS_CACHE_SRAM_TYPE_UNKNOWN (1 << 1) |
| 402 | #define SMBIOS_CACHE_SRAM_TYPE_NON_BURST (1 << 2) |
| 403 | #define SMBIOS_CACHE_SRAM_TYPE_BURST (1 << 3) |
| 404 | #define SMBIOS_CACHE_SRAM_TYPE_PIPELINE_BURST (1 << 4) |
| 405 | #define SMBIOS_CACHE_SRAM_TYPE_SYNCHRONOUS (1 << 5) |
| 406 | #define SMBIOS_CACHE_SRAM_TYPE_ASYNCHRONOUS (1 << 6) |
| 407 | |
| 408 | /* enum for error_correction_type */ |
| 409 | |
| 410 | enum smbios_cache_error_corr { |
| 411 | SMBIOS_CACHE_ERROR_CORRECTION_OTHER = 1, |
| 412 | SMBIOS_CACHE_ERROR_CORRECTION_UNKNOWN, |
| 413 | SMBIOS_CACHE_ERROR_CORRECTION_NONE, |
| 414 | SMBIOS_CACHE_ERROR_CORRECTION_PARITY, |
| 415 | SMBIOS_CACHE_ERROR_CORRECTION_SINGLE_BIT, |
| 416 | SMBIOS_CACHE_ERROR_CORRECTION_MULTI_BIT, |
| 417 | }; |
| 418 | |
| 419 | /* enum for system_cache_type */ |
| 420 | |
| 421 | enum smbios_cache_type { |
| 422 | SMBIOS_CACHE_TYPE_OTHER = 1, |
| 423 | SMBIOS_CACHE_TYPE_UNKNOWN, |
| 424 | SMBIOS_CACHE_TYPE_INSTRUCTION, |
| 425 | SMBIOS_CACHE_TYPE_DATA, |
| 426 | SMBIOS_CACHE_TYPE_UNIFIED, |
| 427 | }; |
| 428 | |
| 429 | /* enum for associativity */ |
| 430 | |
| 431 | enum smbios_cache_associativity { |
| 432 | SMBIOS_CACHE_ASSOCIATIVITY_OTHER = 1, |
| 433 | SMBIOS_CACHE_ASSOCIATIVITY_UNKNOWN, |
| 434 | SMBIOS_CACHE_ASSOCIATIVITY_DIRECT, |
| 435 | SMBIOS_CACHE_ASSOCIATIVITY_2WAY, |
| 436 | SMBIOS_CACHE_ASSOCIATIVITY_4WAY, |
| 437 | SMBIOS_CACHE_ASSOCIATIVITY_FULL, |
| 438 | SMBIOS_CACHE_ASSOCIATIVITY_8WAY, |
| 439 | SMBIOS_CACHE_ASSOCIATIVITY_16WAY, |
| 440 | SMBIOS_CACHE_ASSOCIATIVITY_12WAY, |
| 441 | SMBIOS_CACHE_ASSOCIATIVITY_24WAY, |
| 442 | SMBIOS_CACHE_ASSOCIATIVITY_32WAY, |
| 443 | SMBIOS_CACHE_ASSOCIATIVITY_48WAY, |
| 444 | SMBIOS_CACHE_ASSOCIATIVITY_64WAY, |
| 445 | SMBIOS_CACHE_ASSOCIATIVITY_20WAY, |
| 446 | }; |
| 447 | |
| 448 | /* defines for cache_configuration */ |
| 449 | |
| 450 | #define SMBIOS_CACHE_CONF_LEVEL(x) ((((x) - 1) & 0x7) << 0) |
| 451 | #define SMBIOS_CACHE_CONF_LOCATION(x) (((x) & 0x3) << 5) |
| 452 | #define SMBIOS_CACHE_CONF_ENABLED(x) (((x) & 0x1) << 7) |
| 453 | #define SMBIOS_CACHE_CONF_OPERATION_MODE(x) (((x) & 0x3) << 8) |
| 454 | |
| 455 | /* defines for max_cache_size and installed_size */ |
| 456 | |
| 457 | #define SMBIOS_CACHE_SIZE_UNIT_1KB (0 << 15) |
| 458 | #define SMBIOS_CACHE_SIZE_UNIT_64KB (1 << 15) |
| 459 | #define SMBIOS_CACHE_SIZE_MASK 0x7fff |
| 460 | #define SMBIOS_CACHE_SIZE_OVERFLOW 0xffff |
| 461 | |
| 462 | #define SMBIOS_CACHE_SIZE2_UNIT_1KB (0 << 31) |
| 463 | #define SMBIOS_CACHE_SIZE2_UNIT_64KB (1UL << 31) |
| 464 | #define SMBIOS_CACHE_SIZE2_MASK 0x7fffffff |
| 465 | |
| 466 | struct smbios_type7 { |
| 467 | u8 type; |
| 468 | u8 length; |
| 469 | u16 handle; |
| 470 | u8 socket_designation; |
| 471 | u16 cache_configuration; |
| 472 | u16 max_cache_size; |
| 473 | u16 installed_size; |
| 474 | u16 supported_sram_type; |
| 475 | u16 current_sram_type; |
| 476 | u8 cache_speed; |
| 477 | u8 error_correction_type; |
| 478 | u8 system_cache_type; |
| 479 | u8 associativity; |
| 480 | u32 max_cache_size2; |
| 481 | u32 installed_size2; |
| 482 | u8 eos[2]; |
| 483 | } __packed; |
| 484 | |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 485 | /* System Slots - Slot Type */ |
| 486 | enum misc_slot_type { |
| 487 | SlotTypeOther = 0x01, |
| 488 | SlotTypeUnknown = 0x02, |
| 489 | SlotTypeIsa = 0x03, |
| 490 | SlotTypeMca = 0x04, |
| 491 | SlotTypeEisa = 0x05, |
| 492 | SlotTypePci = 0x06, |
| 493 | SlotTypePcmcia = 0x07, |
| 494 | SlotTypeVlVesa = 0x08, |
| 495 | SlotTypeProprietary = 0x09, |
| 496 | SlotTypeProcessorCardSlot = 0x0A, |
| 497 | SlotTypeProprietaryMemoryCardSlot = 0x0B, |
| 498 | SlotTypeIORiserCardSlot = 0x0C, |
| 499 | SlotTypeNuBus = 0x0D, |
| 500 | SlotTypePci66MhzCapable = 0x0E, |
| 501 | SlotTypeAgp = 0x0F, |
| 502 | SlotTypeApg2X = 0x10, |
| 503 | SlotTypeAgp4X = 0x11, |
| 504 | SlotTypePciX = 0x12, |
| 505 | SlotTypeAgp8X = 0x13, |
| 506 | SlotTypeM2Socket1_DP = 0x14, |
| 507 | SlotTypeM2Socket1_SD = 0x15, |
| 508 | SlotTypeM2Socket2 = 0x16, |
| 509 | SlotTypeM2Socket3 = 0x17, |
| 510 | SlotTypeMxmTypeI = 0x18, |
| 511 | SlotTypeMxmTypeII = 0x19, |
| 512 | SlotTypeMxmTypeIIIStandard = 0x1A, |
| 513 | SlotTypeMxmTypeIIIHe = 0x1B, |
| 514 | SlotTypeMxmTypeIV = 0x1C, |
| 515 | SlotTypeMxm30TypeA = 0x1D, |
| 516 | SlotTypeMxm30TypeB = 0x1E, |
| 517 | SlotTypePciExpressGen2Sff_8639 = 0x1F, |
| 518 | SlotTypePciExpressGen3Sff_8639 = 0x20, |
| 519 | SlotTypePciExpressMini52pinWithBSKO = 0x21, |
| 520 | SlotTypePciExpressMini52pinWithoutBSKO = 0x22, |
| 521 | SlotTypePciExpressMini76pin = 0x23, |
| 522 | SlotTypePC98C20 = 0xA0, |
| 523 | SlotTypePC98C24 = 0xA1, |
| 524 | SlotTypePC98E = 0xA2, |
| 525 | SlotTypePC98LocalBus = 0xA3, |
| 526 | SlotTypePC98Card = 0xA4, |
| 527 | SlotTypePciExpress = 0xA5, |
| 528 | SlotTypePciExpressX1 = 0xA6, |
| 529 | SlotTypePciExpressX2 = 0xA7, |
| 530 | SlotTypePciExpressX4 = 0xA8, |
| 531 | SlotTypePciExpressX8 = 0xA9, |
| 532 | SlotTypePciExpressX16 = 0xAA, |
| 533 | SlotTypePciExpressGen2 = 0xAB, |
| 534 | SlotTypePciExpressGen2X1 = 0xAC, |
| 535 | SlotTypePciExpressGen2X2 = 0xAD, |
| 536 | SlotTypePciExpressGen2X4 = 0xAE, |
| 537 | SlotTypePciExpressGen2X8 = 0xAF, |
| 538 | SlotTypePciExpressGen2X16 = 0xB0, |
| 539 | SlotTypePciExpressGen3 = 0xB1, |
| 540 | SlotTypePciExpressGen3X1 = 0xB2, |
| 541 | SlotTypePciExpressGen3X2 = 0xB3, |
| 542 | SlotTypePciExpressGen3X4 = 0xB4, |
| 543 | SlotTypePciExpressGen3X8 = 0xB5, |
Elyes HAOUAS | 5d0942b | 2019-10-08 16:13:34 +0200 | [diff] [blame] | 544 | SlotTypePciExpressGen3X16 = 0xB6, |
| 545 | SlotTypePciExpressGen4 = 0xB8, |
| 546 | SlotTypePciExpressGen4x1 = 0xB9, |
| 547 | SlotTypePciExpressGen4x2 = 0xBA, |
| 548 | SlotTypePciExpressGen4x4 = 0xBB, |
| 549 | SlotTypePciExpressGen4x8 = 0xBC, |
| 550 | SlotTypePciExpressGen4x16 = 0xBD |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 551 | }; |
| 552 | |
| 553 | /* System Slots - Slot Data Bus Width. */ |
| 554 | enum slot_data_bus_bandwidth { |
| 555 | SlotDataBusWidthOther = 0x01, |
| 556 | SlotDataBusWidthUnknown = 0x02, |
| 557 | SlotDataBusWidth8Bit = 0x03, |
| 558 | SlotDataBusWidth16Bit = 0x04, |
| 559 | SlotDataBusWidth32Bit = 0x05, |
| 560 | SlotDataBusWidth64Bit = 0x06, |
| 561 | SlotDataBusWidth128Bit = 0x07, |
| 562 | SlotDataBusWidth1X = 0x08, |
| 563 | SlotDataBusWidth2X = 0x09, |
| 564 | SlotDataBusWidth4X = 0x0A, |
| 565 | SlotDataBusWidth8X = 0x0B, |
| 566 | SlotDataBusWidth12X = 0x0C, |
| 567 | SlotDataBusWidth16X = 0x0D, |
| 568 | SlotDataBusWidth32X = 0x0E |
| 569 | }; |
| 570 | |
| 571 | /* System Slots - Current Usage. */ |
| 572 | enum misc_slot_usage { |
| 573 | SlotUsageOther = 0x01, |
| 574 | SlotUsageUnknown = 0x02, |
| 575 | SlotUsageAvailable = 0x03, |
| 576 | SlotUsageInUse = 0x04, |
| 577 | SlotUsageUnavailable = 0x05 |
| 578 | }; |
| 579 | |
| 580 | /* System Slots - Slot Length.*/ |
| 581 | enum misc_slot_length { |
| 582 | SlotLengthOther = 0x01, |
| 583 | SlotLengthUnknown = 0x02, |
| 584 | SlotLengthShort = 0x03, |
| 585 | SlotLengthLong = 0x04 |
| 586 | }; |
| 587 | |
| 588 | /* System Slots - Slot Characteristics 1. */ |
| 589 | #define SMBIOS_SLOT_UNKNOWN (1 << 0) |
| 590 | #define SMBIOS_SLOT_5V (1 << 1) |
| 591 | #define SMBIOS_SLOT_3P3V (1 << 2) |
| 592 | #define SMBIOS_SLOT_SHARED (1 << 3) |
| 593 | #define SMBIOS_SLOT_PCCARD_16 (1 << 4) |
| 594 | #define SMBIOS_SLOT_PCCARD_CARDBUS (1 << 5) |
| 595 | #define SMBIOS_SLOT_PCCARD_ZOOM (1 << 6) |
| 596 | #define SMBIOS_SLOT_PCCARD_MODEM_RING (1 << 7) |
| 597 | /* System Slots - Slot Characteristics 2. */ |
| 598 | #define SMBIOS_SLOT_PME (1 << 0) |
| 599 | #define SMBIOS_SLOT_HOTPLUG (1 << 1) |
| 600 | #define SMBIOS_SLOT_SMBUS (1 << 2) |
| 601 | #define SMBIOS_SLOT_BIFURCATION (1 << 3) |
| 602 | |
| 603 | struct slot_peer_groups { |
| 604 | u16 peer_seg_num; |
| 605 | u8 peer_bus_num; |
| 606 | u8 peer_dev_fn_num; |
| 607 | u8 peer_data_bus_width; |
| 608 | } __packed; |
| 609 | |
| 610 | struct smbios_type9 { |
| 611 | u8 type; |
| 612 | u8 length; |
| 613 | u16 handle; |
| 614 | u8 slot_designation; |
| 615 | u8 slot_type; |
| 616 | u8 slot_data_bus_width; |
| 617 | u8 current_usage; |
| 618 | u8 slot_length; |
| 619 | u16 slot_id; |
| 620 | u8 slot_characteristics_1; |
| 621 | u8 slot_characteristics_2; |
| 622 | u16 segment_group_number; |
| 623 | u8 bus_number; |
| 624 | u8 device_function_number; |
| 625 | u8 data_bus_width; |
| 626 | u8 peer_group_count; |
| 627 | struct slot_peer_groups peer[0]; |
| 628 | u8 eos[2]; |
| 629 | } __packed; |
| 630 | |
Peter Stuge | c392b64 | 2013-07-06 19:51:12 +0200 | [diff] [blame] | 631 | struct smbios_type11 { |
| 632 | u8 type; |
| 633 | u8 length; |
| 634 | u16 handle; |
| 635 | u8 count; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 636 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 637 | } __packed; |
Peter Stuge | c392b64 | 2013-07-06 19:51:12 +0200 | [diff] [blame] | 638 | |
Duncan Laurie | 472ec9c | 2012-06-23 16:13:42 -0700 | [diff] [blame] | 639 | struct smbios_type15 { |
| 640 | u8 type; |
| 641 | u8 length; |
| 642 | u16 handle; |
| 643 | u16 area_length; |
| 644 | u16 header_offset; |
| 645 | u16 data_offset; |
| 646 | u8 access_method; |
| 647 | u8 log_status; |
| 648 | u32 change_token; |
| 649 | u32 address; |
| 650 | u8 header_format; |
| 651 | u8 log_type_descriptors; |
| 652 | u8 log_type_descriptor_length; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 653 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 654 | } __packed; |
Duncan Laurie | 472ec9c | 2012-06-23 16:13:42 -0700 | [diff] [blame] | 655 | |
| 656 | enum { |
| 657 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO8 = 0, |
| 658 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO8X2, |
| 659 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO16, |
| 660 | SMBIOS_EVENTLOG_ACCESS_METHOD_MMIO32, |
| 661 | SMBIOS_EVENTLOG_ACCESS_METHOD_GPNV, |
| 662 | }; |
| 663 | |
| 664 | enum { |
| 665 | SMBIOS_EVENTLOG_STATUS_VALID = 1, /* Bit 0 */ |
| 666 | SMBIOS_EVENTLOG_STATUS_FULL = 2, /* Bit 1 */ |
| 667 | }; |
| 668 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 669 | struct smbios_type16 { |
| 670 | u8 type; |
| 671 | u8 length; |
| 672 | u16 handle; |
| 673 | u8 location; |
| 674 | u8 use; |
| 675 | u8 memory_error_correction; |
| 676 | u32 maximum_capacity; |
| 677 | u16 memory_error_information_handle; |
| 678 | u16 number_of_memory_devices; |
| 679 | u64 extended_maximum_capacity; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 680 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 681 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 682 | |
| 683 | struct smbios_type17 { |
| 684 | u8 type; |
| 685 | u8 length; |
| 686 | u16 handle; |
| 687 | u16 phys_memory_array_handle; |
| 688 | u16 memory_error_information_handle; |
| 689 | u16 total_width; |
| 690 | u16 data_width; |
| 691 | u16 size; |
| 692 | u8 form_factor; |
| 693 | u8 device_set; |
| 694 | u8 device_locator; |
| 695 | u8 bank_locator; |
| 696 | u8 memory_type; |
| 697 | u16 type_detail; |
| 698 | u16 speed; |
| 699 | u8 manufacturer; |
| 700 | u8 serial_number; |
| 701 | u8 asset_tag; |
| 702 | u8 part_number; |
| 703 | u8 attributes; |
Timothy Pearson | 964aa83 | 2015-09-05 19:00:34 -0500 | [diff] [blame] | 704 | u32 extended_size; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 705 | u16 clock_speed; |
Timothy Pearson | 964aa83 | 2015-09-05 19:00:34 -0500 | [diff] [blame] | 706 | u16 minimum_voltage; |
| 707 | u16 maximum_voltage; |
| 708 | u16 configured_voltage; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 709 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 710 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 711 | |
| 712 | struct smbios_type32 { |
| 713 | u8 type; |
| 714 | u8 length; |
| 715 | u16 handle; |
| 716 | u8 reserved[6]; |
| 717 | u8 boot_status; |
| 718 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 719 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 720 | |
Sven Schnelle | 6d03876 | 2012-07-09 08:52:53 +0200 | [diff] [blame] | 721 | struct smbios_type38 { |
| 722 | u8 type; |
| 723 | u8 length; |
| 724 | u16 handle; |
| 725 | u8 interface_type; |
| 726 | u8 ipmi_rev; |
| 727 | u8 i2c_slave_addr; |
| 728 | u8 nv_storage_addr; |
| 729 | u64 base_address; |
| 730 | u8 base_address_modifier; |
| 731 | u8 irq; |
Lukasz Siudut | 2352a50 | 2019-02-19 10:06:09 +0000 | [diff] [blame] | 732 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 733 | } __packed; |
Sven Schnelle | 6d03876 | 2012-07-09 08:52:53 +0200 | [diff] [blame] | 734 | |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 735 | enum smbios_bmc_interface_type { |
| 736 | SMBIOS_BMC_INTERFACE_UNKNOWN = 0, |
| 737 | SMBIOS_BMC_INTERFACE_KCS, |
| 738 | SMBIOS_BMC_INTERFACE_SMIC, |
| 739 | SMBIOS_BMC_INTERFACE_BLOCK, |
Elyes HAOUAS | a5cc0cf | 2019-02-14 16:48:08 +0100 | [diff] [blame] | 740 | SMBIOS_BMC_INTERFACE_SMBUS, |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 741 | }; |
| 742 | |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 743 | typedef enum { |
| 744 | SMBIOS_DEVICE_TYPE_OTHER = 0x01, |
| 745 | SMBIOS_DEVICE_TYPE_UNKNOWN, |
| 746 | SMBIOS_DEVICE_TYPE_VIDEO, |
| 747 | SMBIOS_DEVICE_TYPE_SCSI, |
| 748 | SMBIOS_DEVICE_TYPE_ETHERNET, |
| 749 | SMBIOS_DEVICE_TYPE_TOKEN_RING, |
| 750 | SMBIOS_DEVICE_TYPE_SOUND, |
| 751 | SMBIOS_DEVICE_TYPE_PATA, |
| 752 | SMBIOS_DEVICE_TYPE_SATA, |
| 753 | SMBIOS_DEVICE_TYPE_SAS, |
| 754 | } smbios_onboard_device_type; |
| 755 | |
Christian Walter | 9e5b062 | 2019-05-21 17:37:58 +0200 | [diff] [blame] | 756 | #define SMBIOS_DEVICE_TYPE_COUNT 10 |
| 757 | |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 758 | struct smbios_type41 { |
| 759 | u8 type; |
| 760 | u8 length; |
| 761 | u16 handle; |
| 762 | u8 reference_designation; |
| 763 | u8 device_type: 7; |
| 764 | u8 device_status: 1; |
| 765 | u8 device_type_instance; |
| 766 | u16 segment_group_number; |
| 767 | u8 bus_number; |
| 768 | u8 function_number: 3; |
| 769 | u8 device_number: 5; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 770 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 771 | } __packed; |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 772 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 773 | struct smbios_type127 { |
| 774 | u8 type; |
| 775 | u8 length; |
| 776 | u16 handle; |
| 777 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 778 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 779 | |
Lee Leahy | 6a566d7 | 2017-03-07 17:45:12 -0800 | [diff] [blame] | 780 | void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, |
| 781 | struct smbios_type17 *t); |
Lijian Zhao | 10ea93c | 2019-04-11 00:45:10 -0700 | [diff] [blame] | 782 | void smbios_fill_dimm_locator(const struct dimm_info *dimm, |
| 783 | struct smbios_type17 *t); |
Timothy Pearson | 4785f2a | 2015-03-27 23:05:36 -0500 | [diff] [blame] | 784 | |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 785 | smbios_board_type smbios_mainboard_board_type(void); |
Mathew King | be820b3 | 2019-10-31 12:10:44 -0600 | [diff] [blame] | 786 | smbios_enclosure_type smbios_mainboard_enclosure_type(void); |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 787 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 788 | #endif |