summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authornjames <njames@us.ibm.com>2015-02-17 11:02:14 -0600
committernjames <njames@us.ibm.com>2015-02-17 11:02:14 -0600
commitab8e6a68c68e80a731eadf1674d1c61414b898c0 (patch)
tree4c344bb8e44cc0c8c9ca3210119efe5b03d80d97 /scripts
parent9f8811b63958d35d4566d6fb4feaf4d9a1bef5c1 (diff)
downloadserverwiz-ab8e6a68c68e80a731eadf1674d1c61414b898c0.tar.gz
serverwiz-ab8e6a68c68e80a731eadf1674d1c61414b898c0.zip
support IPMI_NAME
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Targets.pm28
-rw-r--r--scripts/processMrw.pl50
2 files changed, 41 insertions, 37 deletions
diff --git a/scripts/Targets.pm b/scripts/Targets.pm
index 202dc7a..3cb519e 100644
--- a/scripts/Targets.pm
+++ b/scripts/Targets.pm
@@ -193,6 +193,7 @@ sub printAttribute
$filter{ENTITY_INSTANCE} = 1;
$filter{MBA_NUM} = 1;
$filter{IPMI_INSTANCE} = 1;
+ $filter{IPMI_NAME} = 1;
$filter{INSTANCE_ID} = 1;
$filter{ADC_CHANNEL_SENSOR_NUMBERS} = 1;
@@ -274,7 +275,7 @@ sub buildHierarchy
{
my $self = shift;
my $target = shift;
-
+
my $old_path = $self->{data}->{INSTANCE_PATH};
my $target_xml = $self->{xml}->{'targetInstance'}{$target};
my $affinity_target = $target;
@@ -287,7 +288,7 @@ sub buildHierarchy
$self->{data}->{INSTANCE_PATH} = $old_path . "/" . $target;
## copy attributes
-
+
foreach my $attribute (keys %{ $target_xml->{attribute} })
{
my $value = $target_xml->{attribute}->{$attribute}->{default};
@@ -318,7 +319,7 @@ sub buildHierarchy
$self->setAttribute($key, $attribute, $value);
}
}
- ## global attributes overwrite local
+ ## global attributes overwrite local
foreach my $prop (keys %{$self->{xml}->{globalSetting}->{$key}->{property}})
{
my $val=$self->{xml}->{globalSetting}->{$key}->{property}->
@@ -401,7 +402,7 @@ sub buildAffinity
{
$proc = -1;
$node = -1;
-
+
$self->{targeting}{SYS}[0]{KEY} = $target;
$self->setAttribute($target, "AFFINITY_PATH", "affinity:sys-0");
$self->setAttribute($target, "PHYS_PATH", "physical:sys-0");
@@ -444,7 +445,7 @@ sub buildAffinity
$self->{NUM_PROCS_PER_NODE} = $proc + 1;
$self->{targeting}->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{KEY} =
$target;
-
+
$self->setHuid($target, 0, $node);
my $socket = $self->getTargetParent(
$self->getTargetParent($target));
@@ -476,7 +477,7 @@ sub buildAffinity
## don't want non-hostboot targets
if ($unit_type_id > 0)
{
-
+
push(@{$self->{targeting}
->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{$unit_type}},
{ 'KEY' => $unit });
@@ -491,7 +492,7 @@ sub buildAffinity
$self->setHuid($unit, 0, $node);
if ($unit_type eq "OCC")
{
- $self->setAttribute($unit, "ENTITY_INSTANCE",$proc);
+ $self->setAttribute($unit, "ENTITY_INSTANCE",$proc);
}
## export core
if ($unit_type eq "EX")
@@ -532,7 +533,7 @@ sub buildAffinity
{
$self->processMcs($unit, $node, $proc, $parent_affinity,
$parent_physical, $node_phys);
-
+
}
}
}
@@ -612,9 +613,9 @@ sub processMcs
$self->{targeting}
->{SYS}[0]{NODES}[$node]{PROCS}[$proc]{MCSS}[$mcs] {MEMBUFS}[0]{KEY} =
$membuf;
-
+
$self->setAttribute($membuf, "ENTITY_INSTANCE",
- $self->{membuf_inst_num});
+ $self->{membuf_inst_num});
$self->{membuf_inst_num}++;
## get the mbas
foreach my $child (@{ $self->{data}->{TARGETS}{$membuf}{CHILDREN} })
@@ -631,7 +632,7 @@ sub processMcs
$node_phys . "/membuf-$membufnum/l4-0");
$self->setHuid($child, 0, $node);
}
-
+
if ($self->getType($child) eq "MBA")
{
my $mba = $self->getAttribute($child,"MBA_NUM");
@@ -673,9 +674,10 @@ sub processMcs
$self->setHuid($dimm, 0, $node);
$self->{targeting}
->{SYS}[0]{NODES}[$node]{PROCS}[$proc] {MCSS}[$mcs]
- {MEMBUFS}[0]{MBAS}[$mba] {DIMMS}[$affinitypos]{KEY} = $dimm;
+ {MEMBUFS}[0]{MBAS}[$mba] {DIMMS}[$affinitypos]{KEY} =
+ $dimm;
$self->setAttribute($dimm, "ENTITY_INSTANCE",
- $self->{dimm_tpos});
+ $self->{dimm_tpos});
$self->{dimm_tpos}++;
$affinitypos++;
}
diff --git a/scripts/processMrw.pl b/scripts/processMrw.pl
index 09f0789..6b685db 100644
--- a/scripts/processMrw.pl
+++ b/scripts/processMrw.pl
@@ -84,7 +84,7 @@ foreach my $target (sort keys %{ $targetObj->getAllTargets() })
if ($type eq "SYS")
{
processSystem($targetObj, $target);
- }
+ }
elsif ($type eq "PROC")
{
processProcessor($targetObj, $target);
@@ -141,7 +141,7 @@ if ($report)
{
my $report_file = $xmldir . "/" . $targetObj->getSystemName() . ".rpt";
open(SUM,">$report_file") || die "Unable to create: $report_file\n";
- my $ref = $targetObj->{targeting}->{SYS}[0]{NODES}[0]{PROCS};
+ my $ref = $targetObj->{targeting}->{SYS}[0]{NODES}[0]{PROCS};
foreach my $proc (@{$ref})
{
foreach my $mcs (@{$proc->{MCSS}})
@@ -149,7 +149,7 @@ if ($report)
my $mcs_target = $mcs->{KEY};
my $membuf=$mcs->{MEMBUFS}[0];
my $membuf_target = $membuf->{KEY};
-
+
my $sch = $targetObj->getAttribute($mcs_target,
"SCHEMATIC_INTERFACE");
my $aff = $targetObj->getAttribute($mcs_target,"AFFINITY_PATH");
@@ -158,7 +158,7 @@ if ($report)
if ($membuf_target ne "") {
foreach my $mba (@{$membuf->{MBAS}}) {
my $mba_target = $mba->{KEY};
-
+
$huid = $targetObj->getAttribute($mba_target,"HUID");
$aff = $targetObj->getAttribute($mcs_target,
"AFFINITY_PATH");
@@ -177,7 +177,7 @@ if ($report)
my $sens = $targetObj->getAttribute($dimm_target,
"IPMI_SENSORS");
my @s = split(/\,/,$sens);
-
+
print SUM "\t\t$huid | $dimm_target".
" | $aff | $p | $d | $i2c | ".
"$s[0],$s[1] | $s[2],$s[3]\n";
@@ -294,7 +294,7 @@ sub processProcessor
$targetObj->getTargetParent($targetObj->getTargetParent($target));
$targetObj->copyAttribute($socket_target,$target,"LOCATION_CODE");
$targetObj->copyAttribute($socket_target,$target,"FRU_ID");
-
+
foreach my $attr (sort (keys
%{ $targetObj->getTarget($socket_target)->{TARGET}->{attribute} }))
@@ -476,7 +476,7 @@ sub setupBars
my $b=sprintf("0x%016X",
$i_base+$i_node_offset*$node+$i_proc_offset*$proc+$i_offset*$i);
my $sep=",";
- if ($i==$num-1)
+ if ($i==$num-1)
{
$sep="";
}
@@ -507,7 +507,7 @@ sub processMcs
my $i_offset = Math::BigInt->new($offset);
my $mcs = $targetObj->getAttribute($target, "MCS_NUM");
- my $mcsStr=sprintf("0x%016X",
+ my $mcsStr=sprintf("0x%016X",
$i_base+$i_node_offset*$node+$i_proc_offset*$proc+$i_offset*$mcs);
$targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr);
}
@@ -524,7 +524,7 @@ sub processXbus
my $target = shift;
# $targetObj->setAttribute($target, "PEER_TARGET","");
-
+
}
#--------------------------------------------------
@@ -542,7 +542,7 @@ sub processAbus
$targetObj->setAttribute($target, "EI_BUS_TX_LANE_INVERT","0");
$targetObj->setAttribute($target, "EI_BUS_TX_MSBSWAP","0");
# $targetObj->setAttribute($target, "PEER_TARGET","");
-
+
my $abus_child_conn = $targetObj->getFirstConnectionDestination($target);
if ($abus_child_conn ne "")
{
@@ -732,12 +732,14 @@ sub processPcie
{
for (my $lane=0;$lane<16;$lane++)
{
- $equalization[$phb_num][$lane]=$eqs[$e+1].",".$eqs[$e+2];
- }
+ $equalization[$phb_num][$lane]=
+ $eqs[$e+1].",".$eqs[$e+2];
+ }
}
else
{
- $equalization[$phb_num][$eqs[$e]] = $eqs[$e+1].",".$eqs[$e+2];
+ $equalization[$phb_num][$eqs[$e]] =
+ $eqs[$e+1].",".$eqs[$e+2];
}
}
substr($phb_config, $phb_num, 1, "1");
@@ -831,7 +833,7 @@ sub processMembufVpdAssociation
{
my $targetObj = shift;
my $target = shift;
-
+
my $vpds=$targetObj->findConnections($target,"I2C","VPD");
if ($vpds ne "" ) {
my $vpd = $vpds->{CONN}->[0];
@@ -844,7 +846,7 @@ sub processMembufVpdAssociation
setEepromAttributes($targetObj,
"EEPROM_VPD_PRIMARY_INFO",$membuf_target,$vpd);
setEepromAttributes($targetObj,
- "EEPROM_VPD_FRU_INFO",$membuf_target,$vpd,"0++");
+ "EEPROM_VPD_FRU_INFO",$membuf_target,$vpd,"0++");
my $index = $targetObj->getBusAttribute($membuf_assoc->{SOURCE},
$membuf_assoc->{BUS_NUM}, "ISDIMM_MBVPD_INDEX");
$targetObj->setAttribute(
@@ -865,8 +867,8 @@ sub processMembuf
{
my $targetObj = shift;
my $target = shift;
- if ($targetObj->isBadAttribute($target, "PHYS_PATH", ""))
- {
+ if ($targetObj->isBadAttribute($target, "PHYS_PATH", ""))
+ {
##dmi is probably not connected. will get caught in error checking
return;
}
@@ -910,15 +912,15 @@ sub processMembuf
$dimm->{SOURCE},"MBA_PORT");
my $dimm_num = $targetObj->getAttribute(
$dimm->{SOURCE},"MBA_DIMM");
-
+
my $map = oct("0b".$mba_num.$port_num.$dimm_num);
$dimm_portmap{$dimm->{DEST_PARENT}} = $map;
}
}
}
}
-
-
+
+
## Process MEMBUF to DIMM I2C connections
my @addr_map=('0','0','0','0','0','0','0','0');
my $dimms=$targetObj->findConnections($target,"I2C","SPD");
@@ -934,7 +936,7 @@ sub processMembuf
my $field=getI2cMapField($targetObj,$dimm_target,$dimm);
my $map = $dimm_portmap{$dimm_target};
- if ($map eq "") {
+ if ($map eq "") {
print "ERROR: $dimm_target doesn't map to a dimm/port\n";
$targetObj->myExit(3);
}
@@ -955,7 +957,7 @@ sub processMembuf
foreach my $ddr (@{$ddrs->{CONN}}) {
my $mba=$ddr->{SOURCE};
my $dimm=$ddr->{DEST_PARENT};
- my ($dimmnum,$port)=split(//,sprintf("%02b\n",$portmap{$mba}));
+ my ($dimmnum,$port)=split(//,sprintf("%02b\n",$portmap{$mba}));
$targetObj->setAttribute($dimm, "MBA_DIMM",$dimmnum);
$targetObj->setAttribute($dimm, "MBA_PORT",$port);
$portmap{$mba}++;
@@ -977,7 +979,7 @@ sub getI2cMapField
my $engine = $targetObj->getAttribute($conn_target->{SOURCE}, "I2C_ENGINE");
my $addr = $targetObj->getBusAttribute($conn_target->{SOURCE},
$conn_target->{BUS_NUM}, "I2C_ADDRESS");
-
+
my $bits=sprintf("%08b",hex($addr));
my $field=sprintf("%d%3s",oct($port),substr($bits,4,3));
my $hexfield = sprintf("%X",oct("0b$field"));
@@ -1036,7 +1038,7 @@ sub setGpioAttributes
my $engine = $targetObj->getAttribute($conn_target->{SOURCE}, "I2C_ENGINE");
my $addr = $targetObj->getBusAttribute($conn_target->{SOURCE},
$conn_target->{BUS_NUM}, "I2C_ADDRESS");
- my $path = $targetObj->getAttribute($conn_target->{SOURCE_PARENT},
+ my $path = $targetObj->getAttribute($conn_target->{SOURCE_PARENT},
"PHYS_PATH");
OpenPOWER on IntegriCloud