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 | |
Benjamin Doron | ea13dc3 | 2023-06-20 12:21:27 -0400 | [diff] [blame^] | 9 | #define update_max(len, max_len, stmt) \ |
| 10 | do { \ |
| 11 | int tmp = stmt; \ |
| 12 | \ |
| 13 | max_len = MAX(max_len, tmp); \ |
| 14 | len += tmp; \ |
| 15 | } while (0) |
| 16 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 17 | unsigned long smbios_write_tables(unsigned long start); |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 18 | int smbios_add_string(u8 *start, const char *str); |
| 19 | int smbios_string_table_len(u8 *start); |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 20 | |
Angel Pons | a37701a | 2021-06-28 17:36:53 +0200 | [diff] [blame] | 21 | struct smbios_header; |
| 22 | int smbios_full_table_len(struct smbios_header *header, u8 *str_table_start); |
Angel Pons | d62a501 | 2021-06-28 17:18:06 +0200 | [diff] [blame] | 23 | void *smbios_carve_table(unsigned long start, u8 type, u8 length, u16 handle); |
| 24 | |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 25 | /* Used by mainboard to add an on-board device */ |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 26 | enum misc_slot_type; |
| 27 | enum misc_slot_length; |
| 28 | enum misc_slot_usage; |
| 29 | enum slot_data_bus_bandwidth; |
| 30 | int smbios_write_type9(unsigned long *current, int *handle, |
| 31 | const char *name, const enum misc_slot_type type, |
| 32 | const enum slot_data_bus_bandwidth bandwidth, |
| 33 | const enum misc_slot_usage usage, |
| 34 | const enum misc_slot_length length, |
JingleHsuWiwynn | 20fa59f | 2021-01-26 09:55:34 +0800 | [diff] [blame] | 35 | const u16 id, u8 slot_char1, u8 slot_char2, u8 bus, u8 dev_func); |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 36 | enum smbios_bmc_interface_type; |
| 37 | int smbios_write_type38(unsigned long *current, int *handle, |
| 38 | const enum smbios_bmc_interface_type interface_type, |
| 39 | const u8 ipmi_rev, const u8 i2c_addr, const u8 nv_addr, |
| 40 | const u64 base_addr, const u8 base_modifier, |
| 41 | const u8 irq); |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 42 | int smbios_write_type41(unsigned long *current, int *handle, |
| 43 | const char *name, u8 instance, u16 segment, |
Christian Walter | e6afab1 | 2019-05-21 17:22:49 +0200 | [diff] [blame] | 44 | u8 bus, u8 device, u8 function, u8 device_type); |
Erik van den Bogaert | 9378152 | 2022-09-28 12:35:51 +0200 | [diff] [blame] | 45 | enum smbios_temp_location; |
| 46 | enum smbios_temp_status; |
| 47 | int smbios_write_type28(unsigned long *current, int *handle, |
| 48 | const char *name, |
| 49 | const enum smbios_temp_location location, |
| 50 | const enum smbios_temp_status status, |
| 51 | u16 max_value, u16 min_value, |
| 52 | u16 resolution, u16 tolerance, |
| 53 | u16 accuracy, |
| 54 | u32 oem, |
| 55 | u16 nominal_value); |
Duncan Laurie | 21a7870 | 2013-05-23 14:17:05 -0700 | [diff] [blame] | 56 | |
Michał Żygowski | e779523 | 2022-05-04 14:10:45 +0200 | [diff] [blame] | 57 | int smbios_write_type43(unsigned long *current, int *handle, const u32 vendor_id, |
| 58 | const u8 major_spec_ver, const u8 minor_spec_ver, |
| 59 | const u32 fw_ver1, const u32 fw_ver2, const char *description, |
| 60 | const u64 characteristics, const u32 oem_defined); |
| 61 | |
Angel Pons | 6a73b24 | 2021-09-03 12:18:10 +0200 | [diff] [blame] | 62 | struct device; |
| 63 | int get_smbios_data(struct device *dev, int *handle, unsigned long *current); |
| 64 | |
Nico Huber | ebd8a4f | 2017-11-01 09:49:16 +0100 | [diff] [blame] | 65 | const char *smbios_system_manufacturer(void); |
| 66 | const char *smbios_system_product_name(void); |
| 67 | const char *smbios_system_serial_number(void); |
| 68 | const char *smbios_system_version(void); |
| 69 | void smbios_system_set_uuid(u8 *uuid); |
| 70 | const char *smbios_system_sku(void); |
| 71 | |
Andrey Petrov | 2e032f0 | 2019-10-23 15:31:51 -0700 | [diff] [blame] | 72 | unsigned int smbios_cpu_get_max_speed_mhz(void); |
| 73 | unsigned int smbios_cpu_get_current_speed_mhz(void); |
Patrick Rudolph | b01ac7e | 2020-07-26 14:23:37 +0200 | [diff] [blame] | 74 | unsigned int smbios_cpu_get_voltage(void); |
Andrey Petrov | 2e032f0 | 2019-10-23 15:31:51 -0700 | [diff] [blame] | 75 | |
Gerd Hoffmann | 0626274 | 2013-11-13 13:37:23 +0100 | [diff] [blame] | 76 | const char *smbios_mainboard_manufacturer(void); |
| 77 | const char *smbios_mainboard_product_name(void); |
Christian Gmeiner | ac3aa09 | 2012-07-25 13:42:40 +0200 | [diff] [blame] | 78 | const char *smbios_mainboard_serial_number(void); |
| 79 | const char *smbios_mainboard_version(void); |
Nico Huber | ebd8a4f | 2017-11-01 09:49:16 +0100 | [diff] [blame] | 80 | |
Vladimir Serbinenko | 63acd22 | 2014-06-01 00:26:48 +0200 | [diff] [blame] | 81 | const char *smbios_mainboard_bios_version(void); |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 82 | const char *smbios_mainboard_asset_tag(void); |
| 83 | u8 smbios_mainboard_feature_flags(void); |
| 84 | const char *smbios_mainboard_location_in_chassis(void); |
Johnny Lin | d344054 | 2020-01-30 18:21:22 +0800 | [diff] [blame] | 85 | const char *smbios_chassis_version(void); |
| 86 | const char *smbios_chassis_serial_number(void); |
| 87 | const char *smbios_processor_serial_number(void); |
JingleHsuWiwynn | 4330b96 | 2021-01-28 09:13:42 +0800 | [diff] [blame] | 88 | u8 smbios_chassis_power_cords(void); |
Christian Gmeiner | ac3aa09 | 2012-07-25 13:42:40 +0200 | [diff] [blame] | 89 | |
Kyösti Mälkki | 0fcbd3a | 2020-12-20 08:27:21 +0200 | [diff] [blame] | 90 | /* This string could be filled late in payload. */ |
| 91 | void smbios_type0_bios_version(uintptr_t address); |
| 92 | |
Tim Chu | f2f53c4 | 2020-09-07 02:30:19 -0700 | [diff] [blame] | 93 | void smbios_ec_revision(uint8_t *ec_major_revision, uint8_t *ec_minor_revision); |
| 94 | |
Morgan Jang | 92bcc4f | 2020-07-24 10:36:18 +0800 | [diff] [blame] | 95 | unsigned int smbios_processor_external_clock(void); |
| 96 | unsigned int smbios_processor_characteristics(void); |
| 97 | struct cpuid_result; |
| 98 | unsigned int smbios_processor_family(struct cpuid_result res); |
| 99 | |
Morgan Jang | 8ae391d | 2020-10-06 16:26:17 +0800 | [diff] [blame] | 100 | unsigned int smbios_cache_error_correction_type(u8 level); |
| 101 | unsigned int smbios_cache_sram_type(void); |
| 102 | unsigned int smbios_cache_conf_operation_mode(u8 level); |
| 103 | |
BryantOu | 4a8e58f | 2020-04-20 19:45:20 -0700 | [diff] [blame] | 104 | /* Used by mainboard to add port information of type 8 */ |
| 105 | struct port_information; |
| 106 | int smbios_write_type8(unsigned long *current, int *handle, |
| 107 | const struct port_information *port, |
| 108 | size_t num_ports); |
| 109 | |
Elyes HAOUAS | 3233cf4 | 2019-02-14 17:46:02 +0100 | [diff] [blame] | 110 | #define BIOS_CHARACTERISTICS_PCI_SUPPORTED (1 << 7) |
| 111 | #define BIOS_CHARACTERISTICS_PC_CARD (1 << 8) |
| 112 | #define BIOS_CHARACTERISTICS_PNP (1 << 9) |
| 113 | #define BIOS_CHARACTERISTICS_APM (1 << 10) |
| 114 | #define BIOS_CHARACTERISTICS_UPGRADEABLE (1 << 11) |
| 115 | #define BIOS_CHARACTERISTICS_SHADOW (1 << 12) |
| 116 | #define BIOS_CHARACTERISTICS_BOOT_FROM_CD (1 << 15) |
| 117 | #define BIOS_CHARACTERISTICS_SELECTABLE_BOOT (1 << 16) |
| 118 | #define BIOS_CHARACTERISTICS_BIOS_SOCKETED (1 << 17) |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 119 | |
Elyes HAOUAS | 3233cf4 | 2019-02-14 17:46:02 +0100 | [diff] [blame] | 120 | #define BIOS_EXT1_CHARACTERISTICS_ACPI (1 << 0) |
| 121 | #define BIOS_EXT2_CHARACTERISTICS_TARGET (1 << 2) |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 122 | |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 123 | #define BIOS_MEMORY_ECC_SINGLE_BIT_CORRECTING (1 << 3) |
| 124 | #define BIOS_MEMORY_ECC_DOUBLE_BIT_CORRECTING (1 << 4) |
| 125 | #define BIOS_MEMORY_ECC_SCRUBBING (1 << 5) |
| 126 | |
| 127 | #define MEMORY_TYPE_DETAIL_OTHER (1 << 1) |
| 128 | #define MEMORY_TYPE_DETAIL_UNKNOWN (1 << 2) |
| 129 | #define MEMORY_TYPE_DETAIL_FAST_PAGED (1 << 3) |
| 130 | #define MEMORY_TYPE_DETAIL_STATIC_COLUMN (1 << 4) |
| 131 | #define MEMORY_TYPE_DETAIL_PSEUDO_STATIC (1 << 5) |
| 132 | #define MEMORY_TYPE_DETAIL_RAMBUS (1 << 6) |
| 133 | #define MEMORY_TYPE_DETAIL_SYNCHRONOUS (1 << 7) |
| 134 | #define MEMORY_TYPE_DETAIL_CMOS (1 << 8) |
| 135 | #define MEMORY_TYPE_DETAIL_EDO (1 << 9) |
| 136 | #define MEMORY_TYPE_DETAIL_WINDOW_DRAM (1 << 10) |
| 137 | #define MEMORY_TYPE_DETAIL_CACHE_DRAM (1 << 11) |
| 138 | #define MEMORY_TYPE_DETAIL_NON_VOLATILE (1 << 12) |
| 139 | #define MEMORY_TYPE_DETAIL_REGISTERED (1 << 13) |
| 140 | #define MEMORY_TYPE_DETAIL_UNBUFFERED (1 << 14) |
Elyes HAOUAS | 1db2346 | 2019-02-14 17:49:47 +0100 | [diff] [blame] | 141 | #define MEMORY_TYPE_DETAIL_LRDIMM (1 << 15) |
| 142 | |
| 143 | #define MEMORY_TECHNOLOGY_OTHER 0x01 |
| 144 | #define MEMORY_TECHNOLOGY_UNKNOWN 0x02 |
| 145 | #define MEMORY_TECHNOLOGY_DRAM 0x03 |
| 146 | #define MEMORY_TECHNOLOGY_NVDIMM_N 0x04 |
| 147 | #define MEMORY_TECHNOLOGY_NVDIMM_F 0x05 |
| 148 | #define MEMORY_TECHNOLOGY_NVDIMM_P 0x06 |
| 149 | #define MEMORY_TECHNOLOGY_INTEL_PERSISTENT 0x07 |
| 150 | |
| 151 | #define MEMORY_OPERATING_MODE_CAP_OTHER (1 << 1) |
| 152 | #define MEMORY_OPERATING_MODE_CAP_UNKNOWN (1 << 2) |
| 153 | #define MEMORY_OPERATING_MODE_CAP_VOLATILE (1 << 3) |
| 154 | #define MEMORY_OPERATING_MODE_CAP_BYTE_ACCESS_PERSISTENT (1 << 4) |
| 155 | #define MEMORY_OPERATING_MODE_CAP_BLOCK_ACCESS_PERSISTENT (1 << 5) |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 156 | |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 157 | typedef enum { |
Lee Leahy | 0be6d93 | 2015-06-26 11:15:42 -0700 | [diff] [blame] | 158 | MEMORY_BUS_WIDTH_8 = 0, |
| 159 | MEMORY_BUS_WIDTH_16 = 1, |
| 160 | MEMORY_BUS_WIDTH_32 = 2, |
| 161 | MEMORY_BUS_WIDTH_64 = 3, |
| 162 | MEMORY_BUS_WIDTH_128 = 4, |
| 163 | MEMORY_BUS_WIDTH_256 = 5, |
| 164 | MEMORY_BUS_WIDTH_512 = 6, |
| 165 | MEMORY_BUS_WIDTH_1024 = 7, |
| 166 | MEMORY_BUS_WIDTH_MAX = 7, |
| 167 | } smbios_memory_bus_width; |
| 168 | |
| 169 | typedef enum { |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 170 | MEMORY_FORMFACTOR_OTHER = 0x01, |
| 171 | MEMORY_FORMFACTOR_UNKNOWN = 0x02, |
| 172 | MEMORY_FORMFACTOR_SIMM = 0x03, |
| 173 | MEMORY_FORMFACTOR_SIP = 0x04, |
| 174 | MEMORY_FORMFACTOR_CHIP = 0x05, |
| 175 | MEMORY_FORMFACTOR_DIP = 0x06, |
| 176 | MEMORY_FORMFACTOR_ZIP = 0x07, |
| 177 | MEMORY_FORMFACTOR_PROPRIETARY_CARD = 0x08, |
| 178 | MEMORY_FORMFACTOR_DIMM = 0x09, |
| 179 | MEMORY_FORMFACTOR_TSOP = 0x0a, |
| 180 | MEMORY_FORMFACTOR_ROC = 0x0b, |
| 181 | MEMORY_FORMFACTOR_RIMM = 0x0c, |
| 182 | MEMORY_FORMFACTOR_SODIMM = 0x0d, |
| 183 | MEMORY_FORMFACTOR_SRIMM = 0x0e, |
| 184 | MEMORY_FORMFACTOR_FBDIMM = 0x0f, |
Elyes HAOUAS | 86b683a | 2019-10-08 16:30:43 +0200 | [diff] [blame] | 185 | MEMORY_FORMFACTOR_DIE = 0x10, |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 186 | } smbios_memory_form_factor; |
| 187 | |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 188 | typedef enum { |
| 189 | MEMORY_TYPE_OTHER = 0x01, |
| 190 | MEMORY_TYPE_UNKNOWN = 0x02, |
| 191 | MEMORY_TYPE_DRAM = 0x03, |
| 192 | MEMORY_TYPE_EDRAM = 0x04, |
| 193 | MEMORY_TYPE_VRAM = 0x05, |
| 194 | MEMORY_TYPE_SRAM = 0x06, |
| 195 | MEMORY_TYPE_RAM = 0x07, |
| 196 | MEMORY_TYPE_ROM = 0x08, |
| 197 | MEMORY_TYPE_FLASH = 0x09, |
| 198 | MEMORY_TYPE_EEPROM = 0x0a, |
| 199 | MEMORY_TYPE_FEPROM = 0x0b, |
| 200 | MEMORY_TYPE_EPROM = 0x0c, |
| 201 | MEMORY_TYPE_CDRAM = 0x0d, |
| 202 | MEMORY_TYPE_3DRAM = 0x0e, |
| 203 | MEMORY_TYPE_SDRAM = 0x0f, |
| 204 | MEMORY_TYPE_SGRAM = 0x10, |
| 205 | MEMORY_TYPE_RDRAM = 0x11, |
| 206 | MEMORY_TYPE_DDR = 0x12, |
| 207 | MEMORY_TYPE_DDR2 = 0x13, |
| 208 | MEMORY_TYPE_DDR2_FBDIMM = 0x14, |
| 209 | MEMORY_TYPE_DDR3 = 0x18, |
| 210 | MEMORY_TYPE_FBD2 = 0x19, |
Elyes HAOUAS | 28114ae | 2018-11-14 17:51:00 +0100 | [diff] [blame] | 211 | MEMORY_TYPE_DDR4 = 0x1a, |
| 212 | MEMORY_TYPE_LPDDR = 0x1b, |
| 213 | MEMORY_TYPE_LPDDR2 = 0x1c, |
| 214 | MEMORY_TYPE_LPDDR3 = 0x1d, |
| 215 | MEMORY_TYPE_LPDDR4 = 0x1e, |
| 216 | MEMORY_TYPE_LOGICAL_NON_VOLATILE_DEVICE = 0x1f, |
Elyes HAOUAS | 86b683a | 2019-10-08 16:30:43 +0200 | [diff] [blame] | 217 | MEMORY_TYPE_HBM = 0x20, |
| 218 | MEMORY_TYPE_HBM2 = 0x21, |
Subrata Banik | 6cdc838 | 2021-10-27 23:04:07 +0530 | [diff] [blame] | 219 | MEMORY_TYPE_DDR5 = 0x22, |
| 220 | MEMORY_TYPE_LPDDR5 = 0x23, |
Elyes Haouas | 5bbdb0c | 2022-06-23 13:38:26 +0200 | [diff] [blame] | 221 | MEMORY_TYPE_HBM3 = 0x24, |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 222 | } smbios_memory_type; |
| 223 | |
| 224 | typedef enum { |
| 225 | MEMORY_ARRAY_LOCATION_OTHER = 0x01, |
| 226 | MEMORY_ARRAY_LOCATION_UNKNOWN = 0x02, |
| 227 | MEMORY_ARRAY_LOCATION_SYSTEM_BOARD = 0x03, |
| 228 | MEMORY_ARRAY_LOCATION_ISA_ADD_ON = 0x04, |
| 229 | MEMORY_ARRAY_LOCATION_EISA_ADD_ON = 0x05, |
| 230 | MEMORY_ARRAY_LOCATION_PCI_ADD_ON = 0x06, |
| 231 | MEMORY_ARRAY_LOCATION_MCA_ADD_ON = 0x07, |
| 232 | MEMORY_ARRAY_LOCATION_PCMCIA_ADD_ON = 0x08, |
| 233 | MEMORY_ARRAY_LOCATION_PROPRIETARY_ADD_ON = 0x09, |
| 234 | MEMORY_ARRAY_LOCATION_NUBUS = 0x0a, |
| 235 | MEMORY_ARRAY_LOCATION_PC_98_C20_ADD_ON = 0xa0, |
| 236 | MEMORY_ARRAY_LOCATION_PC_98_C24_ADD_ON = 0xa1, |
| 237 | MEMORY_ARRAY_LOCATION_PC_98_E_ADD_ON = 0xa2, |
| 238 | MEMORY_ARRAY_LOCATION_PC_98_LOCAL_BUS_ADD_ON = 0xa3, |
Elyes HAOUAS | 77fe213 | 2019-10-29 08:42:03 +0100 | [diff] [blame] | 239 | MEMORY_ARRAY_LOCATION_CXL_FLEXBUS_1_0_ADD_ON = 0xa4, |
Timothy Pearson | 821217b | 2015-03-27 22:47:25 -0500 | [diff] [blame] | 240 | } smbios_memory_array_location; |
| 241 | |
| 242 | typedef enum { |
| 243 | MEMORY_ARRAY_USE_OTHER = 0x01, |
| 244 | MEMORY_ARRAY_USE_UNKNOWN = 0x02, |
| 245 | MEMORY_ARRAY_USE_SYSTEM = 0x03, |
| 246 | MEMORY_ARRAY_USE_VIDEO = 0x04, |
| 247 | MEMORY_ARRAY_USE_FLASH = 0x05, |
| 248 | MEMORY_ARRAY_USE_NVRAM = 0x06, |
| 249 | MEMORY_ARRAY_USE_CACHE = 0x07, |
| 250 | } smbios_memory_array_use; |
| 251 | |
| 252 | typedef enum { |
| 253 | MEMORY_ARRAY_ECC_OTHER = 0x01, |
| 254 | MEMORY_ARRAY_ECC_UNKNOWN = 0x02, |
| 255 | MEMORY_ARRAY_ECC_NONE = 0x03, |
| 256 | MEMORY_ARRAY_ECC_PARITY = 0x04, |
| 257 | MEMORY_ARRAY_ECC_SINGLE_BIT = 0x05, |
| 258 | MEMORY_ARRAY_ECC_MULTI_BIT = 0x06, |
| 259 | MEMORY_ARRAY_ECC_CRC = 0x07, |
| 260 | } smbios_memory_array_ecc; |
| 261 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 262 | #define SMBIOS_STATE_SAFE 3 |
| 263 | typedef enum { |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 264 | SMBIOS_BIOS_INFORMATION = 0, |
| 265 | SMBIOS_SYSTEM_INFORMATION = 1, |
| 266 | SMBIOS_BOARD_INFORMATION = 2, |
| 267 | SMBIOS_SYSTEM_ENCLOSURE = 3, |
| 268 | SMBIOS_PROCESSOR_INFORMATION = 4, |
| 269 | SMBIOS_CACHE_INFORMATION = 7, |
BryantOu | 4a8e58f | 2020-04-20 19:45:20 -0700 | [diff] [blame] | 270 | SMBIOS_PORT_CONNECTOR_INFORMATION = 8, |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 271 | SMBIOS_SYSTEM_SLOTS = 9, |
| 272 | SMBIOS_OEM_STRINGS = 11, |
| 273 | SMBIOS_EVENT_LOG = 15, |
| 274 | SMBIOS_PHYS_MEMORY_ARRAY = 16, |
| 275 | SMBIOS_MEMORY_DEVICE = 17, |
| 276 | SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS = 19, |
Matt DeVillier | d1c1afd | 2016-09-02 21:41:26 -0500 | [diff] [blame] | 277 | SMBIOS_MEMORY_DEVICE_MAPPED_ADDRESS = 20, |
Erik van den Bogaert | 9378152 | 2022-09-28 12:35:51 +0200 | [diff] [blame] | 278 | SMBIOS_TEMPERATURE_PROBE = 28, |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 279 | SMBIOS_SYSTEM_BOOT_INFORMATION = 32, |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 280 | SMBIOS_IPMI_DEVICE_INFORMATION = 38, |
Jonathan Zhang | d57b821 | 2022-10-14 17:06:26 -0700 | [diff] [blame] | 281 | SMBIOS_SYSTEM_POWER_SUPPLY = 39, |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 282 | SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION = 41, |
Michał Żygowski | e779523 | 2022-05-04 14:10:45 +0200 | [diff] [blame] | 283 | SMBIOS_TPM_DEVICE = 43, |
Elyes HAOUAS | a0fed37 | 2016-09-16 20:17:40 +0200 | [diff] [blame] | 284 | SMBIOS_END_OF_TABLE = 127, |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 285 | } smbios_struct_type_t; |
| 286 | |
| 287 | struct smbios_entry { |
| 288 | u8 anchor[4]; |
| 289 | u8 checksum; |
| 290 | u8 length; |
| 291 | u8 major_version; |
| 292 | u8 minor_version; |
| 293 | u16 max_struct_size; |
| 294 | u8 entry_point_rev; |
| 295 | u8 formwatted_area[5]; |
| 296 | u8 intermediate_anchor_string[5]; |
| 297 | u8 intermediate_checksum; |
| 298 | u16 struct_table_length; |
| 299 | u32 struct_table_address; |
| 300 | u16 struct_count; |
| 301 | u8 smbios_bcd_revision; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 302 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 303 | |
Patrick Rudolph | 7a83582 | 2020-07-22 16:00:53 +0200 | [diff] [blame] | 304 | struct smbios_entry30 { |
| 305 | u8 anchor[5]; |
| 306 | u8 checksum; |
| 307 | u8 length; |
| 308 | u8 major_version; |
| 309 | u8 minor_version; |
| 310 | u8 smbios_doc_rev; |
| 311 | u8 entry_point_rev; |
| 312 | u8 reserved; |
| 313 | u32 struct_table_length; |
| 314 | u64 struct_table_address; |
| 315 | } __packed; |
| 316 | |
Angel Pons | ca01baa | 2021-06-28 16:06:28 +0200 | [diff] [blame] | 317 | struct smbios_header { |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 318 | u8 type; |
| 319 | u8 length; |
| 320 | u16 handle; |
Angel Pons | ca01baa | 2021-06-28 16:06:28 +0200 | [diff] [blame] | 321 | } __packed; |
| 322 | |
| 323 | struct smbios_type0 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 324 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 325 | u8 vendor; |
| 326 | u8 bios_version; |
| 327 | u16 bios_start_segment; |
| 328 | u8 bios_release_date; |
| 329 | u8 bios_rom_size; |
| 330 | u64 bios_characteristics; |
| 331 | u8 bios_characteristics_ext1; |
| 332 | u8 bios_characteristics_ext2; |
| 333 | u8 system_bios_major_release; |
| 334 | u8 system_bios_minor_release; |
| 335 | u8 ec_major_release; |
| 336 | u8 ec_minor_release; |
Elyes HAOUAS | 358cbb3 | 2019-02-14 14:19:22 +0100 | [diff] [blame] | 337 | u16 extended_bios_rom_size; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 338 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 339 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 340 | |
Tim Chu | 13ab1d7 | 2021-10-19 01:45:12 +0000 | [diff] [blame] | 341 | typedef enum { |
| 342 | SMBIOS_WAKEUP_TYPE_RESERVED = 0x00, |
| 343 | SMBIOS_WAKEUP_TYPE_OTHER = 0x01, |
| 344 | SMBIOS_WAKEUP_TYPE_UNKNOWN = 0x02, |
| 345 | SMBIOS_WAKEUP_TYPE_APM_TIMER = 0x03, |
| 346 | SMBIOS_WAKEUP_TYPE_MODEM_RING = 0x04, |
| 347 | SMBIOS_WAKEUP_TYPE_LAN_REMOTE = 0x05, |
| 348 | SMBIOS_WAKEUP_TYPE_POWER_SWITCH = 0x06, |
| 349 | SMBIOS_WAKEUP_TYPE_PCI_PME = 0x07, |
| 350 | SMBIOS_WAKEUP_TYPE_AC_POWER_RESTORED = 0x08, |
| 351 | } smbios_wakeup_type; |
| 352 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 353 | struct smbios_type1 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 354 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 355 | u8 manufacturer; |
| 356 | u8 product_name; |
| 357 | u8 version; |
| 358 | u8 serial_number; |
| 359 | u8 uuid[16]; |
| 360 | u8 wakeup_type; |
| 361 | u8 sku; |
| 362 | u8 family; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 363 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 364 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 365 | |
Tim Chu | e82aa22 | 2020-12-21 23:33:18 -0800 | [diff] [blame] | 366 | #define SMBIOS_FEATURE_FLAGS_HOSTING_BOARD (1 << 0) |
| 367 | #define SMBIOS_FEATURE_FLAGS_REQUIRES_DAUGHTER_CARD (1 << 1) |
| 368 | #define SMBIOS_FEATURE_FLAGS_REMOVABLE (1 << 2) |
| 369 | #define SMBIOS_FEATURE_FLAGS_REPLACEABLE (1 << 3) |
| 370 | #define SMBIOS_FEATURE_FLAGS_HOT_SWAPPABLE (1 << 4) |
| 371 | |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 372 | typedef enum { |
| 373 | SMBIOS_BOARD_TYPE_UNKNOWN = 0x01, |
| 374 | SMBIOS_BOARD_TYPE_OTHER = 0x02, |
| 375 | SMBIOS_BOARD_TYPE_SERVER_BLADE = 0x03, |
| 376 | SMBIOS_BOARD_TYPE_CONNECTIVITY_SWITCH = 0x04, |
| 377 | SMBIOS_BOARD_TYPE_SYSTEM_MANAGEMENT_MODULE = 0x05, |
| 378 | SMBIOS_BOARD_TYPE_PROCESSOR_MODULE = 0x06, |
| 379 | SMBIOS_BOARD_TYPE_IO_MODULE = 0x07, |
| 380 | SMBIOS_BOARD_TYPE_MEMORY_MODULE = 0x08, |
| 381 | SMBIOS_BOARD_TYPE_DAUGHTER_BOARD = 0x09, |
| 382 | SMBIOS_BOARD_TYPE_MOTHERBOARD = 0x0a, |
| 383 | SMBIOS_BOARD_TYPE_PROCESSOR_MEMORY_MODULE = 0x0b, |
| 384 | SMBIOS_BOARD_TYPE_PROCESSOR_IO_MODULE = 0x0c, |
| 385 | SMBIOS_BOARD_TYPE_INTERCONNECT_BOARD = 0x0d, |
| 386 | } smbios_board_type; |
| 387 | |
Vladimir Serbinenko | 47089f2 | 2014-03-02 19:14:44 +0100 | [diff] [blame] | 388 | struct smbios_type2 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 389 | struct smbios_header header; |
Vladimir Serbinenko | 47089f2 | 2014-03-02 19:14:44 +0100 | [diff] [blame] | 390 | u8 manufacturer; |
| 391 | u8 product_name; |
| 392 | u8 version; |
| 393 | u8 serial_number; |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 394 | u8 asset_tag; |
| 395 | u8 feature_flags; |
| 396 | u8 location_in_chassis; |
| 397 | u16 chassis_handle; |
| 398 | u8 board_type; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 399 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 400 | } __packed; |
Vladimir Serbinenko | 47089f2 | 2014-03-02 19:14:44 +0100 | [diff] [blame] | 401 | |
Mathew King | be820b3 | 2019-10-31 12:10:44 -0600 | [diff] [blame] | 402 | typedef enum { |
Elyes HAOUAS | 25dbc17 | 2017-07-04 21:38:03 +0200 | [diff] [blame] | 403 | SMBIOS_ENCLOSURE_OTHER = 0x01, |
| 404 | SMBIOS_ENCLOSURE_UNKNOWN = 0x02, |
| 405 | SMBIOS_ENCLOSURE_DESKTOP = 0x03, |
| 406 | SMBIOS_ENCLOSURE_LOW_PROFILE_DESKTOP = 0x04, |
| 407 | SMBIOS_ENCLOSURE_PIZZA_BOX = 0x05, |
| 408 | SMBIOS_ENCLOSURE_MINI_TOWER = 0x06, |
| 409 | SMBIOS_ENCLOSURE_TOWER = 0x07, |
| 410 | SMBIOS_ENCLOSURE_PORTABLE = 0x08, |
| 411 | SMBIOS_ENCLOSURE_LAPTOP = 0x09, |
| 412 | SMBIOS_ENCLOSURE_NOTEBOOK = 0x0a, |
| 413 | SMBIOS_ENCLOSURE_HAND_HELD = 0x0b, |
| 414 | SMBIOS_ENCLOSURE_DOCKING_STATION = 0x0c, |
| 415 | SMBIOS_ENCLOSURE_ALL_IN_ONE = 0x0d, |
| 416 | SMBIOS_ENCLOSURE_SUB_NOTEBOOK = 0x0e, |
| 417 | SMBIOS_ENCLOSURE_SPACE_SAVING = 0x0f, |
| 418 | SMBIOS_ENCLOSURE_LUNCH_BOX = 0x10, |
| 419 | SMBIOS_ENCLOSURE_MAIN_SERVER_CHASSIS = 0x11, |
| 420 | SMBIOS_ENCLOSURE_EXPANSION_CHASSIS = 0x12, |
| 421 | SMBIOS_ENCLOSURE_SUBCHASSIS = 0x13, |
| 422 | SMBIOS_ENCLOSURE_BUS_EXPANSION_CHASSIS = 0x14, |
| 423 | SMBIOS_ENCLOSURE_PERIPHERAL_CHASSIS = 0x15, |
| 424 | SMBIOS_ENCLOSURE_RAID_CHASSIS = 0x16, |
| 425 | SMBIOS_ENCLOSURE_RACK_MOUNT_CHASSIS = 0x17, |
| 426 | SMBIOS_ENCLOSURE_SEALED_CASE_PC = 0x18, |
| 427 | SMBIOS_ENCLOSURE_MULTI_SYSTEM_CHASSIS = 0x19, |
| 428 | SMBIOS_ENCLOSURE_COMPACT_PCI = 0x1a, |
| 429 | SMBIOS_ENCLOSURE_ADVANCED_TCA = 0x1b, |
| 430 | SMBIOS_ENCLOSURE_BLADE = 0x1c, |
| 431 | SMBIOS_ENCLOSURE_BLADE_ENCLOSURE = 0x1d, |
| 432 | SMBIOS_ENCLOSURE_TABLET = 0x1e, |
| 433 | SMBIOS_ENCLOSURE_CONVERTIBLE = 0x1f, |
| 434 | SMBIOS_ENCLOSURE_DETACHABLE = 0x20, |
| 435 | SMBIOS_ENCLOSURE_IOT_GATEWAY = 0x21, |
| 436 | SMBIOS_ENCLOSURE_EMBEDDED_PC = 0x22, |
| 437 | SMBIOS_ENCLOSURE_MINI_PC = 0x23, |
| 438 | SMBIOS_ENCLOSURE_STICK_PC = 0x24, |
Mathew King | be820b3 | 2019-10-31 12:10:44 -0600 | [diff] [blame] | 439 | } smbios_enclosure_type; |
Vladimir Serbinenko | 71c0bf6 | 2014-08-27 23:23:14 +0200 | [diff] [blame] | 440 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 441 | struct smbios_type3 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 442 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 443 | u8 manufacturer; |
| 444 | u8 _type; |
| 445 | u8 version; |
| 446 | u8 serial_number; |
| 447 | u8 asset_tag_number; |
| 448 | u8 bootup_state; |
| 449 | u8 power_supply_state; |
| 450 | u8 thermal_state; |
| 451 | u8 security_status; |
| 452 | u32 oem_defined; |
| 453 | u8 height; |
| 454 | u8 number_of_power_cords; |
| 455 | u8 element_count; |
| 456 | u8 element_record_length; |
Matt DeVillier | 4863cc4 | 2016-09-01 00:55:40 -0500 | [diff] [blame] | 457 | u8 sku_number; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 458 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 459 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 460 | |
| 461 | struct smbios_type4 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 462 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 463 | u8 socket_designation; |
| 464 | u8 processor_type; |
| 465 | u8 processor_family; |
| 466 | u8 processor_manufacturer; |
| 467 | u32 processor_id[2]; |
| 468 | u8 processor_version; |
| 469 | u8 voltage; |
| 470 | u16 external_clock; |
| 471 | u16 max_speed; |
| 472 | u16 current_speed; |
| 473 | u8 status; |
| 474 | u8 processor_upgrade; |
| 475 | u16 l1_cache_handle; |
| 476 | u16 l2_cache_handle; |
| 477 | u16 l3_cache_handle; |
| 478 | u8 serial_number; |
| 479 | u8 asset_tag; |
| 480 | u8 part_number; |
| 481 | u8 core_count; |
| 482 | u8 core_enabled; |
| 483 | u8 thread_count; |
| 484 | u16 processor_characteristics; |
| 485 | u16 processor_family2; |
Patrick Rudolph | 7a83582 | 2020-07-22 16:00:53 +0200 | [diff] [blame] | 486 | u16 core_count2; |
| 487 | u16 core_enabled2; |
| 488 | u16 thread_count2; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 489 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 490 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 491 | |
Patrick Rudolph | 4aea691 | 2020-07-22 07:28:26 +0200 | [diff] [blame] | 492 | /* defines for smbios_type4 */ |
| 493 | |
| 494 | #define SMBIOS_PROCESSOR_STATUS_POPULATED (1 << 6) |
| 495 | #define SMBIOS_PROCESSOR_STATUS_CPU_ENABLED (1 << 0) |
| 496 | |
Li, Jincheng | aa99012 | 2023-01-03 15:43:40 +0800 | [diff] [blame] | 497 | /* enum for socket type */ |
| 498 | enum smbios_processor_upgrade_field { |
| 499 | PROCESSOR_UPGRADE_OTHER = 0x01, |
| 500 | PROCESSOR_UPGRADE_UNKNOWN = 0x02, |
| 501 | PROCESSOR_UPGRADE_DAUGHTER_BOARD = 0x03, |
| 502 | PROCESSOR_UPGRADE_ZIF_SOCKET = 0x04, |
| 503 | PROCESSOR_UPGRADE_REPLACEABLE_PIGGY_BACK = 0x05, |
| 504 | PROCESSOR_UPGRADE_NONE = 0x06, |
| 505 | PROCESSOR_UPGRADE_LIF_SOCKET = 0x07, |
| 506 | PROCESSOR_UPGRADE_SLOT_1 = 0x08, |
| 507 | PROCESSOR_UPGRADE_SLOT_2 = 0x09, |
| 508 | PROCESSOR_UPGRADE_370_PIN_SOCKET = 0x0a, |
| 509 | PROCESSOR_UPGRADE_SLOT_A = 0x0b, |
| 510 | PROCESSOR_UPGRADE_SLOT_M = 0x0c, |
| 511 | PROCESSOR_UPGRADE_SOCKET_423 = 0x0d, |
| 512 | PROCESSOR_UPGRADE_SOCKET_A = 0x0e, |
| 513 | PROCESSOR_UPGRADE_SOCKET_478 = 0x0f, |
| 514 | PROCESSOR_UPGRADE_SOCKET_754 = 0x10, |
| 515 | PROCESSOR_UPGRADE_SOCKET_940 = 0x11, |
| 516 | PROCESSOR_UPGRADE_SOCKET_939 = 0x12, |
| 517 | PROCESSOR_UPGRADE_SOCKET_MPGA604 = 0x13, |
| 518 | PROCESSOR_UPGRADE_SOCKET_LGA771 = 0x14, |
| 519 | PROCESSOR_UPGRADE_SOCKET_LGA775 = 0x15, |
| 520 | PROCESSOR_UPGRADE_SOCKET_S1 = 0x16, |
| 521 | PROCESSOR_UPGRADE_SOCKET_AM2 = 0x17, |
| 522 | PROCESSOR_UPGRADE_SOCKET_F = 0x18, |
| 523 | PROCESSOR_UPGRADE_SOCKET_LGA1366 = 0x19, |
| 524 | PROCESSOR_UPGRADE_SOCKET_G34 = 0x1a, |
| 525 | PROCESSOR_UPGRADE_SOCKET_AM3 = 0x1b, |
| 526 | PROCESSOR_UPGRADE_SOCKET_C32 = 0x1c, |
| 527 | PROCESSOR_UPGRADE_SOCKET_LGA1156 = 0x1d, |
| 528 | PROCESSOR_UPGRADE_SOCKET_LGA1567 = 0x1e, |
| 529 | PROCESSOR_UPGRADE_SOCKET_PGA988A = 0x1f, |
| 530 | PROCESSOR_UPGRADE_SOCKET_BGA1288 = 0x20, |
| 531 | PROCESSOR_UPGRADE_SOCKET_RPGA988B = 0x21, |
| 532 | PROCESSOR_UPGRADE_SOCKET_BGA1023 = 0x22, |
| 533 | PROCESSOR_UPGRADE_SOCKET_BGA1224 = 0x23, |
| 534 | PROCESSOR_UPGRADE_SOCKET_LGA1155 = 0x24, |
| 535 | PROCESSOR_UPGRADE_SOCKET_LGA1356 = 0x25, |
| 536 | PROCESSOR_UPGRADE_SOCKET_LGA2011 = 0x26, |
| 537 | PROCESSOR_UPGRADE_SOCKET_FS1 = 0x27, |
| 538 | PROCESSOR_UPGRADE_SOCKET_FS2 = 0x28, |
| 539 | PROCESSOR_UPGRADE_SOCKET_FM1 = 0x29, |
| 540 | PROCESSOR_UPGRADE_SOCKET_FM2 = 0x2a, |
| 541 | PROCESSOR_UPGRADE_SOCKET_LGA2011_3 = 0x2b, |
| 542 | PROCESSOR_UPGRADE_SOCKET_LGA1356_3 = 0x2c, |
| 543 | PROCESSOR_UPGRADE_SOCKET_LGA1150 = 0x2d, |
| 544 | PROCESSOR_UPGRADE_SOCKET_BGA1168 = 0x2e, |
| 545 | PROCESSOR_UPGRADE_SOCKET_BGA1234 = 0x2f, |
| 546 | PROCESSOR_UPGRADE_SOCKET_BGA1364 = 0x30, |
| 547 | PROCESSOR_UPGRADE_SOCKET_AM4 = 0x31, |
| 548 | PROCESSOR_UPGRADE_SOCKET_LGA1151 = 0x32, |
| 549 | PROCESSOR_UPGRADE_SOCKET_BGA1356 = 0x33, |
| 550 | PROCESSOR_UPGRADE_SOCKET_BGA1440 = 0x34, |
| 551 | PROCESSOR_UPGRADE_SOCKET_BGA1515 = 0x35, |
| 552 | PROCESSOR_UPGRADE_SOCKET_LGA3647_1 = 0x36, |
| 553 | PROCESSOR_UPGRADE_SOCKET_SP3 = 0x37, |
| 554 | PROCESSOR_UPGRADE_SOCKET_SP3R2 = 0x38, |
| 555 | PROCESSOR_UPGRADE_SOCKET_LGA2066 = 0x39, |
| 556 | PROCESSOR_UPGRADE_SOCKET_BGA1392 = 0x3a, |
| 557 | PROCESSOR_UPGRADE_SOCKET_BGA1510 = 0x3b, |
| 558 | PROCESSOR_UPGRADE_SOCKET_BGA1528 = 0x3c, |
| 559 | PROCESSOR_UPGRADE_SOCKET_LGA4189 = 0x3d, |
| 560 | PROCESSOR_UPGRADE_SOCKET_LGA1200 = 0x3e, |
| 561 | PROCESSOR_UPGRADE_SOCKET_LGA4677 = 0x3f, |
| 562 | PROCESSOR_UPGRADE_SOCKET_LGA1700 = 0x40, |
| 563 | PROCESSOR_UPGRADE_SOCKET_BGA1744 = 0x41, |
| 564 | PROCESSOR_UPGRADE_SOCKET_BGA1781 = 0x42, |
| 565 | PROCESSOR_UPGRADE_SOCKET_BGA1211 = 0x43, |
| 566 | PROCESSOR_UPGRADE_SOCKET_BGA2422 = 0x44, |
| 567 | PROCESSOR_UPGRADE_SOCKET_LGA1211 = 0x45, |
| 568 | PROCESSOR_UPGRADE_SOCKET_LGA2422 = 0x46, |
| 569 | PROCESSOR_UPGRADE_SOCKET_LGA5773 = 0x47, |
| 570 | PROCESSOR_UPGRADE_SOCKET_BGA5773 = 0x48, |
| 571 | }; |
| 572 | |
Tim Chu | 323e5a8 | 2022-10-27 03:03:59 +0000 | [diff] [blame] | 573 | /* defines for processor family */ |
| 574 | #define SMBIOS_PROCESSOR_FAMILY_OTHER 0x01 |
| 575 | #define SMBIOS_PROCESSOR_FAMILY_UNKNOWN 0x02 |
| 576 | #define SMBIOS_PROCESSOR_FAMILY_XEON 0xb3 |
| 577 | |
| 578 | /* defines for processor characteristics */ |
| 579 | #define PROCESSOR_64BIT_CAPABLE (1 << 2) |
| 580 | #define PROCESSOR_MULTI_CORE (1 << 3) |
| 581 | #define PROCESSOR_POWER_PERFORMANCE_CONTROL (1 << 7) |
| 582 | |
Patrick Rudolph | fc5b809 | 2019-03-30 17:37:28 +0100 | [diff] [blame] | 583 | /* defines for supported_sram_type/current_sram_type */ |
| 584 | |
| 585 | #define SMBIOS_CACHE_SRAM_TYPE_OTHER (1 << 0) |
| 586 | #define SMBIOS_CACHE_SRAM_TYPE_UNKNOWN (1 << 1) |
| 587 | #define SMBIOS_CACHE_SRAM_TYPE_NON_BURST (1 << 2) |
| 588 | #define SMBIOS_CACHE_SRAM_TYPE_BURST (1 << 3) |
| 589 | #define SMBIOS_CACHE_SRAM_TYPE_PIPELINE_BURST (1 << 4) |
| 590 | #define SMBIOS_CACHE_SRAM_TYPE_SYNCHRONOUS (1 << 5) |
| 591 | #define SMBIOS_CACHE_SRAM_TYPE_ASYNCHRONOUS (1 << 6) |
| 592 | |
| 593 | /* enum for error_correction_type */ |
| 594 | |
| 595 | enum smbios_cache_error_corr { |
| 596 | SMBIOS_CACHE_ERROR_CORRECTION_OTHER = 1, |
| 597 | SMBIOS_CACHE_ERROR_CORRECTION_UNKNOWN, |
| 598 | SMBIOS_CACHE_ERROR_CORRECTION_NONE, |
| 599 | SMBIOS_CACHE_ERROR_CORRECTION_PARITY, |
| 600 | SMBIOS_CACHE_ERROR_CORRECTION_SINGLE_BIT, |
| 601 | SMBIOS_CACHE_ERROR_CORRECTION_MULTI_BIT, |
| 602 | }; |
| 603 | |
| 604 | /* enum for system_cache_type */ |
| 605 | |
| 606 | enum smbios_cache_type { |
| 607 | SMBIOS_CACHE_TYPE_OTHER = 1, |
| 608 | SMBIOS_CACHE_TYPE_UNKNOWN, |
| 609 | SMBIOS_CACHE_TYPE_INSTRUCTION, |
| 610 | SMBIOS_CACHE_TYPE_DATA, |
| 611 | SMBIOS_CACHE_TYPE_UNIFIED, |
| 612 | }; |
| 613 | |
| 614 | /* enum for associativity */ |
| 615 | |
| 616 | enum smbios_cache_associativity { |
| 617 | SMBIOS_CACHE_ASSOCIATIVITY_OTHER = 1, |
| 618 | SMBIOS_CACHE_ASSOCIATIVITY_UNKNOWN, |
| 619 | SMBIOS_CACHE_ASSOCIATIVITY_DIRECT, |
| 620 | SMBIOS_CACHE_ASSOCIATIVITY_2WAY, |
| 621 | SMBIOS_CACHE_ASSOCIATIVITY_4WAY, |
| 622 | SMBIOS_CACHE_ASSOCIATIVITY_FULL, |
| 623 | SMBIOS_CACHE_ASSOCIATIVITY_8WAY, |
| 624 | SMBIOS_CACHE_ASSOCIATIVITY_16WAY, |
| 625 | SMBIOS_CACHE_ASSOCIATIVITY_12WAY, |
| 626 | SMBIOS_CACHE_ASSOCIATIVITY_24WAY, |
| 627 | SMBIOS_CACHE_ASSOCIATIVITY_32WAY, |
| 628 | SMBIOS_CACHE_ASSOCIATIVITY_48WAY, |
| 629 | SMBIOS_CACHE_ASSOCIATIVITY_64WAY, |
| 630 | SMBIOS_CACHE_ASSOCIATIVITY_20WAY, |
| 631 | }; |
| 632 | |
| 633 | /* defines for cache_configuration */ |
| 634 | |
| 635 | #define SMBIOS_CACHE_CONF_LEVEL(x) ((((x) - 1) & 0x7) << 0) |
| 636 | #define SMBIOS_CACHE_CONF_LOCATION(x) (((x) & 0x3) << 5) |
| 637 | #define SMBIOS_CACHE_CONF_ENABLED(x) (((x) & 0x1) << 7) |
| 638 | #define SMBIOS_CACHE_CONF_OPERATION_MODE(x) (((x) & 0x3) << 8) |
| 639 | |
| 640 | /* defines for max_cache_size and installed_size */ |
| 641 | |
| 642 | #define SMBIOS_CACHE_SIZE_UNIT_1KB (0 << 15) |
| 643 | #define SMBIOS_CACHE_SIZE_UNIT_64KB (1 << 15) |
| 644 | #define SMBIOS_CACHE_SIZE_MASK 0x7fff |
| 645 | #define SMBIOS_CACHE_SIZE_OVERFLOW 0xffff |
| 646 | |
| 647 | #define SMBIOS_CACHE_SIZE2_UNIT_1KB (0 << 31) |
| 648 | #define SMBIOS_CACHE_SIZE2_UNIT_64KB (1UL << 31) |
| 649 | #define SMBIOS_CACHE_SIZE2_MASK 0x7fffffff |
| 650 | |
Morgan Jang | 8ae391d | 2020-10-06 16:26:17 +0800 | [diff] [blame] | 651 | /* define for cache operation mode */ |
| 652 | |
| 653 | #define SMBIOS_CACHE_OP_MODE_WRITE_THROUGH 0 |
| 654 | #define SMBIOS_CACHE_OP_MODE_WRITE_BACK 1 |
| 655 | #define SMBIOS_CACHE_OP_MODE_VARIES_WITH_MEMORY_ADDRESS 2 |
| 656 | #define SMBIOS_CACHE_OP_MODE_UNKNOWN 3 |
| 657 | |
Patrick Rudolph | fc5b809 | 2019-03-30 17:37:28 +0100 | [diff] [blame] | 658 | struct smbios_type7 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 659 | struct smbios_header header; |
Patrick Rudolph | fc5b809 | 2019-03-30 17:37:28 +0100 | [diff] [blame] | 660 | u8 socket_designation; |
| 661 | u16 cache_configuration; |
| 662 | u16 max_cache_size; |
| 663 | u16 installed_size; |
| 664 | u16 supported_sram_type; |
| 665 | u16 current_sram_type; |
| 666 | u8 cache_speed; |
| 667 | u8 error_correction_type; |
| 668 | u8 system_cache_type; |
| 669 | u8 associativity; |
| 670 | u32 max_cache_size2; |
| 671 | u32 installed_size2; |
| 672 | u8 eos[2]; |
| 673 | } __packed; |
| 674 | |
BryantOu | 4a8e58f | 2020-04-20 19:45:20 -0700 | [diff] [blame] | 675 | /* enum for connector types */ |
| 676 | typedef enum { |
| 677 | CONN_NONE = 0x00, |
| 678 | CONN_CENTRONICS = 0x01, |
| 679 | CONN_MINI_CENTRONICS = 0x02, |
| 680 | CONN_PROPRIETARY = 0x03, |
| 681 | CONN_DB_25_PIN_MALE = 0x04, |
| 682 | CONN_DB_25_PIN_FEMALE = 0x05, |
| 683 | CONN_DB_15_PIN_MALE = 0x06, |
| 684 | CONN_DB_15_PIN_FEMALE = 0x07, |
| 685 | CONN_DB_9_PIN_MALE = 0x08, |
| 686 | CONN_DB_9_PIN_FEMALE = 0x09, |
| 687 | CONN_RJ_11 = 0x0A, |
| 688 | CONN_RJ_45 = 0x0B, |
| 689 | CONN_50_PIN_MINI_SCSI = 0x0C, |
| 690 | CONN_MINI_DIN = 0x0D, |
| 691 | CONN_MICRO_DIN = 0x0E, |
| 692 | CONN_PS_2 = 0x0F, |
| 693 | CONN_INFRARED = 0x10, |
| 694 | CONN_HP_HIL = 0x11, |
| 695 | CONN_ACCESS_BUS_USB = 0x12, |
| 696 | CONN_SSA_SCSI = 0x13, |
| 697 | CONN_CIRCULAR_DIN_8_MALE = 0x14, |
| 698 | CONN_CIRCULAR_DIN_8_FEMALE = 0x15, |
| 699 | CONN_ON_BOARD_IDE = 0x16, |
| 700 | CONN_ON_BOARD_FLOPPY = 0x17, |
| 701 | CONN_9_PIN_DUAL_INLINE = 0x18, |
| 702 | CONN_25_PIN_DUAL_INLINE = 0x19, |
| 703 | CONN_50_PIN_DUAL_INLINE = 0x1A, |
| 704 | CONN_68_PIN_DUAL_INLINE = 0x1B, |
| 705 | CONN_ON_BOARD_SOUND_INPUT_FROM_CD_ROM = 0x1C, |
| 706 | CONN_MINI_CENTRONICS_TYPE14 = 0x1D, |
| 707 | CONN_MINI_CENTRONICS_TYPE26 = 0x1E, |
| 708 | CONN_MINI_JACK_HEADPHONES = 0x1F, |
| 709 | CONN_BNC = 0x20, |
| 710 | CONN_1394 = 0x21, |
| 711 | CONN_SAS_SATA = 0x22, |
| 712 | CONN_USB_TYPE_C = 0x23, |
| 713 | CONN_PC_98 = 0xA0, |
| 714 | CONN_PC_98_HIRESO = 0xA1, |
| 715 | CONN_PC_H98 = 0xA2, |
| 716 | CONN_PC98_NOTE = 0xA3, |
| 717 | CONN_PC_98_FULL = 0xA4, |
| 718 | CONN_OTHER = 0xFF, |
| 719 | } type8_connector_types; |
| 720 | |
| 721 | /* enum for port types */ |
| 722 | typedef enum { |
Patrick Georgi | 54be395 | 2020-07-04 21:22:25 +0200 | [diff] [blame] | 723 | TYPE_NONE_PORT = 0x00, |
BryantOu | 4a8e58f | 2020-04-20 19:45:20 -0700 | [diff] [blame] | 724 | TYPE_PARALLEL_PORT_XT_AT_COMPATIBLE = 0x01, |
| 725 | TYPE_PARALLEL_PORT_PS_2 = 0x02, |
| 726 | TYPE_PARALLEL_PORT_ECP = 0x03, |
| 727 | TYPE_PARALLEL_PORT_EPP = 0x04, |
| 728 | TYPE_PARALLEL_PORT_ECP_EPP = 0x05, |
| 729 | TYPE_SERIAL_PORT_XT_AT_COMPATIBLE = 0x06, |
| 730 | TYPE_SERIAL_PORT_16450_COMPATIBLE = 0x07, |
| 731 | TYPE_SERIAL_PORT_16550_COMPATIBLE = 0x08, |
| 732 | TYPE_SERIAL_PORT_16550A_COMPATIBLE = 0x09, |
| 733 | TYPE_SCSI_PORT = 0x0A, |
| 734 | TYPE_MIDI_PORT = 0x0B, |
| 735 | TYPE_JOY_STICK_PORT = 0x0C, |
| 736 | TYPE_KEYBOARD_PORT = 0x0D, |
| 737 | TYPE_MOUSE_PORT = 0x0E, |
| 738 | TYPE_SSA_SCSI = 0x0F, |
| 739 | TYPE_USB = 0x10, |
| 740 | TYPE_FIREWIRE_IEEE_P1394 = 0x11, |
| 741 | TYPE_PCMCIA_TYPE_I = 0x12, |
| 742 | TYPE_PCMCIA_TYPE_II = 0x13, |
| 743 | TYPE_PCMCIA_TYPE_III = 0x14, |
| 744 | TYPE_CARDBUS = 0x15, |
| 745 | TYPE_ACCESS_BUS_PORT = 0x16, |
| 746 | TYPE_SCSI_II = 0x17, |
| 747 | TYPE_SCSI_WIDE = 0x18, |
| 748 | TYPE_PC_98 = 0x19, |
| 749 | TYPE_PC_98_HIRESO = 0x1A, |
| 750 | TYPE_PC_H98 = 0x1B, |
| 751 | TYPE_VIDEO_PORT = 0x1C, |
| 752 | TYPE_AUDIO_PORT = 0x1D, |
| 753 | TYPE_MODEM_PORT = 0x1E, |
| 754 | TYPE_NETWORK_PORT = 0x1F, |
| 755 | TYPE_SATA = 0x20, |
| 756 | TYPE_SAS = 0x21, |
| 757 | TYPE_MFDP = 0x22, |
| 758 | TYPE_THUNDERBOLT = 0x23, |
| 759 | TYPE_8251_COMPATIBLE = 0xA0, |
| 760 | TYPE_8251_FIFO_COMPATIBLE = 0xA1, |
Patrick Georgi | 54be395 | 2020-07-04 21:22:25 +0200 | [diff] [blame] | 761 | TYPE_OTHER_PORT = 0xFF, |
BryantOu | 4a8e58f | 2020-04-20 19:45:20 -0700 | [diff] [blame] | 762 | } type8_port_types; |
| 763 | |
| 764 | struct port_information { |
| 765 | const char *internal_reference_designator; |
| 766 | type8_connector_types internal_connector_type; |
| 767 | const char *external_reference_designator; |
| 768 | type8_connector_types external_connector_type; |
| 769 | type8_port_types port_type; |
| 770 | }; |
| 771 | |
| 772 | struct smbios_type8 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 773 | struct smbios_header header; |
BryantOu | 4a8e58f | 2020-04-20 19:45:20 -0700 | [diff] [blame] | 774 | u8 internal_reference_designator; |
| 775 | u8 internal_connector_type; |
| 776 | u8 external_reference_designator; |
| 777 | u8 external_connector_type; |
| 778 | u8 port_type; |
| 779 | u8 eos[2]; |
| 780 | } __packed; |
| 781 | |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 782 | /* System Slots - Slot Type */ |
| 783 | enum misc_slot_type { |
| 784 | SlotTypeOther = 0x01, |
| 785 | SlotTypeUnknown = 0x02, |
| 786 | SlotTypeIsa = 0x03, |
| 787 | SlotTypeMca = 0x04, |
| 788 | SlotTypeEisa = 0x05, |
| 789 | SlotTypePci = 0x06, |
| 790 | SlotTypePcmcia = 0x07, |
| 791 | SlotTypeVlVesa = 0x08, |
| 792 | SlotTypeProprietary = 0x09, |
| 793 | SlotTypeProcessorCardSlot = 0x0A, |
| 794 | SlotTypeProprietaryMemoryCardSlot = 0x0B, |
| 795 | SlotTypeIORiserCardSlot = 0x0C, |
| 796 | SlotTypeNuBus = 0x0D, |
| 797 | SlotTypePci66MhzCapable = 0x0E, |
| 798 | SlotTypeAgp = 0x0F, |
| 799 | SlotTypeApg2X = 0x10, |
| 800 | SlotTypeAgp4X = 0x11, |
| 801 | SlotTypePciX = 0x12, |
| 802 | SlotTypeAgp8X = 0x13, |
| 803 | SlotTypeM2Socket1_DP = 0x14, |
| 804 | SlotTypeM2Socket1_SD = 0x15, |
| 805 | SlotTypeM2Socket2 = 0x16, |
| 806 | SlotTypeM2Socket3 = 0x17, |
| 807 | SlotTypeMxmTypeI = 0x18, |
| 808 | SlotTypeMxmTypeII = 0x19, |
| 809 | SlotTypeMxmTypeIIIStandard = 0x1A, |
| 810 | SlotTypeMxmTypeIIIHe = 0x1B, |
| 811 | SlotTypeMxmTypeIV = 0x1C, |
| 812 | SlotTypeMxm30TypeA = 0x1D, |
| 813 | SlotTypeMxm30TypeB = 0x1E, |
| 814 | SlotTypePciExpressGen2Sff_8639 = 0x1F, |
| 815 | SlotTypePciExpressGen3Sff_8639 = 0x20, |
| 816 | SlotTypePciExpressMini52pinWithBSKO = 0x21, |
| 817 | SlotTypePciExpressMini52pinWithoutBSKO = 0x22, |
| 818 | SlotTypePciExpressMini76pin = 0x23, |
Tim Chu | 323e5a8 | 2022-10-27 03:03:59 +0000 | [diff] [blame] | 819 | SlotTypePciExpressOCPNIC30SFF = 0x26, |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 820 | SlotTypePC98C20 = 0xA0, |
| 821 | SlotTypePC98C24 = 0xA1, |
| 822 | SlotTypePC98E = 0xA2, |
| 823 | SlotTypePC98LocalBus = 0xA3, |
| 824 | SlotTypePC98Card = 0xA4, |
| 825 | SlotTypePciExpress = 0xA5, |
| 826 | SlotTypePciExpressX1 = 0xA6, |
| 827 | SlotTypePciExpressX2 = 0xA7, |
| 828 | SlotTypePciExpressX4 = 0xA8, |
| 829 | SlotTypePciExpressX8 = 0xA9, |
| 830 | SlotTypePciExpressX16 = 0xAA, |
| 831 | SlotTypePciExpressGen2 = 0xAB, |
| 832 | SlotTypePciExpressGen2X1 = 0xAC, |
| 833 | SlotTypePciExpressGen2X2 = 0xAD, |
| 834 | SlotTypePciExpressGen2X4 = 0xAE, |
| 835 | SlotTypePciExpressGen2X8 = 0xAF, |
| 836 | SlotTypePciExpressGen2X16 = 0xB0, |
| 837 | SlotTypePciExpressGen3 = 0xB1, |
| 838 | SlotTypePciExpressGen3X1 = 0xB2, |
| 839 | SlotTypePciExpressGen3X2 = 0xB3, |
| 840 | SlotTypePciExpressGen3X4 = 0xB4, |
| 841 | SlotTypePciExpressGen3X8 = 0xB5, |
Elyes HAOUAS | 5d0942b | 2019-10-08 16:13:34 +0200 | [diff] [blame] | 842 | SlotTypePciExpressGen3X16 = 0xB6, |
| 843 | SlotTypePciExpressGen4 = 0xB8, |
| 844 | SlotTypePciExpressGen4x1 = 0xB9, |
| 845 | SlotTypePciExpressGen4x2 = 0xBA, |
| 846 | SlotTypePciExpressGen4x4 = 0xBB, |
| 847 | SlotTypePciExpressGen4x8 = 0xBC, |
Elyes HAOUAS | f6c100f | 2021-12-12 09:04:38 +0100 | [diff] [blame] | 848 | SlotTypePciExpressGen4x16 = 0xBD, |
| 849 | SlotTypePciExpressGen5 = 0xBE, |
| 850 | SlotTypePciExpressGen5x1 = 0xBF, |
| 851 | SlotTypePciExpressGen5x2 = 0xC0, |
| 852 | SlotTypePciExpressGen5x4 = 0xC1, |
| 853 | SlotTypePciExpressGen5x8 = 0xC2, |
| 854 | SlotTypePciExpressGen5x16 = 0xC3 |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 855 | }; |
| 856 | |
| 857 | /* System Slots - Slot Data Bus Width. */ |
| 858 | enum slot_data_bus_bandwidth { |
| 859 | SlotDataBusWidthOther = 0x01, |
| 860 | SlotDataBusWidthUnknown = 0x02, |
| 861 | SlotDataBusWidth8Bit = 0x03, |
| 862 | SlotDataBusWidth16Bit = 0x04, |
| 863 | SlotDataBusWidth32Bit = 0x05, |
| 864 | SlotDataBusWidth64Bit = 0x06, |
| 865 | SlotDataBusWidth128Bit = 0x07, |
| 866 | SlotDataBusWidth1X = 0x08, |
| 867 | SlotDataBusWidth2X = 0x09, |
| 868 | SlotDataBusWidth4X = 0x0A, |
| 869 | SlotDataBusWidth8X = 0x0B, |
| 870 | SlotDataBusWidth12X = 0x0C, |
| 871 | SlotDataBusWidth16X = 0x0D, |
| 872 | SlotDataBusWidth32X = 0x0E |
| 873 | }; |
| 874 | |
| 875 | /* System Slots - Current Usage. */ |
| 876 | enum misc_slot_usage { |
| 877 | SlotUsageOther = 0x01, |
| 878 | SlotUsageUnknown = 0x02, |
| 879 | SlotUsageAvailable = 0x03, |
| 880 | SlotUsageInUse = 0x04, |
| 881 | SlotUsageUnavailable = 0x05 |
| 882 | }; |
| 883 | |
| 884 | /* System Slots - Slot Length.*/ |
| 885 | enum misc_slot_length { |
| 886 | SlotLengthOther = 0x01, |
| 887 | SlotLengthUnknown = 0x02, |
| 888 | SlotLengthShort = 0x03, |
| 889 | SlotLengthLong = 0x04 |
| 890 | }; |
| 891 | |
| 892 | /* System Slots - Slot Characteristics 1. */ |
| 893 | #define SMBIOS_SLOT_UNKNOWN (1 << 0) |
| 894 | #define SMBIOS_SLOT_5V (1 << 1) |
| 895 | #define SMBIOS_SLOT_3P3V (1 << 2) |
| 896 | #define SMBIOS_SLOT_SHARED (1 << 3) |
| 897 | #define SMBIOS_SLOT_PCCARD_16 (1 << 4) |
| 898 | #define SMBIOS_SLOT_PCCARD_CARDBUS (1 << 5) |
| 899 | #define SMBIOS_SLOT_PCCARD_ZOOM (1 << 6) |
| 900 | #define SMBIOS_SLOT_PCCARD_MODEM_RING (1 << 7) |
| 901 | /* System Slots - Slot Characteristics 2. */ |
| 902 | #define SMBIOS_SLOT_PME (1 << 0) |
| 903 | #define SMBIOS_SLOT_HOTPLUG (1 << 1) |
| 904 | #define SMBIOS_SLOT_SMBUS (1 << 2) |
| 905 | #define SMBIOS_SLOT_BIFURCATION (1 << 3) |
| 906 | |
| 907 | struct slot_peer_groups { |
| 908 | u16 peer_seg_num; |
| 909 | u8 peer_bus_num; |
| 910 | u8 peer_dev_fn_num; |
| 911 | u8 peer_data_bus_width; |
| 912 | } __packed; |
| 913 | |
| 914 | struct smbios_type9 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 915 | struct smbios_header header; |
Lijian Zhao | e98a751 | 2019-04-11 23:28:09 -0700 | [diff] [blame] | 916 | u8 slot_designation; |
| 917 | u8 slot_type; |
| 918 | u8 slot_data_bus_width; |
| 919 | u8 current_usage; |
| 920 | u8 slot_length; |
| 921 | u16 slot_id; |
| 922 | u8 slot_characteristics_1; |
| 923 | u8 slot_characteristics_2; |
| 924 | u16 segment_group_number; |
| 925 | u8 bus_number; |
| 926 | u8 device_function_number; |
| 927 | u8 data_bus_width; |
| 928 | u8 peer_group_count; |
| 929 | struct slot_peer_groups peer[0]; |
| 930 | u8 eos[2]; |
| 931 | } __packed; |
| 932 | |
Peter Stuge | c392b64 | 2013-07-06 19:51:12 +0200 | [diff] [blame] | 933 | struct smbios_type11 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 934 | struct smbios_header header; |
Peter Stuge | c392b64 | 2013-07-06 19:51:12 +0200 | [diff] [blame] | 935 | u8 count; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 936 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 937 | } __packed; |
Peter Stuge | c392b64 | 2013-07-06 19:51:12 +0200 | [diff] [blame] | 938 | |
Duncan Laurie | 472ec9c | 2012-06-23 16:13:42 -0700 | [diff] [blame] | 939 | struct smbios_type15 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 940 | struct smbios_header header; |
Duncan Laurie | 472ec9c | 2012-06-23 16:13:42 -0700 | [diff] [blame] | 941 | u16 area_length; |
| 942 | u16 header_offset; |
| 943 | u16 data_offset; |
| 944 | u8 access_method; |
| 945 | u8 log_status; |
| 946 | u32 change_token; |
| 947 | u32 address; |
| 948 | u8 header_format; |
| 949 | u8 log_type_descriptors; |
| 950 | u8 log_type_descriptor_length; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 951 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 952 | } __packed; |
Duncan Laurie | 472ec9c | 2012-06-23 16:13:42 -0700 | [diff] [blame] | 953 | |
| 954 | enum { |
| 955 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO8 = 0, |
| 956 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO8X2, |
| 957 | SMBIOS_EVENTLOG_ACCESS_METHOD_IO16, |
| 958 | SMBIOS_EVENTLOG_ACCESS_METHOD_MMIO32, |
| 959 | SMBIOS_EVENTLOG_ACCESS_METHOD_GPNV, |
| 960 | }; |
| 961 | |
| 962 | enum { |
| 963 | SMBIOS_EVENTLOG_STATUS_VALID = 1, /* Bit 0 */ |
| 964 | SMBIOS_EVENTLOG_STATUS_FULL = 2, /* Bit 1 */ |
| 965 | }; |
| 966 | |
Jingle Hsu | 869e90a | 2021-09-09 14:24:25 +0800 | [diff] [blame] | 967 | #define SMBIOS_USE_EXTENDED_MAX_CAPACITY (1ULL << 31) |
Tim Chu | 1ee8ddc | 2021-01-22 01:10:45 -0800 | [diff] [blame] | 968 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 969 | struct smbios_type16 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 970 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 971 | u8 location; |
| 972 | u8 use; |
| 973 | u8 memory_error_correction; |
| 974 | u32 maximum_capacity; |
| 975 | u16 memory_error_information_handle; |
| 976 | u16 number_of_memory_devices; |
| 977 | u64 extended_maximum_capacity; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 978 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 979 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 980 | |
| 981 | struct smbios_type17 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 982 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 983 | u16 phys_memory_array_handle; |
| 984 | u16 memory_error_information_handle; |
| 985 | u16 total_width; |
| 986 | u16 data_width; |
| 987 | u16 size; |
| 988 | u8 form_factor; |
| 989 | u8 device_set; |
| 990 | u8 device_locator; |
| 991 | u8 bank_locator; |
| 992 | u8 memory_type; |
| 993 | u16 type_detail; |
| 994 | u16 speed; |
| 995 | u8 manufacturer; |
| 996 | u8 serial_number; |
| 997 | u8 asset_tag; |
| 998 | u8 part_number; |
| 999 | u8 attributes; |
Timothy Pearson | 964aa83 | 2015-09-05 19:00:34 -0500 | [diff] [blame] | 1000 | u32 extended_size; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1001 | u16 clock_speed; |
Timothy Pearson | 964aa83 | 2015-09-05 19:00:34 -0500 | [diff] [blame] | 1002 | u16 minimum_voltage; |
| 1003 | u16 maximum_voltage; |
| 1004 | u16 configured_voltage; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 1005 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 1006 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1007 | |
Patrick Rudolph | 604295e | 2020-07-21 14:53:37 +0200 | [diff] [blame] | 1008 | struct smbios_type19 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 1009 | struct smbios_header header; |
Patrick Rudolph | 604295e | 2020-07-21 14:53:37 +0200 | [diff] [blame] | 1010 | u32 starting_address; |
| 1011 | u32 ending_address; |
| 1012 | u16 memory_array_handle; |
| 1013 | u8 partition_width; |
| 1014 | u64 extended_starting_address; |
| 1015 | u64 extended_ending_address; |
| 1016 | u8 eos[2]; |
| 1017 | } __packed; |
| 1018 | |
Matt DeVillier | d1c1afd | 2016-09-02 21:41:26 -0500 | [diff] [blame] | 1019 | struct smbios_type20 { |
| 1020 | struct smbios_header header; |
| 1021 | u32 addr_start; |
| 1022 | u32 addr_end; |
| 1023 | u16 memory_device_handle; |
| 1024 | u16 memory_array_mapped_address_handle; |
| 1025 | u8 partition_row_pos; |
| 1026 | u8 interleave_pos; |
| 1027 | u8 interleave_depth; |
| 1028 | u64 ext_addr_start; |
| 1029 | u64 ext_addr_end; |
| 1030 | u8 eos[2]; |
| 1031 | } __packed; |
| 1032 | |
Erik van den Bogaert | 9378152 | 2022-09-28 12:35:51 +0200 | [diff] [blame] | 1033 | /* Bit[7..5] = Temp status */ |
| 1034 | enum smbios_temp_status { |
| 1035 | SMBIOS_TEMP_STATUS_OTHER = 0x01, |
| 1036 | SMBIOS_TEMP_STATUS_UNKNOWN, |
| 1037 | SMBIOS_TEMP_STATUS_OK, |
| 1038 | SMBIOS_TEMP_STATUS_NONCRITICAL, |
| 1039 | SMBIOS_TEMP_STATUS_CRITICAL, |
| 1040 | SMBIOS_TEMP_STATUS_NONREC, // Non-Recoverable. |
| 1041 | }; |
| 1042 | |
| 1043 | /* Bit[4..0] = Temp location */ |
| 1044 | enum smbios_temp_location { |
| 1045 | SMBIOS_TEMP_LOCATION_OTHER = 0x01, |
| 1046 | SMBIOS_TEMP_LOCATION_UNKNOWN, |
| 1047 | SMBIOS_TEMP_LOCATION_PROCESSOR, |
| 1048 | SMBIOS_TEMP_LOCATION_DISK, |
| 1049 | SMBIOS_TEMP_LOCATION_BAY, // Peripheral Bay. |
| 1050 | SMBIOS_TEMP_LOCATION_SMM, // System Management Module. |
| 1051 | SMBIOS_TEMP_LOCATION_BOARD, // Motherboard. |
| 1052 | SMBIOS_TEMP_LOCATION_MM, // Memory. |
| 1053 | SMBIOS_TEMP_LOCATION_PM, // Processor Module. |
| 1054 | SMBIOS_TEMP_LOCATION_POW, // Power Unit. |
| 1055 | SMBIOS_TEMP_LOCATION_ADDCARD, |
| 1056 | }; |
| 1057 | |
| 1058 | struct smbios_type28 { |
| 1059 | struct smbios_header header; |
| 1060 | u8 description; |
| 1061 | u8 location_and_status; |
| 1062 | u16 maximum_value; |
| 1063 | u16 minimum_value; |
| 1064 | u16 resolution; |
| 1065 | u16 tolerance; |
| 1066 | u16 accuracy; |
| 1067 | u32 oem_defined; |
| 1068 | u16 nominal_value; |
| 1069 | u8 eos[2]; |
| 1070 | } __packed; |
| 1071 | |
| 1072 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1073 | struct smbios_type32 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 1074 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1075 | u8 reserved[6]; |
| 1076 | u8 boot_status; |
| 1077 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 1078 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1079 | |
Sven Schnelle | 6d03876 | 2012-07-09 08:52:53 +0200 | [diff] [blame] | 1080 | struct smbios_type38 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 1081 | struct smbios_header header; |
Sven Schnelle | 6d03876 | 2012-07-09 08:52:53 +0200 | [diff] [blame] | 1082 | u8 interface_type; |
| 1083 | u8 ipmi_rev; |
| 1084 | u8 i2c_slave_addr; |
| 1085 | u8 nv_storage_addr; |
| 1086 | u64 base_address; |
| 1087 | u8 base_address_modifier; |
| 1088 | u8 irq; |
Lukasz Siudut | 2352a50 | 2019-02-19 10:06:09 +0000 | [diff] [blame] | 1089 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 1090 | } __packed; |
Sven Schnelle | 6d03876 | 2012-07-09 08:52:53 +0200 | [diff] [blame] | 1091 | |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 1092 | enum smbios_bmc_interface_type { |
| 1093 | SMBIOS_BMC_INTERFACE_UNKNOWN = 0, |
| 1094 | SMBIOS_BMC_INTERFACE_KCS, |
| 1095 | SMBIOS_BMC_INTERFACE_SMIC, |
| 1096 | SMBIOS_BMC_INTERFACE_BLOCK, |
Elyes HAOUAS | a5cc0cf | 2019-02-14 16:48:08 +0100 | [diff] [blame] | 1097 | SMBIOS_BMC_INTERFACE_SMBUS, |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 1098 | }; |
| 1099 | |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 1100 | typedef enum { |
Jonathan Zhang | d57b821 | 2022-10-14 17:06:26 -0700 | [diff] [blame] | 1101 | PowerSupplyTypeOther = 1, |
| 1102 | PowerSupplyTypeUnknown = 2, |
| 1103 | PowerSupplyTypeLinear = 3, |
| 1104 | PowerSupplyTypeSwitching = 4, |
| 1105 | PowerSupplyTypeBattery = 5, |
| 1106 | PowerSupplyTypeUps = 6, |
| 1107 | PowerSupplyTypeConverter = 7, |
| 1108 | PowerSupplyTypeRegulator = 8 |
| 1109 | } power_supply_type; |
| 1110 | |
| 1111 | typedef enum { |
| 1112 | PowerSupplyStatusOther = 1, |
| 1113 | PowerSupplyStatusUnknown = 2, |
| 1114 | PowerSupplyStatusOk = 3, |
| 1115 | PowerSupplyStatusNonCritical = 4, |
| 1116 | PowerSupplyStatusCritical = 5 |
| 1117 | } power_supply_status; |
| 1118 | |
| 1119 | typedef enum { |
| 1120 | PowerSupplyInputVoltageRangeSwitchingOther = 1, |
| 1121 | PowerSupplyInputVoltageRangeSwitchingUnknown = 2, |
| 1122 | PowerSupplyInputVoltageRangeSwitchingManual = 3, |
| 1123 | PowerSupplyInputVoltageRangeSwitchingAutoSwitch = 4, |
| 1124 | PowerSupplyInputVoltageRangeSwitchingWideRange = 5, |
| 1125 | PowerSupplyInputVoltageRangeSwitchingNotApplicable = 6 |
| 1126 | } power_supply_input_voltage_range_switching; |
| 1127 | |
| 1128 | struct power_supply_ch { |
| 1129 | u16 reserved :2; |
| 1130 | u16 power_supply_type :4; |
| 1131 | u16 power_supply_status :3; |
| 1132 | u16 input_voltage_range_switch :4; |
| 1133 | u16 power_supply_unplugged :1; |
| 1134 | u16 power_supply_present :1; |
| 1135 | u16 power_supply_hot_replaceble :1; |
| 1136 | }; |
| 1137 | |
| 1138 | struct smbios_type39 { |
| 1139 | struct smbios_header header; |
| 1140 | u8 power_unit_group; |
| 1141 | u8 location; |
| 1142 | u8 device_name; |
| 1143 | u8 manufacturer; |
| 1144 | u8 serial_number; |
| 1145 | u8 asset_tag_number; |
| 1146 | u8 model_part_number; |
| 1147 | u8 revision_level; |
| 1148 | u16 max_power_capacity; |
| 1149 | u16 power_supply_characteristics; |
| 1150 | u16 input_voltage_probe_handle; |
| 1151 | u16 cooling_device_handle; |
| 1152 | u16 input_current_probe_handle; |
| 1153 | u8 eos[2]; |
| 1154 | } __packed; |
| 1155 | |
| 1156 | int smbios_write_type39(unsigned long *current, int *handle, |
| 1157 | u8 unit_group, const char *loc, const char *dev_name, |
| 1158 | const char *man, const char *serial_num, |
| 1159 | const char *tag_num, const char *part_num, |
| 1160 | const char *rev_lvl, u16 max_pow_cap, |
| 1161 | const struct power_supply_ch *ps_ch); |
| 1162 | |
| 1163 | typedef enum { |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 1164 | SMBIOS_DEVICE_TYPE_OTHER = 0x01, |
| 1165 | SMBIOS_DEVICE_TYPE_UNKNOWN, |
| 1166 | SMBIOS_DEVICE_TYPE_VIDEO, |
| 1167 | SMBIOS_DEVICE_TYPE_SCSI, |
| 1168 | SMBIOS_DEVICE_TYPE_ETHERNET, |
| 1169 | SMBIOS_DEVICE_TYPE_TOKEN_RING, |
| 1170 | SMBIOS_DEVICE_TYPE_SOUND, |
| 1171 | SMBIOS_DEVICE_TYPE_PATA, |
| 1172 | SMBIOS_DEVICE_TYPE_SATA, |
| 1173 | SMBIOS_DEVICE_TYPE_SAS, |
Elyes HAOUAS | f6c100f | 2021-12-12 09:04:38 +0100 | [diff] [blame] | 1174 | SMBIOS_DEVICE_TYPE_WIRELESS_LAN, |
| 1175 | SMBIOS_DEVICE_TYPE_BLUETOOTH, |
| 1176 | SMBIOS_DEVICE_TYPE_WWAN, |
| 1177 | SMBIOS_DEVICE_TYPE_EMMC, |
| 1178 | SMBIOS_DEVICE_TYPE_NVME, |
| 1179 | SMBIOS_DEVICE_TYPE_UFS, |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 1180 | } smbios_onboard_device_type; |
| 1181 | |
Christian Walter | 9e5b062 | 2019-05-21 17:37:58 +0200 | [diff] [blame] | 1182 | #define SMBIOS_DEVICE_TYPE_COUNT 10 |
| 1183 | |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 1184 | struct smbios_type41 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 1185 | struct smbios_header header; |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 1186 | u8 reference_designation; |
| 1187 | u8 device_type: 7; |
| 1188 | u8 device_status: 1; |
| 1189 | u8 device_type_instance; |
| 1190 | u16 segment_group_number; |
| 1191 | u8 bus_number; |
| 1192 | u8 function_number: 3; |
| 1193 | u8 device_number: 5; |
Konstantin Aladyshev | d0df1d7 | 2017-08-01 15:52:46 +0300 | [diff] [blame] | 1194 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 1195 | } __packed; |
Stefan Reinauer | 3d7c677 | 2012-04-02 13:30:10 -0700 | [diff] [blame] | 1196 | |
Michał Żygowski | e779523 | 2022-05-04 14:10:45 +0200 | [diff] [blame] | 1197 | |
| 1198 | #define SMBIOS_TPM_DEVICE_CHARACTERISTICS_NOT_SUPPORTED (1ULL << 2) |
| 1199 | #define SMBIOS_TPM_DEVICE_FAMILY_CONFIGURABLE_VIA_FW_UPD (1ULL << 3) |
| 1200 | #define SMBIOS_TPM_DEVICE_FAMILY_CONFIGURABLE_VIA_PLATFORM_SW_SUPPORT (1ULL << 4) |
| 1201 | #define SMBIOS_TPM_DEVICE_FAMILY_CONFIGURABLE_VIA_OEM_PROPRIETARY (1ULL << 5) |
| 1202 | |
| 1203 | struct smbios_type43 { |
| 1204 | struct smbios_header header; |
| 1205 | u32 vendor_id; |
| 1206 | u8 major_spec_ver; |
| 1207 | u8 minor_spec_ver; |
| 1208 | u32 fw_ver1; |
| 1209 | u32 fw_ver2; |
| 1210 | u8 description; |
| 1211 | u64 characteristics; |
| 1212 | u32 oem_defined; |
| 1213 | u8 eos[2]; |
| 1214 | } __packed; |
| 1215 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1216 | struct smbios_type127 { |
Angel Pons | b554b7c | 2021-06-28 17:42:40 +0200 | [diff] [blame] | 1217 | struct smbios_header header; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1218 | u8 eos[2]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 1219 | } __packed; |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1220 | |
Benjamin Doron | ea13dc3 | 2023-06-20 12:21:27 -0400 | [diff] [blame^] | 1221 | /* Provided to help architecture code */ |
| 1222 | int smbios_write_type7(unsigned long *current, |
| 1223 | const int handle, |
| 1224 | const u8 level, |
| 1225 | const u8 sram_type, |
| 1226 | const enum smbios_cache_associativity associativity, |
| 1227 | const enum smbios_cache_type type, |
| 1228 | const size_t max_cache_size, |
| 1229 | const size_t cache_size); |
| 1230 | enum smbios_cache_associativity smbios_cache_associativity(const u8 num); |
| 1231 | |
| 1232 | /* Must be defined by architecture code */ |
| 1233 | int smbios_write_type4(unsigned long *current, int handle); |
| 1234 | int smbios_write_type7_cache_parameters(unsigned long *current, |
| 1235 | int *handle, |
| 1236 | int *max_struct_size, |
| 1237 | struct smbios_type4 *type4); |
| 1238 | |
Lee Leahy | 6a566d7 | 2017-03-07 17:45:12 -0800 | [diff] [blame] | 1239 | void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, |
| 1240 | struct smbios_type17 *t); |
Tim Chu | 31b4209 | 2020-12-23 19:15:21 -0800 | [diff] [blame] | 1241 | void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm, |
| 1242 | struct smbios_type17 *t); |
Lijian Zhao | 10ea93c | 2019-04-11 00:45:10 -0700 | [diff] [blame] | 1243 | void smbios_fill_dimm_locator(const struct dimm_info *dimm, |
| 1244 | struct smbios_type17 *t); |
Timothy Pearson | 4785f2a | 2015-03-27 23:05:36 -0500 | [diff] [blame] | 1245 | |
Tim Chu | 13ab1d7 | 2021-10-19 01:45:12 +0000 | [diff] [blame] | 1246 | smbios_wakeup_type smbios_system_wakeup_type(void); |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 1247 | smbios_board_type smbios_mainboard_board_type(void); |
Mathew King | be820b3 | 2019-10-31 12:10:44 -0600 | [diff] [blame] | 1248 | smbios_enclosure_type smbios_mainboard_enclosure_type(void); |
Julien Viard de Galbert | 9a31dfe | 2018-02-22 16:39:58 +0100 | [diff] [blame] | 1249 | |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 1250 | #endif |