Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering |
| 5 | * Copyright (C) various authors, the coreboot project |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 15 | */ |
| 16 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 17 | #ifndef SMBIOS_H |
| 18 | #define SMBIOS_H |
| 19 | |
| 20 | #include <types.h> |
| 21 | |
| 22 | unsigned long smbios_write_tables(unsigned long start); |
| 23 | int smbios_add_string(char *start, const char *str); |
| 24 | int smbios_string_table_len(char *start); |
| 25 | |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 26 | /* Used by mainboard to add an on-board device */ |
| 27 | int smbios_write_type41(unsigned long *current, int *handle, |
| 28 | const char *name, u8 instance, u16 segment, |
| 29 | u8 bus, u8 device, u8 function); |
| 30 | |
Gerd Hoffmann | 0626274 | 2013-11-13 13:37:23 +0100 | [diff] [blame] | 31 | const char *smbios_mainboard_manufacturer(void); |
| 32 | const char *smbios_mainboard_product_name(void); |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 33 | |
Christian Gmeiner | ac3aa09 | 2012-07-25 13:42:40 +0200 | [diff] [blame] | 34 | const char *smbios_mainboard_serial_number(void); |
| 35 | const char *smbios_mainboard_version(void); |
Gerd Hoffmann | 0626274 | 2013-11-13 13:37:23 +0100 | [diff] [blame] | 36 | void smbios_mainboard_set_uuid(u8 *uuid); |
Vladimir Serbinenko | 63acd22 | 2014-06-01 00:26:48 +0200 | [diff] [blame] | 37 | const char *smbios_mainboard_bios_version(void); |
Kyösti Mälkki | c5b758b | 2016-05-30 16:52:31 +0300 | [diff] [blame] | 38 | const char *smbios_mainboard_sku(void); |
Vladimir Serbinenko | a71bdc3 | 2014-08-30 00:35:39 +0200 | [diff] [blame] | 39 | u8 smbios_mainboard_enclosure_type(void); |
Kane Chen | 51bdc47 | 2014-09-08 18:40:30 -0700 | [diff] [blame] | 40 | #ifdef CONFIG_MAINBOARD_FAMILY |
| 41 | const char *smbios_mainboard_family(void); |
| 42 | #endif |
Christian Gmeiner | ac3aa09 | 2012-07-25 13:42:40 +0200 | [diff] [blame] | 43 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 44 | #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) |
| 45 | #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) |
| 46 | #define BIOS_CHARACTERISTICS_PNP (1 << 9) |
| 47 | #define BIOS_CHARACTERISTICS_APM (1 << 10) |
| 48 | #define BIOS_CHARACTERISTICS_UPGRADEABLE (1 << 11) |
| 49 | #define BIOS_CHARACTERISTICS_SHADOW (1 << 12) |
| 50 | #define BIOS_CHARACTERISTICS_BOOT_FROM_CD (1 << 15) |
| 51 | #define BIOS_CHARACTERISTICS_SELECTABLE_BOOT (1 << 16) |
| 52 | #define BIOS_CHARACTERISTICS_BIOS_SOCKETED (1 << 17) |
| 53 | |
| 54 | #define BIOS_EXT1_CHARACTERISTICS_ACPI (1 << 0) |
| 55 | #define BIOS_EXT2_CHARACTERISTICS_TARGET (1 << 2) |
| 56 | |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 57 | #define BIOS_MEMORY_ECC_SINGLE_BIT_CORRECTING (1 << 3) |
| 58 | #define BIOS_MEMORY_ECC_DOUBLE_BIT_CORRECTING (1 << 4) |
| 59 | #define BIOS_MEMORY_ECC_SCRUBBING (1 << 5) |
| 60 | |
| 61 | #define MEMORY_TYPE_DETAIL_OTHER (1 << 1) |
| 62 | #define MEMORY_TYPE_DETAIL_UNKNOWN (1 << 2) |
| 63 | #define MEMORY_TYPE_DETAIL_FAST_PAGED (1 << 3) |
| 64 | #define MEMORY_TYPE_DETAIL_STATIC_COLUMN (1 << 4) |
| 65 | #define MEMORY_TYPE_DETAIL_PSEUDO_STATIC (1 << 5) |
| 66 | #define MEMORY_TYPE_DETAIL_RAMBUS (1 << 6) |
| 67 | #define MEMORY_TYPE_DETAIL_SYNCHRONOUS (1 << 7) |
| 68 | #define MEMORY_TYPE_DETAIL_CMOS (1 << 8) |
| 69 | #define MEMORY_TYPE_DETAIL_EDO (1 << 9) |
| 70 | #define MEMORY_TYPE_DETAIL_WINDOW_DRAM (1 << 10) |
| 71 | #define MEMORY_TYPE_DETAIL_CACHE_DRAM (1 << 11) |
| 72 | #define MEMORY_TYPE_DETAIL_NON_VOLATILE (1 << 12) |
| 73 | #define MEMORY_TYPE_DETAIL_REGISTERED (1 << 13) |
| 74 | #define MEMORY_TYPE_DETAIL_UNBUFFERED (1 << 14) |
| 75 | |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 76 | typedef enum { |
Lee Leahy | 0be6d93 | 2015-06-26 11:15:42 -0700 | [diff] [blame] | 77 | MEMORY_BUS_WIDTH_8 = 0, |
| 78 | MEMORY_BUS_WIDTH_16 = 1, |
| 79 | MEMORY_BUS_WIDTH_32 = 2, |
| 80 | MEMORY_BUS_WIDTH_64 = 3, |
| 81 | MEMORY_BUS_WIDTH_128 = 4, |
| 82 | MEMORY_BUS_WIDTH_256 = 5, |
| 83 | MEMORY_BUS_WIDTH_512 = 6, |
| 84 | MEMORY_BUS_WIDTH_1024 = 7, |
| 85 | MEMORY_BUS_WIDTH_MAX = 7, |
| 86 | } smbios_memory_bus_width; |
| 87 | |
| 88 | typedef enum { |
| 89 | MEMORY_DEVICE_OTHER = 0x01, |
| 90 | MEMORY_DEVICE_UNKNOWN = 0x02, |
| 91 | MEMORY_DEVICE_DRAM = 0x03, |
| 92 | MEMORY_DEVICE_EDRAM = 0x04, |
| 93 | MEMORY_DEVICE_VRAM = 0x05, |
| 94 | MEMORY_DEVICE_SRAM = 0x06, |
| 95 | MEMORY_DEVICE_RAM = 0x07, |
| 96 | MEMORY_DEVICE_ROM = 0x08, |
| 97 | MEMORY_DEVICE_FLASH = 0x09, |
| 98 | MEMORY_DEVICE_EEPROM = 0x0A, |
| 99 | MEMORY_DEVICE_FEPROM = 0x0B, |
| 100 | MEMORY_DEVICE_EPROM = 0x0C, |
| 101 | MEMORY_DEVICE_CDRAM = 0x0D, |
| 102 | MEMORY_DEVICE_3DRAM = 0x0E, |
| 103 | MEMORY_DEVICE_SDRAM = 0x0F, |
| 104 | MEMORY_DEVICE_SGRAM = 0x10, |
| 105 | MEMORY_DEVICE_RDRAM = 0x11, |
| 106 | MEMORY_DEVICE_DDR = 0x12, |
| 107 | MEMORY_DEVICE_DDR2 = 0x13, |
| 108 | MEMORY_DEVICE_DDR2_FB_DIMM = 0x14, |
| 109 | MEMORY_DEVICE_DDR3 = 0x18, |
| 110 | MEMORY_DEVICE_DBD2 = 0x19, |
| 111 | MEMORY_DEVICE_DDR4 = 0x1A, |
| 112 | MEMORY_DEVICE_LPDDR = 0x1B, |
| 113 | MEMORY_DEVICE_LPDDR2 = 0x1C, |
| 114 | MEMORY_DEVICE_LPDDR3 = 0x1D, |
| 115 | MEMORY_DEVICE_LPDDR4 = 0x1E, |
| 116 | } smbios_memory_device_type; |
| 117 | |
| 118 | typedef enum { |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 119 | MEMORY_FORMFACTOR_OTHER = 0x01, |
| 120 | MEMORY_FORMFACTOR_UNKNOWN = 0x02, |
| 121 | MEMORY_FORMFACTOR_SIMM = 0x03, |
| 122 | MEMORY_FORMFACTOR_SIP = 0x04, |
| 123 | MEMORY_FORMFACTOR_CHIP = 0x05, |
| 124 | MEMORY_FORMFACTOR_DIP = 0x06, |
| 125 | MEMORY_FORMFACTOR_ZIP = 0x07, |
| 126 | MEMORY_FORMFACTOR_PROPRIETARY_CARD = 0x08, |
| 127 | MEMORY_FORMFACTOR_DIMM = 0x09, |
| 128 | MEMORY_FORMFACTOR_TSOP = 0x0a, |
| 129 | MEMORY_FORMFACTOR_ROC = 0x0b, |
| 130 | MEMORY_FORMFACTOR_RIMM = 0x0c, |
| 131 | MEMORY_FORMFACTOR_SODIMM = 0x0d, |
| 132 | MEMORY_FORMFACTOR_SRIMM = 0x0e, |
| 133 | MEMORY_FORMFACTOR_FBDIMM = 0x0f, |
| 134 | } smbios_memory_form_factor; |
| 135 | |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 136 | typedef enum { |
| 137 | MEMORY_TYPE_OTHER = 0x01, |
| 138 | MEMORY_TYPE_UNKNOWN = 0x02, |
| 139 | MEMORY_TYPE_DRAM = 0x03, |
| 140 | MEMORY_TYPE_EDRAM = 0x04, |
| 141 | MEMORY_TYPE_VRAM = 0x05, |
| 142 | MEMORY_TYPE_SRAM = 0x06, |
| 143 | MEMORY_TYPE_RAM = 0x07, |
| 144 | MEMORY_TYPE_ROM = 0x08, |
| 145 | MEMORY_TYPE_FLASH = 0x09, |
| 146 | MEMORY_TYPE_EEPROM = 0x0a, |
| 147 | MEMORY_TYPE_FEPROM = 0x0b, |
| 148 | MEMORY_TYPE_EPROM = 0x0c, |
| 149 | MEMORY_TYPE_CDRAM = 0x0d, |
| 150 | MEMORY_TYPE_3DRAM = 0x0e, |
| 151 | MEMORY_TYPE_SDRAM = 0x0f, |
| 152 | MEMORY_TYPE_SGRAM = 0x10, |
| 153 | MEMORY_TYPE_RDRAM = 0x11, |
| 154 | MEMORY_TYPE_DDR = 0x12, |
| 155 | MEMORY_TYPE_DDR2 = 0x13, |
| 156 | MEMORY_TYPE_DDR2_FBDIMM = 0x14, |
| 157 | MEMORY_TYPE_DDR3 = 0x18, |
| 158 | MEMORY_TYPE_FBD2 = 0x19, |
| 159 | } smbios_memory_type; |
| 160 | |
| 161 | typedef enum { |
| 162 | MEMORY_ARRAY_LOCATION_OTHER = 0x01, |
| 163 | MEMORY_ARRAY_LOCATION_UNKNOWN = 0x02, |
| 164 | MEMORY_ARRAY_LOCATION_SYSTEM_BOARD = 0x03, |
| 165 | MEMORY_ARRAY_LOCATION_ISA_ADD_ON = 0x04, |
| 166 | MEMORY_ARRAY_LOCATION_EISA_ADD_ON = 0x05, |
| 167 | MEMORY_ARRAY_LOCATION_PCI_ADD_ON = 0x06, |
| 168 | MEMORY_ARRAY_LOCATION_MCA_ADD_ON = 0x07, |
| 169 | MEMORY_ARRAY_LOCATION_PCMCIA_ADD_ON = 0x08, |
| 170 | MEMORY_ARRAY_LOCATION_PROPRIETARY_ADD_ON = 0x09, |
| 171 | MEMORY_ARRAY_LOCATION_NUBUS = 0x0a, |
| 172 | MEMORY_ARRAY_LOCATION_PC_98_C20_ADD_ON = 0xa0, |
| 173 | MEMORY_ARRAY_LOCATION_PC_98_C24_ADD_ON = 0xa1, |
| 174 | MEMORY_ARRAY_LOCATION_PC_98_E_ADD_ON = 0xa2, |
| 175 | MEMORY_ARRAY_LOCATION_PC_98_LOCAL_BUS_ADD_ON = 0xa3, |
| 176 | } smbios_memory_array_location; |
| 177 | |
| 178 | typedef enum { |
| 179 | MEMORY_ARRAY_USE_OTHER = 0x01, |
| 180 | MEMORY_ARRAY_USE_UNKNOWN = 0x02, |
| 181 | MEMORY_ARRAY_USE_SYSTEM = 0x03, |
| 182 | MEMORY_ARRAY_USE_VIDEO = 0x04, |
| 183 | MEMORY_ARRAY_USE_FLASH = 0x05, |
| 184 | MEMORY_ARRAY_USE_NVRAM = 0x06, |
| 185 | MEMORY_ARRAY_USE_CACHE = 0x07, |
| 186 | } smbios_memory_array_use; |
| 187 | |
| 188 | typedef enum { |
| 189 | MEMORY_ARRAY_ECC_OTHER = 0x01, |
| 190 | MEMORY_ARRAY_ECC_UNKNOWN = 0x02, |
| 191 | MEMORY_ARRAY_ECC_NONE = 0x03, |
| 192 | MEMORY_ARRAY_ECC_PARITY = 0x04, |
| 193 | MEMORY_ARRAY_ECC_SINGLE_BIT = 0x05, |
| 194 | MEMORY_ARRAY_ECC_MULTI_BIT = 0x06, |
| 195 | MEMORY_ARRAY_ECC_CRC = 0x07, |
| 196 | } smbios_memory_array_ecc; |
| 197 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 198 | #define SMBIOS_STATE_SAFE 3 |
| 199 | typedef enum { |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 200 | SMBIOS_BIOS_INFORMATION = 0, |
| 201 | SMBIOS_SYSTEM_INFORMATION = 1, |
| 202 | SMBIOS_BOARD_INFORMATION = 2, |
| 203 | SMBIOS_SYSTEM_ENCLOSURE = 3, |
| 204 | SMBIOS_PROCESSOR_INFORMATION = 4, |
| 205 | SMBIOS_CACHE_INFORMATION = 7, |
| 206 | SMBIOS_SYSTEM_SLOTS = 9, |
| 207 | SMBIOS_OEM_STRINGS = 11, |
| 208 | SMBIOS_EVENT_LOG = 15, |
| 209 | SMBIOS_PHYS_MEMORY_ARRAY = 16, |
| 210 | SMBIOS_MEMORY_DEVICE = 17, |
| 211 | SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS = 19, |
| 212 | SMBIOS_SYSTEM_BOOT_INFORMATION = 32, |
| 213 | SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION = 41, |
| 214 | SMBIOS_END_OF_TABLE = 127, |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 215 | } smbios_struct_type_t; |
| 216 | |
| 217 | struct smbios_entry { |
| 218 | u8 anchor[4]; |
| 219 | u8 checksum; |
| 220 | u8 length; |
| 221 | u8 major_version; |
| 222 | u8 minor_version; |
| 223 | u16 max_struct_size; |
| 224 | u8 entry_point_rev; |
| 225 | u8 formwatted_area[5]; |
| 226 | u8 intermediate_anchor_string[5]; |
| 227 | u8 intermediate_checksum; |
| 228 | u16 struct_table_length; |
| 229 | u32 struct_table_address; |
| 230 | u16 struct_count; |
| 231 | u8 smbios_bcd_revision; |
| 232 | } __attribute__((packed)); |
| 233 | |
| 234 | struct smbios_type0 { |
| 235 | u8 type; |
| 236 | u8 length; |
| 237 | u16 handle; |
| 238 | u8 vendor; |
| 239 | u8 bios_version; |
| 240 | u16 bios_start_segment; |
| 241 | u8 bios_release_date; |
| 242 | u8 bios_rom_size; |
| 243 | u64 bios_characteristics; |
| 244 | u8 bios_characteristics_ext1; |
| 245 | u8 bios_characteristics_ext2; |
| 246 | u8 system_bios_major_release; |
| 247 | u8 system_bios_minor_release; |
| 248 | u8 ec_major_release; |
| 249 | u8 ec_minor_release; |
| 250 | char eos[2]; |
| 251 | } __attribute__((packed)); |
| 252 | |
| 253 | struct smbios_type1 { |
| 254 | u8 type; |
| 255 | u8 length; |
| 256 | u16 handle; |
| 257 | u8 manufacturer; |
| 258 | u8 product_name; |
| 259 | u8 version; |
| 260 | u8 serial_number; |
| 261 | u8 uuid[16]; |
| 262 | u8 wakeup_type; |
| 263 | u8 sku; |
| 264 | u8 family; |
| 265 | char eos[2]; |
| 266 | } __attribute__((packed)); |
| 267 | |
Vladimir Serbinenko | 47089f2 | 2014-03-02 19:14:44 +0100 | [diff] [blame] | 268 | struct smbios_type2 { |
| 269 | u8 type; |
| 270 | u8 length; |
| 271 | u16 handle; |
| 272 | u8 manufacturer; |
| 273 | u8 product_name; |
| 274 | u8 version; |
| 275 | u8 serial_number; |
| 276 | char eos[2]; |
| 277 | } __attribute__((packed)); |
| 278 | |
Lee Leahy | 6625ecc | 2017-03-07 15:11:07 -0800 | [diff] [blame] | 279 | enum { |
Vladimir Serbinenko | 71c0bf6 | 2014-08-27 23:23:14 +0200 | [diff] [blame] | 280 | SMBIOS_ENCLOSURE_DESKTOP = 3, |
| 281 | SMBIOS_ENCLOSURE_NOTEBOOK = 9, |
| 282 | }; |
| 283 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 284 | struct smbios_type3 { |
| 285 | u8 type; |
| 286 | u8 length; |
| 287 | u16 handle; |
| 288 | u8 manufacturer; |
| 289 | u8 _type; |
| 290 | u8 version; |
| 291 | u8 serial_number; |
| 292 | u8 asset_tag_number; |
| 293 | u8 bootup_state; |
| 294 | u8 power_supply_state; |
| 295 | u8 thermal_state; |
| 296 | u8 security_status; |
| 297 | u32 oem_defined; |
| 298 | u8 height; |
| 299 | u8 number_of_power_cords; |
| 300 | u8 element_count; |
| 301 | u8 element_record_length; |
Matt DeVillier | 4863cc4 | 2016-09-01 00:55:40 -0500 | [diff] [blame] | 302 | u8 sku_number; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 303 | char eos[2]; |
| 304 | } __attribute__((packed)); |
| 305 | |
| 306 | struct smbios_type4 { |
| 307 | u8 type; |
| 308 | u8 length; |
| 309 | u16 handle; |
| 310 | u8 socket_designation; |
| 311 | u8 processor_type; |
| 312 | u8 processor_family; |
| 313 | u8 processor_manufacturer; |
| 314 | u32 processor_id[2]; |
| 315 | u8 processor_version; |
| 316 | u8 voltage; |
| 317 | u16 external_clock; |
| 318 | u16 max_speed; |
| 319 | u16 current_speed; |
| 320 | u8 status; |
| 321 | u8 processor_upgrade; |
| 322 | u16 l1_cache_handle; |
| 323 | u16 l2_cache_handle; |
| 324 | u16 l3_cache_handle; |
| 325 | u8 serial_number; |
| 326 | u8 asset_tag; |
| 327 | u8 part_number; |
| 328 | u8 core_count; |
| 329 | u8 core_enabled; |
| 330 | u8 thread_count; |
| 331 | u16 processor_characteristics; |
| 332 | u16 processor_family2; |
| 333 | char eos[2]; |
| 334 | } __attribute__((packed)); |
| 335 | |
Peter Stuge | c392b64 | 2013-07-06 19:51:12 +0200 | [diff] [blame] | 336 | struct smbios_type11 { |
| 337 | u8 type; |
| 338 | u8 length; |
| 339 | u16 handle; |
| 340 | u8 count; |
| 341 | char eos[2]; |
| 342 | } __attribute__((packed)); |
| 343 | |
Duncan Laurie | 472ec9c | 2012-06-23 16:13:42 -0700 | [diff] [blame] | 344 | struct smbios_type15 { |
| 345 | u8 type; |
| 346 | u8 length; |
| 347 | u16 handle; |
| 348 | u16 area_length; |
| 349 | u16 header_offset; |
| 350 | u16 data_offset; |
| 351 | u8 access_method; |
| 352 | u8 log_status; |
| 353 | u32 change_token; |
| 354 | u32 address; |
| 355 | u8 header_format; |
| 356 | u8 log_type_descriptors; |
| 357 | u8 log_type_descriptor_length; |
| 358 | char eos[2]; |
| 359 | } __attribute__((packed)); |
| 360 | |
| 361 | enum { |
| 362 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO8 = 0, |
| 363 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO8X2, |
| 364 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO16, |
| 365 | SMBIOS_EVENTLOG_ACCESS_METHOD_MMIO32, |
| 366 | SMBIOS_EVENTLOG_ACCESS_METHOD_GPNV, |
| 367 | }; |
| 368 | |
| 369 | enum { |
| 370 | SMBIOS_EVENTLOG_STATUS_VALID = 1, /* Bit 0 */ |
| 371 | SMBIOS_EVENTLOG_STATUS_FULL = 2, /* Bit 1 */ |
| 372 | }; |
| 373 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 374 | struct smbios_type16 { |
| 375 | u8 type; |
| 376 | u8 length; |
| 377 | u16 handle; |
| 378 | u8 location; |
| 379 | u8 use; |
| 380 | u8 memory_error_correction; |
| 381 | u32 maximum_capacity; |
| 382 | u16 memory_error_information_handle; |
| 383 | u16 number_of_memory_devices; |
| 384 | u64 extended_maximum_capacity; |
| 385 | char eos[2]; |
| 386 | } __attribute__((packed)); |
| 387 | |
| 388 | struct smbios_type17 { |
| 389 | u8 type; |
| 390 | u8 length; |
| 391 | u16 handle; |
| 392 | u16 phys_memory_array_handle; |
| 393 | u16 memory_error_information_handle; |
| 394 | u16 total_width; |
| 395 | u16 data_width; |
| 396 | u16 size; |
| 397 | u8 form_factor; |
| 398 | u8 device_set; |
| 399 | u8 device_locator; |
| 400 | u8 bank_locator; |
| 401 | u8 memory_type; |
| 402 | u16 type_detail; |
| 403 | u16 speed; |
| 404 | u8 manufacturer; |
| 405 | u8 serial_number; |
| 406 | u8 asset_tag; |
| 407 | u8 part_number; |
| 408 | u8 attributes; |
Timothy Pearson | 964aa83 | 2015-09-05 19:00:34 -0500 | [diff] [blame] | 409 | u32 extended_size; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 410 | u16 clock_speed; |
Timothy Pearson | 964aa83 | 2015-09-05 19:00:34 -0500 | [diff] [blame] | 411 | u16 minimum_voltage; |
| 412 | u16 maximum_voltage; |
| 413 | u16 configured_voltage; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 414 | char eos[2]; |
| 415 | } __attribute__((packed)); |
| 416 | |
| 417 | struct smbios_type32 { |
| 418 | u8 type; |
| 419 | u8 length; |
| 420 | u16 handle; |
| 421 | u8 reserved[6]; |
| 422 | u8 boot_status; |
| 423 | u8 eos[2]; |
| 424 | } __attribute__((packed)); |
| 425 | |
Sven Schnelle | 6d03876 | 2012-07-09 08:52:53 +0200 | [diff] [blame] | 426 | struct smbios_type38 { |
| 427 | u8 type; |
| 428 | u8 length; |
| 429 | u16 handle; |
| 430 | u8 interface_type; |
| 431 | u8 ipmi_rev; |
| 432 | u8 i2c_slave_addr; |
| 433 | u8 nv_storage_addr; |
| 434 | u64 base_address; |
| 435 | u8 base_address_modifier; |
| 436 | u8 irq; |
| 437 | } __attribute__((packed)); |
| 438 | |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 439 | typedef enum { |
| 440 | SMBIOS_DEVICE_TYPE_OTHER = 0x01, |
| 441 | SMBIOS_DEVICE_TYPE_UNKNOWN, |
| 442 | SMBIOS_DEVICE_TYPE_VIDEO, |
| 443 | SMBIOS_DEVICE_TYPE_SCSI, |
| 444 | SMBIOS_DEVICE_TYPE_ETHERNET, |
| 445 | SMBIOS_DEVICE_TYPE_TOKEN_RING, |
| 446 | SMBIOS_DEVICE_TYPE_SOUND, |
| 447 | SMBIOS_DEVICE_TYPE_PATA, |
| 448 | SMBIOS_DEVICE_TYPE_SATA, |
| 449 | SMBIOS_DEVICE_TYPE_SAS, |
| 450 | } smbios_onboard_device_type; |
| 451 | |
| 452 | struct smbios_type41 { |
| 453 | u8 type; |
| 454 | u8 length; |
| 455 | u16 handle; |
| 456 | u8 reference_designation; |
| 457 | u8 device_type: 7; |
| 458 | u8 device_status: 1; |
| 459 | u8 device_type_instance; |
| 460 | u16 segment_group_number; |
| 461 | u8 bus_number; |
| 462 | u8 function_number: 3; |
| 463 | u8 device_number: 5; |
| 464 | char eos[2]; |
| 465 | } __attribute__((packed)); |
| 466 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 467 | struct smbios_type127 { |
| 468 | u8 type; |
| 469 | u8 length; |
| 470 | u16 handle; |
| 471 | u8 eos[2]; |
| 472 | } __attribute__((packed)); |
| 473 | |
Timothy Pearson | 4785f2a | 2015-03-27 23:05:36 -0500 | [diff] [blame] | 474 | void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17 *t); |
| 475 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 476 | #endif |