diff options
author | Rob Johnston <rob.johnston@joyent.com> | 2018-04-07 07:30:35 +0000 |
---|---|---|
committer | Rob Johnston <rob.johnston@joyent.com> | 2018-04-26 22:06:16 +0000 |
commit | 4cbfb4e7e093f73a0396f7354b72ffeb3c5ab608 (patch) | |
tree | dc402a8afd5b013d0f242573ea3ca024c309136c | |
parent | f2285ca5410456673906e9e258bf9e27974161de (diff) | |
download | illumos-joyent-4cbfb4e7e093f73a0396f7354b72ffeb3c5ab608.tar.gz |
OS-6870 need topo maps for the SMCI,SSG-2029P-ACR24L
OS-6876 authority and system pgroups missing on some nodes
OS-6877 extend pcibus enumerator to expose driver instance as property on pcifn/pciexfn nodes
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
16 files changed, 740 insertions, 85 deletions
@@ -10166,6 +10166,10 @@ f usr/platform/i86pc/lib/fm/topo/maps/SSG-2028R-ACR24L-hc-topology.xml 0444 root f usr/platform/i86pc/lib/fm/topo/maps/SSG-2028R-ACR24L-chassis-hc-topology.xml 0444 root sys f usr/platform/i86pc/lib/fm/topo/maps/SSG-2028R-ACR24L-disk-hc-topology.xml 0444 root sys f usr/platform/i86pc/lib/fm/topo/maps/SSG-2028R-ACR24L-slot-hc-topology.xml 0444 root sys +f usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-hc-topology.xml 0444 root sys +f usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-chassis-hc-topology.xml 0444 root sys +f usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-disk-hc-topology.xml 0444 root sys +f usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-slot-hc-topology.xml 0444 root sys f usr/platform/i86pc/lib/fm/topo/maps/chassis-hc-topology.xml 0444 root sys f usr/platform/i86pc/lib/fm/topo/maps/chip-hc-topology.xml 0444 root sys f usr/platform/i86pc/lib/fm/topo/maps/fan-hc-topology.xml 0444 root sys diff --git a/usr/src/lib/fm/topo/libtopo/common/hc.c b/usr/src/lib/fm/topo/libtopo/common/hc.c index b9001f0fd2..26d7b2a642 100644 --- a/usr/src/lib/fm/topo/libtopo/common/hc.c +++ b/usr/src/lib/fm/topo/libtopo/common/hc.c @@ -233,84 +233,6 @@ hc_fini(topo_mod_t *mod) topo_mod_unregister(mod); } - -static const topo_pgroup_info_t sys_pgroup = { - TOPO_PGROUP_SYSTEM, - TOPO_STABILITY_PRIVATE, - TOPO_STABILITY_PRIVATE, - 1 -}; - -static const topo_pgroup_info_t auth_pgroup = { - FM_FMRI_AUTHORITY, - TOPO_STABILITY_PRIVATE, - TOPO_STABILITY_PRIVATE, - 1 -}; - -static void -hc_prop_set(tnode_t *node, nvlist_t *auth) -{ - int err; - char isa[MAXNAMELEN]; - struct utsname uts; - char *prod, *psn, *csn, *server; - - if (auth == NULL) - return; - - if (topo_pgroup_create(node, &auth_pgroup, &err) != 0) { - if (err != ETOPO_PROP_DEFD) - return; - } - - /* - * Inherit if we can, it saves memory - */ - if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_PRODUCT, - &err) != 0) && (err != ETOPO_PROP_DEFD)) { - if (nvlist_lookup_string(auth, FM_FMRI_AUTH_PRODUCT, &prod) - == 0) - (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, - FM_FMRI_AUTH_PRODUCT, TOPO_PROP_IMMUTABLE, prod, - &err); - } - if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_PRODUCT_SN, - &err) != 0) && (err != ETOPO_PROP_DEFD)) { - if (nvlist_lookup_string(auth, FM_FMRI_AUTH_PRODUCT_SN, &psn) - == 0) - (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, - FM_FMRI_AUTH_PRODUCT_SN, TOPO_PROP_IMMUTABLE, psn, - &err); - } - if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_CHASSIS, - &err) != 0) && (err != ETOPO_PROP_DEFD)) { - if (nvlist_lookup_string(auth, FM_FMRI_AUTH_CHASSIS, &csn) == 0) - (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, - FM_FMRI_AUTH_CHASSIS, TOPO_PROP_IMMUTABLE, csn, - &err); - } - if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_SERVER, - &err) != 0) && (err != ETOPO_PROP_DEFD)) { - if (nvlist_lookup_string(auth, FM_FMRI_AUTH_SERVER, &server) - == 0) - (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, - FM_FMRI_AUTH_SERVER, TOPO_PROP_IMMUTABLE, server, - &err); - } - - if (topo_pgroup_create(node, &sys_pgroup, &err) != 0) - return; - - isa[0] = '\0'; - (void) sysinfo(SI_ARCHITECTURE, isa, sizeof (isa)); - (void) uname(&uts); - (void) topo_prop_set_string(node, TOPO_PGROUP_SYSTEM, TOPO_PROP_ISA, - TOPO_PROP_IMMUTABLE, isa, &err); - (void) topo_prop_set_string(node, TOPO_PGROUP_SYSTEM, TOPO_PROP_MACHINE, - TOPO_PROP_IMMUTABLE, uts.machine, &err); -} - /*ARGSUSED*/ int hc_enum(topo_mod_t *mod, tnode_t *pnode, const char *name, topo_instance_t min, @@ -364,7 +286,7 @@ hc_enum(topo_mod_t *mod, tnode_t *pnode, const char *name, topo_instance_t min, if (strcmp(name, MOTHERBOARD) == 0) (void) topo_node_fru_set(node, nvl, 0, &err); - hc_prop_set(node, auth); + topo_pgroup_hcset(node, auth); nvlist_free(nvl); nvlist_free(auth); diff --git a/usr/src/lib/fm/topo/libtopo/common/libtopo.h b/usr/src/lib/fm/topo/libtopo/common/libtopo.h index 822922294c..156b04342e 100644 --- a/usr/src/lib/fm/topo/libtopo/common/libtopo.h +++ b/usr/src/lib/fm/topo/libtopo/common/libtopo.h @@ -365,6 +365,7 @@ extern int topo_fmri_getpgrp(topo_hdl_t *, nvlist_t *, const char *, nvlist_t **, int *); extern int topo_fmri_setprop(topo_hdl_t *, nvlist_t *, const char *, nvlist_t *, int, nvlist_t *, int *); +extern void topo_pgroup_hcset(tnode_t *, nvlist_t *); /* Property node NVL names used in topo_prop_getprops */ #define TOPO_PROP_GROUP "property-group" diff --git a/usr/src/lib/fm/topo/libtopo/common/mapfile-vers b/usr/src/lib/fm/topo/libtopo/common/mapfile-vers index 34aebfff5f..0cb00e6508 100644 --- a/usr/src/lib/fm/topo/libtopo/common/mapfile-vers +++ b/usr/src/lib/fm/topo/libtopo/common/mapfile-vers @@ -153,6 +153,7 @@ SYMBOL_VERSION SUNWprivate { topo_pgroup_create; topo_pgroup_destroy; topo_pgroup_info; + topo_pgroup_hcset; topo_prop_get_fmri; topo_prop_get_int32; topo_prop_get_int64; diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_hc.h b/usr/src/lib/fm/topo/libtopo/common/topo_hc.h index 66032a670c..fdeb5f7193 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_hc.h +++ b/usr/src/lib/fm/topo/libtopo/common/topo_hc.h @@ -102,6 +102,7 @@ extern "C" { #define TOPO_PGROUP_IO "io" #define TOPO_IO_DEVTYPE "devtype" #define TOPO_IO_DRIVER "driver" +#define TOPO_IO_INSTANCE "instance" #define TOPO_IO_MODULE "module" #define TOPO_IO_DEV "dev" #define TOPO_IO_DEVID "devid" @@ -236,7 +237,7 @@ extern "C" { #define TOPO_DIMM_TYPE_LPDDR3 "LPDDR3" #define TOPO_DIMM_TYPE_LPDDR4 "LPDDR4" -#define TOPO_PGROUP_MOTHERBOARD "motherboard-properties" +#define TOPO_PGROUP_MOTHERBOARD "motherboard-properties" #define TOPO_PROP_MB_MANUFACTURER "manufacturer" #define TOPO_PROP_MB_PRODUCT "product-id" #define TOPO_PROP_MB_ASSET "assert-tag" diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_mod.map b/usr/src/lib/fm/topo/libtopo/common/topo_mod.map index 1c50a7cf89..c5eaab059f 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_mod.map +++ b/usr/src/lib/fm/topo/libtopo/common/topo_mod.map @@ -94,4 +94,5 @@ SYMBOL_SCOPE { topo_prop_set_fmri_array { TYPE = FUNCTION; FLAGS = extern }; topo_prop_inherit { TYPE = FUNCTION; FLAGS = extern }; topo_pgroup_create { TYPE = FUNCTION; FLAGS = extern }; + topo_pgroup_hcset { TYPE = FUNCTION; FLAGS = extern }; }; diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_subr.c b/usr/src/lib/fm/topo/libtopo/common/topo_subr.c index 7a6ed4be77..9d68061e11 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_subr.c +++ b/usr/src/lib/fm/topo/libtopo/common/topo_subr.c @@ -22,6 +22,9 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <alloca.h> #include <ctype.h> @@ -29,6 +32,9 @@ #include <syslog.h> #include <strings.h> #include <unistd.h> +#include <sys/fm/protocol.h> +#include <sys/systeminfo.h> +#include <sys/utsname.h> #include <topo_error.h> #include <topo_subr.h> @@ -394,7 +400,7 @@ topo_led_state_name(uint8_t type, char *buf, size_t len) void topo_sensor_state_name(uint32_t sensor_type, uint8_t state, char *buf, -size_t len) + size_t len) { topo_name_trans_t *ntp; @@ -538,3 +544,79 @@ size_t len) (void) snprintf(buf, len, "0x%02x", state); } + +static const topo_pgroup_info_t sys_pgroup = { + TOPO_PGROUP_SYSTEM, + TOPO_STABILITY_PRIVATE, + TOPO_STABILITY_PRIVATE, + 1 +}; +static const topo_pgroup_info_t auth_pgroup = { + FM_FMRI_AUTHORITY, + TOPO_STABILITY_PRIVATE, + TOPO_STABILITY_PRIVATE, + 1 +}; + +void +topo_pgroup_hcset(tnode_t *node, nvlist_t *auth) +{ + int err, ret; + char isa[MAXNAMELEN]; + struct utsname uts; + char *prod, *psn, *csn, *server; + + if (auth == NULL) + return; + + if (topo_pgroup_create(node, &auth_pgroup, &err) != 0) { + if (err != ETOPO_PROP_DEFD) + return; + } + + /* + * Inherit if we can, it saves memory + */ + if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_PRODUCT, + &err) != 0) && (err != ETOPO_PROP_DEFD)) { + if (nvlist_lookup_string(auth, FM_FMRI_AUTH_PRODUCT, &prod) == + 0) + (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, + FM_FMRI_AUTH_PRODUCT, TOPO_PROP_IMMUTABLE, prod, + &err); + } + if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_PRODUCT_SN, + &err) != 0) && (err != ETOPO_PROP_DEFD)) { + if (nvlist_lookup_string(auth, FM_FMRI_AUTH_PRODUCT_SN, &psn) == + 0) + (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, + FM_FMRI_AUTH_PRODUCT_SN, TOPO_PROP_IMMUTABLE, psn, + &err); + } + if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_CHASSIS, + &err) != 0) && (err != ETOPO_PROP_DEFD)) { + if (nvlist_lookup_string(auth, FM_FMRI_AUTH_CHASSIS, &csn) == 0) + (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, + FM_FMRI_AUTH_CHASSIS, TOPO_PROP_IMMUTABLE, csn, + &err); + } + if ((topo_prop_inherit(node, FM_FMRI_AUTHORITY, FM_FMRI_AUTH_SERVER, + &err) != 0) && (err != ETOPO_PROP_DEFD)) { + if (nvlist_lookup_string(auth, FM_FMRI_AUTH_SERVER, &server) == + 0) + (void) topo_prop_set_string(node, FM_FMRI_AUTHORITY, + FM_FMRI_AUTH_SERVER, TOPO_PROP_IMMUTABLE, server, + &err); + } + + if (topo_pgroup_create(node, &sys_pgroup, &err) != 0) + return; + + if (sysinfo(SI_ARCHITECTURE, isa, sizeof (isa)) != -1) + (void) topo_prop_set_string(node, TOPO_PGROUP_SYSTEM, + TOPO_PROP_ISA, TOPO_PROP_IMMUTABLE, isa, &err); + + if (uname(&uts) != -1) + (void) topo_prop_set_string(node, TOPO_PGROUP_SYSTEM, + TOPO_PROP_MACHINE, TOPO_PROP_IMMUTABLE, uts.machine, &err); +} diff --git a/usr/src/lib/fm/topo/maps/Makefile b/usr/src/lib/fm/topo/maps/Makefile index 6cfbd1988d..a35419192f 100644 --- a/usr/src/lib/fm/topo/maps/Makefile +++ b/usr/src/lib/fm/topo/maps/Makefile @@ -54,7 +54,8 @@ i386_SUBDIRS = i86pc \ Joyent,Joyent-Compute-Platform-330x \ Joyent,Joyent-Storage-Platform-7001 \ SMCI,SSG-2028R-ACR24L \ - SMCI,SSG-6049P-E1CR36L + SMCI,SSG-6049P-E1CR36L \ + SMCI,SSG-2029P-ACR24L SUBDIRS = $($(MACH)_SUBDIRS) diff --git a/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/Makefile b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/Makefile new file mode 100644 index 0000000000..f158cf2fe4 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/Makefile @@ -0,0 +1,36 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2018, Joyent, Inc. +# + +# NOTE: The name of the xml file we are building is 'platform' +# specific, but its build is structured as 'arch' specific since +# 'uname -i' on all x86 platforms returns i86pc. + +ARCH = i86pc +CLASS = arch +DTDFILE = topology.dtd.1 + +TOPOFILE = \ + SSG-2029P-ACR24L-hc-topology.xml \ + SSG-2029P-ACR24L-chassis-hc-topology.xml \ + SSG-2029P-ACR24L-disk-hc-topology.xml \ + SSG-2029P-ACR24L-slot-hc-topology.xml + +SRCDIR = ../SMCI,SSG-2029P-ACR24L + +PLATFORM = SSG-2029P-ACR24L + +CLOBBERFILES += SSG-2029P-ACR24L-disk-hc-topology.xml + +include ../Makefile.map diff --git a/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-chassis-hc-topology.xml b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-chassis-hc-topology.xml new file mode 100644 index 0000000000..8f1d790414 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-chassis-hc-topology.xml @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<!DOCTYPE topology SYSTEM "/usr/share/lib/xml/dtd/topology.dtd.1"> +<!-- + Copyright (c) 2018, Joyent, Inc. + + + This file and its contents are supplied under the terms of the + Common Development and Distribution License ("CDDL"), version 1.0. + You may only use this file in accordance with the terms of version + 1.0 of the CDDL. + + A full copy of the text of the CDDL should have accompanied this + source. A copy of the CDDL is also available via the Internet at + http://www.illumos.org/license/CDDL. + +--> + +<topology name='chassis' scheme='hc'> + <range name='chassis' min='0' max='0'> + <node instance='0'> + <fac-enum provider='fac_prov_ipmi' /> + <!-- + chassis locate LED + --> + <facility name='locate' type='indicator' provider='fac_prov_ipmi' > + <propgroup name='facility' version='1' name-stability='Private' + data-stability='Private' > + <propval name='type' type='uint32' value='1' /> + <propmethod name='chassis_ident_mode' version='0' + propname='mode' proptype='uint32' mutable='1' > + </propmethod> + </propgroup> + </facility> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='Chassis Intru' /> + <propitem value='System Temp' /> + </propval> + </propgroup> + </node> + </range> +</topology> diff --git a/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-disk-hc-topology.xmlgenksh b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-disk-hc-topology.xmlgenksh new file mode 100755 index 0000000000..9ab078cff4 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-disk-hc-topology.xmlgenksh @@ -0,0 +1,143 @@ +#!/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2018, Joyent, Inc. +# + +# +# Generate the topology map for an expanderless system with 24 bays. HBAs are +# in slots 2, 4, and 6. Additionally, there are two rear-facing SATA drive +# bays, connected to the SATA headers on the motherboard. +# + +function do_sas_node +{ + cat <<EOF + <node instance='${1}'> + <facility name='fail' type='indicator' provider='fac_prov_mptsas' > + <propgroup name='facility' version='1' name-stability='Private' + data-stability='Private' > + <propval name='type' type='uint32' value='0' /> + <propmethod name='mptsas_led_mode' version='0' propname='mode' + proptype='uint32' mutable='1'> + </propmethod> + </propgroup> + </facility> + <facility name='ident' type='indicator' provider='fac_prov_mptsas' > + <propgroup name='facility' version='1' name-stability='Private' + data-stability='Private' > + <propval name='type' type='uint32' value='1' /> + <propmethod name='mptsas_led_mode' version='0' propname='mode' + proptype='uint32' mutable='1'> + </propmethod> + </propgroup> + </facility> + <facility name='ok2rm' type='indicator' provider='fac_prov_mptsas' > + <propgroup name='facility' version='1' name-stability='Private' + data-stability='Private' > + <propval name='type' type='uint32' value='2' /> + <propmethod name='mptsas_led_mode' version='0' propname='mode' + proptype='uint32' mutable='1'> + </propmethod> + </propgroup> + </facility> + <propgroup name='protocol' version='1' name-stability='Private' + data-stability='Private'> + <propval name='label' type='string' value='${2}' /> + </propgroup> + <propgroup name='binding' version='1' name-stability='Private' + data-stability='Private'> + <propval name='driver' type='string' value='mpt_sas' /> + <propval name='devctl' type='string' value='${3}' /> + <propval name='enclosure' type='uint32' value='${4}' /> + <propval name='slot' type='uint32' value='${5}' /> + </propgroup> + </node> +EOF +} + +function do_sata_node +{ + bay=$1 + bay_inst=$2 + # + # There are six SATA headers on the motherboard, which represent + # targets 0-5. The two rear-facing SATA bays are connected to the two + # headers associated with targets 4 and 5. + # + (( target = bay + 4 )) + hpath="/pci@0,0/pci15d9,981@11,5" + tpath="/disk@${target},0" + cat <<EOF + <node instance='$bay_inst'> + <propgroup name='protocol' version='1' name-stability='Private' + data-stability='Private'> + <propval name='label' type='string' value='Rear Disk $bay' /> + </propgroup> + <propgroup name='io' version='1' name-stability='Private' + data-stability='Private'> + <propval name='ap-path' type='string' value='/devices${hpath}:$target' /> + </propgroup> + <propgroup name='binding' version='1' name-stability='Private' + data-stability='Private'> + <propval name='occupant-path' type='string' + value='$hpath$tpath' /> + </propgroup> + </node> +EOF +} + + +cat <<EOF +<topology name='disk' scheme='hc'> + <range name='bay' min='0' max='25'> +EOF + +enclosure=1 +bay=0 +slot=0 +devctl0='/devices/pci@7c,0/pci8086,2030@0/pci15d9,808@0:devctl' +while (( slot <= 7 )); do + do_sas_node $bay "Front Disk $bay" "$devctl0" $enclosure $slot + (( bay = bay + 1 )) + (( slot = slot + 1 )) +done + +slot=0 +devctl0='/devices/pci@cc,0/pci8086,2030@0/pci15d9,808@0:devctl' +while (( slot <= 7 )); do + do_sas_node $bay "Front Disk $bay" "$devctl0" $enclosure $slot + (( bay = bay + 1 )) + (( slot = slot + 1 )) +done + +slot=0 +devctl0='/devices/pci@55,0/pci8086,2030@0/pci15d9,808@0:devctl' +while (( slot <= 7 )); do + do_sas_node $bay "Front Disk $bay" "$devctl0" $enclosure $slot + (( bay = bay + 1 )) + (( slot = slot + 1 )) +done + +do_sata_node 0 24 +do_sata_node 1 25 + +cat <<EOF + <dependents grouping='children'> + <range name='disk' min='0' max='0'> + <enum-method name='disk' version='1' /> + </range> + </dependents> + </range> +</topology> +EOF diff --git a/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-hc-topology.xml b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-hc-topology.xml new file mode 100644 index 0000000000..68182bfef3 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-hc-topology.xml @@ -0,0 +1,96 @@ +<?xml version="1.0"?> +<!DOCTYPE topology SYSTEM "/usr/share/lib/xml/dtd/topology.dtd.1"> +<!-- + This file and its contents are supplied under the terms of the + Common Development and Distribution License ("CDDL"), version 1.0. + You may only use this file in accordance with the terms of version + 1.0 of the CDDL. + + A full copy of the text of the CDDL should have accompanied this + source. A copy of the CDDL is also available via the Internet at + http://www.illumos.org/license/CDDL. + + Copyright (c) 2018, Joyent, Inc. +--> +<topology name='i86pc' scheme='hc'> + + <range name='motherboard' min='0' max='0'> + <enum-method name='smbios' version='1' /> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='protocol' version='1' + name-stability='Private' data-stability='Private' > + <propval name='label' type='string' value='MB' /> + </propgroup> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='1.05V PCH' /> + <propitem value='1.8V PCH' /> + <propitem value='3.3VSB' /> + <propitem value='3.3VCC' /> + <propitem value='5VCC' /> + <propitem value='5VSB' /> + <propitem value='12V' /> + <propitem value='MB_10G Temp' /> + <propitem value='PCH Temp' /> + <propitem value='Peripheral Temp' /> + <propitem value='PVNN PCH' /> + <propitem value='VBAT' /> + <propitem value='Vcpu1' /> + <propitem value='Vcpu2' /> + <propitem value='VDIMMP1ABC' /> + <propitem value='VDIMMP1DEF' /> + <propitem value='VDIMMP2ABC' /> + <propitem value='VDIMMP2DEF' /> + <propitem value='VRMCpu1SA Temp' /> + <propitem value='VRMCpu1IO Temp' /> + <propitem value='VRMCpu1CCH Temp' /> + <propitem value='VRMCpu2SA Temp ' /> + <propitem value='VRMCpu2IO Temp' /> + <propitem value='VRMP1ABC Temp' /> + <propitem value='VRMP1DEF Temp' /> + <propitem value='VRMP2ABC Temp' /> + <propitem value='VRMP2DEF Temp' /> + </propval> + </propgroup> + </node> + + <dependents grouping='children'> + <range name='chip' min='0' max='100'> + <enum-method name='chip' version='1' /> + </range> + <range name='hostbridge' min='0' max='254'> + <enum-method name='hostbridge' version='1' /> + </range> + <range name='sp' min='0' max='0'> + <enum-method name='ipmi' version='1' /> + </range> + <range name='slot' min='0' max='15'> + <enum-method name='smbios' version='1' /> + <propmap name='SSG-2029P-ACR24L-slot' /> + </range> + </dependents> + + </range> + + <range name='chassis' min='0' max='0'> + <propmap name='SSG-2029P-ACR24L-chassis' /> + + <dependents grouping='children'> + + <range name='psu' min='0' max='1'> + <enum-method name='ipmi' version='1' /> + </range> + <range name='fan' min='0' max='7'> + <enum-method name='ipmi' version='1' /> + </range> + <range name='bay' min='0' max='25'> + <propmap name='SSG-2029P-ACR24L-disk' /> + </range> + + </dependents> + + </range> + +</topology> diff --git a/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-slot-hc-topology.xml b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-slot-hc-topology.xml new file mode 100644 index 0000000000..29dcc6d206 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SMCI,SSG-2029P-ACR24L/SSG-2029P-ACR24L-slot-hc-topology.xml @@ -0,0 +1,277 @@ +<?xml version="1.0"?> +<!DOCTYPE topology SYSTEM "/usr/share/lib/xml/dtd/topology.dtd.1"> +<!-- + + This file and its contents are supplied under the terms of the + Common Development and Distribution License ("CDDL"), version 1.0. + You may only use this file in accordance with the terms of version + 1.0 of the CDDL. + + A full copy of the text of the CDDL should have accompanied this + source. A copy of the CDDL is also available via the Internet at + http://www.illumos.org/license/CDDL. + + Copyright (c) 2018, Joyent, Inc. + +--> + +<topology name='slot' scheme='hc'> + <range name='slot' min='0' max='15'> + <node instance='0' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMA1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='1' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMA2 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='2' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMB1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='3' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMC1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='4' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMD1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='5' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMD2 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='6' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMME1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='7' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P1-DIMMF1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='8' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMA1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='9' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMA2 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='10' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMB1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='11' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMC1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='12' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMD1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='13' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMD2 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='14' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMME1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + <node instance='15' static='true'> + <dependents grouping='children'> + <range name='dimm' min='0' max='0'> + <node instance='0' static='true'> + <fac-enum provider='fac_prov_ipmi' /> + <propgroup name='ipmi' version='1' + name-stability='Private' data-stability='Private' > + <propval name='entity-list' type='string_array' > + <propitem value='P2-DIMMF1 Temp' /> + </propval> + </propgroup> + </node> + </range> + </dependents> + </node> + + </range> <!-- slot --> +</topology> diff --git a/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c b/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c index 6d900c2989..e216dec9d1 100644 --- a/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c +++ b/usr/src/lib/fm/topo/modules/common/pcibus/did_props.c @@ -54,6 +54,8 @@ static int DEVprop_set(tnode_t *, did_t *, const char *, const char *, const char *); static int DRIVERprop_set(tnode_t *, did_t *, const char *, const char *, const char *); +static int INSTprop_set(tnode_t *, did_t *, + const char *, const char *, const char *); static int MODULEprop_set(tnode_t *, did_t *, const char *, const char *, const char *); static int EXCAP_set(tnode_t *, did_t *, @@ -101,6 +103,7 @@ txprop_t Fn_common_props[] = { { DI_DEVTYPPROP, &io_pgroup, TOPO_IO_DEVTYPE, maybe_di_chars_copy }, { DI_DEVIDPROP, &pci_pgroup, TOPO_PCI_DEVID, maybe_di_uint_to_str }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { "serd_io_device_nonfatal_n", &io_pgroup, "serd_io_device_nonfatal_n", maybe_di_uint_to_dec_str }, @@ -172,6 +175,7 @@ txprop_t Dev_common_props[] = { txprop_t Bus_common_props[] = { { DI_DEVTYPPROP, &io_pgroup, TOPO_IO_DEVTYPE, maybe_di_chars_copy }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { NULL, &protocol_pgroup, TOPO_PROP_LABEL, label_set }, { NULL, &protocol_pgroup, TOPO_PROP_FRU, FRU_set }, @@ -182,6 +186,7 @@ txprop_t RC_common_props[] = { { NULL, &io_pgroup, TOPO_IO_DEV, DEVprop_set }, { DI_DEVTYPPROP, &io_pgroup, TOPO_IO_DEVTYPE, maybe_di_chars_copy }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { NULL, &pci_pgroup, TOPO_PCI_EXCAP, EXCAP_set }, { NULL, &pci_pgroup, TOPO_PCI_BDF, BDF_set }, @@ -213,6 +218,7 @@ txprop_t IOB_common_props[] = { txprop_t HB_common_props[] = { { NULL, &io_pgroup, TOPO_IO_DEV, DEVprop_set }, { NULL, &io_pgroup, TOPO_IO_DRIVER, DRIVERprop_set }, + { NULL, &io_pgroup, TOPO_IO_INSTANCE, INSTprop_set }, { NULL, &io_pgroup, TOPO_IO_MODULE, MODULEprop_set }, { NULL, &protocol_pgroup, TOPO_PROP_ASRU, ASRU_set }, /* @@ -778,6 +784,22 @@ DRIVERprop_set(tnode_t *tn, did_t *pd, /*ARGSUSED*/ static int +INSTprop_set(tnode_t *tn, did_t *pd, + const char *dpnm, const char *tpgrp, const char *tpnm) +{ + int inst, err; + + if ((inst = di_instance(did_dinode(pd))) == -1) + return (0); + if (topo_prop_set_uint32(tn, + tpgrp, tpnm, TOPO_PROP_IMMUTABLE, inst, &err) < 0) + return (topo_mod_seterrno(did_mod(pd), err)); + + return (0); +} + +/*ARGSUSED*/ +static int MODULEprop_set(tnode_t *tn, did_t *pd, const char *dpnm, const char *tpgrp, const char *tpnm) { diff --git a/usr/src/lib/fm/topo/modules/common/smbios/smbios_enum.c b/usr/src/lib/fm/topo/modules/common/smbios/smbios_enum.c index de043d8ba8..ac209e90c7 100644 --- a/usr/src/lib/fm/topo/modules/common/smbios/smbios_enum.c +++ b/usr/src/lib/fm/topo/modules/common/smbios/smbios_enum.c @@ -121,9 +121,9 @@ smbios_make_slot(smb_enum_data_t *smed, smbios_memdevice_t *smb_md) /* errno set */ return (NULL); } - nvlist_free(auth); if ((slotnode = topo_node_bind(mod, smed->sme_pnode, SLOT, smed->sme_slot_inst, fmri)) == NULL) { + nvlist_free(auth); nvlist_free(fmri); topo_mod_dprintf(mod, "topo_node_bind() failed: %s", topo_mod_errmsg(mod)); @@ -133,6 +133,10 @@ smbios_make_slot(smb_enum_data_t *smed, smbios_memdevice_t *smb_md) nvlist_free(fmri); fmri = NULL; + /* Create authority and system pgroups */ + topo_pgroup_hcset(slotnode, auth); + nvlist_free(auth); + if (topo_node_label_set(slotnode, (char *)smb_md->smbmd_dloc, &err) != 0) { topo_mod_dprintf(mod, "failed to set label on %s=%d: %s", @@ -226,11 +230,11 @@ smbios_make_dimm(smb_enum_data_t *smed, smbios_memdevice_t *smb_md) /* errno set */ goto err; } - nvlist_free(auth); if (topo_node_range_create(mod, slotnode, DIMM, 0, 0) < 0 || (dimmnode = topo_node_bind(mod, slotnode, DIMM, 0, fmri)) == NULL) { + nvlist_free(auth); nvlist_free(fmri); topo_mod_dprintf(mod, "failed to bind dimm node: %s", topo_mod_errmsg(mod)); @@ -238,6 +242,10 @@ smbios_make_dimm(smb_enum_data_t *smed, smbios_memdevice_t *smb_md) goto err; } + /* Create authority and system pgroups */ + topo_pgroup_hcset(dimmnode, auth); + nvlist_free(auth); + if (topo_node_fru_set(dimmnode, fmri, NULL, &err) != 0) { topo_mod_dprintf(mod, "failed to set FRU on %s: %s", DIMM, topo_strerror(err)); @@ -448,16 +456,21 @@ smbios_enum_motherboard(smbios_hdl_t *shp, smb_enum_data_t *smed) /* errno set */ goto err; } - nvlist_free(auth); if ((mbnode = topo_node_bind(mod, smed->sme_pnode, MOTHERBOARD, 0, fmri)) == NULL) { + nvlist_free(auth); nvlist_free(fmri); topo_mod_dprintf(mod, "topo_node_bind() failed: %s", topo_mod_errmsg(mod)); /* errno set */ goto err; } + + /* Create authority and system pgroups */ + topo_pgroup_hcset(mbnode, auth); + nvlist_free(auth); + if (topo_node_fru_set(mbnode, fmri, NULL, &err) != 0) { topo_mod_dprintf(mod, "failed to set FRU on %s: %s", MOTHERBOARD, topo_strerror(err)); diff --git a/usr/src/pkg/manifests/service-fault-management.mf b/usr/src/pkg/manifests/service-fault-management.mf index 081e2f4841..f97cdac667 100644 --- a/usr/src/pkg/manifests/service-fault-management.mf +++ b/usr/src/pkg/manifests/service-fault-management.mf @@ -770,6 +770,18 @@ $(i386_ONLY)file \ path=usr/platform/i86pc/lib/fm/topo/maps/SSG-2028R-ACR24L-slot-hc-topology.xml \ mode=0444 $(i386_ONLY)file \ + path=usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-hc-topology.xml \ + mode=0444 +$(i386_ONLY)file \ + path=usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-chassis-hc-topology.xml \ + mode=0444 +$(i386_ONLY)file \ + path=usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-disk-hc-topology.xml \ + mode=0444 +$(i386_ONLY)file \ + path=usr/platform/i86pc/lib/fm/topo/maps/SSG-2029P-ACR24L-slot-hc-topology.xml \ + mode=0444 +$(i386_ONLY)file \ path=usr/platform/i86pc/lib/fm/topo/maps/Netra-X4200-M2-disk-hc-topology.xml \ mode=0444 $(i386_ONLY)file \ |