blob: f02b48b0c00fdeda7cde6e0c147c52b9526b15e4 [file] [log] [blame]
Angel Pons32859fc2020-04-02 23:48:27 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Timothy Pearson821217b2015-03-27 22:47:25 -05002
Sven Schnelle164bcfd2011-08-14 20:56:34 +02003#ifndef SMBIOS_H
4#define SMBIOS_H
5
6#include <types.h>
Lijian Zhao10ea93c2019-04-11 00:45:10 -07007#include <memory_info.h>
Sven Schnelle164bcfd2011-08-14 20:56:34 +02008
Benjamin Doronea13dc32023-06-20 12:21:27 -04009#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 Schnelle164bcfd2011-08-14 20:56:34 +020017unsigned long smbios_write_tables(unsigned long start);
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +030018int smbios_add_string(u8 *start, const char *str);
19int smbios_string_table_len(u8 *start);
Sven Schnelle164bcfd2011-08-14 20:56:34 +020020
Angel Ponsa37701a2021-06-28 17:36:53 +020021struct smbios_header;
22int smbios_full_table_len(struct smbios_header *header, u8 *str_table_start);
Angel Ponsd62a5012021-06-28 17:18:06 +020023void *smbios_carve_table(unsigned long start, u8 type, u8 length, u16 handle);
24
Duncan Laurie21a78702013-05-23 14:17:05 -070025/* Used by mainboard to add an on-board device */
Lijian Zhaoe98a7512019-04-11 23:28:09 -070026enum misc_slot_type;
27enum misc_slot_length;
28enum misc_slot_usage;
29enum slot_data_bus_bandwidth;
30int 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,
JingleHsuWiwynn20fa59f2021-01-26 09:55:34 +080035 const u16 id, u8 slot_char1, u8 slot_char2, u8 bus, u8 dev_func);
Patrick Rudolphfe98e902018-03-27 16:17:12 +020036enum smbios_bmc_interface_type;
37int 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 Laurie21a78702013-05-23 14:17:05 -070042int smbios_write_type41(unsigned long *current, int *handle,
43 const char *name, u8 instance, u16 segment,
Christian Waltere6afab12019-05-21 17:22:49 +020044 u8 bus, u8 device, u8 function, u8 device_type);
Erik van den Bogaert93781522022-09-28 12:35:51 +020045enum smbios_temp_location;
46enum smbios_temp_status;
47int 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 Laurie21a78702013-05-23 14:17:05 -070056
Michał Żygowskie7795232022-05-04 14:10:45 +020057int 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 Pons6a73b242021-09-03 12:18:10 +020062struct device;
63int get_smbios_data(struct device *dev, int *handle, unsigned long *current);
64
Nico Huberebd8a4f2017-11-01 09:49:16 +010065const char *smbios_system_manufacturer(void);
66const char *smbios_system_product_name(void);
67const char *smbios_system_serial_number(void);
68const char *smbios_system_version(void);
69void smbios_system_set_uuid(u8 *uuid);
70const char *smbios_system_sku(void);
71
Andrey Petrov2e032f02019-10-23 15:31:51 -070072unsigned int smbios_cpu_get_max_speed_mhz(void);
73unsigned int smbios_cpu_get_current_speed_mhz(void);
Patrick Rudolphb01ac7e2020-07-26 14:23:37 +020074unsigned int smbios_cpu_get_voltage(void);
Andrey Petrov2e032f02019-10-23 15:31:51 -070075
Gerd Hoffmann06262742013-11-13 13:37:23 +010076const char *smbios_mainboard_manufacturer(void);
77const char *smbios_mainboard_product_name(void);
Christian Gmeinerac3aa092012-07-25 13:42:40 +020078const char *smbios_mainboard_serial_number(void);
79const char *smbios_mainboard_version(void);
Nico Huberebd8a4f2017-11-01 09:49:16 +010080
Vladimir Serbinenko63acd222014-06-01 00:26:48 +020081const char *smbios_mainboard_bios_version(void);
Julien Viard de Galbert9a31dfe2018-02-22 16:39:58 +010082const char *smbios_mainboard_asset_tag(void);
83u8 smbios_mainboard_feature_flags(void);
84const char *smbios_mainboard_location_in_chassis(void);
Johnny Lind3440542020-01-30 18:21:22 +080085const char *smbios_chassis_version(void);
86const char *smbios_chassis_serial_number(void);
87const char *smbios_processor_serial_number(void);
JingleHsuWiwynn4330b962021-01-28 09:13:42 +080088u8 smbios_chassis_power_cords(void);
Christian Gmeinerac3aa092012-07-25 13:42:40 +020089
Kyösti Mälkki0fcbd3a2020-12-20 08:27:21 +020090/* This string could be filled late in payload. */
91void smbios_type0_bios_version(uintptr_t address);
92
Tim Chuf2f53c42020-09-07 02:30:19 -070093void smbios_ec_revision(uint8_t *ec_major_revision, uint8_t *ec_minor_revision);
94
Morgan Jang92bcc4f2020-07-24 10:36:18 +080095unsigned int smbios_processor_external_clock(void);
96unsigned int smbios_processor_characteristics(void);
97struct cpuid_result;
98unsigned int smbios_processor_family(struct cpuid_result res);
99
Morgan Jang8ae391d2020-10-06 16:26:17 +0800100unsigned int smbios_cache_error_correction_type(u8 level);
101unsigned int smbios_cache_sram_type(void);
102unsigned int smbios_cache_conf_operation_mode(u8 level);
103
BryantOu4a8e58f2020-04-20 19:45:20 -0700104/* Used by mainboard to add port information of type 8 */
105struct port_information;
106int smbios_write_type8(unsigned long *current, int *handle,
107 const struct port_information *port,
108 size_t num_ports);
109
Elyes HAOUAS3233cf42019-02-14 17:46:02 +0100110#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 Schnelle164bcfd2011-08-14 20:56:34 +0200119
Elyes HAOUAS3233cf42019-02-14 17:46:02 +0100120#define BIOS_EXT1_CHARACTERISTICS_ACPI (1 << 0)
121#define BIOS_EXT2_CHARACTERISTICS_TARGET (1 << 2)
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200122
Timothy Pearson821217b2015-03-27 22:47:25 -0500123#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 HAOUAS1db23462019-02-14 17:49:47 +0100141#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 Pearson821217b2015-03-27 22:47:25 -0500156
Kane Chen33faac62014-07-27 12:54:44 -0700157typedef enum {
Lee Leahy0be6d932015-06-26 11:15:42 -0700158 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
169typedef enum {
Kane Chen33faac62014-07-27 12:54:44 -0700170 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 HAOUAS86b683a2019-10-08 16:30:43 +0200185 MEMORY_FORMFACTOR_DIE = 0x10,
Kane Chen33faac62014-07-27 12:54:44 -0700186} smbios_memory_form_factor;
187
Timothy Pearson821217b2015-03-27 22:47:25 -0500188typedef 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 HAOUAS28114ae2018-11-14 17:51:00 +0100211 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 HAOUAS86b683a2019-10-08 16:30:43 +0200217 MEMORY_TYPE_HBM = 0x20,
218 MEMORY_TYPE_HBM2 = 0x21,
Subrata Banik6cdc8382021-10-27 23:04:07 +0530219 MEMORY_TYPE_DDR5 = 0x22,
220 MEMORY_TYPE_LPDDR5 = 0x23,
Elyes Haouas5bbdb0c2022-06-23 13:38:26 +0200221 MEMORY_TYPE_HBM3 = 0x24,
Timothy Pearson821217b2015-03-27 22:47:25 -0500222} smbios_memory_type;
223
224typedef 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 HAOUAS77fe2132019-10-29 08:42:03 +0100239 MEMORY_ARRAY_LOCATION_CXL_FLEXBUS_1_0_ADD_ON = 0xa4,
Timothy Pearson821217b2015-03-27 22:47:25 -0500240} smbios_memory_array_location;
241
242typedef 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
252typedef 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 Schnelle164bcfd2011-08-14 20:56:34 +0200262#define SMBIOS_STATE_SAFE 3
263typedef enum {
Elyes HAOUASa0fed372016-09-16 20:17:40 +0200264 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,
BryantOu4a8e58f2020-04-20 19:45:20 -0700270 SMBIOS_PORT_CONNECTOR_INFORMATION = 8,
Elyes HAOUASa0fed372016-09-16 20:17:40 +0200271 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 DeVillierd1c1afd2016-09-02 21:41:26 -0500277 SMBIOS_MEMORY_DEVICE_MAPPED_ADDRESS = 20,
Erik van den Bogaert93781522022-09-28 12:35:51 +0200278 SMBIOS_TEMPERATURE_PROBE = 28,
Elyes HAOUASa0fed372016-09-16 20:17:40 +0200279 SMBIOS_SYSTEM_BOOT_INFORMATION = 32,
Patrick Rudolphfe98e902018-03-27 16:17:12 +0200280 SMBIOS_IPMI_DEVICE_INFORMATION = 38,
Jonathan Zhangd57b8212022-10-14 17:06:26 -0700281 SMBIOS_SYSTEM_POWER_SUPPLY = 39,
Elyes HAOUASa0fed372016-09-16 20:17:40 +0200282 SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION = 41,
Michał Żygowskie7795232022-05-04 14:10:45 +0200283 SMBIOS_TPM_DEVICE = 43,
Elyes HAOUASa0fed372016-09-16 20:17:40 +0200284 SMBIOS_END_OF_TABLE = 127,
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200285} smbios_struct_type_t;
286
287struct 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 Reinauer6a001132017-07-13 02:20:27 +0200302} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200303
Patrick Rudolph7a835822020-07-22 16:00:53 +0200304struct 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 Ponsca01baa2021-06-28 16:06:28 +0200317struct smbios_header {
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200318 u8 type;
319 u8 length;
320 u16 handle;
Angel Ponsca01baa2021-06-28 16:06:28 +0200321} __packed;
322
323struct smbios_type0 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200324 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200325 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 HAOUAS358cbb32019-02-14 14:19:22 +0100337 u16 extended_bios_rom_size;
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +0300338 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200339} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200340
Tim Chu13ab1d72021-10-19 01:45:12 +0000341typedef 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 Schnelle164bcfd2011-08-14 20:56:34 +0200353struct smbios_type1 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200354 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200355 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 Aladyshevd0df1d72017-08-01 15:52:46 +0300363 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200364} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200365
Tim Chue82aa222020-12-21 23:33:18 -0800366#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 Galbert9a31dfe2018-02-22 16:39:58 +0100372typedef 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 Serbinenko47089f22014-03-02 19:14:44 +0100388struct smbios_type2 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200389 struct smbios_header header;
Vladimir Serbinenko47089f22014-03-02 19:14:44 +0100390 u8 manufacturer;
391 u8 product_name;
392 u8 version;
393 u8 serial_number;
Julien Viard de Galbert9a31dfe2018-02-22 16:39:58 +0100394 u8 asset_tag;
395 u8 feature_flags;
396 u8 location_in_chassis;
397 u16 chassis_handle;
398 u8 board_type;
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +0300399 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200400} __packed;
Vladimir Serbinenko47089f22014-03-02 19:14:44 +0100401
Mathew Kingbe820b32019-10-31 12:10:44 -0600402typedef enum {
Elyes HAOUAS25dbc172017-07-04 21:38:03 +0200403 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 Kingbe820b32019-10-31 12:10:44 -0600439} smbios_enclosure_type;
Vladimir Serbinenko71c0bf62014-08-27 23:23:14 +0200440
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200441struct smbios_type3 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200442 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200443 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 DeVillier4863cc42016-09-01 00:55:40 -0500457 u8 sku_number;
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +0300458 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200459} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200460
461struct smbios_type4 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200462 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200463 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 Rudolph7a835822020-07-22 16:00:53 +0200486 u16 core_count2;
487 u16 core_enabled2;
488 u16 thread_count2;
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +0300489 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200490} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200491
Patrick Rudolph4aea6912020-07-22 07:28:26 +0200492/* defines for smbios_type4 */
493
494#define SMBIOS_PROCESSOR_STATUS_POPULATED (1 << 6)
495#define SMBIOS_PROCESSOR_STATUS_CPU_ENABLED (1 << 0)
496
Li, Jinchengaa990122023-01-03 15:43:40 +0800497/* enum for socket type */
498enum 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 Chu323e5a82022-10-27 03:03:59 +0000573/* 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 Rudolphfc5b8092019-03-30 17:37:28 +0100583/* 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
595enum 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
606enum 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
616enum 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 Jang8ae391d2020-10-06 16:26:17 +0800651/* 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 Rudolphfc5b8092019-03-30 17:37:28 +0100658struct smbios_type7 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200659 struct smbios_header header;
Patrick Rudolphfc5b8092019-03-30 17:37:28 +0100660 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
BryantOu4a8e58f2020-04-20 19:45:20 -0700675/* enum for connector types */
676typedef 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 */
722typedef enum {
Patrick Georgi54be3952020-07-04 21:22:25 +0200723 TYPE_NONE_PORT = 0x00,
BryantOu4a8e58f2020-04-20 19:45:20 -0700724 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 Georgi54be3952020-07-04 21:22:25 +0200761 TYPE_OTHER_PORT = 0xFF,
BryantOu4a8e58f2020-04-20 19:45:20 -0700762} type8_port_types;
763
764struct 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
772struct smbios_type8 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200773 struct smbios_header header;
BryantOu4a8e58f2020-04-20 19:45:20 -0700774 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 Zhaoe98a7512019-04-11 23:28:09 -0700782/* System Slots - Slot Type */
783enum 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 Chu323e5a82022-10-27 03:03:59 +0000819 SlotTypePciExpressOCPNIC30SFF = 0x26,
Lijian Zhaoe98a7512019-04-11 23:28:09 -0700820 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 HAOUAS5d0942b2019-10-08 16:13:34 +0200842 SlotTypePciExpressGen3X16 = 0xB6,
843 SlotTypePciExpressGen4 = 0xB8,
844 SlotTypePciExpressGen4x1 = 0xB9,
845 SlotTypePciExpressGen4x2 = 0xBA,
846 SlotTypePciExpressGen4x4 = 0xBB,
847 SlotTypePciExpressGen4x8 = 0xBC,
Elyes HAOUASf6c100f2021-12-12 09:04:38 +0100848 SlotTypePciExpressGen4x16 = 0xBD,
849 SlotTypePciExpressGen5 = 0xBE,
850 SlotTypePciExpressGen5x1 = 0xBF,
851 SlotTypePciExpressGen5x2 = 0xC0,
852 SlotTypePciExpressGen5x4 = 0xC1,
853 SlotTypePciExpressGen5x8 = 0xC2,
854 SlotTypePciExpressGen5x16 = 0xC3
Lijian Zhaoe98a7512019-04-11 23:28:09 -0700855};
856
857/* System Slots - Slot Data Bus Width. */
858enum 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. */
876enum 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.*/
885enum 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
907struct 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
914struct smbios_type9 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200915 struct smbios_header header;
Lijian Zhaoe98a7512019-04-11 23:28:09 -0700916 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 Stugec392b642013-07-06 19:51:12 +0200933struct smbios_type11 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200934 struct smbios_header header;
Peter Stugec392b642013-07-06 19:51:12 +0200935 u8 count;
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +0300936 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200937} __packed;
Peter Stugec392b642013-07-06 19:51:12 +0200938
Duncan Laurie472ec9c2012-06-23 16:13:42 -0700939struct smbios_type15 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200940 struct smbios_header header;
Duncan Laurie472ec9c2012-06-23 16:13:42 -0700941 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 Aladyshevd0df1d72017-08-01 15:52:46 +0300951 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200952} __packed;
Duncan Laurie472ec9c2012-06-23 16:13:42 -0700953
954enum {
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
962enum {
963 SMBIOS_EVENTLOG_STATUS_VALID = 1, /* Bit 0 */
964 SMBIOS_EVENTLOG_STATUS_FULL = 2, /* Bit 1 */
965};
966
Jingle Hsu869e90a2021-09-09 14:24:25 +0800967#define SMBIOS_USE_EXTENDED_MAX_CAPACITY (1ULL << 31)
Tim Chu1ee8ddc2021-01-22 01:10:45 -0800968
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200969struct smbios_type16 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200970 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200971 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 Aladyshevd0df1d72017-08-01 15:52:46 +0300978 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +0200979} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200980
981struct smbios_type17 {
Angel Ponsb554b7c2021-06-28 17:42:40 +0200982 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +0200983 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 Pearson964aa832015-09-05 19:00:34 -05001000 u32 extended_size;
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001001 u16 clock_speed;
Timothy Pearson964aa832015-09-05 19:00:34 -05001002 u16 minimum_voltage;
1003 u16 maximum_voltage;
1004 u16 configured_voltage;
Konstantin Aladyshevd0df1d72017-08-01 15:52:46 +03001005 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +02001006} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001007
Patrick Rudolph604295e2020-07-21 14:53:37 +02001008struct smbios_type19 {
Angel Ponsb554b7c2021-06-28 17:42:40 +02001009 struct smbios_header header;
Patrick Rudolph604295e2020-07-21 14:53:37 +02001010 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 DeVillierd1c1afd2016-09-02 21:41:26 -05001019struct 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 Bogaert93781522022-09-28 12:35:51 +02001033/* Bit[7..5] = Temp status */
1034enum 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 */
1044enum 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
1058struct 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 Schnelle164bcfd2011-08-14 20:56:34 +02001073struct smbios_type32 {
Angel Ponsb554b7c2021-06-28 17:42:40 +02001074 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001075 u8 reserved[6];
1076 u8 boot_status;
1077 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +02001078} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001079
Sven Schnelle6d038762012-07-09 08:52:53 +02001080struct smbios_type38 {
Angel Ponsb554b7c2021-06-28 17:42:40 +02001081 struct smbios_header header;
Sven Schnelle6d038762012-07-09 08:52:53 +02001082 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 Siudut2352a502019-02-19 10:06:09 +00001089 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +02001090} __packed;
Sven Schnelle6d038762012-07-09 08:52:53 +02001091
Patrick Rudolphfe98e902018-03-27 16:17:12 +02001092enum 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 HAOUASa5cc0cf2019-02-14 16:48:08 +01001097 SMBIOS_BMC_INTERFACE_SMBUS,
Patrick Rudolphfe98e902018-03-27 16:17:12 +02001098};
1099
Stefan Reinauer3d7c6772012-04-02 13:30:10 -07001100typedef enum {
Jonathan Zhangd57b8212022-10-14 17:06:26 -07001101 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
1111typedef enum {
1112 PowerSupplyStatusOther = 1,
1113 PowerSupplyStatusUnknown = 2,
1114 PowerSupplyStatusOk = 3,
1115 PowerSupplyStatusNonCritical = 4,
1116 PowerSupplyStatusCritical = 5
1117} power_supply_status;
1118
1119typedef 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
1128struct 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
1138struct 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
1156int 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
1163typedef enum {
Stefan Reinauer3d7c6772012-04-02 13:30:10 -07001164 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 HAOUASf6c100f2021-12-12 09:04:38 +01001174 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 Reinauer3d7c6772012-04-02 13:30:10 -07001180} smbios_onboard_device_type;
1181
Christian Walter9e5b0622019-05-21 17:37:58 +02001182#define SMBIOS_DEVICE_TYPE_COUNT 10
1183
Stefan Reinauer3d7c6772012-04-02 13:30:10 -07001184struct smbios_type41 {
Angel Ponsb554b7c2021-06-28 17:42:40 +02001185 struct smbios_header header;
Stefan Reinauer3d7c6772012-04-02 13:30:10 -07001186 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 Aladyshevd0df1d72017-08-01 15:52:46 +03001194 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +02001195} __packed;
Stefan Reinauer3d7c6772012-04-02 13:30:10 -07001196
Michał Żygowskie7795232022-05-04 14:10:45 +02001197
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
1203struct 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 Schnelle164bcfd2011-08-14 20:56:34 +02001216struct smbios_type127 {
Angel Ponsb554b7c2021-06-28 17:42:40 +02001217 struct smbios_header header;
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001218 u8 eos[2];
Stefan Reinauer6a001132017-07-13 02:20:27 +02001219} __packed;
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001220
Benjamin Doronea13dc32023-06-20 12:21:27 -04001221/* Provided to help architecture code */
1222int 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);
1230enum smbios_cache_associativity smbios_cache_associativity(const u8 num);
1231
1232/* Must be defined by architecture code */
1233int smbios_write_type4(unsigned long *current, int handle);
1234int smbios_write_type7_cache_parameters(unsigned long *current,
1235 int *handle,
1236 int *max_struct_size,
1237 struct smbios_type4 *type4);
1238
Lee Leahy6a566d72017-03-07 17:45:12 -08001239void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id,
1240 struct smbios_type17 *t);
Tim Chu31b42092020-12-23 19:15:21 -08001241void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm,
1242 struct smbios_type17 *t);
Lijian Zhao10ea93c2019-04-11 00:45:10 -07001243void smbios_fill_dimm_locator(const struct dimm_info *dimm,
1244 struct smbios_type17 *t);
Timothy Pearson4785f2a2015-03-27 23:05:36 -05001245
Tim Chu13ab1d72021-10-19 01:45:12 +00001246smbios_wakeup_type smbios_system_wakeup_type(void);
Julien Viard de Galbert9a31dfe2018-02-22 16:39:58 +01001247smbios_board_type smbios_mainboard_board_type(void);
Mathew Kingbe820b32019-10-31 12:10:44 -06001248smbios_enclosure_type smbios_mainboard_enclosure_type(void);
Julien Viard de Galbert9a31dfe2018-02-22 16:39:58 +01001249
Sven Schnelle164bcfd2011-08-14 20:56:34 +02001250#endif