summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys
diff options
context:
space:
mode:
authorTom Pothier <Tom.Pothier@Sun.COM>2009-11-03 21:14:05 -0500
committerTom Pothier <Tom.Pothier@Sun.COM>2009-11-03 21:14:05 -0500
commit074bb90d80fdbeb2d04a8450a55ecbc96de28785 (patch)
tree8a51c05e37f62db5e4c24f3e134755322fa6c78a /usr/src/uts/common/sys
parent36d41b68ce4ecc38f01ced5fe21dddf05a5f9289 (diff)
downloadillumos-joyent-074bb90d80fdbeb2d04a8450a55ecbc96de28785.tar.gz
PSARC/2009/490 x86 Generic FMA Topology Enumerator
6785310 Implement SMBIOS contained elements/handles 6841286 Need x86 generic FMA topo enumerator 6853537 x86gentopo needs OEM-Specific SMBIOS structures 6865771 Topology relationships should be derived from contained handles & elements of SMBIOS 6865814 Chip enumerator should derive serials & labels using libsmbios, if SMBIOS is FM aware 6865845 /dev/fm should export the Initial APICID, SMBIOS based ID/instance to the chip enumerator 6866456 Generic Topology FMRI ereport
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r--usr/src/uts/common/sys/devfm.h17
-rw-r--r--usr/src/uts/common/sys/fm/protocol.h2
-rw-r--r--usr/src/uts/common/sys/smbios.h60
-rw-r--r--usr/src/uts/common/sys/smbios_impl.h38
4 files changed, 107 insertions, 10 deletions
diff --git a/usr/src/uts/common/sys/devfm.h b/usr/src/uts/common/sys/devfm.h
index e9ad95b39f..e42e259cba 100644
--- a/usr/src/uts/common/sys/devfm.h
+++ b/usr/src/uts/common/sys/devfm.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -40,6 +40,7 @@ extern "C" {
#define FM_PAGE_OP_VERSION "page-operation-version"
#define FM_CPU_OP_VERSION "cpu-operation-version"
#define FM_CPU_INFO_VERSION "cpu-info-version"
+#define FM_TOPO_LEGACY_VERSION "topo-legacy-version"
/*
* FMA driver ioctl interfaces
@@ -55,6 +56,7 @@ extern "C" {
#define FM_IOC_CPU_RETIRE (FM_IOC | 6)
#define FM_IOC_CPU_STATUS (FM_IOC | 7)
#define FM_IOC_CPU_UNRETIRE (FM_IOC | 8)
+#define FM_IOC_GENTOPO_LEGACY (FM_IOC | 9)
#endif /* __x86 */
/*
@@ -87,6 +89,7 @@ typedef struct fm_ioc_data32 {
#define FM_CPU_RETIRE_CORE_ID "core_id"
#define FM_CPU_RETIRE_STRAND_ID "strand_id"
#define FM_CPU_RETIRE_OLDSTATUS "oldstatus"
+#define FM_GENTOPO_LEGACY "gentopolegacy"
/*
* Properties set by FM_PHYSCPU_INFO
@@ -95,9 +98,21 @@ typedef struct fm_ioc_data32 {
#define FM_PHYSCPU_INFO_FAMILY "family"
#define FM_PHYSCPU_INFO_MODEL "model"
#define FM_PHYSCPU_INFO_STEPPING "stepping"
+
+/*
+ * When Multi-Chip-Module(MCM) support is added
+ * chip_id should map to the processor package
+ * and not the die in the processor package.
+ * This is for FMA; kernel's perception of
+ * chip_id could differ for MCM.
+ */
#define FM_PHYSCPU_INFO_CHIP_ID "chip_id"
+
#define FM_PHYSCPU_INFO_CORE_ID "core_id"
#define FM_PHYSCPU_INFO_STRAND_ID "strand_id"
+#define FM_PHYSCPU_INFO_STRAND_APICID "strand_initial_apicid"
+#define FM_PHYSCPU_INFO_SMBIOS_ID "smbios_id"
+#define FM_PHYSCPU_INFO_CHIP_ROOTS "chip_roots"
#define FM_PHYSCPU_INFO_CHIP_REV "chip_rev"
#define FM_PHYSCPU_INFO_SOCKET_TYPE "socket_type"
#define FM_PHYSCPU_INFO_CPU_ID "cpuid"
diff --git a/usr/src/uts/common/sys/fm/protocol.h b/usr/src/uts/common/sys/fm/protocol.h
index 4c19a47318..37f7e92db2 100644
--- a/usr/src/uts/common/sys/fm/protocol.h
+++ b/usr/src/uts/common/sys/fm/protocol.h
@@ -323,6 +323,8 @@ extern void fm_fmri_mem_set(nvlist_t *, int, const nvlist_t *, const char *,
extern void fm_authority_set(nvlist_t *, int, const char *, const char *,
const char *, const char *);
extern void fm_fmri_zfs_set(nvlist_t *, int, uint64_t, uint64_t);
+extern void fm_fmri_hc_create(nvlist_t *, int, const nvlist_t *, nvlist_t *,
+ nvlist_t *, int, ...);
extern uint64_t fm_ena_increment(uint64_t);
extern uint64_t fm_ena_generate(uint64_t, uchar_t);
diff --git a/usr/src/uts/common/sys/smbios.h b/usr/src/uts/common/sys/smbios.h
index 187ec2c63f..a21dceb5e3 100644
--- a/usr/src/uts/common/sys/smbios.h
+++ b/usr/src/uts/common/sys/smbios.h
@@ -126,6 +126,10 @@ typedef struct smbios_entry {
#define SMB_TYPE_EOT 127 /* end of table */
#define SMB_TYPE_OEM_LO 128 /* start of OEM-specific type range */
+#define SUN_OEM_EXT_PROCESSOR 132 /* processor extended info */
+#define SUN_OEM_PCIEXRC 138 /* PCIE RootComplex/RootPort info */
+#define SUN_OEM_EXT_MEMARRAY 144 /* phys memory array extended info */
+#define SUN_OEM_EXT_MEMDEVICE 145 /* memory device extended info */
#define SMB_TYPE_OEM_HI 256 /* end of OEM-specific type range */
/*
@@ -160,6 +164,10 @@ typedef struct smbios_version {
uint8_t smbv_minor; /* version minor number */
} smbios_version_t;
+#define SMB_CONT_BYTE 1 /* contained elements are byte size */
+#define SMB_CONT_WORD 2 /* contained elements are word size */
+#define SMB_CONT_MAX 255 /* maximum contained objects */
+
/*
* SMBIOS Bios Information. See DSP0134 Section 3.3.1 for more information.
* smbb_romsize is converted from the implementation format into bytes.
@@ -261,6 +269,7 @@ typedef struct smbios_bboard {
id_t smbb_chassis; /* chassis containing this board */
uint8_t smbb_flags; /* flags (see below) */
uint8_t smbb_type; /* board type (see below) */
+ uint8_t smbb_contn; /* number of contained object hdls */
} smbios_bboard_t;
#define SMB_BBFL_MOTHERBOARD 0x01 /* board is a motherboard */
@@ -286,8 +295,6 @@ typedef struct smbios_bboard {
/*
* SMBIOS Chassis description. See DSP0134 Section 3.3.4 for more information.
* We move the lock bit of the type field into smbc_lock for easier processing.
- * NOTE: We do not currently export the contained element data for each chassis
- * as this seems useless: see DSP0134 3.3.4.4. It can be added if necessary.
*/
typedef struct smbios_chassis {
uint32_t smbc_oemdata; /* OEM-specific data */
@@ -299,7 +306,8 @@ typedef struct smbios_chassis {
uint8_t smbc_security; /* security status */
uint8_t smbc_uheight; /* enclosure height in U's */
uint8_t smbc_cords; /* number of power cords */
- uint8_t smbc_elems; /* number of element records */
+ uint8_t smbc_elems; /* number of element records (n) */
+ uint8_t smbc_elemlen; /* length of contained element (m) */
} smbios_chassis_t;
#define SMB_CHT_OTHER 0x01 /* other */
@@ -1071,6 +1079,43 @@ typedef struct smbios_ipmi {
#define SMB_IPMI_F_INTREDGE 0x08 /* intr is edge triggered (else lvl) */
/*
+ * SMBIOS OEM-specific (Type 132) Processor Extended Information.
+ */
+typedef struct smbios_processor_ext {
+ uint16_t smbpe_processor; /* extending processor handle */
+ uint8_t smbpe_fru; /* FRU indicaor */
+ uint8_t smbpe_n; /* number of APIC IDs */
+ uint16_t *smbpe_apicid; /* strand Inital APIC IDs */
+} smbios_processor_ext_t;
+
+/*
+ * SMBIOS OEM-specific (Type 138) PCI-Express RC/RP Information.
+ */
+typedef struct smbios_pciexrc {
+ uint16_t smbpcie_bb; /* base board handle */
+ uint16_t smbpcie_bdf; /* Bus/Dev/Funct (PCI) */
+} smbios_pciexrc_t;
+
+/*
+ * SMBIOS OEM-specific (Type 144) Memory Array Extended Information.
+ */
+typedef struct smbios_memarray_ext {
+ uint16_t smbmae_ma; /* memory array handle */
+ uint16_t smbmae_comp; /* component parent handle */
+ uint16_t smbmae_bdf; /* Bus/Dev/Funct (PCI) */
+} smbios_memarray_ext_t;
+
+/*
+ * SMBIOS OEM-specific (Type 145) Memory Device Extended Information.
+ */
+typedef struct smbios_memdevice_ext {
+ uint16_t smbmdeve_md; /* memory device handle */
+ uint8_t smbmdeve_drch; /* DRAM channel */
+ uint8_t smbmdeve_ncs; /* number of chip selects */
+ uint8_t *smbmdeve_cs; /* array of chip select numbers */
+} smbios_memdevice_ext_t;
+
+/*
* SMBIOS Interfaces. An SMBIOS image can be opened by either providing a file
* pathname, device pathname, file descriptor, or raw memory buffer. Once an
* image is opened the functions below can be used to iterate over the various
@@ -1123,15 +1168,19 @@ extern int smbios_errno(smbios_hdl_t *);
extern const char *smbios_errmsg(int);
extern int smbios_lookup_id(smbios_hdl_t *, id_t, smbios_struct_t *);
+extern int smbios_lookup_type(smbios_hdl_t *, uint_t, smbios_struct_t *);
extern int smbios_iter(smbios_hdl_t *, smbios_struct_f *, void *);
extern void smbios_info_smbios(smbios_hdl_t *, smbios_entry_t *);
extern int smbios_info_common(smbios_hdl_t *, id_t, smbios_info_t *);
+extern int smbios_info_contains(smbios_hdl_t *, id_t, uint_t, id_t *);
extern id_t smbios_info_bios(smbios_hdl_t *, smbios_bios_t *);
extern id_t smbios_info_system(smbios_hdl_t *, smbios_system_t *);
extern int smbios_info_bboard(smbios_hdl_t *, id_t, smbios_bboard_t *);
extern int smbios_info_chassis(smbios_hdl_t *, id_t, smbios_chassis_t *);
extern int smbios_info_processor(smbios_hdl_t *, id_t, smbios_processor_t *);
+extern int smbios_info_extprocessor(smbios_hdl_t *, id_t,
+ smbios_processor_ext_t *);
extern int smbios_info_cache(smbios_hdl_t *, id_t, smbios_cache_t *);
extern int smbios_info_port(smbios_hdl_t *, id_t, smbios_port_t *);
extern int smbios_info_slot(smbios_hdl_t *, id_t, smbios_slot_t *);
@@ -1140,12 +1189,17 @@ extern int smbios_info_strtab(smbios_hdl_t *, id_t, int, const char *[]);
extern id_t smbios_info_lang(smbios_hdl_t *, smbios_lang_t *);
extern id_t smbios_info_eventlog(smbios_hdl_t *, smbios_evlog_t *);
extern int smbios_info_memarray(smbios_hdl_t *, id_t, smbios_memarray_t *);
+extern int smbios_info_extmemarray(smbios_hdl_t *, id_t,
+ smbios_memarray_ext_t *);
extern int smbios_info_memarrmap(smbios_hdl_t *, id_t, smbios_memarrmap_t *);
extern int smbios_info_memdevice(smbios_hdl_t *, id_t, smbios_memdevice_t *);
+extern int smbios_info_extmemdevice(smbios_hdl_t *, id_t,
+ smbios_memdevice_ext_t *);
extern int smbios_info_memdevmap(smbios_hdl_t *, id_t, smbios_memdevmap_t *);
extern id_t smbios_info_hwsec(smbios_hdl_t *, smbios_hwsec_t *);
extern id_t smbios_info_boot(smbios_hdl_t *, smbios_boot_t *);
extern id_t smbios_info_ipmi(smbios_hdl_t *, smbios_ipmi_t *);
+extern int smbios_info_pciexrc(smbios_hdl_t *, id_t, smbios_pciexrc_t *);
extern const char *smbios_psn(smbios_hdl_t *);
extern const char *smbios_csn(smbios_hdl_t *);
diff --git a/usr/src/uts/common/sys/smbios_impl.h b/usr/src/uts/common/sys/smbios_impl.h
index 3b87012f74..b1ac86b1b5 100644
--- a/usr/src/uts/common/sys/smbios_impl.h
+++ b/usr/src/uts/common/sys/smbios_impl.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -21,7 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -36,8 +35,6 @@
#ifndef _SYS_SMBIOS_IMPL_H
#define _SYS_SMBIOS_IMPL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/smbios.h>
#include <sys/sysmacros.h>
@@ -360,6 +357,35 @@ typedef struct smb_powersup {
uint16_t smbpsup_iprobe; /* current probe handle */
} smb_powersup_t;
+typedef struct smb_processor_ext {
+ smb_header_t smbpre_hdr; /* structure header */
+ uint16_t smbpre_processor; /* processor handle */
+ uint8_t smbpre_fru; /* FRU indicator */
+ uint8_t smbpre_n; /* number of APIC IDs */
+ uint16_t smbpre_apicid[1]; /* strand initial apic id */
+} smb_processor_ext_t;
+
+typedef struct smb_pciexrc {
+ smb_header_t smbpciexrc_hdr; /* structure header */
+ uint16_t smbpciexrc_bboard; /* base board handle */
+ uint16_t smbpciexrc_bdf; /* PCI Bus/Dev/Func */
+} smb_pciexrc_t;
+
+typedef struct smb_memarray_ext {
+ smb_header_t smbmarre_hdr; /* structure header */
+ uint16_t smbmarre_ma; /* memory array handle */
+ uint16_t smbmarre_component; /* component parent handle */
+ uint16_t smbmarre_bdf; /* PCI bus/dev/funct */
+} smb_memarray_ext_t;
+
+typedef struct smb_memdevice_ext {
+ smb_header_t smbmdeve_hdr; /* structure header */
+ uint16_t smbmdeve_mdev; /* memory device handle */
+ uint8_t smbmdeve_dchan; /* DRAM channel */
+ uint8_t smbmdeve_ncs; /* number of chip select */
+ uint8_t smbmdeve_cs[1]; /* chip selects */
+} smb_memdevice_ext_t;
+
#pragma pack()
typedef struct smb_struct {