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