From 5c6c304a4e1e8e4b04430b84aba2dd31c0e0f49c Mon Sep 17 00:00:00 2001 From: ayma Date: Tue, 25 Sep 2012 18:02:05 -0500 Subject: 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 Reviewed-by: A. Patrick Williams III --- src/usr/hwas/common/hwas.C | 7 +- src/usr/targeting/common/entitypath.C | 4 + .../targeting/common/xmltohb/attribute_types.xml | 3 + src/usr/targeting/xmltohb/genHwsvMrwXml.pl | 129 +++++++++++++++++++++ 4 files changed, 138 insertions(+), 5 deletions(-) (limited to 'src') 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(), 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 @@ -167,6 +167,9 @@ FSP + + PNOR + LAST_IN_RANGE 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\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\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\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 " + + sys${sys}node${node}pnor${pnor} + chip-pnor-power8 + HUID${uidstr} + ORDINAL_ID$count + + POSITION + $pnor + + + PHYS_PATH + physical:sys-$sys/node-$node/pnor-$pnor + + + AFFINITY_PATH + affinity:sys-$sys/node-$node/proc-$proc/pnor-$pnor + + + PRIMARY_CAPABILITIES + + supportsFsiScom0 + supportsXscom0 + supportsInbandScom0 + reserved0 + + + + RID + 0x800 + + + FSP_A_MTD_DEVICE_PATH + $charPath + + + FSP_A_MTDBLOCK_DEVICE_PATH + $blockPath + "; + + + print "\n\n"; +} + + sub display_help { use File::Basename; -- cgit v1.2.1