2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# CDDL HEADER START
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# The contents of this file are subject to the terms of the
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Common Development and Distribution License (the "License").
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# You may not use this file except in compliance with the License.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# See the License for the specific language governing permissions
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# and limitations under the License.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# When distributing Covered Code, include this CDDL HEADER in each
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# If applicable, add the following below this CDDL HEADER, with the
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# fields enclosed by brackets "[]" replaced with your own identifying
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# information: Portions Copyright [yyyy] [name of copyright owner]
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# CDDL HEADER END
e5dcf7beb7c949f9234713d5818b581ec3825443Robert Johnston# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Use is subject to license terms.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# The fan topologies can be quite complicated, but are ultimately regular. This
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# perl file uses some simplified internal structures to generate an .xml file
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# without the maintenance overhead.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Master table of platforms.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # These systems have 2 fan-connector boards. Each fan-connector board has 3
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # fan modules. Each fan module is an individual FRU. The fan-connector
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj set => "Sun-Fire-X4100-Server|Sun-Fire-X4200-Server|" .
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # These systems have 5 fan modules, with each fan module containing 2 fans.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # The FRUs for the individual fans are the containing fan module.
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston fm_service_indctr => "FT%d/SVC,ft%d.service.led",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston fm_ok2rm_indctr => "FT%d/OK,ft%d.ok2rm.led",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston entity_ref => "FT%d/FAN%d/TACH,ft%d.f%d.speed",
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj # There are two fan boards, which are FRU's. Each fan board has
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj # 3 fan modules for a total of 6 fan modules, with each fan module
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj # containing 2 fans. The FRU's for the individual fans are the
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # Unfortunately, the IPMI topology on these systems is rather broken, and
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # all the SDRs that should be separate entities in fact refer to the same
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj # entity IDs. So we have to use the alternative 'entity_present' option
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston entity_present => "FB%d/FM%d/PRSNT,fb%d.fm%d.prsnt",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston fm_service_indctr=> "FB%d/FM%d/SERVICE,fb%d.fm%d.led",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston entity_ref => "FB%d/FM%d/F%d/TACH,fb%d.fm%d.f%d.speed",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston entity_present => "FB%d/FM%d/PRSNT,fb%d.fm%d.prsnt",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston # Fan Module/Fan topology for the Sun Fire X4600/X4600 M2 platforms.
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj # These systems have 4 fan assemblies with a single fan per assembly.
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj # Each fan assembly is a FRU. The fan assemblies have a service LED
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston # Fan Module/Fan topology for Sun Fire X4140.
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston # There are two fan boards, which are FRU's. The first fanboard has 4
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston # fanmodules (which are also FRU's). The second fan board has 3 fan
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston # modules. Each fanmodule contains two fans.
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston fm_service_indctr=> "FB%d/FM%d/SERVICE,fb%d.fm%d.led",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston entity_ref => "FB%d/FM%d/F%d/TACH,fb%d.fm%d.f%d.speed",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston # Fan Module/Fan topology for the Sun Fire X4150.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston # There are two fan boards, which are FRU's. The first fanboard has 4
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston # fanmodules (which are also FRU's). The second fan board has 3 fan
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston # modules. Each fanmodule contains two fans.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston # There are two fan boards, which are FRU's. Both fanboards have 3
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston # fanmodules (which are also FRU's). Each fanmodule contains two fans.
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Process an entry in the topology list. We are passed the indentation level,
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# the current topology array, the set list, and any pushed indices. This is
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# called recursively.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston my ($indent, $toporef, $set, @indices) = @_;
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj my $level = shift @topo;
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston # Special case code for the 1U version of Durado and Duradi,
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston # both of which have an assymetric fan topology
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston last if ((($set eq "SUN-FIRE-X4150") || ($set eq "Sun-Fire-X4140"))
80f1b0f5d7bc2c2f91ce68ea6379c779a03c595eRobert Johnston && ($type eq "fanmodule") && ($#indices == 0)
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<node instance='%d'>\n", $indent, "", $i);
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<facility name='service' type='indicator' ".
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propgroup name='facility' version='1' ".
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj "name-stability='Private' data-stability='Private' >\n",
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propmethod name='ipmi_entity' version='0' ".
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston "propname='entity_ref' proptype='string_array' >\n",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston printf("%*s<argval name='format' type='string_array'>\n",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston my @refs = split(/\,/, $level->{fm_service_indctr});
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston printf("%*s<argitem value='", $indent+10, "");
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propmethod name='ipmi_indicator_mode' ".
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<facility name='ok2rm' type='indicator' ".
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propgroup name='facility' version='1' ".
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj "name-stability='Private' data-stability='Private' >\n",
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propmethod name='ipmi_entity' version='0' ".
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston "propname='entity_ref' proptype='string_array' >\n",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston printf("%*s<argval name='format' type='string_array'>\n",
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston my @refs = split(/\,/, $level->{fm_ok2rm_indctr});
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston printf("%*s<argitem value='", $indent+10, "");
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propmethod name='ipmi_indicator_mode' ".
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj "version='0' propname='mode' proptype='uint32' mutable='1' >\n",
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<propgroup name='protocol' version='1' " .
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj "name-stability='Private' data-stability='Private'>\n",
e5dcf7beb7c949f9234713d5818b581ec3825443Robert Johnston printf("%*s<propgroup name='ipmi' version='1' " .
e5dcf7beb7c949f9234713d5818b581ec3825443Robert Johnston "data-stability='Private' >\n", $indent, "");
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston printf("%*s<propitem value='", $indent+4, "");
e5dcf7beb7c949f9234713d5818b581ec3825443Robert Johnston printf("%*s<propval name='entity_present' " .
88045cff0aae4ed8823cd0989168e8f56927f83eRobert Johnston printf("%*s<propitem value='", $indent+4, "");
7793aa8b1cb26c7fc1397aa9db2364098fc25543Eric Schrock printf("%*s<enum-method name='ipmi' version='1' ".
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston process_topology($indent + 2, \@topo, $set, @indices);
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# Process a single platform file.
d91236fe104c7ea63142e053b22a39c8a30d304beschrock printf("%*s<set type='product' setlist='%s'>\n", $indent, "",
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston process_topology($indent + 2, $desc->{topology}, $desc->{set});
d91236fe104c7ea63142e053b22a39c8a30d304beschrockprint "<topology name='fan' scheme='hc'>\n";
d91236fe104c7ea63142e053b22a39c8a30d304beschrockprint "</topology>\n";