summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorayma <ayma@us.ibm.com>2012-09-25 18:02:05 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-01 09:51:20 -0500
commit5c6c304a4e1e8e4b04430b84aba2dd31c0e0f49c (patch)
treebda9d26cab250564f0b1b75671796945d4fb6f48 /src/usr
parentb1e6ad7f6c2b921f4c52354facf1b804326d5573 (diff)
downloadtalos-hostboot-5c6c304a4e1e8e4b04430b84aba2dd31c0e0f49c.tar.gz
talos-hostboot-5c6c304a4e1e8e4b04430b84aba2dd31c0e0f49c.zip
add attributes and target types for the pnor device to add it to targeting files
RTC:47730 Change-Id: Iecd2f5e123356a7e01921c41fd6327618b5f3043 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1881 Tested-by: Jenkins Server Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwas/common/hwas.C7
-rw-r--r--src/usr/targeting/common/entitypath.C4
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml3
-rwxr-xr-xsrc/usr/targeting/xmltohb/genHwsvMrwXml.pl129
4 files changed, 138 insertions, 5 deletions
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C
index 868a3f19c..a89bd4bc7 100644
--- a/src/usr/hwas/common/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -128,13 +128,10 @@ errlHndl_t discoverTargets()
pEnc->getAttr<ATTR_HUID>(), pEnc);
} // for pEnc_it
- // find TYPE_PROC, TYPE_MEMBUF and TYPE_DIMM
- PredicateCTM predProc(CLASS_CHIP, TYPE_PROC);
- PredicateCTM predMembuf(CLASS_CHIP, TYPE_MEMBUF);
- PredicateCTM predFSP(CLASS_CHIP, TYPE_FSP);
+ PredicateCTM predChip(CLASS_CHIP);
PredicateCTM predDimm(CLASS_LOGICAL_CARD, TYPE_DIMM);
PredicatePostfixExpr checkExpr;
- checkExpr.push(&predProc).push(&predMembuf).Or().push(&predDimm).Or().push(&predFSP).Or();
+ checkExpr.push(&predChip).push(&predDimm).Or();
TargetHandleList pCheckPres;
targetService().getAssociated( pCheckPres, pSys,
diff --git a/src/usr/targeting/common/entitypath.C b/src/usr/targeting/common/entitypath.C
index 53023e4f6..7a8dadb1a 100644
--- a/src/usr/targeting/common/entitypath.C
+++ b/src/usr/targeting/common/entitypath.C
@@ -358,6 +358,10 @@ const char* EntityPath::pathElementTypeAsString(
return "PSI";
case TYPE_FSP:
return "FSP";
+ case TYPE_PNOR:
+ return "PNOR";
+ case TYPE_NA:
+ return "NA";
// case TYPE_FSI_LINK:
// return "FSI-link";
// case TYPE_CFAM:
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 862e35cdb..9f2468f2d 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -168,6 +168,9 @@
<name>FSP</name>
</enumerator>
<enumerator>
+ <name>PNOR</name>
+ </enumerator>
+ <enumerator>
<name>LAST_IN_RANGE</name>
</enumerator>
<default>NA</default>
diff --git a/src/usr/targeting/xmltohb/genHwsvMrwXml.pl b/src/usr/targeting/xmltohb/genHwsvMrwXml.pl
index 444729209..502935927 100755
--- a/src/usr/targeting/xmltohb/genHwsvMrwXml.pl
+++ b/src/usr/targeting/xmltohb/genHwsvMrwXml.pl
@@ -98,6 +98,36 @@ foreach my $i (@{$powerbus->{'power-bus'}})
push @pbus, [ lc($endp2), lc($endp1) ];
}
+open (FH, "<$mrwdir/${sysname}-lpc2spi.xml") ||
+ die "ERROR: unable to open $mrwdir/${sysname}-lpc2spi.xml\n";
+close (FH);
+
+my $pnorPath = XMLin("$mrwdir/${sysname}-lpc2spi.xml",forcearray=>['proc-to-pnor-connection']);
+
+# Capture all pnor attributes into the @pnorBlock array
+use constant PNOR_MTD_CHAR_FIELD => 0;
+use constant PNOR_BLOCK_DEV_FIELD => 1;
+use constant PNOR_POS_FIELD => 2;
+use constant PNOR_NODE_FIELD => 3;
+use constant PNOR_PROC_FIELD => 4;
+
+my @unsortedPnorTargets;
+foreach my $i (@{$pnorPath->{'proc-to-pnor-connection'}})
+{
+ my $mtdCharDev = $i->{'lpc2spi'}->{'fsp-dev-paths'}->{'fsp-dev-path'}->{'character-dev-path'};
+ my $mtdBlockDev = $i->{'lpc2spi'}->{'fsp-dev-paths'}->{'fsp-dev-path'}->{'block-dev-path'};
+
+ my $pnorPosition = $i->{'flash'}->{'target'}->{'position'};
+ my $nodePosition = $i->{'flash'}->{'target'}->{'node'};
+
+ my $procPosition = $i->{'processor'}->{'target'}->{'position'};
+
+ push (@unsortedPnorTargets,[$mtdCharDev, $mtdBlockDev, $pnorPosition, $nodePosition, $procPosition]);
+
+}
+
+my @SortedPnor = sort byPnorNodePos @unsortedPnorTargets;
+
open (FH, "<$mrwdir/${sysname}-cec-chips.xml") ||
die "ERROR: unable to open $mrwdir/${sysname}-cec-chips.xml\n";
close (FH);
@@ -469,6 +499,17 @@ for my $i ( 0 .. $#SMembuses )
}
}
+if ($build eq "fsp")
+{
+ print "\n<!--$SYSNAME PNOR -->\n";
+ for my $i (0 .. $#SortedPnor)
+ {
+ generate_pnor($sys,$SortedPnor[$i][PNOR_NODE_FIELD],$SortedPnor[$i][PNOR_POS_FIELD],$SortedPnor[$i][PNOR_MTD_CHAR_FIELD],$SortedPnor[$i][PNOR_BLOCK_DEV_FIELD],
+ $SortedPnor[$i][PNOR_PROC_FIELD],$i);
+
+ }
+}
+
print "\n</attributes>\n";
# All done!
@@ -506,6 +547,37 @@ sub byDimmInstancePath ($$)
return int($lhsInstance) <=> int($rhsInstance);
}
+################################################################################
+# Compares two PNOR instances based on the node and position #
+################################################################################
+sub byPnorNodePos($$)
+{
+ my $retVal = -1;
+
+ my $lhsInstance_node = $_[0][PNOR_NODE_FIELD];
+ my $rhsInstance_node = $_[1][PNOR_NODE_FIELD];
+ if(int($lhsInstance_node) eq int($rhsInstance_node))
+ {
+ my $lhsInstance_pos = $_[0][PNOR_POS_FIELD];
+ my $rhsInstance_pos = $_[1][PNOR_POS_FIELD];
+ if(int($lhsInstance_pos) eq int($rhsInstance_pos))
+ {
+ die "ERROR: Duplicate pnor positions: 2 pnors with same
+ node and position, \
+ NODE: $lhsInstance_node POSITION: $lhsInstance_pos\n";
+ }
+ elsif(int($lhsInstance_pos) > int($rhsInstance_pos))
+ {
+ $retVal = 1;
+ }
+ }
+ elsif(int($lhsInstance_node) > int($rhsInstance_node))
+ {
+ $retVal = 1;
+ }
+ return $retVal;
+}
+
sub generate_sys
{
my $proc_refclk = $policy->{'required-policy-settings'}->{'processor-refclock-frequency'}->{content};
@@ -1456,6 +1528,63 @@ sub generate_dimm
print "\n</targetInstance>\n";
}
+sub generate_pnor
+{
+ my ($sys, $node, $pnor, $charPath, $blockPath,$proc,$count) = @_;
+
+# @TODO via RTC: 48523
+# Will need to compute the HUID using the workbook info to determine max # parts per node
+ my $uidstr = sprintf("0x%02X13%04X",${node},$pnor+${node}*2);
+
+# @TODO via RTC: 37573
+# Will need to re-evaluate how to compute the PNOR RID value once
+# the new system comes out. Currently the 0x800 RID value is only
+# for the TULETA system
+ print "
+<targetInstance>
+ <id>sys${sys}node${node}pnor${pnor}</id>
+ <type>chip-pnor-power8</type>
+ <attribute><id>HUID</id><default>${uidstr}</default></attribute>
+ <attribute><id>ORDINAL_ID</id><default>$count</default></attribute>
+ <attribute>
+ <id>POSITION</id>
+ <default>$pnor</default>
+ </attribute>
+ <attribute>
+ <id>PHYS_PATH</id>
+ <default>physical:sys-$sys/node-$node/pnor-$pnor</default>
+ </attribute>
+ <attribute>
+ <id>AFFINITY_PATH</id>
+ <default>affinity:sys-$sys/node-$node/proc-$proc/pnor-$pnor</default>
+ </attribute>
+ <attribute>
+ <id>PRIMARY_CAPABILITIES</id>
+ <default>
+ <field><id>supportsFsiScom</id><value>0</value></field>
+ <field><id>supportsXscom</id><value>0</value></field>
+ <field><id>supportsInbandScom</id><value>0</value></field>
+ <field><id>reserved</id><value>0</value></field>
+ </default>
+ </attribute>
+ <attribute>
+ <id>RID</id>
+ <default>0x800</default>
+ </attribute>
+ <attribute>
+ <id>FSP_A_MTD_DEVICE_PATH</id>
+ <default>$charPath</default>
+ </attribute>
+ <attribute>
+ <id>FSP_A_MTDBLOCK_DEVICE_PATH</id>
+ <default>$blockPath</default>
+ </attribute>";
+
+
+ print "\n</targetInstance>\n";
+}
+
+
sub display_help
{
use File::Basename;
OpenPOWER on IntegriCloud