xref: /titanic_44/usr/src/uts/common/sys/smbios.h (revision a872c43a336e31f3079d97e6970f11020b524149)
184ab085aSmws /*
284ab085aSmws  * CDDL HEADER START
384ab085aSmws  *
484ab085aSmws  * The contents of this file are subject to the terms of the
580ab886dSwesolows  * Common Development and Distribution License (the "License").
680ab886dSwesolows  * You may not use this file except in compliance with the License.
784ab085aSmws  *
884ab085aSmws  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
984ab085aSmws  * or http://www.opensolaris.org/os/licensing.
1084ab085aSmws  * See the License for the specific language governing permissions
1184ab085aSmws  * and limitations under the License.
1284ab085aSmws  *
1384ab085aSmws  * When distributing Covered Code, include this CDDL HEADER in each
1484ab085aSmws  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1584ab085aSmws  * If applicable, add the following below this CDDL HEADER, with the
1684ab085aSmws  * fields enclosed by brackets "[]" replaced with your own identifying
1784ab085aSmws  * information: Portions Copyright [yyyy] [name of copyright owner]
1884ab085aSmws  *
1984ab085aSmws  * CDDL HEADER END
2084ab085aSmws  */
2184ab085aSmws 
2284ab085aSmws /*
234e901881SDale Ghent  * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
2419e81714SRobert Mustacchi  * Copyright (c) 2017, Joyent, Inc.
2503f9f63dSTom Pothier  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
2684ab085aSmws  * Use is subject to license terms.
2784ab085aSmws  */
2884ab085aSmws 
2984ab085aSmws /*
3084ab085aSmws  * This header file defines the interfaces available from the SMBIOS access
3184ab085aSmws  * library, libsmbios, and an equivalent kernel module.  This API can be used
3284ab085aSmws  * to access DMTF SMBIOS data from a device, file, or raw memory buffer.
3384ab085aSmws  *
344e901881SDale Ghent  * This is NOT a Public interface, and should be considered Unstable, as it is
354e901881SDale Ghent  * subject to change without notice as the DMTF SMBIOS specification evolves.
364e901881SDale Ghent  * Therefore, be aware that any program linked with this API in this
374e901881SDale Ghent  * instance of illumos is almost guaranteed to break in the next release.
3884ab085aSmws  */
3984ab085aSmws 
4084ab085aSmws #ifndef	_SYS_SMBIOS_H
4184ab085aSmws #define	_SYS_SMBIOS_H
4284ab085aSmws 
4384ab085aSmws #include <sys/types.h>
4484ab085aSmws 
4584ab085aSmws #ifdef	__cplusplus
4684ab085aSmws extern "C" {
4784ab085aSmws #endif
4884ab085aSmws 
49af349cd6SToomas Soome typedef enum smbios_entry_point_type {
50af349cd6SToomas Soome 	SMBIOS_ENTRY_POINT_21,
51af349cd6SToomas Soome 	SMBIOS_ENTRY_POINT_30
52af349cd6SToomas Soome } smbios_entry_point_t;
53af349cd6SToomas Soome 
5484ab085aSmws /*
554e901881SDale Ghent  * SMBIOS Structure Table Entry Point.  See DSP0134 5.2.1 for more information.
5684ab085aSmws  * The structure table entry point is located by searching for the anchor.
5784ab085aSmws  */
58e4586ebfSmws #pragma pack(1)
59e4586ebfSmws 
60af349cd6SToomas Soome typedef struct smbios_21_entry {
6184ab085aSmws 	char smbe_eanchor[4];		/* anchor tag (SMB_ENTRY_EANCHOR) */
6284ab085aSmws 	uint8_t smbe_ecksum;		/* checksum of entry point structure */
6384ab085aSmws 	uint8_t smbe_elen;		/* length in bytes of entry point */
6484ab085aSmws 	uint8_t smbe_major;		/* major version of the SMBIOS spec */
6584ab085aSmws 	uint8_t smbe_minor;		/* minor version of the SMBIOS spec */
6684ab085aSmws 	uint16_t smbe_maxssize;		/* maximum size in bytes of a struct */
6784ab085aSmws 	uint8_t smbe_revision;		/* entry point structure revision */
6884ab085aSmws 	uint8_t smbe_format[5];		/* entry point revision-specific data */
6984ab085aSmws 	char smbe_ianchor[5];		/* intermed. tag (SMB_ENTRY_IANCHOR) */
7084ab085aSmws 	uint8_t smbe_icksum;		/* intermed. checksum */
7184ab085aSmws 	uint16_t smbe_stlen;		/* length in bytes of structure table */
7284ab085aSmws 	uint32_t smbe_staddr;		/* physical addr of structure table */
7384ab085aSmws 	uint16_t smbe_stnum;		/* number of structure table entries */
7484ab085aSmws 	uint8_t smbe_bcdrev;		/* BCD value representing DMI version */
75af349cd6SToomas Soome } smbios_21_entry_t;
76af349cd6SToomas Soome 
77af349cd6SToomas Soome /*
78af349cd6SToomas Soome  * The 64-bit SMBIOS 3.0 Entry Point.  See DSP0134 5.2.2 for more information.
79af349cd6SToomas Soome  * The structure table entry point is located by searching for the anchor.
80af349cd6SToomas Soome  */
81af349cd6SToomas Soome 
82af349cd6SToomas Soome typedef struct smbios_30_entry {
83af349cd6SToomas Soome 	char smbe_eanchor[5];		/* anchor tag (SMB3_ENTRY_EANCHOR) */
84af349cd6SToomas Soome 	uint8_t smbe_ecksum;		/* checksum of entry point structure */
85af349cd6SToomas Soome 	uint8_t smbe_elen;		/* length in bytes of entry point */
86af349cd6SToomas Soome 	uint8_t smbe_major;		/* major version of the SMBIOS spec */
87af349cd6SToomas Soome 	uint8_t smbe_minor;		/* minor version of the SMBIOS spec */
88af349cd6SToomas Soome 	uint8_t smbe_docrev;		/* specification docrev */
89af349cd6SToomas Soome 	uint8_t smbe_revision;		/* entry point structure revision */
90af349cd6SToomas Soome 	uint8_t smbe_reserved;
91af349cd6SToomas Soome 	uint32_t smbe_stlen;		/* length in bytes of structure table */
92af349cd6SToomas Soome 	uint64_t smbe_staddr;		/* physical addr of structure table */
93af349cd6SToomas Soome } smbios_30_entry_t;
94af349cd6SToomas Soome 
95af349cd6SToomas Soome typedef union {
96af349cd6SToomas Soome 	smbios_21_entry_t ep21;
97af349cd6SToomas Soome 	smbios_30_entry_t ep30;
9884ab085aSmws } smbios_entry_t;
9984ab085aSmws 
100e4586ebfSmws #pragma pack()
101e4586ebfSmws 
10284ab085aSmws #define	SMB_ENTRY_EANCHOR	"_SM_"	/* structure table entry point anchor */
10384ab085aSmws #define	SMB_ENTRY_EANCHORLEN	4	/* length of entry point anchor */
104af349cd6SToomas Soome #define	SMB3_ENTRY_EANCHOR	"_SM3_"	/* structure table entry point anchor */
105af349cd6SToomas Soome #define	SMB3_ENTRY_EANCHORLEN	5	/* length of entry point anchor */
10684ab085aSmws #define	SMB_ENTRY_IANCHOR	"_DMI_"	/* intermediate anchor string */
10784ab085aSmws #define	SMB_ENTRY_IANCHORLEN	5	/* length of intermediate anchor */
10880ab886dSwesolows #define	SMB_ENTRY_MAXLEN	255	/* maximum length of entry point */
10984ab085aSmws 
11084ab085aSmws /*
11184ab085aSmws  * Structure type codes.  The comments next to each type include an (R) note to
1124e901881SDale Ghent  * indicate a structure that is required as of SMBIOS v2.8 and an (O) note to
1134e901881SDale Ghent  * indicate a structure that is obsolete as of SMBIOS v2.8.
11484ab085aSmws  */
11584ab085aSmws #define	SMB_TYPE_BIOS		0	/* BIOS information (R) */
11684ab085aSmws #define	SMB_TYPE_SYSTEM		1	/* system information (R) */
11784ab085aSmws #define	SMB_TYPE_BASEBOARD	2	/* base board */
11884ab085aSmws #define	SMB_TYPE_CHASSIS	3	/* system enclosure or chassis (R) */
11984ab085aSmws #define	SMB_TYPE_PROCESSOR	4	/* processor (R) */
12084ab085aSmws #define	SMB_TYPE_MEMCTL		5	/* memory controller (O) */
12184ab085aSmws #define	SMB_TYPE_MEMMOD		6	/* memory module (O) */
12284ab085aSmws #define	SMB_TYPE_CACHE		7	/* processor cache (R) */
12384ab085aSmws #define	SMB_TYPE_PORT		8	/* port connector */
12484ab085aSmws #define	SMB_TYPE_SLOT		9	/* upgradeable system slot (R) */
1254e901881SDale Ghent #define	SMB_TYPE_OBDEVS		10	/* on-board devices (O) */
12684ab085aSmws #define	SMB_TYPE_OEMSTR		11	/* OEM string table */
12784ab085aSmws #define	SMB_TYPE_SYSCONFSTR	12	/* system configuration string table */
12884ab085aSmws #define	SMB_TYPE_LANG		13	/* BIOS language information */
12984ab085aSmws #define	SMB_TYPE_GROUP		14	/* group associations */
13084ab085aSmws #define	SMB_TYPE_EVENTLOG	15	/* system event log */
13184ab085aSmws #define	SMB_TYPE_MEMARRAY	16	/* physical memory array (R) */
13284ab085aSmws #define	SMB_TYPE_MEMDEVICE	17	/* memory device (R) */
13384ab085aSmws #define	SMB_TYPE_MEMERR32	18	/* 32-bit memory error information */
13484ab085aSmws #define	SMB_TYPE_MEMARRAYMAP	19	/* memory array mapped address (R) */
1354e901881SDale Ghent #define	SMB_TYPE_MEMDEVICEMAP	20	/* memory device mapped address */
13684ab085aSmws #define	SMB_TYPE_POINTDEV	21	/* built-in pointing device */
13784ab085aSmws #define	SMB_TYPE_BATTERY	22	/* portable battery */
13884ab085aSmws #define	SMB_TYPE_RESET		23	/* system reset settings */
13984ab085aSmws #define	SMB_TYPE_SECURITY	24	/* hardware security settings */
14084ab085aSmws #define	SMB_TYPE_POWERCTL	25	/* system power controls */
14184ab085aSmws #define	SMB_TYPE_VPROBE		26	/* voltage probe */
14284ab085aSmws #define	SMB_TYPE_COOLDEV	27	/* cooling device */
14384ab085aSmws #define	SMB_TYPE_TPROBE		28	/* temperature probe */
14484ab085aSmws #define	SMB_TYPE_IPROBE		29	/* current probe */
14584ab085aSmws #define	SMB_TYPE_OOBRA		30	/* out-of-band remote access facility */
14684ab085aSmws #define	SMB_TYPE_BIS		31	/* boot integrity services */
14784ab085aSmws #define	SMB_TYPE_BOOT		32	/* system boot status (R) */
14884ab085aSmws #define	SMB_TYPE_MEMERR64	33	/* 64-bit memory error information */
14984ab085aSmws #define	SMB_TYPE_MGMTDEV	34	/* management device */
15084ab085aSmws #define	SMB_TYPE_MGMTDEVCP	35	/* management device component */
15184ab085aSmws #define	SMB_TYPE_MGMTDEVDATA	36	/* management device threshold data */
15284ab085aSmws #define	SMB_TYPE_MEMCHAN	37	/* memory channel */
15384ab085aSmws #define	SMB_TYPE_IPMIDEV	38	/* IPMI device information */
15484ab085aSmws #define	SMB_TYPE_POWERSUP	39	/* system power supply */
1554e901881SDale Ghent #define	SMB_TYPE_ADDINFO	40	/* additional information */
15603f9f63dSTom Pothier #define	SMB_TYPE_OBDEVEXT	41	/* on-board device extended info */
1574e901881SDale Ghent #define	SMB_TYPE_MCHI		42	/* mgmt controller host interface */
1581eb9e3eaSRobert Mustacchi #define	SMB_TYPE_TPM		43	/* TPM device */
15984ab085aSmws #define	SMB_TYPE_INACTIVE	126	/* inactive table entry */
16084ab085aSmws #define	SMB_TYPE_EOT		127	/* end of table */
16184ab085aSmws 
16284ab085aSmws #define	SMB_TYPE_OEM_LO		128	/* start of OEM-specific type range */
163074bb90dSTom Pothier #define	SUN_OEM_EXT_PROCESSOR	132	/* processor extended info */
16403f9f63dSTom Pothier #define	SUN_OEM_EXT_PORT	136	/* port exteded info */
165074bb90dSTom Pothier #define	SUN_OEM_PCIEXRC		138	/* PCIE RootComplex/RootPort info */
166074bb90dSTom Pothier #define	SUN_OEM_EXT_MEMARRAY	144	/* phys memory array extended info */
167074bb90dSTom Pothier #define	SUN_OEM_EXT_MEMDEVICE	145	/* memory device extended info */
16884ab085aSmws #define	SMB_TYPE_OEM_HI		256	/* end of OEM-specific type range */
16984ab085aSmws 
17084ab085aSmws /*
1719c94f155SCheng Sean Ye  * OEM string indicating "Platform Resource Management Specification"
1729c94f155SCheng Sean Ye  * compliance.
1739c94f155SCheng Sean Ye  */
1749c94f155SCheng Sean Ye #define	SMB_PRMS1	"SUNW-PRMS-1"
1759c94f155SCheng Sean Ye 
1769c94f155SCheng Sean Ye /*
1779c94f155SCheng Sean Ye  * Some default values set by BIOS vendor
1789c94f155SCheng Sean Ye  */
1799c94f155SCheng Sean Ye #define	SMB_DEFAULT1	"To Be Filled By O.E.M."
1809c94f155SCheng Sean Ye #define	SMB_DEFAULT2	"Not Available"
1819c94f155SCheng Sean Ye 
1829c94f155SCheng Sean Ye /*
18384ab085aSmws  * SMBIOS Common Information.  These structures do not correspond to anything
18484ab085aSmws  * in the SMBIOS specification, but allow library clients to more easily read
18584ab085aSmws  * information that is frequently encoded into the various SMBIOS structures.
18684ab085aSmws  */
18784ab085aSmws typedef struct smbios_info {
18884ab085aSmws 	const char *smbi_manufacturer;	/* manufacturer */
18984ab085aSmws 	const char *smbi_product;	/* product name */
19084ab085aSmws 	const char *smbi_version;	/* version */
19184ab085aSmws 	const char *smbi_serial;	/* serial number */
19284ab085aSmws 	const char *smbi_asset;		/* asset tag */
19384ab085aSmws 	const char *smbi_location;	/* location tag */
19484ab085aSmws 	const char *smbi_part;		/* part number */
19584ab085aSmws } smbios_info_t;
19684ab085aSmws 
19784ab085aSmws typedef struct smbios_version {
19884ab085aSmws 	uint8_t smbv_major;		/* version major number */
19984ab085aSmws 	uint8_t smbv_minor;		/* version minor number */
20084ab085aSmws } smbios_version_t;
20184ab085aSmws 
202074bb90dSTom Pothier #define	SMB_CONT_BYTE	1		/* contained elements are byte size */
203074bb90dSTom Pothier #define	SMB_CONT_WORD	2		/* contained elements are word size */
204074bb90dSTom Pothier #define	SMB_CONT_MAX	255		/* maximum contained objects */
205074bb90dSTom Pothier 
20684ab085aSmws /*
2074e901881SDale Ghent  * SMBIOS Bios Information.  See DSP0134 Section 7.1 for more information.
2081eb9e3eaSRobert Mustacchi  * smbb_romsize is converted from the implementation format into bytes. Note, if
2091eb9e3eaSRobert Mustacchi  * we do not have an extended BIOS ROM size, it is filled in with the default
2101eb9e3eaSRobert Mustacchi  * BIOS ROM size.
21184ab085aSmws  */
21284ab085aSmws typedef struct smbios_bios {
21384ab085aSmws 	const char *smbb_vendor;	/* bios vendor string */
21484ab085aSmws 	const char *smbb_version;	/* bios version string */
21584ab085aSmws 	const char *smbb_reldate;	/* bios release date */
21684ab085aSmws 	uint32_t smbb_segment;		/* bios address segment location */
21784ab085aSmws 	uint32_t smbb_romsize;		/* bios rom size in bytes */
21884ab085aSmws 	uint32_t smbb_runsize;		/* bios image size in bytes */
21984ab085aSmws 	uint64_t smbb_cflags;		/* bios characteristics */
22084ab085aSmws 	const uint8_t *smbb_xcflags;	/* bios characteristics extensions */
22184ab085aSmws 	size_t smbb_nxcflags;		/* number of smbb_xcflags[] bytes */
22284ab085aSmws 	smbios_version_t smbb_biosv;	/* bios version */
22384ab085aSmws 	smbios_version_t smbb_ecfwv;	/* bios embedded ctrl f/w version */
2241eb9e3eaSRobert Mustacchi 	uint64_t smbb_extromsize;	/* Extended bios ROM Size */
22584ab085aSmws } smbios_bios_t;
22684ab085aSmws 
22784ab085aSmws #define	SMB_BIOSFL_RSV0		0x00000001	/* reserved bit zero */
22884ab085aSmws #define	SMB_BIOSFL_RSV1		0x00000002	/* reserved bit one */
22984ab085aSmws #define	SMB_BIOSFL_UNKNOWN	0x00000004	/* unknown */
23084ab085aSmws #define	SMB_BIOSFL_BCNOTSUP	0x00000008	/* BIOS chars not supported */
23184ab085aSmws #define	SMB_BIOSFL_ISA		0x00000010	/* ISA is supported */
23284ab085aSmws #define	SMB_BIOSFL_MCA		0x00000020	/* MCA is supported */
23384ab085aSmws #define	SMB_BIOSFL_EISA		0x00000040	/* EISA is supported */
23484ab085aSmws #define	SMB_BIOSFL_PCI		0x00000080	/* PCI is supported */
23584ab085aSmws #define	SMB_BIOSFL_PCMCIA	0x00000100	/* PCMCIA is supported */
23684ab085aSmws #define	SMB_BIOSFL_PLUGNPLAY	0x00000200	/* Plug and Play is supported */
23784ab085aSmws #define	SMB_BIOSFL_APM		0x00000400	/* APM is supported */
23884ab085aSmws #define	SMB_BIOSFL_FLASH	0x00000800	/* BIOS is Flash Upgradeable */
23984ab085aSmws #define	SMB_BIOSFL_SHADOW	0x00001000	/* BIOS shadowing is allowed */
24084ab085aSmws #define	SMB_BIOSFL_VLVESA	0x00002000	/* VL-VESA is supported */
24184ab085aSmws #define	SMB_BIOSFL_ESCD		0x00004000	/* ESCD support is available */
24284ab085aSmws #define	SMB_BIOSFL_CDBOOT	0x00008000	/* Boot from CD is supported */
24384ab085aSmws #define	SMB_BIOSFL_SELBOOT	0x00010000	/* Selectable Boot supported */
24484ab085aSmws #define	SMB_BIOSFL_ROMSOCK	0x00020000	/* BIOS ROM is socketed */
24584ab085aSmws #define	SMB_BIOSFL_PCMBOOT	0x00040000	/* Boot from PCMCIA supported */
24684ab085aSmws #define	SMB_BIOSFL_EDD		0x00080000	/* EDD Spec is supported */
24784ab085aSmws #define	SMB_BIOSFL_NEC9800	0x00100000	/* int 0x13 NEC 9800 floppy */
24884ab085aSmws #define	SMB_BIOSFL_TOSHIBA	0x00200000	/* int 0x13 Toshiba floppy */
24984ab085aSmws #define	SMB_BIOSFL_525_360K	0x00400000	/* int 0x13 5.25" 360K floppy */
25084ab085aSmws #define	SMB_BIOSFL_525_12M	0x00800000	/* int 0x13 5.25" 1.2M floppy */
25184ab085aSmws #define	SMB_BIOSFL_35_720K	0x01000000	/* int 0x13 3.5" 720K floppy */
25284ab085aSmws #define	SMB_BIOSFL_35_288M	0x02000000	/* int 0x13 3.5" 2.88M floppy */
25384ab085aSmws #define	SMB_BIOSFL_I5_PRINT	0x04000000	/* int 0x5 print screen svcs */
25484ab085aSmws #define	SMB_BIOSFL_I9_KBD	0x08000000	/* int 0x9 8042 keyboard svcs */
25584ab085aSmws #define	SMB_BIOSFL_I14_SER	0x10000000	/* int 0x14 serial svcs */
25684ab085aSmws #define	SMB_BIOSFL_I17_PRINTER	0x20000000	/* int 0x17 printer svcs */
25784ab085aSmws #define	SMB_BIOSFL_I10_CGA	0x40000000	/* int 0x10 CGA svcs */
25884ab085aSmws #define	SMB_BIOSFL_NEC_PC98	0x80000000	/* NEC PC-98 */
25984ab085aSmws 
2601eb9e3eaSRobert Mustacchi /*
2611eb9e3eaSRobert Mustacchi  * These values are used to allow consumers to have raw access to the extended
2621eb9e3eaSRobert Mustacchi  * characteristic flags. We explicitly don't include the extended BIOS
2631eb9e3eaSRobert Mustacchi  * information from section 3.1 as part of this as it has its own member.
2641eb9e3eaSRobert Mustacchi  */
2654e901881SDale Ghent #define	SMB_BIOSXB_1		0	/* bios extension byte 1 (7.1.2.1) */
2664e901881SDale Ghent #define	SMB_BIOSXB_2		1	/* bios extension byte 2 (7.1.2.2) */
26784ab085aSmws #define	SMB_BIOSXB_BIOS_MAJ	2	/* bios major version */
26884ab085aSmws #define	SMB_BIOSXB_BIOS_MIN	3	/* bios minor version */
26984ab085aSmws #define	SMB_BIOSXB_ECFW_MAJ	4	/* extended ctlr f/w major version */
27084ab085aSmws #define	SMB_BIOSXB_ECFW_MIN	5	/* extended ctlr f/w minor version */
27184ab085aSmws 
27284ab085aSmws #define	SMB_BIOSXB1_ACPI	0x01	/* ACPI is supported */
27384ab085aSmws #define	SMB_BIOSXB1_USBL	0x02	/* USB legacy is supported */
27484ab085aSmws #define	SMB_BIOSXB1_AGP		0x04	/* AGP is supported */
27584ab085aSmws #define	SMB_BIOSXB1_I20		0x08	/* I2O boot is supported */
27684ab085aSmws #define	SMB_BIOSXB1_LS120	0x10	/* LS-120 boot is supported */
27784ab085aSmws #define	SMB_BIOSXB1_ATZIP	0x20	/* ATAPI ZIP drive boot is supported */
27884ab085aSmws #define	SMB_BIOSXB1_1394	0x40	/* 1394 boot is supported */
27984ab085aSmws #define	SMB_BIOSXB1_SMBAT	0x80	/* Smart Battery is supported */
28084ab085aSmws 
28184ab085aSmws #define	SMB_BIOSXB2_BBOOT	0x01	/* BIOS Boot Specification supported */
28284ab085aSmws #define	SMB_BIOSXB2_FKNETSVC	0x02	/* F-key Network Svc boot supported */
28384ab085aSmws #define	SMB_BIOSXB2_ETCDIST	0x04	/* Enable Targeted Content Distrib. */
2844e901881SDale Ghent #define	SMB_BIOSXB2_UEFI	0x08	/* UEFI Specification supported */
2854e901881SDale Ghent #define	SMB_BIOSXB2_VM		0x10	/* SMBIOS table describes a VM */
28684ab085aSmws 
28784ab085aSmws /*
2884e901881SDale Ghent  * SMBIOS System Information.  See DSP0134 Section 7.2 for more information.
28984ab085aSmws  * The current set of smbs_wakeup values is defined after the structure.
29084ab085aSmws  */
29184ab085aSmws typedef struct smbios_system {
29284ab085aSmws 	const uint8_t *smbs_uuid;	/* UUID byte array */
29384ab085aSmws 	uint8_t smbs_uuidlen;		/* UUID byte array length */
29484ab085aSmws 	uint8_t smbs_wakeup;		/* wake-up event */
29584ab085aSmws 	const char *smbs_sku;		/* SKU number */
29684ab085aSmws 	const char *smbs_family;	/* family */
29784ab085aSmws } smbios_system_t;
29884ab085aSmws 
29984ab085aSmws #define	SMB_WAKEUP_RSV0		0x00	/* reserved */
30084ab085aSmws #define	SMB_WAKEUP_OTHER	0x01	/* other */
30184ab085aSmws #define	SMB_WAKEUP_UNKNOWN	0x02	/* unknown */
30284ab085aSmws #define	SMB_WAKEUP_APM		0x03	/* APM timer */
30384ab085aSmws #define	SMB_WAKEUP_MODEM	0x04	/* modem ring */
30484ab085aSmws #define	SMB_WAKEUP_LAN		0x05	/* LAN remote */
30584ab085aSmws #define	SMB_WAKEUP_SWITCH	0x06	/* power switch */
30684ab085aSmws #define	SMB_WAKEUP_PCIPME	0x07	/* PCI PME# */
30784ab085aSmws #define	SMB_WAKEUP_AC		0x08	/* AC power restored */
30884ab085aSmws 
30984ab085aSmws /*
3104e901881SDale Ghent  * SMBIOS Base Board description.  See DSP0134 Section 7.3 for more
31184ab085aSmws  * information.  smbb_flags and smbb_type definitions are below.
31284ab085aSmws  */
31384ab085aSmws typedef struct smbios_bboard {
31484ab085aSmws 	id_t smbb_chassis;		/* chassis containing this board */
31584ab085aSmws 	uint8_t smbb_flags;		/* flags (see below) */
31684ab085aSmws 	uint8_t smbb_type;		/* board type (see below) */
317074bb90dSTom Pothier 	uint8_t smbb_contn;		/* number of contained object hdls */
31884ab085aSmws } smbios_bboard_t;
31984ab085aSmws 
32084ab085aSmws #define	SMB_BBFL_MOTHERBOARD	0x01	/* board is a motherboard */
32184ab085aSmws #define	SMB_BBFL_NEEDAUX	0x02	/* auxiliary card or daughter req'd */
32284ab085aSmws #define	SMB_BBFL_REMOVABLE	0x04	/* board is removable */
32384ab085aSmws #define	SMB_BBFL_REPLACABLE	0x08	/* board is field-replacable */
32484ab085aSmws #define	SMB_BBFL_HOTSWAP	0x10	/* board is hot-swappable */
32584ab085aSmws 
32684ab085aSmws #define	SMB_BBT_UNKNOWN		0x1	/* unknown */
32784ab085aSmws #define	SMB_BBT_OTHER		0x2	/* other */
32884ab085aSmws #define	SMB_BBT_SBLADE		0x3	/* server blade */
32984ab085aSmws #define	SMB_BBT_CSWITCH		0x4	/* connectivity switch */
33084ab085aSmws #define	SMB_BBT_SMM		0x5	/* system management module */
33184ab085aSmws #define	SMB_BBT_PROC		0x6	/* processor module */
33284ab085aSmws #define	SMB_BBT_IO		0x7	/* i/o module */
33384ab085aSmws #define	SMB_BBT_MEM		0x8	/* memory module */
33484ab085aSmws #define	SMB_BBT_DAUGHTER	0x9	/* daughterboard */
33584ab085aSmws #define	SMB_BBT_MOTHER		0xA	/* motherboard */
33684ab085aSmws #define	SMB_BBT_PROCMEM		0xB	/* processor/memory module */
33784ab085aSmws #define	SMB_BBT_PROCIO		0xC	/* processor/i/o module */
33884ab085aSmws #define	SMB_BBT_INTER		0xD	/* interconnect board */
33984ab085aSmws 
34084ab085aSmws /*
3414e901881SDale Ghent  * SMBIOS Chassis description.  See DSP0134 Section 7.4 for more information.
34284ab085aSmws  * We move the lock bit of the type field into smbc_lock for easier processing.
34384ab085aSmws  */
34484ab085aSmws typedef struct smbios_chassis {
34584ab085aSmws 	uint32_t smbc_oemdata;		/* OEM-specific data */
34684ab085aSmws 	uint8_t smbc_lock;		/* lock present? */
34784ab085aSmws 	uint8_t smbc_type;		/* type */
34884ab085aSmws 	uint8_t smbc_bustate;		/* boot-up state */
34984ab085aSmws 	uint8_t smbc_psstate;		/* power supply state */
35084ab085aSmws 	uint8_t smbc_thstate;		/* thermal state */
35184ab085aSmws 	uint8_t smbc_security;		/* security status */
35284ab085aSmws 	uint8_t smbc_uheight;		/* enclosure height in U's */
35384ab085aSmws 	uint8_t smbc_cords;		/* number of power cords */
354074bb90dSTom Pothier 	uint8_t smbc_elems;		/* number of element records (n) */
355074bb90dSTom Pothier 	uint8_t smbc_elemlen;		/* length of contained element (m) */
3564e901881SDale Ghent 	char smbc_sku[256];		/* SKU number (as a string) */
35784ab085aSmws } smbios_chassis_t;
35884ab085aSmws 
35984ab085aSmws #define	SMB_CHT_OTHER		0x01	/* other */
36084ab085aSmws #define	SMB_CHT_UNKNOWN		0x02	/* unknown */
36184ab085aSmws #define	SMB_CHT_DESKTOP		0x03	/* desktop */
36284ab085aSmws #define	SMB_CHT_LPDESKTOP	0x04	/* low-profile desktop */
36384ab085aSmws #define	SMB_CHT_PIZZA		0x05	/* pizza box */
36484ab085aSmws #define	SMB_CHT_MINITOWER	0x06	/* mini-tower */
36584ab085aSmws #define	SMB_CHT_TOWER		0x07	/* tower */
36684ab085aSmws #define	SMB_CHT_PORTABLE	0x08	/* portable */
36784ab085aSmws #define	SMB_CHT_LAPTOP		0x09	/* laptop */
36884ab085aSmws #define	SMB_CHT_NOTEBOOK	0x0A	/* notebook */
36984ab085aSmws #define	SMB_CHT_HANDHELD	0x0B	/* hand-held */
37084ab085aSmws #define	SMB_CHT_DOCK		0x0C	/* docking station */
37184ab085aSmws #define	SMB_CHT_ALLIN1		0x0D	/* all-in-one */
37284ab085aSmws #define	SMB_CHT_SUBNOTE		0x0E	/* sub-notebook */
37384ab085aSmws #define	SMB_CHT_SPACESAVE	0x0F	/* space-saving */
37484ab085aSmws #define	SMB_CHT_LUNCHBOX	0x10	/* lunchbox */
37584ab085aSmws #define	SMB_CHT_MAIN		0x11	/* main server chassis */
37684ab085aSmws #define	SMB_CHT_EXPANSION	0x12	/* expansion chassis */
37784ab085aSmws #define	SMB_CHT_SUB		0x13	/* sub-chassis */
37884ab085aSmws #define	SMB_CHT_BUS		0x14	/* bus expansion chassis */
37984ab085aSmws #define	SMB_CHT_PERIPHERAL	0x15	/* peripheral chassis */
38084ab085aSmws #define	SMB_CHT_RAID		0x16	/* raid chassis */
38184ab085aSmws #define	SMB_CHT_RACK		0x17	/* rack mount chassis */
38284ab085aSmws #define	SMB_CHT_SEALED		0x18	/* sealed case pc */
38384ab085aSmws #define	SMB_CHT_MULTI		0x19	/* multi-system chassis */
38442a58d9dSsethg #define	SMB_CHT_CPCI		0x1A	/* compact PCI */
38542a58d9dSsethg #define	SMB_CHT_ATCA		0x1B	/* advanced TCA */
38642a58d9dSsethg #define	SMB_CHT_BLADE		0x1C	/* blade */
38742a58d9dSsethg #define	SMB_CHT_BLADEENC	0x1D	/* blade enclosure */
38804cdb0e3SRobert Mustacchi #define	SMB_CHT_TABLET		0x1E	/* tablet */
38904cdb0e3SRobert Mustacchi #define	SMB_CHT_CONVERTIBLE	0x1F	/* convertible */
39004cdb0e3SRobert Mustacchi #define	SMB_CHT_DETACHABLE	0x20	/* detachable */
3911eb9e3eaSRobert Mustacchi #define	SMB_CHT_IOTGW		0x21	/* IoT Gateway */
3921eb9e3eaSRobert Mustacchi #define	SMB_CHT_EMBEDPC		0x22	/* Embedded PC */
3931eb9e3eaSRobert Mustacchi #define	SMB_CHT_MINIPC		0x23	/* Mini PC */
3941eb9e3eaSRobert Mustacchi #define	SMB_CHT_STICKPC		0x24	/* Stick PC */
39584ab085aSmws 
39684ab085aSmws #define	SMB_CHST_OTHER		0x01	/* other */
39784ab085aSmws #define	SMB_CHST_UNKNOWN	0x02	/* unknown */
39884ab085aSmws #define	SMB_CHST_SAFE		0x03	/* safe */
39984ab085aSmws #define	SMB_CHST_WARNING	0x04	/* warning */
40084ab085aSmws #define	SMB_CHST_CRITICAL	0x05	/* critical */
40184ab085aSmws #define	SMB_CHST_NONREC		0x06	/* non-recoverable */
40284ab085aSmws 
40384ab085aSmws #define	SMB_CHSC_OTHER		0x01	/* other */
40484ab085aSmws #define	SMB_CHSC_UNKNOWN	0x02	/* unknown */
40584ab085aSmws #define	SMB_CHSC_NONE		0x03	/* none */
40684ab085aSmws #define	SMB_CHSC_EILOCK		0x04	/* external interface locked out */
40784ab085aSmws #define	SMB_CHSC_EIENAB		0x05	/* external interface enabled */
40884ab085aSmws 
40984ab085aSmws /*
4104e901881SDale Ghent  * SMBIOS Processor description.  See DSP0134 Section 7.5 for more details.
41184ab085aSmws  * If the L1, L2, or L3 cache handle is -1, the cache information is unknown.
41284ab085aSmws  * If the handle refers to something of size 0, that type of cache is absent.
41384ab085aSmws  *
41484ab085aSmws  * NOTE: Although SMBIOS exports a 64-bit CPUID result, this value should not
4154e901881SDale Ghent  * be used for any purpose other than BIOS debugging.  illumos itself computes
41684ab085aSmws  * its own CPUID value and applies knowledge of additional errata and processor
41784ab085aSmws  * specific CPUID variations, so this value should not be used for anything.
41884ab085aSmws  */
41984ab085aSmws typedef struct smbios_processor {
42084ab085aSmws 	uint64_t smbp_cpuid;		/* processor cpuid information */
42184ab085aSmws 	uint32_t smbp_family;		/* processor family */
42284ab085aSmws 	uint8_t smbp_type;		/* processor type (SMB_PRT_*) */
42384ab085aSmws 	uint8_t smbp_voltage;		/* voltage (SMB_PRV_*) */
42484ab085aSmws 	uint8_t smbp_status;		/* status (SMB_PRS_*) */
42584ab085aSmws 	uint8_t smbp_upgrade;		/* upgrade (SMB_PRU_*) */
42684ab085aSmws 	uint32_t smbp_clkspeed;		/* external clock speed in MHz */
42784ab085aSmws 	uint32_t smbp_maxspeed;		/* maximum speed in MHz */
42884ab085aSmws 	uint32_t smbp_curspeed;		/* current speed in MHz */
42984ab085aSmws 	id_t smbp_l1cache;		/* L1 cache handle */
43084ab085aSmws 	id_t smbp_l2cache;		/* L2 cache handle */
43184ab085aSmws 	id_t smbp_l3cache;		/* L3 cache handle */
43204cdb0e3SRobert Mustacchi 	uint32_t smbp_corecount;
43304cdb0e3SRobert Mustacchi 		/* number of cores per processor socket */
43404cdb0e3SRobert Mustacchi 	uint32_t smbp_coresenabled;
4354e901881SDale Ghent 		/* number of enabled cores per processor socket */
43604cdb0e3SRobert Mustacchi 	uint32_t smbp_threadcount;
4374e901881SDale Ghent 		/* number of threads per processor socket */
4384e901881SDale Ghent 	uint16_t smbp_cflags;
4394e901881SDale Ghent 		/* processor characteristics (SMB_PRC_*) */
4404e901881SDale Ghent 	uint16_t smbp_family2;		/* processor family 2 */
44104cdb0e3SRobert Mustacchi 	uint16_t smbp_corecount2;	/* core count 2 */
44204cdb0e3SRobert Mustacchi 	uint16_t smbp_coresenabled2;	/* cores enabled 2 */
44304cdb0e3SRobert Mustacchi 	uint16_t smbp_threadcount2;	/* thread count 2 */
44484ab085aSmws } smbios_processor_t;
44584ab085aSmws 
44684ab085aSmws #define	SMB_PRT_OTHER		0x01	/* other */
44784ab085aSmws #define	SMB_PRT_UNKNOWN		0x02	/* unknown */
44884ab085aSmws #define	SMB_PRT_CENTRAL		0x03	/* central processor */
44984ab085aSmws #define	SMB_PRT_MATH		0x04	/* math processor */
45084ab085aSmws #define	SMB_PRT_DSP		0x05	/* DSP processor */
45184ab085aSmws #define	SMB_PRT_VIDEO		0x06	/* video processor */
45284ab085aSmws 
45384ab085aSmws #define	SMB_PRV_LEGACY(v)	(!((v) & 0x80))	/* legacy voltage mode */
45484ab085aSmws #define	SMB_PRV_FIXED(v)	((v) & 0x80)	/* fixed voltage mode */
45584ab085aSmws 
45684ab085aSmws #define	SMB_PRV_5V		0x01	/* 5V is supported */
45784ab085aSmws #define	SMB_PRV_33V		0x02	/* 3.3V is supported */
45884ab085aSmws #define	SMB_PRV_29V		0x04	/* 2.9V is supported */
45984ab085aSmws 
46084ab085aSmws #define	SMB_PRV_VOLTAGE(v)	((v) & 0x7f)
46184ab085aSmws 
46284ab085aSmws #define	SMB_PRSTATUS_PRESENT(s)	((s) & 0x40)	/* socket is populated */
46384ab085aSmws #define	SMB_PRSTATUS_STATUS(s)	((s) & 0x07)	/* status (see below) */
46484ab085aSmws 
46584ab085aSmws #define	SMB_PRS_UNKNOWN		0x0	/* unknown */
46684ab085aSmws #define	SMB_PRS_ENABLED		0x1	/* enabled */
46784ab085aSmws #define	SMB_PRS_BDISABLED	0x2	/* disabled in bios user setup */
46884ab085aSmws #define	SMB_PRS_PDISABLED	0x3	/* disabled in bios from post error */
46984ab085aSmws #define	SMB_PRS_IDLE		0x4	/* waiting to be enabled */
47084ab085aSmws #define	SMB_PRS_OTHER		0x7	/* other */
47184ab085aSmws 
47284ab085aSmws #define	SMB_PRU_OTHER		0x01	/* other */
47384ab085aSmws #define	SMB_PRU_UNKNOWN		0x02	/* unknown */
47484ab085aSmws #define	SMB_PRU_DAUGHTER	0x03	/* daughter board */
47584ab085aSmws #define	SMB_PRU_ZIF		0x04	/* ZIF socket */
47684ab085aSmws #define	SMB_PRU_PIGGY		0x05	/* replaceable piggy back */
47784ab085aSmws #define	SMB_PRU_NONE		0x06	/* none */
47884ab085aSmws #define	SMB_PRU_LIF		0x07	/* LIF socket */
47984ab085aSmws #define	SMB_PRU_SLOT1		0x08	/* slot 1 */
48084ab085aSmws #define	SMB_PRU_SLOT2		0x09	/* slot 2 */
48184ab085aSmws #define	SMB_PRU_370PIN		0x0A	/* 370-pin socket */
48284ab085aSmws #define	SMB_PRU_SLOTA		0x0B	/* slot A */
48384ab085aSmws #define	SMB_PRU_SLOTM		0x0C	/* slot M */
48484ab085aSmws #define	SMB_PRU_423		0x0D	/* socket 423 */
48584ab085aSmws #define	SMB_PRU_A		0x0E	/* socket A (socket 462) */
48684ab085aSmws #define	SMB_PRU_478		0x0F	/* socket 478 */
48784ab085aSmws #define	SMB_PRU_754		0x10	/* socket 754 */
48884ab085aSmws #define	SMB_PRU_940		0x11	/* socket 940 */
48942a58d9dSsethg #define	SMB_PRU_939		0x12	/* socket 939 */
49042a58d9dSsethg #define	SMB_PRU_MPGA604		0x13	/* mPGA604 */
49142a58d9dSsethg #define	SMB_PRU_LGA771		0x14	/* LGA771 */
49242a58d9dSsethg #define	SMB_PRU_LGA775		0x15	/* LGA775 */
49342a58d9dSsethg #define	SMB_PRU_S1		0x16	/* socket S1 */
49442a58d9dSsethg #define	SMB_PRU_AM2		0x17	/* socket AM2 */
49542a58d9dSsethg #define	SMB_PRU_F		0x18	/* socket F */
4964e901881SDale Ghent #define	SMB_PRU_LGA1366		0x19	/* LGA1366 */
4974e901881SDale Ghent #define	SMB_PRU_G34		0x1A	/* socket G34 */
4984e901881SDale Ghent #define	SMB_PRU_AM3		0x1B	/* socket AM3 */
4994e901881SDale Ghent #define	SMB_PRU_C32		0x1C	/* socket C32 */
5004e901881SDale Ghent #define	SMB_PRU_LGA1156		0x1D	/* LGA1156 */
5014e901881SDale Ghent #define	SMB_PRU_LGA1567		0x1E	/* LGA1567 */
5024e901881SDale Ghent #define	SMB_PRU_PGA988A		0x1F	/* PGA988A */
5034e901881SDale Ghent #define	SMB_PRU_BGA1288		0x20	/* BGA1288 */
5044e901881SDale Ghent #define	SMB_PRU_RPGA988B	0x21	/* rPGA988B */
5054e901881SDale Ghent #define	SMB_PRU_BGA1023		0x22	/* BGA1023 */
5064e901881SDale Ghent #define	SMB_PRU_BGA1224		0x23	/* BGA1224 */
5074e901881SDale Ghent #define	SMB_PRU_LGA1155		0x24	/* LGA1155 */
5084e901881SDale Ghent #define	SMB_PRU_LGA1356		0x25	/* LGA1356 */
5094e901881SDale Ghent #define	SMB_PRU_LGA2011		0x26	/* LGA2011 */
5104e901881SDale Ghent #define	SMB_PRU_FS1		0x27	/* socket FS1 */
5114e901881SDale Ghent #define	SMB_PRU_FS2		0x28	/* socket FS2 */
5124e901881SDale Ghent #define	SMB_PRU_FM1		0x29	/* socket FM1 */
5134e901881SDale Ghent #define	SMB_PRU_FM2		0x2A	/* socket FM2 */
5144e901881SDale Ghent #define	SMB_PRU_LGA20113	0x2B	/* LGA2011-3 */
5154e901881SDale Ghent #define	SMB_PRU_LGA13563	0x2C	/* LGA1356-3 */
51604cdb0e3SRobert Mustacchi #define	SMB_PRU_LGA1150		0x2D	/* LGA1150 */
51704cdb0e3SRobert Mustacchi #define	SMB_PRU_BGA1168		0x2E	/* BGA1168 */
51804cdb0e3SRobert Mustacchi #define	SMB_PRU_BGA1234		0x2F	/* BGA1234 */
51904cdb0e3SRobert Mustacchi #define	SMB_PRU_BGA1364		0x30	/* BGA1364 */
5201eb9e3eaSRobert Mustacchi #define	SMB_PRU_AM4		0x31	/* socket AM4 */
5211eb9e3eaSRobert Mustacchi #define	SMB_PRU_LGA1151		0x32	/* LGA1151 */
5221eb9e3eaSRobert Mustacchi #define	SMB_PRU_BGA1356		0x33	/* BGA1356 */
5231eb9e3eaSRobert Mustacchi #define	SMB_PRU_BGA1440		0x34	/* BGA1440 */
5241eb9e3eaSRobert Mustacchi #define	SMB_PRU_BGA1515		0x35	/* BGA1515 */
5251eb9e3eaSRobert Mustacchi #define	SMB_PRU_LGA36471	0x36	/* LGA3647-1 */
5261eb9e3eaSRobert Mustacchi #define	SMB_PRU_SP3		0x37	/* socket SP3 */
52719e81714SRobert Mustacchi #define	SMB_PRU_SP3r2		0x38	/* socket SP3r2 */
5284e901881SDale Ghent 
5294e901881SDale Ghent #define	SMB_PRC_RESERVED	0x0001	/* reserved */
5304e901881SDale Ghent #define	SMB_PRC_UNKNOWN		0x0002	/* unknown */
5314e901881SDale Ghent #define	SMB_PRC_64BIT		0x0004	/* 64-bit capable */
5324e901881SDale Ghent #define	SMB_PRC_MC		0x0008	/* multi-core */
5334e901881SDale Ghent #define	SMB_PRC_HT		0x0010	/* hardware thread */
5344e901881SDale Ghent #define	SMB_PRC_NX		0x0020	/* execution protection */
5354e901881SDale Ghent #define	SMB_PRC_VT		0x0040	/* enhanced virtualization */
5364e901881SDale Ghent #define	SMB_PRC_PM		0x0080	/* power/performance control */
53784ab085aSmws 
53884ab085aSmws #define	SMB_PRF_OTHER		0x01	/* other */
53984ab085aSmws #define	SMB_PRF_UNKNOWN		0x02	/* unknown */
54084ab085aSmws #define	SMB_PRF_8086		0x03	/* 8086 */
54184ab085aSmws #define	SMB_PRF_80286		0x04	/* 80286 */
54284ab085aSmws #define	SMB_PRF_I386		0x05	/* Intel 386 */
54384ab085aSmws #define	SMB_PRF_I486		0x06	/* Intel 486 */
54484ab085aSmws #define	SMB_PRF_8087		0x07	/* 8087 */
54584ab085aSmws #define	SMB_PRF_80287		0x08	/* 80287 */
54684ab085aSmws #define	SMB_PRF_80387		0x09	/* 80387 */
54784ab085aSmws #define	SMB_PRF_80487		0x0A	/* 80487 */
54884ab085aSmws #define	SMB_PRF_PENTIUM		0x0B	/* Pentium Family */
54984ab085aSmws #define	SMB_PRF_PENTIUMPRO	0x0C	/* Pentium Pro */
55084ab085aSmws #define	SMB_PRF_PENTIUMII	0x0D	/* Pentium II */
55184ab085aSmws #define	SMB_PRF_PENTIUM_MMX	0x0E	/* Pentium w/ MMX */
55284ab085aSmws #define	SMB_PRF_CELERON		0x0F	/* Celeron */
55384ab085aSmws #define	SMB_PRF_PENTIUMII_XEON	0x10	/* Pentium II Xeon */
55484ab085aSmws #define	SMB_PRF_PENTIUMIII	0x11	/* Pentium III */
55584ab085aSmws #define	SMB_PRF_M1		0x12	/* M1 */
55684ab085aSmws #define	SMB_PRF_M2		0x13	/* M2 */
5574e901881SDale Ghent #define	SMB_PRF_CELERON_M	0x14	/* Celeron M */
5584e901881SDale Ghent #define	SMB_PRF_PENTIUMIV_HT	0x15	/* Pentium 4 HT */
55984ab085aSmws #define	SMB_PRF_DURON		0x18	/* AMD Duron */
56084ab085aSmws #define	SMB_PRF_K5		0x19	/* K5 */
56184ab085aSmws #define	SMB_PRF_K6		0x1A	/* K6 */
56284ab085aSmws #define	SMB_PRF_K6_2		0x1B	/* K6-2 */
56384ab085aSmws #define	SMB_PRF_K6_3		0x1C	/* K6-3 */
56484ab085aSmws #define	SMB_PRF_ATHLON		0x1D	/* Athlon */
56584ab085aSmws #define	SMB_PRF_2900		0x1E	/* AMD 2900 */
56684ab085aSmws #define	SMB_PRF_K6_2PLUS	0x1F	/* K6-2+ */
56784ab085aSmws #define	SMB_PRF_PPC		0x20	/* PowerPC */
56884ab085aSmws #define	SMB_PRF_PPC_601		0x21	/* PowerPC 601 */
56984ab085aSmws #define	SMB_PRF_PPC_603		0x22	/* PowerPC 603 */
57084ab085aSmws #define	SMB_PRF_PPC_603PLUS	0x23	/* PowerPC 603+ */
57184ab085aSmws #define	SMB_PRF_PPC_604		0x24	/* PowerPC 604 */
57284ab085aSmws #define	SMB_PRF_PPC_620		0x25	/* PowerPC 620 */
57384ab085aSmws #define	SMB_PRF_PPC_704		0x26	/* PowerPC x704 */
57484ab085aSmws #define	SMB_PRF_PPC_750		0x27	/* PowerPC 750 */
5754e901881SDale Ghent #define	SMB_PRF_CORE_DUO	0x28	/* Core Duo */
5764e901881SDale Ghent #define	SMB_PRF_CORE_DUO_M	0x29	/* Core Duo mobile */
5774e901881SDale Ghent #define	SMB_PRF_CORE_SOLO_M	0x2A	/* Core Solo mobile */
5784e901881SDale Ghent #define	SMB_PRF_ATOM		0x2B	/* Intel Atom */
57904cdb0e3SRobert Mustacchi #define	SMB_PRF_CORE_M		0x2C	/* Intel Core M */
5801eb9e3eaSRobert Mustacchi #define	SMB_PRF_CORE_M3		0x2D	/* Intel Core m3 */
5811eb9e3eaSRobert Mustacchi #define	SMB_PRF_CORE_M5		0x2E	/* Intel Core m5 */
5821eb9e3eaSRobert Mustacchi #define	SMB_PRF_CORE_M7		0x2F	/* Intel Core m7 */
58384ab085aSmws #define	SMB_PRF_ALPHA		0x30	/* Alpha */
58484ab085aSmws #define	SMB_PRF_ALPHA_21064	0x31	/* Alpha 21064 */
58584ab085aSmws #define	SMB_PRF_ALPHA_21066	0x32	/* Alpha 21066 */
58684ab085aSmws #define	SMB_PRF_ALPHA_21164	0x33	/* Alpha 21164 */
58784ab085aSmws #define	SMB_PRF_ALPHA_21164PC	0x34	/* Alpha 21164PC */
58884ab085aSmws #define	SMB_PRF_ALPHA_21164A	0x35	/* Alpha 21164a */
58984ab085aSmws #define	SMB_PRF_ALPHA_21264	0x36	/* Alpha 21264 */
59084ab085aSmws #define	SMB_PRF_ALPHA_21364	0x37	/* Alpha 21364 */
5914e901881SDale Ghent #define	SMB_PRF_TURION2U_2C_MM	0x38
5924e901881SDale Ghent 			/* AMD Turion II Ultra Dual-Core Mobile M */
5934e901881SDale Ghent #define	SMB_PRF_TURION2_2C_MM	0x39	/* AMD Turion II Dual-Core Mobile M */
5944e901881SDale Ghent #define	SMB_PRF_ATHLON2_2C_M	0x3A	/* AMD Athlon II Dual-Core M */
5954e901881SDale Ghent #define	SMB_PRF_OPTERON_6100	0x3B	/* AMD Opteron 6100 series */
5964e901881SDale Ghent #define	SMB_PRF_OPTERON_4100	0x3C	/* AMD Opteron 4100 series */
5974e901881SDale Ghent #define	SMB_PRF_OPTERON_6200	0x3D	/* AMD Opteron 6200 series */
5984e901881SDale Ghent #define	SMB_PRF_OPTERON_4200	0x3E	/* AMD Opteron 4200 series */
5994e901881SDale Ghent #define	SMB_PRF_AMD_FX		0x3F	/* AMD FX series */
60084ab085aSmws #define	SMB_PRF_MIPS		0x40	/* MIPS */
60184ab085aSmws #define	SMB_PRF_MIPS_R4000	0x41	/* MIPS R4000 */
60284ab085aSmws #define	SMB_PRF_MIPS_R4200	0x42	/* MIPS R4200 */
60384ab085aSmws #define	SMB_PRF_MIPS_R4400	0x43	/* MIPS R4400 */
60484ab085aSmws #define	SMB_PRF_MIPS_R4600	0x44	/* MIPS R4600 */
60584ab085aSmws #define	SMB_PRF_MIPS_R10000	0x45	/* MIPS R10000 */
6064e901881SDale Ghent #define	SMB_PRF_AMD_C		0x46	/* AMD C-series */
6074e901881SDale Ghent #define	SMB_PRF_AMD_E		0x47	/* AMD E-series */
6084e901881SDale Ghent #define	SMB_PRF_AMD_A		0x48	/* AMD A-series */
6094e901881SDale Ghent #define	SMB_PRF_AMD_G		0x49	/* AMD G-series */
6104e901881SDale Ghent #define	SMB_PRF_AMD_Z		0x4A	/* AMD Z-series */
6114e901881SDale Ghent #define	SMB_PRF_AMD_R		0x4B	/* AMD R-series */
6124e901881SDale Ghent #define	SMB_PRF_OPTERON_4300	0x4C	/* AMD Opteron 4300 series */
6134e901881SDale Ghent #define	SMB_PRF_OPTERON_6300	0x4D	/* AMD Opteron 6300 series */
6144e901881SDale Ghent #define	SMB_PRF_OPTERON_3300	0x4E	/* AMD Opteron 3300 series */
6154e901881SDale Ghent #define	SMB_PRF_AMD_FIREPRO	0x4F	/* AMD FirePro series */
61684ab085aSmws #define	SMB_PRF_SPARC		0x50	/* SPARC */
61784ab085aSmws #define	SMB_PRF_SUPERSPARC	0x51	/* SuperSPARC */
61884ab085aSmws #define	SMB_PRF_MICROSPARCII	0x52	/* microSPARC II */
61984ab085aSmws #define	SMB_PRF_MICROSPARCIIep	0x53	/* microSPARC IIep */
62084ab085aSmws #define	SMB_PRF_ULTRASPARC	0x54	/* UltraSPARC */
62184ab085aSmws #define	SMB_PRF_USII		0x55	/* UltraSPARC II */
62284ab085aSmws #define	SMB_PRF_USIIi		0x56	/* UltraSPARC IIi */
62384ab085aSmws #define	SMB_PRF_USIII		0x57	/* UltraSPARC III */
62484ab085aSmws #define	SMB_PRF_USIIIi		0x58	/* UltraSPARC IIIi */
62584ab085aSmws #define	SMB_PRF_68040		0x60	/* 68040 */
62684ab085aSmws #define	SMB_PRF_68XXX		0x61	/* 68XXX */
62784ab085aSmws #define	SMB_PRF_68000		0x62	/* 68000 */
62884ab085aSmws #define	SMB_PRF_68010		0x63	/* 68010 */
62984ab085aSmws #define	SMB_PRF_68020		0x64	/* 68020 */
63084ab085aSmws #define	SMB_PRF_68030		0x65	/* 68030 */
63104cdb0e3SRobert Mustacchi #define	SMB_PRF_ATHLON_X4	0x66	/* AMD Athlon X4 Quad-Core */
63204cdb0e3SRobert Mustacchi #define	SMB_PRF_OPTERON_X1K	0x67	/* AMD Opteron X1000 */
63304cdb0e3SRobert Mustacchi #define	SMB_PRF_OPTERON_X2K	0x68	/* AMD Opteron X2000 APU */
6341eb9e3eaSRobert Mustacchi #define	SMB_PRF_OPTERON_A	0x69	/* AMD Opteron A Series */
635*a872c43aSRobert Mustacchi #define	SMB_PRF_OPTERON_X3K	0x6A	/* AMD Opteron X3000 APU */
63619e81714SRobert Mustacchi #define	SMB_PRF_ZEN		0x6B	/* AMD Zen Processor Family */
63784ab085aSmws #define	SMB_PRF_HOBBIT		0x70	/* Hobbit */
63884ab085aSmws #define	SMB_PRF_TM5000		0x78	/* Crusoe TM5000 */
63984ab085aSmws #define	SMB_PRF_TM3000		0x79	/* Crusoe TM3000 */
64084ab085aSmws #define	SMB_PRF_TM8000		0x7A	/* Efficeon TM8000 */
64184ab085aSmws #define	SMB_PRF_WEITEK		0x80	/* Weitek */
64284ab085aSmws #define	SMB_PRF_ITANIC		0x82	/* Itanium */
64384ab085aSmws #define	SMB_PRF_ATHLON64	0x83	/* Athlon64 */
64484ab085aSmws #define	SMB_PRF_OPTERON		0x84	/* Opteron */
6454e901881SDale Ghent #define	SMB_PRF_SEMPRON		0x85    /* Sempron */
6464e901881SDale Ghent #define	SMB_PRF_TURION64_M	0x86	/* Turion 64 Mobile */
6474e901881SDale Ghent #define	SMB_PRF_OPTERON_2C	0x87	/* AMD Opteron Dual-Core */
6484e901881SDale Ghent #define	SMB_PRF_ATHLON64_X2_2C	0x88	/* AMD Athlon 64 X2 Dual-Core */
6494e901881SDale Ghent #define	SMB_PRF_TURION64_X2_M	0x89	/* AMD Turion 64 X2 Mobile */
6504e901881SDale Ghent #define	SMB_PRF_OPTERON_4C	0x8A	/* AMD Opteron Quad-Core */
6514e901881SDale Ghent #define	SMB_PRF_OPTERON_3G	0x8B	/* AMD Opteron 3rd Generation */
6524e901881SDale Ghent #define	SMB_PRF_PHENOM_FX_4C	0x8C	/* AMD Phenom FX Quad-Core */
6534e901881SDale Ghent #define	SMB_PRF_PHENOM_X4_4C	0x8D	/* AMD Phenom X4 Quad-Core */
6544e901881SDale Ghent #define	SMB_PRF_PHENOM_X2_2C	0x8E	/* AMD Phenom X2 Dual-Core */
6554e901881SDale Ghent #define	SMB_PRF_ATHLON_X2_2C	0x8F	/* AMD Athlon X2 Dual-Core */
65684ab085aSmws #define	SMB_PRF_PA		0x90	/* PA-RISC */
65784ab085aSmws #define	SMB_PRF_PA8500		0x91	/* PA-RISC 8500 */
65884ab085aSmws #define	SMB_PRF_PA8000		0x92	/* PA-RISC 8000 */
65984ab085aSmws #define	SMB_PRF_PA7300LC	0x93	/* PA-RISC 7300LC */
66084ab085aSmws #define	SMB_PRF_PA7200		0x94	/* PA-RISC 7200 */
66184ab085aSmws #define	SMB_PRF_PA7100LC	0x95	/* PA-RISC 7100LC */
66284ab085aSmws #define	SMB_PRF_PA7100		0x96	/* PA-RISC 7100 */
66384ab085aSmws #define	SMB_PRF_V30		0xA0	/* V30 */
6644e901881SDale Ghent #define	SMB_PRF_XEON_4C_3200	0xA1	/* Xeon Quad Core 3200 */
6654e901881SDale Ghent #define	SMB_PRF_XEON_2C_3000	0xA2	/* Xeon Dual Core 3000 */
6664e901881SDale Ghent #define	SMB_PRF_XEON_4C_5300	0xA3	/* Xeon Quad Core 5300 */
6674e901881SDale Ghent #define	SMB_PRF_XEON_2C_5100	0xA4	/* Xeon Dual Core 5100 */
6684e901881SDale Ghent #define	SMB_PRF_XEON_2C_5000	0xA5	/* Xeon Dual Core 5000 */
6694e901881SDale Ghent #define	SMB_PRF_XEON_2C_LV	0xA6	/* Xeon Dual Core LV */
6704e901881SDale Ghent #define	SMB_PRF_XEON_2C_ULV	0xA7	/* Xeon Dual Core ULV */
6714e901881SDale Ghent #define	SMB_PRF_XEON_2C_7100	0xA8	/* Xeon Dual Core 7100 */
6724e901881SDale Ghent #define	SMB_PRF_XEON_4C_5400	0xA9	/* Xeon Quad Core 5400 */
6734e901881SDale Ghent #define	SMB_PRF_XEON_4C		0xAA	/* Xeon Quad Core */
6744e901881SDale Ghent #define	SMB_PRF_XEON_2C_5200	0xAB	/* Xeon Dual Core 5200 */
6754e901881SDale Ghent #define	SMB_PRF_XEON_2C_7200	0xAC	/* Xeon Dual Core 7200 */
6764e901881SDale Ghent #define	SMB_PRF_XEON_4C_7300	0xAD	/* Xeon Quad Core 7300 */
6774e901881SDale Ghent #define	SMB_PRF_XEON_4C_7400	0xAE	/* Xeon Quad Core 7400 */
6784e901881SDale Ghent #define	SMB_PRF_XEON_XC_7400	0xAF	/* Xeon Multi Core 7400 */
67984ab085aSmws #define	SMB_PRF_PENTIUMIII_XEON	0xB0	/* Pentium III Xeon */
68084ab085aSmws #define	SMB_PRF_PENTIUMIII_SS	0xB1	/* Pentium III with SpeedStep */
68184ab085aSmws #define	SMB_PRF_P4		0xB2	/* Pentium 4 */
68284ab085aSmws #define	SMB_PRF_XEON		0xB3	/* Intel Xeon */
68384ab085aSmws #define	SMB_PRF_AS400		0xB4	/* AS400 */
68484ab085aSmws #define	SMB_PRF_XEON_MP		0xB5	/* Intel Xeon MP */
68584ab085aSmws #define	SMB_PRF_ATHLON_XP	0xB6	/* AMD Athlon XP */
68642a58d9dSsethg #define	SMB_PRF_ATHLON_MP	0xB7	/* AMD Athlon MP */
68784ab085aSmws #define	SMB_PRF_ITANIC2		0xB8	/* Itanium 2 */
68884ab085aSmws #define	SMB_PRF_PENTIUM_M	0xB9	/* Pentium M */
68942a58d9dSsethg #define	SMB_PRF_CELERON_D	0xBA	/* Celeron D */
69042a58d9dSsethg #define	SMB_PRF_PENTIUM_D	0xBB	/* Pentium D */
69142a58d9dSsethg #define	SMB_PRF_PENTIUM_EE	0xBC	/* Pentium Extreme Edition */
6924e901881SDale Ghent #define	SMB_PRF_CORE_SOLO	0xBD	/* Intel Core Solo */
6934e901881SDale Ghent #define	SMB_PRF_CORE2_DUO	0xBF	/* Intel Core 2 Duo */
6944e901881SDale Ghent #define	SMB_PRF_CORE2_SOLO	0xC0	/* Intel Core 2 Solo */
6954e901881SDale Ghent #define	SMB_PRF_CORE2_EX	0xC1	/* Intel Core 2 Extreme */
6964e901881SDale Ghent #define	SMB_PRF_CORE2_QUAD	0xC2	/* Intel Core 2 Quad */
6974e901881SDale Ghent #define	SMB_PRF_CORE2_EX_M	0xC3	/* Intel Core 2 Extreme mobile */
6984e901881SDale Ghent #define	SMB_PRF_CORE2_DUO_M	0xC4	/* Intel Core 2 Duo mobile */
6994e901881SDale Ghent #define	SMB_PRF_CORE2_SOLO_M	0xC5	/* Intel Core 2 Solo mobile */
7004e901881SDale Ghent #define	SMB_PRF_CORE_I7		0xC6	/* Intel Core i7 */
7014e901881SDale Ghent #define	SMB_PRF_CELERON_2C	0xC7	/* Celeron Dual-Core */
70284ab085aSmws #define	SMB_PRF_IBM390		0xC8	/* IBM 390 */
70384ab085aSmws #define	SMB_PRF_G4		0xC9	/* G4 */
70484ab085aSmws #define	SMB_PRF_G5		0xCA	/* G5 */
70542a58d9dSsethg #define	SMB_PRF_ESA390		0xCB	/* ESA390 */
70642a58d9dSsethg #define	SMB_PRF_ZARCH		0xCC	/* z/Architecture */
7074e901881SDale Ghent #define	SMB_PRF_CORE_I5		0xCD	/* Intel Core i5 */
7084e901881SDale Ghent #define	SMB_PRF_CORE_I3		0xCE	/* Intel Core i3 */
70942a58d9dSsethg #define	SMB_PRF_C7M		0xD2	/* VIA C7-M */
71042a58d9dSsethg #define	SMB_PRF_C7D		0xD3	/* VIA C7-D */
71142a58d9dSsethg #define	SMB_PRF_C7		0xD4	/* VIA C7 */
71242a58d9dSsethg #define	SMB_PRF_EDEN		0xD5	/* VIA Eden */
7134e901881SDale Ghent #define	SMB_PRF_XEON_XC		0xD6	/* Intel Xeon Multi-Core */
7144e901881SDale Ghent #define	SMB_PRF_XEON_2C_3XXX	0xD7	/* Intel Xeon Dual-Core 3xxx */
7154e901881SDale Ghent #define	SMB_PRF_XEON_4C_3XXX	0xD8	/* Intel Xeon Quad-Core 3xxx */
7164e901881SDale Ghent #define	SMB_PRF_VIA_NANO	0xD9	/* VIA Nano */
7174e901881SDale Ghent #define	SMB_PRF_XEON_2C_5XXX	0xDA	/* Intel Xeon Dual-Core 5xxx */
7184e901881SDale Ghent #define	SMB_PRF_XEON_4C_5XXX	0xDB	/* Intel Xeon Quad-Core 5xxx */
7194e901881SDale Ghent #define	SMB_PRF_XEON_2C_7XXX	0xDD	/* Intel Xeon Dual-Core 7xxx */
7204e901881SDale Ghent #define	SMB_PRF_XEON_4C_7XXX	0xDE	/* Intel Xeon Quad-Core 7xxx */
7214e901881SDale Ghent #define	SMB_PRF_XEON_XC_7XXX	0xDF	/* Intel Xeon Multi-Core 7xxx */
7224e901881SDale Ghent #define	SMB_PRF_XEON_XC_3400	0xE0	/* Intel Xeon Multi-Core 3400 */
7234e901881SDale Ghent #define	SMB_PRF_OPTERON_3000	0xE4	/* AMD Opteron 3000 */
7244e901881SDale Ghent #define	SMB_PRF_SEMPRON_II	0xE5	/* AMD Sempron II */
7254e901881SDale Ghent #define	SMB_PRF_OPTERON_4C_EM	0xE6	/* AMD Opteron Quad-Core embedded */
7264e901881SDale Ghent #define	SMB_PRF_PHENOM_3C	0xE7	/* AMD Phenom Triple-Core */
7274e901881SDale Ghent #define	SMB_PRF_TURIONU_2C_M	0xE8	/* AMD Turion Ultra Dual-Core mobile */
7284e901881SDale Ghent #define	SMB_PRF_TURION_2C_M	0xE9	/* AMD Turion Dual-Core mobile */
7294e901881SDale Ghent #define	SMB_PRF_ATHLON_2C	0xEA	/* AMD Athlon Dual-Core */
7304e901881SDale Ghent #define	SMB_PRF_SEMPRON_SI	0xEB	/* AMD Sempron SI */
7314e901881SDale Ghent #define	SMB_PRF_PHENOM_II	0xEC	/* AMD Phenom II */
7324e901881SDale Ghent #define	SMB_PRF_ATHLON_II	0xED	/* AMD Athlon II */
7334e901881SDale Ghent #define	SMB_PRF_OPTERON_6C	0xEE	/* AMD Opteron Six-Core */
7344e901881SDale Ghent #define	SMB_PRF_SEMPRON_M	0xEF	/* AMD Sempron M */
73584ab085aSmws #define	SMB_PRF_I860		0xFA	/* i860 */
73684ab085aSmws #define	SMB_PRF_I960		0xFB	/* i960 */
7371eb9e3eaSRobert Mustacchi #define	SMB_PRF_ARMv7		0x100	/* ARMv7 */
7381eb9e3eaSRobert Mustacchi #define	SMB_PRF_ARMv8		0x101	/* ARMv8 */
73942a58d9dSsethg #define	SMB_PRF_SH3		0x104	/* SH-3 */
74042a58d9dSsethg #define	SMB_PRF_SH4		0x105	/* SH-4 */
74142a58d9dSsethg #define	SMB_PRF_ARM		0x118	/* ARM */
74242a58d9dSsethg #define	SMB_PRF_SARM		0x119	/* StrongARM */
74342a58d9dSsethg #define	SMB_PRF_6X86		0x12C	/* 6x86 */
74442a58d9dSsethg #define	SMB_PRF_MEDIAGX		0x12D	/* MediaGX */
74542a58d9dSsethg #define	SMB_PRF_MII		0x12E	/* MII */
74642a58d9dSsethg #define	SMB_PRF_WINCHIP		0x140	/* WinChip */
74742a58d9dSsethg #define	SMB_PRF_DSP		0x15E	/* DSP */
74842a58d9dSsethg #define	SMB_PRF_VIDEO		0x1F4	/* Video Processor */
74984ab085aSmws 
75084ab085aSmws /*
7514e901881SDale Ghent  * SMBIOS Cache Information.  See DSP0134 Section 7.8 for more information.
75284ab085aSmws  * If smba_size is zero, this indicates the specified cache is not present.
7531eb9e3eaSRobert Mustacchi  *
7541eb9e3eaSRobert Mustacchi  * SMBIOS 3.1 added extended cache sizes. Unfortunately, we had already baked in
7551eb9e3eaSRobert Mustacchi  * the uint32_t sizes, so we added extended uint64_t's that correspond to the
7561eb9e3eaSRobert Mustacchi  * new fields. To make life easier for consumers, we always make sure that the
7571eb9e3eaSRobert Mustacchi  * _maxsize2 and _size2 members are filled in with the old value if no other
7581eb9e3eaSRobert Mustacchi  * value is present.
75984ab085aSmws  */
76084ab085aSmws typedef struct smbios_cache {
76184ab085aSmws 	uint32_t smba_maxsize;		/* maximum installed size in bytes */
76284ab085aSmws 	uint32_t smba_size;		/* installed size in bytes */
76384ab085aSmws 	uint16_t smba_stype;		/* supported SRAM types (SMB_CAT_*) */
76484ab085aSmws 	uint16_t smba_ctype;		/* current SRAM type (SMB_CAT_*) */
76584ab085aSmws 	uint8_t smba_speed;		/* speed in nanoseconds */
76684ab085aSmws 	uint8_t smba_etype;		/* error correction type (SMB_CAE_*) */
76784ab085aSmws 	uint8_t smba_ltype;		/* logical cache type (SMB_CAG_*) */
76884ab085aSmws 	uint8_t smba_assoc;		/* associativity (SMB_CAA_*) */
76984ab085aSmws 	uint8_t smba_level;		/* cache level */
77084ab085aSmws 	uint8_t smba_mode;		/* cache mode (SMB_CAM_*) */
77184ab085aSmws 	uint8_t smba_location;		/* cache location (SMB_CAL_*) */
77284ab085aSmws 	uint8_t smba_flags;		/* cache flags (SMB_CAF_*) */
7731eb9e3eaSRobert Mustacchi 	uint64_t smba_maxsize2;		/* maximum installed size in bytes */
7741eb9e3eaSRobert Mustacchi 	uint64_t smba_size2;		/* installed size in bytes */
77584ab085aSmws } smbios_cache_t;
77684ab085aSmws 
77784ab085aSmws #define	SMB_CAT_OTHER		0x0001		/* other */
77884ab085aSmws #define	SMB_CAT_UNKNOWN		0x0002		/* unknown */
77984ab085aSmws #define	SMB_CAT_NONBURST	0x0004		/* non-burst */
78084ab085aSmws #define	SMB_CAT_BURST		0x0008		/* burst */
78184ab085aSmws #define	SMB_CAT_PBURST		0x0010		/* pipeline burst */
78284ab085aSmws #define	SMB_CAT_SYNC		0x0020		/* synchronous */
78384ab085aSmws #define	SMB_CAT_ASYNC		0x0040		/* asynchronous */
78484ab085aSmws 
78584ab085aSmws #define	SMB_CAE_OTHER		0x01		/* other */
78684ab085aSmws #define	SMB_CAE_UNKNOWN		0x02		/* unknown */
78784ab085aSmws #define	SMB_CAE_NONE		0x03		/* none */
78884ab085aSmws #define	SMB_CAE_PARITY		0x04		/* parity */
78984ab085aSmws #define	SMB_CAE_SBECC		0x05		/* single-bit ECC */
79084ab085aSmws #define	SMB_CAE_MBECC		0x06		/* multi-bit ECC */
79184ab085aSmws 
79284ab085aSmws #define	SMB_CAG_OTHER		0x01		/* other */
79384ab085aSmws #define	SMB_CAG_UNKNOWN		0x02		/* unknown */
79484ab085aSmws #define	SMB_CAG_INSTR		0x03		/* instruction */
79584ab085aSmws #define	SMB_CAG_DATA		0x04		/* data */
79684ab085aSmws #define	SMB_CAG_UNIFIED		0x05		/* unified */
79784ab085aSmws 
79884ab085aSmws #define	SMB_CAA_OTHER		0x01		/* other */
79984ab085aSmws #define	SMB_CAA_UNKNOWN		0x02		/* unknown */
80084ab085aSmws #define	SMB_CAA_DIRECT		0x03		/* direct mapped */
80184ab085aSmws #define	SMB_CAA_2WAY		0x04		/* 2-way set associative */
80284ab085aSmws #define	SMB_CAA_4WAY		0x05		/* 4-way set associative */
80384ab085aSmws #define	SMB_CAA_FULL		0x06		/* fully associative */
80484ab085aSmws #define	SMB_CAA_8WAY		0x07		/* 8-way set associative */
80584ab085aSmws #define	SMB_CAA_16WAY		0x08		/* 16-way set associative */
8064e901881SDale Ghent #define	SMB_CAA_12WAY		0x09		/* 12-way set associative */
8074e901881SDale Ghent #define	SMB_CAA_24WAY		0x0A		/* 24-way set associative */
8084e901881SDale Ghent #define	SMB_CAA_32WAY		0x0B		/* 32-way set associative */
8094e901881SDale Ghent #define	SMB_CAA_48WAY		0x0C		/* 48-way set associative */
8104e901881SDale Ghent #define	SMB_CAA_64WAY		0x0D		/* 64-way set associative */
8114e901881SDale Ghent #define	SMB_CAA_20WAY		0x0E		/* 20-way set associative */
81284ab085aSmws 
81384ab085aSmws #define	SMB_CAM_WT		0x00		/* write-through */
81484ab085aSmws #define	SMB_CAM_WB		0x01		/* write-back */
81584ab085aSmws #define	SMB_CAM_VARY		0x02		/* varies by address */
81684ab085aSmws #define	SMB_CAM_UNKNOWN		0x03		/* unknown */
81784ab085aSmws 
81884ab085aSmws #define	SMB_CAL_INTERNAL	0x00		/* internal */
81984ab085aSmws #define	SMB_CAL_EXTERNAL	0x01		/* external */
82084ab085aSmws #define	SMB_CAL_RESERVED	0x02		/* reserved */
82184ab085aSmws #define	SMB_CAL_UNKNOWN		0x03		/* unknown */
82284ab085aSmws 
82384ab085aSmws #define	SMB_CAF_ENABLED		0x01		/* enabled at boot time */
82484ab085aSmws #define	SMB_CAF_SOCKETED	0x02		/* cache is socketed */
82584ab085aSmws 
82684ab085aSmws /*
8274e901881SDale Ghent  * SMBIOS Port Information.  See DSP0134 Section 7.9 for more information.
82884ab085aSmws  * The internal reference designator string is also mapped to the location.
82984ab085aSmws  */
83084ab085aSmws typedef struct smbios_port {
83184ab085aSmws 	const char *smbo_iref;	/* internal reference designator */
83284ab085aSmws 	const char *smbo_eref;	/* external reference designator */
83384ab085aSmws 	uint8_t smbo_itype;	/* internal connector type (SMB_POC_*) */
83484ab085aSmws 	uint8_t smbo_etype;	/* external connector type (SMB_POC_*) */
83584ab085aSmws 	uint8_t smbo_ptype;	/* port type (SMB_POT_*) */
83684ab085aSmws 	uint8_t smbo_pad;	/* padding */
83784ab085aSmws } smbios_port_t;
83884ab085aSmws 
83984ab085aSmws #define	SMB_POC_NONE		0x00		/* none */
84084ab085aSmws #define	SMB_POC_CENT		0x01		/* Centronics */
84184ab085aSmws #define	SMB_POC_MINICENT	0x02		/* Mini-Centronics */
84284ab085aSmws #define	SMB_POC_PROPRIETARY	0x03		/* proprietary */
84384ab085aSmws #define	SMB_POC_DB25M		0x04		/* DB-25 pin male */
84484ab085aSmws #define	SMB_POC_DB25F		0x05		/* DB-25 pin female */
84584ab085aSmws #define	SMB_POC_DB15M		0x06		/* DB-15 pin male */
84684ab085aSmws #define	SMB_POC_DB15F		0x07		/* DB-15 pin female */
84784ab085aSmws #define	SMB_POC_DB9M		0x08		/* DB-9 pin male */
84884ab085aSmws #define	SMB_POC_DB9F		0x09		/* DB-9 pin female */
84984ab085aSmws #define	SMB_POC_RJ11		0x0A		/* RJ-11 */
85084ab085aSmws #define	SMB_POC_RJ45		0x0B		/* RJ-45 */
85184ab085aSmws #define	SMB_POC_MINISCSI	0x0C		/* 50-pin MiniSCSI */
85284ab085aSmws #define	SMB_POC_MINIDIN		0x0D		/* Mini-DIN */
85384ab085aSmws #define	SMB_POC_MICRODIN	0x0E		/* Micro-DIN */
85484ab085aSmws #define	SMB_POC_PS2		0x0F		/* PS/2 */
85584ab085aSmws #define	SMB_POC_IR		0x10		/* Infrared */
85684ab085aSmws #define	SMB_POC_HPHIL		0x11		/* HP-HIL */
85784ab085aSmws #define	SMB_POC_USB		0x12		/* USB */
85884ab085aSmws #define	SMB_POC_SSA		0x13		/* SSA SCSI */
85984ab085aSmws #define	SMB_POC_DIN8M		0x14		/* Circular DIN-8 male */
86084ab085aSmws #define	SMB_POC_DIN8F		0x15		/* Circular DIN-8 female */
86184ab085aSmws #define	SMB_POC_OBIDE		0x16		/* on-board IDE */
86284ab085aSmws #define	SMB_POC_OBFLOPPY	0x17		/* on-board floppy */
86384ab085aSmws #define	SMB_POC_DI9		0x18		/* 9p dual inline (p10 cut) */
86484ab085aSmws #define	SMB_POC_DI25		0x19		/* 25p dual inline (p26 cut) */
86584ab085aSmws #define	SMB_POC_DI50		0x1A		/* 50p dual inline */
86684ab085aSmws #define	SMB_POC_DI68		0x1B		/* 68p dual inline */
86784ab085aSmws #define	SMB_POC_CDROM		0x1C		/* on-board sound from CDROM */
86884ab085aSmws #define	SMB_POC_MINI14		0x1D		/* Mini-Centronics Type 14 */
86984ab085aSmws #define	SMB_POC_MINI26		0x1E		/* Mini-Centronics Type 26 */
87084ab085aSmws #define	SMB_POC_MINIJACK	0x1F		/* Mini-jack (headphones) */
87184ab085aSmws #define	SMB_POC_BNC		0x20		/* BNC */
87284ab085aSmws #define	SMB_POC_1394		0x21		/* 1394 */
8734e901881SDale Ghent #define	SMB_POC_SATA		0x22		/* SAS/SATA plug receptacle */
87484ab085aSmws #define	SMB_POC_PC98		0xA0		/* PC-98 */
87584ab085aSmws #define	SMB_POC_PC98HR		0xA1		/* PC-98Hireso */
87684ab085aSmws #define	SMB_POC_PCH98		0xA2		/* PC-H98 */
87784ab085aSmws #define	SMB_POC_PC98NOTE	0xA3		/* PC-98Note */
87884ab085aSmws #define	SMB_POC_PC98FULL	0xA4		/* PC-98Full */
87984ab085aSmws #define	SMB_POC_OTHER		0xFF		/* other */
88084ab085aSmws 
88184ab085aSmws #define	SMB_POT_NONE		0x00		/* none */
88284ab085aSmws #define	SMB_POT_PP_XTAT		0x01		/* Parallel Port XT/AT compat */
88384ab085aSmws #define	SMB_POT_PP_PS2		0x02		/* Parallel Port PS/2 */
88484ab085aSmws #define	SMB_POT_PP_ECP		0x03		/* Parallel Port ECP */
88584ab085aSmws #define	SMB_POT_PP_EPP		0x04		/* Parallel Port EPP */
88684ab085aSmws #define	SMB_POT_PP_ECPEPP	0x05		/* Parallel Port ECP/EPP */
88784ab085aSmws #define	SMB_POT_SP_XTAT		0x06		/* Serial Port XT/AT compat */
88884ab085aSmws #define	SMB_POT_SP_16450	0x07		/* Serial Port 16450 compat */
88984ab085aSmws #define	SMB_POT_SP_16550	0x08		/* Serial Port 16550 compat */
89084ab085aSmws #define	SMB_POT_SP_16550A	0x09		/* Serial Port 16550A compat */
89184ab085aSmws #define	SMB_POT_SCSI		0x0A		/* SCSI port */
89284ab085aSmws #define	SMB_POT_MIDI		0x0B		/* MIDI port */
89384ab085aSmws #define	SMB_POT_JOYSTICK	0x0C		/* Joystick port */
89484ab085aSmws #define	SMB_POT_KEYBOARD	0x0D		/* Keyboard port */
89584ab085aSmws #define	SMB_POT_MOUSE		0x0E		/* Mouse port */
89684ab085aSmws #define	SMB_POT_SSA		0x0F		/* SSA SCSI */
89784ab085aSmws #define	SMB_POT_USB		0x10		/* USB */
89884ab085aSmws #define	SMB_POT_FIREWIRE	0x11		/* FireWrite (IEEE P1394) */
89984ab085aSmws #define	SMB_POT_PCMII		0x12		/* PCMCIA Type II */
90084ab085aSmws #define	SMB_POT_PCMIIa		0x13		/* PCMCIA Type II (alternate) */
90184ab085aSmws #define	SMB_POT_PCMIII		0x14		/* PCMCIA Type III */
90284ab085aSmws #define	SMB_POT_CARDBUS		0x15		/* Cardbus */
90384ab085aSmws #define	SMB_POT_ACCESS		0x16		/* Access Bus Port */
90484ab085aSmws #define	SMB_POT_SCSI2		0x17		/* SCSI II */
90584ab085aSmws #define	SMB_POT_SCSIW		0x18		/* SCSI Wide */
90684ab085aSmws #define	SMB_POT_PC98		0x19		/* PC-98 */
90784ab085aSmws #define	SMB_POT_PC98HR		0x1A		/* PC-98Hireso */
90884ab085aSmws #define	SMB_POT_PCH98		0x1B		/* PC-H98 */
90984ab085aSmws #define	SMB_POT_VIDEO		0x1C		/* Video port */
91084ab085aSmws #define	SMB_POT_AUDIO		0x1D		/* Audio port */
91184ab085aSmws #define	SMB_POT_MODEM		0x1E		/* Modem port */
91284ab085aSmws #define	SMB_POT_NETWORK		0x1F		/* Network port */
91342a58d9dSsethg #define	SMB_POT_SATA		0x20		/* SATA */
91442a58d9dSsethg #define	SMB_POT_SAS		0x21		/* SAS */
91584ab085aSmws #define	SMB_POT_8251		0xA0		/* 8251 compatible */
91684ab085aSmws #define	SMB_POT_8251F		0xA1		/* 8251 FIFO compatible */
91784ab085aSmws #define	SMB_POT_OTHER		0xFF		/* other */
91884ab085aSmws 
91984ab085aSmws /*
9204e901881SDale Ghent  * SMBIOS Slot Information.  See DSP0134 Section 7.10 for more information.
9214e901881SDale Ghent  * See DSP0134 7.10.5 for how to interpret the value of smbl_id.
92284ab085aSmws  */
92384ab085aSmws typedef struct smbios_slot {
92484ab085aSmws 	const char *smbl_name;		/* reference designation */
92584ab085aSmws 	uint8_t smbl_type;		/* slot type */
92684ab085aSmws 	uint8_t smbl_width;		/* slot data bus width */
92784ab085aSmws 	uint8_t smbl_usage;		/* current usage */
92884ab085aSmws 	uint8_t smbl_length;		/* slot length */
92984ab085aSmws 	uint16_t smbl_id;		/* slot ID */
93084ab085aSmws 	uint8_t smbl_ch1;		/* slot characteristics 1 */
93184ab085aSmws 	uint8_t smbl_ch2;		/* slot characteristics 2 */
93203f9f63dSTom Pothier 	uint16_t smbl_sg;		/* segment group number */
93303f9f63dSTom Pothier 	uint8_t smbl_bus;		/* bus number */
93403f9f63dSTom Pothier 	uint8_t smbl_df;		/* device/function number */
93584ab085aSmws } smbios_slot_t;
93684ab085aSmws 
93784ab085aSmws #define	SMB_SLT_OTHER		0x01	/* other */
93884ab085aSmws #define	SMB_SLT_UNKNOWN		0x02	/* unknown */
93984ab085aSmws #define	SMB_SLT_ISA		0x03	/* ISA */
94084ab085aSmws #define	SMB_SLT_MCA		0x04	/* MCA */
94184ab085aSmws #define	SMB_SLT_EISA		0x05	/* EISA */
94284ab085aSmws #define	SMB_SLT_PCI		0x06	/* PCI */
94384ab085aSmws #define	SMB_SLT_PCMCIA		0x07	/* PCMCIA */
94484ab085aSmws #define	SMB_SLT_VLVESA		0x08	/* VL-VESA */
94584ab085aSmws #define	SMB_SLT_PROPRIETARY	0x09	/* proprietary */
94684ab085aSmws #define	SMB_SLT_PROC		0x0A	/* processor card slot */
94784ab085aSmws #define	SMB_SLT_MEM		0x0B	/* proprietary memory card slot */
94884ab085aSmws #define	SMB_SLT_IOR		0x0C	/* I/O riser card slot */
94984ab085aSmws #define	SMB_SLT_NUBUS		0x0D	/* NuBus */
95084ab085aSmws #define	SMB_SLT_PCI66		0x0E	/* PCI (66MHz capable) */
95184ab085aSmws #define	SMB_SLT_AGP		0x0F	/* AGP */
95284ab085aSmws #define	SMB_SLT_AGP2X		0x10	/* AGP 2X */
95384ab085aSmws #define	SMB_SLT_AGP4X		0x11	/* AGP 4X */
95484ab085aSmws #define	SMB_SLT_PCIX		0x12	/* PCI-X */
95584ab085aSmws #define	SMB_SLT_AGP8X		0x13	/* AGP 8X */
95604cdb0e3SRobert Mustacchi #define	SMB_SLT_M2_1DP		0x14	/* M.2 Socket 1-DP (Mechanical Key A) */
95704cdb0e3SRobert Mustacchi #define	SMB_SLT_M2_1SD		0x15	/* M.2 Socket 1-SD (Mechanical Key E) */
95804cdb0e3SRobert Mustacchi #define	SMB_SLT_M2_2		0x16	/* M.2 Socket 2 (Mechanical Key B) */
95904cdb0e3SRobert Mustacchi #define	SMB_SLT_M2_3		0x17	/* M.2 Socket 3 (Mechanical Key M) */
96004cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM_I		0x18	/* MXM Type I */
96104cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM_II		0x19	/* MXM Type II */
96204cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM_III		0x1A	/* MXM Type III (standard connector) */
96304cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM_III_HE	0x1B	/* MXM Type III (HE connector) */
96404cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM_V		0x1C	/* MXM Type IV */
96504cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM3_A		0x1D	/* MXM 3.0 Type A */
96604cdb0e3SRobert Mustacchi #define	SMB_SLT_MXM3_B		0x1E	/* MXM 3.0 Type B */
96704cdb0e3SRobert Mustacchi #define	SMB_SLT_PCIEG2_SFF	0x1F	/* PCI Express Gen 2 SFF-8639 */
96804cdb0e3SRobert Mustacchi #define	SMB_SLT_PCIEG3_SFF	0x20	/* PCI Express Gen 3 SFF-8639 */
9691eb9e3eaSRobert Mustacchi /*
9701eb9e3eaSRobert Mustacchi  * These lines must be on one line for the string generating code.
9711eb9e3eaSRobert Mustacchi  */
9721eb9e3eaSRobert Mustacchi /* BEGIN CSTYLED */
9731eb9e3eaSRobert Mustacchi #define	SMB_SLT_PCIE_M52_WBSKO	0x21	/* PCI Express Mini 52-pin with bottom-side keep-outs */
9741eb9e3eaSRobert Mustacchi #define	SMB_SLT_PCIE_M52_WOBSKO	0x22	/* PCI Express Mini 52-pin without bottom-side keep-outs */
9751eb9e3eaSRobert Mustacchi /* END CSTYLED */
9761eb9e3eaSRobert Mustacchi #define	SMB_SLT_PCIE_M76	0x23	/* PCI Express Mini 72-pin */
97784ab085aSmws #define	SMB_SLT_PC98_C20	0xA0	/* PC-98/C20 */
97884ab085aSmws #define	SMB_SLT_PC98_C24	0xA1	/* PC-98/C24 */
97984ab085aSmws #define	SMB_SLT_PC98_E		0xA2	/* PC-98/E */
98084ab085aSmws #define	SMB_SLT_PC98_LB		0xA3	/* PC-98/Local Bus */
98184ab085aSmws #define	SMB_SLT_PC98_C		0xA4	/* PC-98/Card */
98284ab085aSmws #define	SMB_SLT_PCIE		0xA5	/* PCI Express */
98342a58d9dSsethg #define	SMB_SLT_PCIE1		0xA6	/* PCI Express x1 */
98442a58d9dSsethg #define	SMB_SLT_PCIE2		0xA7	/* PCI Express x2 */
98542a58d9dSsethg #define	SMB_SLT_PCIE4		0xA8	/* PCI Express x4 */
98642a58d9dSsethg #define	SMB_SLT_PCIE8		0xA9	/* PCI Express x8 */
98742a58d9dSsethg #define	SMB_SLT_PCIE16		0xAA	/* PCI Express x16 */
9884e901881SDale Ghent #define	SMB_SLT_PCIE2G		0xAB	/* PCI Exp. Gen 2 */
9894e901881SDale Ghent #define	SMB_SLT_PCIE2G1		0xAC	/* PCI Exp. Gen 2 x1 */
9904e901881SDale Ghent #define	SMB_SLT_PCIE2G2		0xAD	/* PCI Exp. Gen 2 x2 */
9914e901881SDale Ghent #define	SMB_SLT_PCIE2G4		0xAE	/* PCI Exp. Gen 2 x4 */
9924e901881SDale Ghent #define	SMB_SLT_PCIE2G8		0xAF	/* PCI Exp. Gen 2 x8 */
9934e901881SDale Ghent #define	SMB_SLT_PCIE2G16	0xB0	/* PCI Exp. Gen 2 x16 */
9944e901881SDale Ghent #define	SMB_SLT_PCIE3G		0xB1	/* PCI Exp. Gen 3 */
9954e901881SDale Ghent #define	SMB_SLT_PCIE3G1		0xB2	/* PCI Exp. Gen 3 x1 */
9964e901881SDale Ghent #define	SMB_SLT_PCIE3G2		0xB3	/* PCI Exp. Gen 3 x2 */
9974e901881SDale Ghent #define	SMB_SLT_PCIE3G4		0xB4	/* PCI Exp. Gen 3 x4 */
9984e901881SDale Ghent #define	SMB_SLT_PCIE3G8		0xB5	/* PCI Exp. Gen 3 x8 */
9994e901881SDale Ghent #define	SMB_SLT_PCIE3G16	0xB6	/* PCI Exp. Gen 3 x16 */
100084ab085aSmws 
100184ab085aSmws #define	SMB_SLW_OTHER		0x01	/* other */
100284ab085aSmws #define	SMB_SLW_UNKNOWN		0x02	/* unknown */
100384ab085aSmws #define	SMB_SLW_8		0x03	/* 8 bit */
100484ab085aSmws #define	SMB_SLW_16		0x04	/* 16 bit */
100584ab085aSmws #define	SMB_SLW_32		0x05	/* 32 bit */
100684ab085aSmws #define	SMB_SLW_64		0x06	/* 64 bit */
100784ab085aSmws #define	SMB_SLW_128		0x07	/* 128 bit */
100884ab085aSmws #define	SMB_SLW_1X		0x08	/* 1x or x1 */
100984ab085aSmws #define	SMB_SLW_2X		0x09	/* 2x or x2 */
101084ab085aSmws #define	SMB_SLW_4X		0x0A	/* 4x or x4 */
101184ab085aSmws #define	SMB_SLW_8X		0x0B	/* 8x or x8 */
101284ab085aSmws #define	SMB_SLW_12X		0x0C	/* 12x or x12 */
101384ab085aSmws #define	SMB_SLW_16X		0x0D	/* 16x or x16 */
101484ab085aSmws #define	SMB_SLW_32X		0x0E	/* 32x or x32 */
101584ab085aSmws 
101684ab085aSmws #define	SMB_SLU_OTHER		0x01	/* other */
101784ab085aSmws #define	SMB_SLU_UNKNOWN		0x02	/* unknown */
101884ab085aSmws #define	SMB_SLU_AVAIL		0x03	/* available */
101984ab085aSmws #define	SMB_SLU_INUSE		0x04	/* in use */
102084ab085aSmws 
102184ab085aSmws #define	SMB_SLL_OTHER		0x01	/* other */
102284ab085aSmws #define	SMB_SLL_UNKNOWN		0x02	/* unknown */
102384ab085aSmws #define	SMB_SLL_SHORT		0x03	/* short length */
102484ab085aSmws #define	SMB_SLL_LONG		0x04	/* long length */
102584ab085aSmws 
102684ab085aSmws #define	SMB_SLCH1_UNKNOWN	0x01	/* characteristics unknown */
102784ab085aSmws #define	SMB_SLCH1_5V		0x02	/* provides 5.0V */
102884ab085aSmws #define	SMB_SLCH1_33V		0x04	/* provides 3.3V */
102984ab085aSmws #define	SMB_SLCH1_SHARED	0x08	/* opening shared with other slot */
103084ab085aSmws #define	SMB_SLCH1_PC16		0x10	/* slot supports PC Card-16 */
103184ab085aSmws #define	SMB_SLCH1_PCCB		0x20	/* slot supports CardBus */
103284ab085aSmws #define	SMB_SLCH1_PCZV		0x40	/* slot supports Zoom Video */
103384ab085aSmws #define	SMB_SLCH1_PCMRR		0x80	/* slot supports Modem Ring Resume */
103484ab085aSmws 
103584ab085aSmws #define	SMB_SLCH2_PME		0x01	/* slot supports PME# signal */
103684ab085aSmws #define	SMB_SLCH2_HOTPLUG	0x02	/* slot supports hot-plug devices */
103784ab085aSmws #define	SMB_SLCH2_SMBUS		0x04	/* slot supports SMBus signal */
103884ab085aSmws 
103984ab085aSmws /*
10404e901881SDale Ghent  * SMBIOS On-Board Device Information.  See DSP0134 Section 7.11 for more
104184ab085aSmws  * information.  Any number of on-board device sections may be present, each
104284ab085aSmws  * containing one or more records.  The smbios_info_obdevs() function permits
104384ab085aSmws  * the caller to retrieve one or more of the records from a given section.
104484ab085aSmws  */
104584ab085aSmws typedef struct smbios_obdev {
104684ab085aSmws 	const char *smbd_name;		/* description string for this device */
104784ab085aSmws 	uint8_t smbd_type;		/* type code (SMB_OBT_*) */
104884ab085aSmws 	uint8_t smbd_enabled;		/* boolean (device is enabled) */
104984ab085aSmws } smbios_obdev_t;
105084ab085aSmws 
105184ab085aSmws #define	SMB_OBT_OTHER		0x01	/* other */
105284ab085aSmws #define	SMB_OBT_UNKNOWN		0x02	/* unknown */
105384ab085aSmws #define	SMB_OBT_VIDEO		0x03	/* video */
105484ab085aSmws #define	SMB_OBT_SCSI		0x04	/* scsi */
105584ab085aSmws #define	SMB_OBT_ETHERNET	0x05	/* ethernet */
105684ab085aSmws #define	SMB_OBT_TOKEN		0x06	/* token ring */
105784ab085aSmws #define	SMB_OBT_SOUND		0x07	/* sound */
105842a58d9dSsethg #define	SMB_OBT_PATA		0x08	/* pata */
105942a58d9dSsethg #define	SMB_OBT_SATA		0x09	/* sata */
106042a58d9dSsethg #define	SMB_OBT_SAS		0x0A	/* sas */
106184ab085aSmws 
106284ab085aSmws /*
10634e901881SDale Ghent  * SMBIOS BIOS Language Information.  See DSP0134 Section 7.14 for more
106484ab085aSmws  * information.  The smbios_info_strtab() function can be applied using a
106584ab085aSmws  * count of smbla_num to retrieve the other possible language settings.
106684ab085aSmws  */
106784ab085aSmws typedef struct smbios_lang {
106884ab085aSmws 	const char *smbla_cur;		/* current language setting */
106984ab085aSmws 	uint_t smbla_fmt;		/* language name format (see below) */
107084ab085aSmws 	uint_t smbla_num;		/* number of installed languages */
107184ab085aSmws } smbios_lang_t;
107284ab085aSmws 
107384ab085aSmws #define	SMB_LFMT_LONG	0		/* <ISO639>|<ISO3166>|Encoding Method */
107484ab085aSmws #define	SMB_LFMT_SHORT	1		/* <ISO930><ISO3166> */
107584ab085aSmws 
107684ab085aSmws /*
10774e901881SDale Ghent  * SMBIOS System Event Log Information.  See DSP0134 Section 7.16 for more
107884ab085aSmws  * information.  Accessing the event log itself requires additional interfaces.
107984ab085aSmws  */
108084ab085aSmws typedef struct smbios_evtype {
108184ab085aSmws 	uint8_t smbevt_ltype;		/* log type */
108284ab085aSmws 	uint8_t smbevt_dtype;		/* variable data format type */
108384ab085aSmws } smbios_evtype_t;
108484ab085aSmws 
108584ab085aSmws typedef struct smbios_evlog {
108684ab085aSmws 	size_t smbev_size;		/* size in bytes of log area */
108784ab085aSmws 	size_t smbev_hdr;		/* offset or index of header */
108884ab085aSmws 	size_t smbev_data;		/* offset or index of data */
108984ab085aSmws 	uint8_t smbev_method;		/* data access method (see below) */
109084ab085aSmws 	uint8_t smbev_flags;		/* flags (see below) */
109184ab085aSmws 	uint8_t smbev_format;		/* log header format (see below) */
109284ab085aSmws 	uint8_t smbev_pad;		/* padding */
109384ab085aSmws 	uint32_t smbev_token;		/* data update change token */
109484ab085aSmws 	union {
109584ab085aSmws 		struct {
109684ab085aSmws 			uint16_t evi_iaddr; /* index address */
109784ab085aSmws 			uint16_t evi_daddr; /* data address */
109884ab085aSmws 		} eva_io;		/* i/o address for SMB_EVM_XxY */
109984ab085aSmws 		uint32_t eva_addr;	/* address for SMB_EVM_MEM32 */
110084ab085aSmws 		uint16_t eva_gpnv;	/* handle for SMB_EVM_GPNV */
110184ab085aSmws 	} smbev_addr;
110284ab085aSmws 	uint32_t smbev_typec;		/* number of type descriptors */
110384ab085aSmws 	const smbios_evtype_t *smbev_typev; /* type descriptor array */
110484ab085aSmws } smbios_evlog_t;
110584ab085aSmws 
110684ab085aSmws #define	SMB_EVM_1x1i_1x1d	0	/* I/O: 1 1b idx port, 1 1b data port */
110784ab085aSmws #define	SMB_EVM_2x1i_1x1d	1	/* I/O: 2 1b idx port, 1 1b data port */
110884ab085aSmws #define	SMB_EVM_1x2i_1x1d	2	/* I/O: 1 2b idx port, 1 1b data port */
110984ab085aSmws #define	SMB_EVM_MEM32		3	/* Memory-Mapped 32-bit Physical Addr */
111084ab085aSmws #define	SMB_EVM_GPNV		4	/* GP Non-Volatile API Access */
111184ab085aSmws 
111284ab085aSmws #define	SMB_EVFL_VALID		0x1	/* log area valid */
111384ab085aSmws #define	SMB_EVFL_FULL		0x2	/* log area full */
111484ab085aSmws 
111584ab085aSmws #define	SMB_EVHF_NONE		0	/* no log headers used */
111684ab085aSmws #define	SMB_EVHF_F1		1	/* DMTF log header type 1 */
111784ab085aSmws 
111884ab085aSmws /*
11194e901881SDale Ghent  * SMBIOS Physical Memory Array Information.  See DSP0134 Section 7.17 for
112084ab085aSmws  * more information.  This describes a collection of physical memory devices.
112184ab085aSmws  */
112284ab085aSmws typedef struct smbios_memarray {
112384ab085aSmws 	uint8_t smbma_location;		/* physical device location */
112484ab085aSmws 	uint8_t smbma_use;		/* physical device functional purpose */
112584ab085aSmws 	uint8_t smbma_ecc;		/* error detect/correct mechanism */
112684ab085aSmws 	uint8_t smbma_pad0;		/* padding */
112784ab085aSmws 	uint32_t smbma_pad1;		/* padding */
112884ab085aSmws 	uint32_t smbma_ndevs;		/* number of slots or sockets */
112984ab085aSmws 	id_t smbma_err;			/* handle of error (if any) */
113084ab085aSmws 	uint64_t smbma_size;		/* maximum capacity in bytes */
113184ab085aSmws } smbios_memarray_t;
113284ab085aSmws 
113384ab085aSmws #define	SMB_MAL_OTHER		0x01	/* other */
113484ab085aSmws #define	SMB_MAL_UNKNOWN		0x02	/* unknown */
113584ab085aSmws #define	SMB_MAL_SYSMB		0x03	/* system board or motherboard */
113684ab085aSmws #define	SMB_MAL_ISA		0x04	/* ISA add-on card */
113784ab085aSmws #define	SMB_MAL_EISA		0x05	/* EISA add-on card */
113884ab085aSmws #define	SMB_MAL_PCI		0x06	/* PCI add-on card */
113984ab085aSmws #define	SMB_MAL_MCA		0x07	/* MCA add-on card */
114084ab085aSmws #define	SMB_MAL_PCMCIA		0x08	/* PCMCIA add-on card */
114184ab085aSmws #define	SMB_MAL_PROP		0x09	/* proprietary add-on card */
114284ab085aSmws #define	SMB_MAL_NUBUS		0x0A	/* NuBus */
114384ab085aSmws #define	SMB_MAL_PC98C20		0xA0	/* PC-98/C20 add-on card */
114484ab085aSmws #define	SMB_MAL_PC98C24		0xA1	/* PC-98/C24 add-on card */
114584ab085aSmws #define	SMB_MAL_PC98E		0xA2	/* PC-98/E add-on card */
114684ab085aSmws #define	SMB_MAL_PC98LB		0xA3	/* PC-98/Local bus add-on card */
114784ab085aSmws 
114884ab085aSmws #define	SMB_MAU_OTHER		0x01	/* other */
114984ab085aSmws #define	SMB_MAU_UNKNOWN		0x02	/* unknown */
115084ab085aSmws #define	SMB_MAU_SYSTEM		0x03	/* system memory */
115184ab085aSmws #define	SMB_MAU_VIDEO		0x04	/* video memory */
115284ab085aSmws #define	SMB_MAU_FLASH		0x05	/* flash memory */
115384ab085aSmws #define	SMB_MAU_NVRAM		0x06	/* non-volatile RAM */
115484ab085aSmws #define	SMB_MAU_CACHE		0x07	/* cache memory */
115584ab085aSmws 
115684ab085aSmws #define	SMB_MAE_OTHER		0x01	/* other */
115784ab085aSmws #define	SMB_MAE_UNKNOWN		0x02	/* unknown */
115884ab085aSmws #define	SMB_MAE_NONE		0x03	/* none */
115984ab085aSmws #define	SMB_MAE_PARITY		0x04	/* parity */
116084ab085aSmws #define	SMB_MAE_SECC		0x05	/* single-bit ECC */
116184ab085aSmws #define	SMB_MAE_MECC		0x06	/* multi-bit ECC */
116284ab085aSmws #define	SMB_MAE_CRC		0x07	/* CRC */
116384ab085aSmws 
116484ab085aSmws /*
11654e901881SDale Ghent  * SMBIOS Memory Device Information.  See DSP0134 Section 7.18 for more
116684ab085aSmws  * information.  One or more of these structures are associated with each
116784ab085aSmws  * smbios_memarray_t.  A structure is present even for unpopulated sockets.
116884ab085aSmws  * Unknown values are set to -1.  A smbmd_size of 0 indicates unpopulated.
116984ab085aSmws  * WARNING: Some BIOSes appear to export the *maximum* size of the device
117084ab085aSmws  * that can appear in the corresponding socket as opposed to the current one.
117184ab085aSmws  */
117284ab085aSmws typedef struct smbios_memdevice {
117384ab085aSmws 	id_t smbmd_array;		/* handle of physical memory array */
117484ab085aSmws 	id_t smbmd_error;		/* handle of memory error data */
117584ab085aSmws 	uint32_t smbmd_twidth;		/* total width in bits including ecc */
117684ab085aSmws 	uint32_t smbmd_dwidth;		/* data width in bits */
117784ab085aSmws 	uint64_t smbmd_size;		/* size in bytes (see note above) */
117884ab085aSmws 	uint8_t smbmd_form;		/* form factor */
117984ab085aSmws 	uint8_t smbmd_set;		/* set (0x00=none, 0xFF=unknown) */
118084ab085aSmws 	uint8_t smbmd_type;		/* memory type */
118184ab085aSmws 	uint8_t smbmd_pad;		/* padding */
118284ab085aSmws 	uint32_t smbmd_flags;		/* flags (see below) */
11831eb9e3eaSRobert Mustacchi 	uint32_t smbmd_speed;		/* speed in MT/s */
118484ab085aSmws 	const char *smbmd_dloc;		/* physical device locator string */
118584ab085aSmws 	const char *smbmd_bloc;		/* physical bank locator string */
11864e901881SDale Ghent 	uint8_t smbmd_rank;		/* rank */
11874e901881SDale Ghent 	uint16_t smbmd_clkspeed;	/* configured clock speed */
11884e901881SDale Ghent 	uint16_t smbmd_minvolt;		/* minimum voltage */
11894e901881SDale Ghent 	uint16_t smbmd_maxvolt;		/* maximum voltage */
11904e901881SDale Ghent 	uint16_t smbmd_confvolt;	/* configured voltage */
119184ab085aSmws } smbios_memdevice_t;
119284ab085aSmws 
119384ab085aSmws #define	SMB_MDFF_OTHER		0x01	/* other */
119484ab085aSmws #define	SMB_MDFF_UNKNOWN	0x02	/* unknown */
119584ab085aSmws #define	SMB_MDFF_SIMM		0x03	/* SIMM */
119684ab085aSmws #define	SMB_MDFF_SIP		0x04	/* SIP */
119784ab085aSmws #define	SMB_MDFF_CHIP		0x05	/* chip */
119884ab085aSmws #define	SMB_MDFF_DIP		0x06	/* DIP */
119984ab085aSmws #define	SMB_MDFF_ZIP		0x07	/* ZIP */
120084ab085aSmws #define	SMB_MDFF_PROP		0x08	/* proprietary card */
120184ab085aSmws #define	SMB_MDFF_DIMM		0x09	/* DIMM */
120284ab085aSmws #define	SMB_MDFF_TSOP		0x0A	/* TSOP */
120384ab085aSmws #define	SMB_MDFF_CHIPROW	0x0B	/* row of chips */
120484ab085aSmws #define	SMB_MDFF_RIMM		0x0C	/* RIMM */
120584ab085aSmws #define	SMB_MDFF_SODIMM		0x0D	/* SODIMM */
120684ab085aSmws #define	SMB_MDFF_SRIMM		0x0E	/* SRIMM */
120742a58d9dSsethg #define	SMB_MDFF_FBDIMM		0x0F	/* FBDIMM */
120884ab085aSmws 
120984ab085aSmws #define	SMB_MDT_OTHER		0x01	/* other */
121084ab085aSmws #define	SMB_MDT_UNKNOWN		0x02	/* unknown */
121184ab085aSmws #define	SMB_MDT_DRAM		0x03	/* DRAM */
121284ab085aSmws #define	SMB_MDT_EDRAM		0x04	/* EDRAM */
121384ab085aSmws #define	SMB_MDT_VRAM		0x05	/* VRAM */
121484ab085aSmws #define	SMB_MDT_SRAM		0x06	/* SRAM */
121584ab085aSmws #define	SMB_MDT_RAM		0x07	/* RAM */
121684ab085aSmws #define	SMB_MDT_ROM		0x08	/* ROM */
121784ab085aSmws #define	SMB_MDT_FLASH		0x09	/* FLASH */
121884ab085aSmws #define	SMB_MDT_EEPROM		0x0A	/* EEPROM */
121984ab085aSmws #define	SMB_MDT_FEPROM		0x0B	/* FEPROM */
122084ab085aSmws #define	SMB_MDT_EPROM		0x0C	/* EPROM */
122184ab085aSmws #define	SMB_MDT_CDRAM		0x0D	/* CDRAM */
122284ab085aSmws #define	SMB_MDT_3DRAM		0x0E	/* 3DRAM */
122384ab085aSmws #define	SMB_MDT_SDRAM		0x0F	/* SDRAM */
122484ab085aSmws #define	SMB_MDT_SGRAM		0x10	/* SGRAM */
122584ab085aSmws #define	SMB_MDT_RDRAM		0x11	/* RDRAM */
122684ab085aSmws #define	SMB_MDT_DDR		0x12	/* DDR */
122784ab085aSmws #define	SMB_MDT_DDR2		0x13	/* DDR2 */
122842a58d9dSsethg #define	SMB_MDT_DDR2FBDIMM	0x14	/* DDR2 FBDIMM */
12294e901881SDale Ghent #define	SMB_MDT_DDR3		0x18	/* DDR3 */
12304e901881SDale Ghent #define	SMB_MDT_FBD2		0x19	/* FBD2 */
123104cdb0e3SRobert Mustacchi #define	SMB_MDT_DDR4		0x1A	/* DDR4 */
123204cdb0e3SRobert Mustacchi #define	SMB_MDT_LPDDR		0x1B	/* LPDDR */
123304cdb0e3SRobert Mustacchi #define	SMB_MDT_LPDDR2		0x1C	/* LPDDR2 */
123404cdb0e3SRobert Mustacchi #define	SMB_MDT_LPDDR3		0x1D	/* LPDDR3 */
123504cdb0e3SRobert Mustacchi #define	SMB_MDT_LPDDR4		0x1E	/* LPDDR4 */
123684ab085aSmws 
123784ab085aSmws #define	SMB_MDF_OTHER		0x0002	/* other */
123884ab085aSmws #define	SMB_MDF_UNKNOWN		0x0004	/* unknown */
123984ab085aSmws #define	SMB_MDF_FASTPG		0x0008	/* fast-paged */
124084ab085aSmws #define	SMB_MDF_STATIC		0x0010	/* static column */
124184ab085aSmws #define	SMB_MDF_PSTATIC		0x0020	/* pseudo-static */
124284ab085aSmws #define	SMB_MDF_RAMBUS		0x0040	/* RAMBUS */
124384ab085aSmws #define	SMB_MDF_SYNC		0x0080	/* synchronous */
124484ab085aSmws #define	SMB_MDF_CMOS		0x0100	/* CMOS */
124584ab085aSmws #define	SMB_MDF_EDO		0x0200	/* EDO */
124684ab085aSmws #define	SMB_MDF_WDRAM		0x0400	/* Window DRAM */
124784ab085aSmws #define	SMB_MDF_CDRAM		0x0800	/* Cache DRAM */
124884ab085aSmws #define	SMB_MDF_NV		0x1000	/* non-volatile */
12494e901881SDale Ghent #define	SMB_MDF_REG		0x2000	/* Registered (Buffered) */
12504e901881SDale Ghent #define	SMB_MDF_UNREG		0x4000	/* Unregistered (Unbuffered) */
12514e901881SDale Ghent #define	SMB_MDF_LRDIMM		0x8000	/* LRDIMM */
12524e901881SDale Ghent 
12534e901881SDale Ghent #define	SMB_MDR_SINGLE		0x01	/* single */
12544e901881SDale Ghent #define	SMB_MDR_DUAL		0x02	/* dual */
12554e901881SDale Ghent #define	SMB_MDR_QUAD		0x04	/* quad */
12564e901881SDale Ghent #define	SMB_MDR_OCTAL		0x08	/* octal */
125784ab085aSmws 
125884ab085aSmws /*
12594e901881SDale Ghent  * SMBIOS Memory Array Mapped Address.  See DSP0134 Section 7.20 for more
126084ab085aSmws  * information.  We convert start/end addresses into addr/size for convenience.
126184ab085aSmws  */
126284ab085aSmws typedef struct smbios_memarrmap {
126384ab085aSmws 	id_t smbmam_array;		/* physical memory array handle */
126484ab085aSmws 	uint32_t smbmam_width;		/* number of devices that form a row */
126584ab085aSmws 	uint64_t smbmam_addr;		/* physical address of mapping */
126684ab085aSmws 	uint64_t smbmam_size;		/* size in bytes of address range */
126784ab085aSmws } smbios_memarrmap_t;
126884ab085aSmws 
126984ab085aSmws /*
12704e901881SDale Ghent  * SMBIOS Memory Device Mapped Address.  See DSP0134 Section 7.21 for more
127184ab085aSmws  * information.  We convert start/end addresses into addr/size for convenience.
127284ab085aSmws  */
127384ab085aSmws typedef struct smbios_memdevmap {
127484ab085aSmws 	id_t smbmdm_device;		/* memory device handle */
127584ab085aSmws 	id_t smbmdm_arrmap;		/* memory array mapped address handle */
127684ab085aSmws 	uint64_t smbmdm_addr;		/* physical address of mapping */
127784ab085aSmws 	uint64_t smbmdm_size;		/* size in bytes of address range */
127884ab085aSmws 	uint8_t smbmdm_rpos;		/* partition row position */
127984ab085aSmws 	uint8_t smbmdm_ipos;		/* interleave position */
128084ab085aSmws 	uint8_t smbmdm_idepth;		/* interleave data depth */
128184ab085aSmws } smbios_memdevmap_t;
128284ab085aSmws 
128384ab085aSmws /*
12844e901881SDale Ghent  * SMBIOS Hardware Security Settings.  See DSP0134 Section 7.25 for more
128584ab085aSmws  * information.  Only one such record will be present in the SMBIOS.
128684ab085aSmws  */
128784ab085aSmws typedef struct smbios_hwsec {
128884ab085aSmws 	uint8_t smbh_pwr_ps;		/* power-on password status */
128984ab085aSmws 	uint8_t smbh_kbd_ps;		/* keyboard password status */
129084ab085aSmws 	uint8_t smbh_adm_ps;		/* administrator password status */
129184ab085aSmws 	uint8_t smbh_pan_ps;		/* front panel reset status */
129284ab085aSmws } smbios_hwsec_t;
129384ab085aSmws 
129484ab085aSmws #define	SMB_HWSEC_PS_DISABLED	0x00	/* password disabled */
129584ab085aSmws #define	SMB_HWSEC_PS_ENABLED	0x01	/* password enabled */
129684ab085aSmws #define	SMB_HWSEC_PS_NOTIMPL	0x02	/* password not implemented */
129784ab085aSmws #define	SMB_HWSEC_PS_UNKNOWN	0x03	/* password status unknown */
129884ab085aSmws 
129984ab085aSmws /*
13004e901881SDale Ghent  * SMBIOS System Boot Information.  See DSP0134 Section 7.33 for more
130184ab085aSmws  * information.  The contents of the data varies by type and is undocumented
130284ab085aSmws  * from the perspective of DSP0134 -- it seems to be left as vendor-specific.
130384ab085aSmws  * The (D) annotation next to SMB_BOOT_* below indicates possible data payload.
130484ab085aSmws  */
130584ab085aSmws typedef struct smbios_boot {
130684ab085aSmws 	uint8_t smbt_status;		/* boot status code (see below) */
130784ab085aSmws 	const void *smbt_data;		/* data buffer specific to status */
130884ab085aSmws 	size_t smbt_size;		/* size of smbt_data buffer in bytes */
130984ab085aSmws } smbios_boot_t;
131084ab085aSmws 
131184ab085aSmws #define	SMB_BOOT_NORMAL		0	/* no errors detected */
131284ab085aSmws #define	SMB_BOOT_NOMEDIA	1	/* no bootable media */
131384ab085aSmws #define	SMB_BOOT_OSFAIL		2	/* normal o/s failed to load */
131484ab085aSmws #define	SMB_BOOT_FWHWFAIL	3	/* firmware-detected hardware failure */
131584ab085aSmws #define	SMB_BOOT_OSHWFAIL	4	/* o/s-detected hardware failure */
131684ab085aSmws #define	SMB_BOOT_USERREQ	5	/* user-requested boot (keystroke) */
131784ab085aSmws #define	SMB_BOOT_SECURITY	6	/* system security violation */
131884ab085aSmws #define	SMB_BOOT_PREVREQ	7	/* previously requested image (D) */
131984ab085aSmws #define	SMB_BOOT_WATCHDOG	8	/* watchdog initiated reboot */
132084ab085aSmws #define	SMB_BOOT_RESV_LO	9	/* low end of reserved range */
132184ab085aSmws #define	SMB_BOOT_RESV_HI	127	/* high end of reserved range */
132284ab085aSmws #define	SMB_BOOT_OEM_LO		128	/* low end of OEM-specific range */
132384ab085aSmws #define	SMB_BOOT_OEM_HI		191	/* high end of OEM-specific range */
132484ab085aSmws #define	SMB_BOOT_PROD_LO	192	/* low end of product-specific range */
132584ab085aSmws #define	SMB_BOOT_PROD_HI	255	/* high end of product-specific range */
132684ab085aSmws 
132784ab085aSmws /*
13284e901881SDale Ghent  * SMBIOS IPMI Device Information.  See DSP0134 Section 7.39 and also
132984ab085aSmws  * Appendix C1 of the IPMI specification for more information on this record.
133084ab085aSmws  */
133184ab085aSmws typedef struct smbios_ipmi {
133284ab085aSmws 	uint_t smbip_type;		/* BMC interface type */
133384ab085aSmws 	smbios_version_t smbip_vers;	/* BMC's IPMI specification version */
133484ab085aSmws 	uint32_t smbip_i2c;		/* BMC I2C bus slave address */
133584ab085aSmws 	uint32_t smbip_bus;		/* bus ID of NV storage device, or -1 */
133684ab085aSmws 	uint64_t smbip_addr;		/* BMC base address */
133784ab085aSmws 	uint32_t smbip_flags;		/* flags (see below) */
133884ab085aSmws 	uint16_t smbip_intr;		/* interrupt number (or zero if none) */
133984ab085aSmws 	uint16_t smbip_regspacing;	/* i/o space register spacing (bytes) */
134084ab085aSmws } smbios_ipmi_t;
134184ab085aSmws 
134284ab085aSmws #define	SMB_IPMI_T_UNKNOWN	0x00	/* unknown */
134384ab085aSmws #define	SMB_IPMI_T_KCS		0x01	/* KCS: Keyboard Controller Style */
134484ab085aSmws #define	SMB_IPMI_T_SMIC		0x02	/* SMIC: Server Mgmt Interface Chip */
134584ab085aSmws #define	SMB_IPMI_T_BT		0x03	/* BT: Block Transfer */
134684ab085aSmws #define	SMB_IPMI_T_SSIF		0x04	/* SSIF: SMBus System Interface */
134784ab085aSmws 
134884ab085aSmws #define	SMB_IPMI_F_IOADDR	0x01	/* base address is in i/o space */
134984ab085aSmws #define	SMB_IPMI_F_INTRSPEC	0x02	/* intr information is specified */
135084ab085aSmws #define	SMB_IPMI_F_INTRHIGH	0x04	/* intr active high (else low) */
135184ab085aSmws #define	SMB_IPMI_F_INTREDGE	0x08	/* intr is edge triggered (else lvl) */
135284ab085aSmws 
135384ab085aSmws /*
13544e901881SDale Ghent  * SMBIOS Onboard Devices Extended Information.  See DSP0134 Section 7.42
135503f9f63dSTom Pothier  * for more information.
135603f9f63dSTom Pothier  */
135703f9f63dSTom Pothier typedef struct smbios_obdev_ext {
135803f9f63dSTom Pothier 	const char *smboe_name;		/* reference designation */
135903f9f63dSTom Pothier 	uint8_t smboe_dtype;		/* device type */
136003f9f63dSTom Pothier 	uint8_t smboe_dti;		/* device type instance */
136103f9f63dSTom Pothier 	uint16_t smboe_sg;		/* segment group number */
136203f9f63dSTom Pothier 	uint8_t smboe_bus;		/* bus number */
136303f9f63dSTom Pothier 	uint8_t smboe_df;		/* device/function number */
136403f9f63dSTom Pothier } smbios_obdev_ext_t;
136503f9f63dSTom Pothier 
136603f9f63dSTom Pothier 
136703f9f63dSTom Pothier /*
1368074bb90dSTom Pothier  * SMBIOS OEM-specific (Type 132) Processor Extended Information.
1369074bb90dSTom Pothier  */
1370074bb90dSTom Pothier typedef struct smbios_processor_ext {
1371074bb90dSTom Pothier 	uint16_t smbpe_processor;	/* extending processor handle */
1372074bb90dSTom Pothier 	uint8_t smbpe_fru;		/* FRU indicaor */
1373074bb90dSTom Pothier 	uint8_t smbpe_n;		/* number of APIC IDs */
1374074bb90dSTom Pothier 	uint16_t *smbpe_apicid;		/* strand Inital APIC IDs */
1375074bb90dSTom Pothier } smbios_processor_ext_t;
1376074bb90dSTom Pothier 
1377074bb90dSTom Pothier /*
137803f9f63dSTom Pothier  * SMBIOS OEM-specific (Type 136) Port Extended Information.
137903f9f63dSTom Pothier  */
138003f9f63dSTom Pothier typedef struct smbios_port_ext {
138103f9f63dSTom Pothier 	uint16_t smbporte_chassis;	/* chassis handle */
138203f9f63dSTom Pothier 	uint16_t smbporte_port;		/* port connector handle */
138303f9f63dSTom Pothier 	uint8_t smbporte_dtype;		/* device type */
138403f9f63dSTom Pothier 	uint16_t smbporte_devhdl;	/* device handle */
138503f9f63dSTom Pothier 	uint8_t smbporte_phy;		/* PHY number */
138603f9f63dSTom Pothier } smbios_port_ext_t;
138703f9f63dSTom Pothier 
138803f9f63dSTom Pothier /*
1389074bb90dSTom Pothier  * SMBIOS OEM-specific (Type 138) PCI-Express RC/RP Information.
1390074bb90dSTom Pothier  */
1391074bb90dSTom Pothier typedef struct smbios_pciexrc {
1392074bb90dSTom Pothier 	uint16_t smbpcie_bb;		/* base board handle */
1393074bb90dSTom Pothier 	uint16_t smbpcie_bdf;		/* Bus/Dev/Funct (PCI) */
1394074bb90dSTom Pothier } smbios_pciexrc_t;
1395074bb90dSTom Pothier 
1396074bb90dSTom Pothier /*
1397074bb90dSTom Pothier  * SMBIOS OEM-specific (Type 144) Memory Array Extended Information.
1398074bb90dSTom Pothier  */
1399074bb90dSTom Pothier typedef struct smbios_memarray_ext {
1400074bb90dSTom Pothier 	uint16_t smbmae_ma;		/* memory array handle */
1401074bb90dSTom Pothier 	uint16_t smbmae_comp;		/* component parent handle */
1402074bb90dSTom Pothier 	uint16_t smbmae_bdf;		/* Bus/Dev/Funct (PCI) */
1403074bb90dSTom Pothier } smbios_memarray_ext_t;
1404074bb90dSTom Pothier 
1405074bb90dSTom Pothier /*
1406074bb90dSTom Pothier  * SMBIOS OEM-specific (Type 145) Memory Device Extended Information.
1407074bb90dSTom Pothier  */
1408074bb90dSTom Pothier typedef struct smbios_memdevice_ext {
1409074bb90dSTom Pothier 	uint16_t smbmdeve_md;		/* memory device handle */
1410074bb90dSTom Pothier 	uint8_t smbmdeve_drch;		/* DRAM channel */
1411074bb90dSTom Pothier 	uint8_t smbmdeve_ncs;		/* number of chip selects */
1412074bb90dSTom Pothier 	uint8_t *smbmdeve_cs;		/* array of chip select numbers */
1413074bb90dSTom Pothier } smbios_memdevice_ext_t;
1414074bb90dSTom Pothier 
1415074bb90dSTom Pothier /*
141684ab085aSmws  * SMBIOS Interfaces.  An SMBIOS image can be opened by either providing a file
141784ab085aSmws  * pathname, device pathname, file descriptor, or raw memory buffer.  Once an
141884ab085aSmws  * image is opened the functions below can be used to iterate over the various
141984ab085aSmws  * structures and convert the underlying data representation into the simpler
142084ab085aSmws  * data structures described earlier in this header file.  The SMB_VERSION
142184ab085aSmws  * constant specified when opening an image indicates the version of the ABI
142284ab085aSmws  * the caller expects and the DMTF SMBIOS version the client can understand.
142384ab085aSmws  * The library will then map older or newer data structures to that as needed.
142484ab085aSmws  */
142584ab085aSmws 
142684ab085aSmws #define	SMB_VERSION_23	0x0203		/* SMBIOS encoding for DMTF spec 2.3 */
142784ab085aSmws #define	SMB_VERSION_24	0x0204		/* SMBIOS encoding for DMTF spec 2.4 */
14284e901881SDale Ghent #define	SMB_VERSION_25	0x0205		/* SMBIOS encoding for DMTF spec 2.5 */
14294e901881SDale Ghent #define	SMB_VERSION_26	0x0206		/* SMBIOS encoding for DMTF spec 2.6 */
14304e901881SDale Ghent #define	SMB_VERSION_27	0x0207		/* SMBIOS encoding for DMTF spec 2.7 */
14314e901881SDale Ghent #define	SMB_VERSION_28	0x0208		/* SMBIOS encoding for DMTF spec 2.8 */
143204cdb0e3SRobert Mustacchi #define	SMB_VERSION_30	0x0300		/* SMBIOS encoding for DMTF spec 3.0 */
14331eb9e3eaSRobert Mustacchi #define	SMB_VERSION_31	0x0301		/* SMBIOS encoding for DMTF spec 3.1 */
14341eb9e3eaSRobert Mustacchi #define	SMB_VERSION	SMB_VERSION_31	/* SMBIOS latest version definitions */
143584ab085aSmws 
143684ab085aSmws #define	SMB_O_NOCKSUM	0x1		/* do not verify header checksums */
143784ab085aSmws #define	SMB_O_NOVERS	0x2		/* do not verify header versions */
143884ab085aSmws #define	SMB_O_ZIDS	0x4		/* strip out identification numbers */
143984ab085aSmws #define	SMB_O_MASK	0x7		/* mask of valid smbios_*open flags */
144084ab085aSmws 
144184ab085aSmws #define	SMB_ID_NOTSUP	0xFFFE		/* structure is not supported by BIOS */
144284ab085aSmws #define	SMB_ID_NONE	0xFFFF		/* structure is a null reference */
144384ab085aSmws 
144484ab085aSmws #define	SMB_ERR		(-1)		/* id_t value indicating error */
144584ab085aSmws 
144684ab085aSmws typedef struct smbios_hdl smbios_hdl_t;
144784ab085aSmws 
144884ab085aSmws typedef struct smbios_struct {
144984ab085aSmws 	id_t smbstr_id;			/* structure ID handle */
145084ab085aSmws 	uint_t smbstr_type;		/* structure type */
145184ab085aSmws 	const void *smbstr_data;	/* structure data */
145284ab085aSmws 	size_t smbstr_size;		/* structure size */
145384ab085aSmws } smbios_struct_t;
145484ab085aSmws 
145584ab085aSmws typedef int smbios_struct_f(smbios_hdl_t *,
145684ab085aSmws     const smbios_struct_t *, void *);
145784ab085aSmws 
145884ab085aSmws extern smbios_hdl_t *smbios_open(const char *, int, int, int *);
145984ab085aSmws extern smbios_hdl_t *smbios_fdopen(int, int, int, int *);
146084ab085aSmws extern smbios_hdl_t *smbios_bufopen(const smbios_entry_t *,
146184ab085aSmws     const void *, size_t, int, int, int *);
146284ab085aSmws 
146384ab085aSmws extern const void *smbios_buf(smbios_hdl_t *);
146484ab085aSmws extern size_t smbios_buflen(smbios_hdl_t *);
146584ab085aSmws 
146684ab085aSmws extern void smbios_checksum(smbios_hdl_t *, smbios_entry_t *);
146784ab085aSmws extern int smbios_write(smbios_hdl_t *, int);
146884ab085aSmws extern void smbios_close(smbios_hdl_t *);
146984ab085aSmws 
1470dabec466SJonathan Matthew extern boolean_t smbios_truncated(smbios_hdl_t *);
147184ab085aSmws extern int smbios_errno(smbios_hdl_t *);
147284ab085aSmws extern const char *smbios_errmsg(int);
147384ab085aSmws 
147484ab085aSmws extern int smbios_lookup_id(smbios_hdl_t *, id_t, smbios_struct_t *);
1475074bb90dSTom Pothier extern int smbios_lookup_type(smbios_hdl_t *, uint_t, smbios_struct_t *);
147684ab085aSmws extern int smbios_iter(smbios_hdl_t *, smbios_struct_f *, void *);
147784ab085aSmws 
1478af349cd6SToomas Soome extern smbios_entry_point_t smbios_info_smbios(smbios_hdl_t *,
1479af349cd6SToomas Soome     smbios_entry_t *);
1480af349cd6SToomas Soome extern void smbios_info_smbios_version(smbios_hdl_t *, smbios_version_t *);
148184ab085aSmws extern int smbios_info_common(smbios_hdl_t *, id_t, smbios_info_t *);
1482074bb90dSTom Pothier extern int smbios_info_contains(smbios_hdl_t *, id_t, uint_t, id_t *);
148384ab085aSmws extern id_t smbios_info_bios(smbios_hdl_t *, smbios_bios_t *);
148484ab085aSmws extern id_t smbios_info_system(smbios_hdl_t *, smbios_system_t *);
148584ab085aSmws extern int smbios_info_bboard(smbios_hdl_t *, id_t, smbios_bboard_t *);
148684ab085aSmws extern int smbios_info_chassis(smbios_hdl_t *, id_t, smbios_chassis_t *);
148784ab085aSmws extern int smbios_info_processor(smbios_hdl_t *, id_t, smbios_processor_t *);
1488074bb90dSTom Pothier extern int smbios_info_extprocessor(smbios_hdl_t *, id_t,
1489074bb90dSTom Pothier     smbios_processor_ext_t *);
149084ab085aSmws extern int smbios_info_cache(smbios_hdl_t *, id_t, smbios_cache_t *);
149184ab085aSmws extern int smbios_info_port(smbios_hdl_t *, id_t, smbios_port_t *);
149203f9f63dSTom Pothier extern int smbios_info_extport(smbios_hdl_t *, id_t, smbios_port_ext_t *);
149384ab085aSmws extern int smbios_info_slot(smbios_hdl_t *, id_t, smbios_slot_t *);
149484ab085aSmws extern int smbios_info_obdevs(smbios_hdl_t *, id_t, int, smbios_obdev_t *);
149503f9f63dSTom Pothier extern int smbios_info_obdevs_ext(smbios_hdl_t *, id_t, smbios_obdev_ext_t *);
149684ab085aSmws extern int smbios_info_strtab(smbios_hdl_t *, id_t, int, const char *[]);
149784ab085aSmws extern id_t smbios_info_lang(smbios_hdl_t *, smbios_lang_t *);
149884ab085aSmws extern id_t smbios_info_eventlog(smbios_hdl_t *, smbios_evlog_t *);
149984ab085aSmws extern int smbios_info_memarray(smbios_hdl_t *, id_t, smbios_memarray_t *);
1500074bb90dSTom Pothier extern int smbios_info_extmemarray(smbios_hdl_t *, id_t,
1501074bb90dSTom Pothier     smbios_memarray_ext_t *);
150284ab085aSmws extern int smbios_info_memarrmap(smbios_hdl_t *, id_t, smbios_memarrmap_t *);
150384ab085aSmws extern int smbios_info_memdevice(smbios_hdl_t *, id_t, smbios_memdevice_t *);
1504074bb90dSTom Pothier extern int smbios_info_extmemdevice(smbios_hdl_t *, id_t,
1505074bb90dSTom Pothier     smbios_memdevice_ext_t *);
150684ab085aSmws extern int smbios_info_memdevmap(smbios_hdl_t *, id_t, smbios_memdevmap_t *);
150784ab085aSmws extern id_t smbios_info_hwsec(smbios_hdl_t *, smbios_hwsec_t *);
150884ab085aSmws extern id_t smbios_info_boot(smbios_hdl_t *, smbios_boot_t *);
150984ab085aSmws extern id_t smbios_info_ipmi(smbios_hdl_t *, smbios_ipmi_t *);
1510074bb90dSTom Pothier extern int smbios_info_pciexrc(smbios_hdl_t *, id_t, smbios_pciexrc_t *);
151184ab085aSmws 
15129c94f155SCheng Sean Ye extern const char *smbios_psn(smbios_hdl_t *);
15139c94f155SCheng Sean Ye extern const char *smbios_csn(smbios_hdl_t *);
15149c94f155SCheng Sean Ye 
151584ab085aSmws #ifndef _KERNEL
151684ab085aSmws /*
151784ab085aSmws  * The smbios_*_desc() and smbios_*_name() interfaces can be used for utilities
151884ab085aSmws  * such as smbios(1M) that wish to decode SMBIOS fields for humans.  The _desc
151984ab085aSmws  * functions return the comment string next to the #defines listed above, and
152084ab085aSmws  * the _name functions return the appropriate #define identifier itself.
152184ab085aSmws  */
152284ab085aSmws extern const char *smbios_bboard_flag_desc(uint_t);
152384ab085aSmws extern const char *smbios_bboard_flag_name(uint_t);
152484ab085aSmws extern const char *smbios_bboard_type_desc(uint_t);
152584ab085aSmws 
152684ab085aSmws extern const char *smbios_bios_flag_desc(uint64_t);
152784ab085aSmws extern const char *smbios_bios_flag_name(uint64_t);
152884ab085aSmws 
152984ab085aSmws extern const char *smbios_bios_xb1_desc(uint_t);
153084ab085aSmws extern const char *smbios_bios_xb1_name(uint_t);
153184ab085aSmws extern const char *smbios_bios_xb2_desc(uint_t);
153284ab085aSmws extern const char *smbios_bios_xb2_name(uint_t);
153384ab085aSmws 
153484ab085aSmws extern const char *smbios_boot_desc(uint_t);
153584ab085aSmws 
153684ab085aSmws extern const char *smbios_cache_assoc_desc(uint_t);
153784ab085aSmws extern const char *smbios_cache_ctype_desc(uint_t);
153884ab085aSmws extern const char *smbios_cache_ctype_name(uint_t);
153984ab085aSmws extern const char *smbios_cache_ecc_desc(uint_t);
154084ab085aSmws extern const char *smbios_cache_flag_desc(uint_t);
154184ab085aSmws extern const char *smbios_cache_flag_name(uint_t);
154284ab085aSmws extern const char *smbios_cache_loc_desc(uint_t);
154384ab085aSmws extern const char *smbios_cache_logical_desc(uint_t);
154484ab085aSmws extern const char *smbios_cache_mode_desc(uint_t);
154584ab085aSmws 
154684ab085aSmws extern const char *smbios_chassis_state_desc(uint_t);
154784ab085aSmws extern const char *smbios_chassis_type_desc(uint_t);
154884ab085aSmws 
154984ab085aSmws extern const char *smbios_evlog_flag_desc(uint_t);
155084ab085aSmws extern const char *smbios_evlog_flag_name(uint_t);
155184ab085aSmws extern const char *smbios_evlog_format_desc(uint_t);
155284ab085aSmws extern const char *smbios_evlog_method_desc(uint_t);
155384ab085aSmws 
155484ab085aSmws extern const char *smbios_ipmi_flag_name(uint_t);
155584ab085aSmws extern const char *smbios_ipmi_flag_desc(uint_t);
155684ab085aSmws extern const char *smbios_ipmi_type_desc(uint_t);
155784ab085aSmws 
155884ab085aSmws extern const char *smbios_hwsec_desc(uint_t);
155984ab085aSmws 
156084ab085aSmws extern const char *smbios_memarray_loc_desc(uint_t);
156184ab085aSmws extern const char *smbios_memarray_use_desc(uint_t);
156284ab085aSmws extern const char *smbios_memarray_ecc_desc(uint_t);
156384ab085aSmws 
156484ab085aSmws extern const char *smbios_memdevice_form_desc(uint_t);
156584ab085aSmws extern const char *smbios_memdevice_type_desc(uint_t);
156684ab085aSmws extern const char *smbios_memdevice_flag_name(uint_t);
156784ab085aSmws extern const char *smbios_memdevice_flag_desc(uint_t);
15684e901881SDale Ghent extern const char *smbios_memdevice_rank_desc(uint_t);
156984ab085aSmws 
157004cdb0e3SRobert Mustacchi extern const char *smbios_onboard_type_desc(uint_t);
157104cdb0e3SRobert Mustacchi 
157284ab085aSmws extern const char *smbios_port_conn_desc(uint_t);
157384ab085aSmws extern const char *smbios_port_type_desc(uint_t);
157484ab085aSmws 
157584ab085aSmws extern const char *smbios_processor_family_desc(uint_t);
157684ab085aSmws extern const char *smbios_processor_status_desc(uint_t);
157784ab085aSmws extern const char *smbios_processor_type_desc(uint_t);
157884ab085aSmws extern const char *smbios_processor_upgrade_desc(uint_t);
15794e901881SDale Ghent extern const char *smbios_processor_core_flag_name(uint_t);
15804e901881SDale Ghent extern const char *smbios_processor_core_flag_desc(uint_t);
158184ab085aSmws 
158284ab085aSmws extern const char *smbios_slot_type_desc(uint_t);
158384ab085aSmws extern const char *smbios_slot_width_desc(uint_t);
158484ab085aSmws extern const char *smbios_slot_usage_desc(uint_t);
158584ab085aSmws extern const char *smbios_slot_length_desc(uint_t);
158684ab085aSmws extern const char *smbios_slot_ch1_desc(uint_t);
158784ab085aSmws extern const char *smbios_slot_ch1_name(uint_t);
158884ab085aSmws extern const char *smbios_slot_ch2_desc(uint_t);
158984ab085aSmws extern const char *smbios_slot_ch2_name(uint_t);
159084ab085aSmws 
159184ab085aSmws extern const char *smbios_type_desc(uint_t);
159284ab085aSmws extern const char *smbios_type_name(uint_t);
159384ab085aSmws 
159484ab085aSmws extern const char *smbios_system_wakeup_desc(uint_t);
159584ab085aSmws #endif /* !_KERNEL */
159684ab085aSmws 
159784ab085aSmws #ifdef _KERNEL
159884ab085aSmws /*
159984ab085aSmws  * For SMBIOS clients within the kernel itself, ksmbios is used to refer to
160084ab085aSmws  * the kernel's current snapshot of the SMBIOS, if one exists, and the
160184ab085aSmws  * ksmbios_flags tunable is the set of flags for use with smbios_open().
160284ab085aSmws  */
160384ab085aSmws extern smbios_hdl_t *ksmbios;
160484ab085aSmws extern int ksmbios_flags;
160584ab085aSmws #endif /* _KERNEL */
160684ab085aSmws 
160784ab085aSmws #ifdef	__cplusplus
160884ab085aSmws }
160984ab085aSmws #endif
161084ab085aSmws 
161184ab085aSmws #endif	/* _SYS_SMBIOS_H */
1612