From e56b8dd2a3574d107ae91d8aa9927123b0f0993c Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 31 Mar 2014 12:21:39 -0500 Subject: Pull alternate FSI data from MRW Change-Id: I11d8eef010464f2023dd2b19d20db66ee5290676 RTC: 35041 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/10009 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/targeting/common/genHwsvMrwXml.pl | 395 ++++++++++++++++----- .../targeting/common/xmltohb/attribute_types.xml | 8 +- src/usr/targeting/targetservicestart.C | 11 +- 3 files changed, 327 insertions(+), 87 deletions(-) (limited to 'src/usr/targeting') diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index a2b9fee46..fd07be2e8 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -685,15 +685,6 @@ foreach my $i (@{$eTargets->{target}}) my $fsi_busses_file = open_mrw_file($mrwdir, "${sysname}-fsi-busses.xml"); my $fsiBus = XMLin($fsi_busses_file); -# Capture all FSI connections into the @Fsis array -# Save the FSP node id -use constant FSI_TYPE_FIELD => 0; -use constant FSI_LINK_FIELD => 1; -use constant FSI_TARGET_FIELD => 2; -use constant FSI_MASTER_FIELD => 3; -use constant FSI_TARGET_TYPE => 4; -my @Fsis; - # Build all the FSP chip targets / attributes my %FSPs = (); foreach my $fsiBus (@{$fsiBus->{'fsi-bus'}}) @@ -718,14 +709,89 @@ foreach my $fsiBus (@{$fsiBus->{'fsi-bus'}}) 'rid' => $rid, }; } +} + +# Build up FSI paths +# Capture all FSI connections into the @Fsis array +my @Fsis; +use constant FSI_TYPE_FIELD => 0; +use constant FSI_LINK_FIELD => 1; +use constant FSI_TARGET_FIELD => 2; +use constant FSI_MASTERNODE_FIELD => 3; +use constant FSI_MASTERPOS_FIELD => 4; +use constant FSI_TARGET_TYPE_FIELD => 5; +use constant FSI_SLAVE_PORT_FIELD => 6; +#Master procs have FSP as their master +# +# +# FSP Master +# BRAZOS_FSP2 +# FSIM_CLK[23] +# fsp41 +# 0 +# 23 +# +# +# VENICE +# FSI_SLAVE0 +# pu31 +# 0 +# +# +#Non-master chips have a MURANO/VENICE as their master +# +# +# VENICE +# FSI_CASCADE3 +# pu00 +# 12 +# 3 +# Cascaded Master +# +# +# CENTAUR +# FSI_SLAVE0 +# memb00 +# L02C0E12:L3C0 +# 0 +# +# +foreach my $fsiBus (@{$fsiBus->{'fsi-bus'}}) +{ + #skip slaves that we don't care about + if( !($fsiBus->{'slave'}->{'target'}->{'name'} eq "pu") + && !($fsiBus->{'slave'}->{'target'}->{'name'} eq "memb") ) + { + next; + } - push @Fsis, [ $fsiBus->{master}->{type}, $fsiBus->{master}->{link}, + push @Fsis, [ + #TYPE :: 'fsp master','hub master','cascaded master' + $fsiBus->{'master'}->{'type'}, + #LINK :: coming out of master + $fsiBus->{'master'}->{'link'}, + #TARGET :: Slave chip "n$fsiBus->{slave}->{target}->{node}:" . "p$fsiBus->{slave}->{target}->{position}", - "n$fsiBus->{master}->{target}->{node}:" - . "p$fsiBus->{master}->{target}->{position}", - $fsiBus->{slave}->{target}->{name} ]; -} + #MASTERNODE :: Master chip node + "$fsiBus->{master}->{target}->{node}", + #MASTERPOS :: Master chip position + "$fsiBus->{master}->{target}->{position}", + #TARGET_TYPE :: Slave chip type 'pu','memb' + $fsiBus->{'slave'}->{'target'}->{'name'}, + #SLAVE_PORT :: mproc->'fsi_slave0',altmproc->'fsi_slave1' + $fsiBus->{'slave'}->{'unit-id'} + ]; + + #print "\nTARGET=$Fsis[$#Fsis][FSI_TARGET_FIELD]\n"; + #print "TYPE=$Fsis[$#Fsis][FSI_TYPE_FIELD]\n"; + #print "LINK=$Fsis[$#Fsis][FSI_LINK_FIELD]\n"; + #print "MASTERNODE=$Fsis[$#Fsis][FSI_MASTERNODE_FIELD]\n"; + #print "MASTERPOS=$Fsis[$#Fsis][FSI_MASTERPOS_FIELD]\n"; + #print "TARGET_TYPE=$Fsis[$#Fsis][FSI_TARGET_TYPE_FIELD]\n"; + #print "SLAVE_PORT=$Fsis[$#Fsis][FSI_SLAVE_PORT_FIELD]\n"; +} +#print "Fsis = $#Fsis\n"; #------------------------------------------------------------------------------ # Process the psi-busses MRW file @@ -762,11 +828,10 @@ use constant MCS_TARGET_FIELD => 0; use constant CENTAUR_TARGET_FIELD => 1; use constant DIMM_TARGET_FIELD => 2; use constant DIMM_PATH_FIELD => 3; -use constant CFSI_LINK_FIELD => 4; -use constant BUS_NODE_FIELD => 5; -use constant BUS_POS_FIELD => 6; -use constant BUS_ORDINAL_FIELD => 7; -use constant DIMM_POS_FIELD => 8; +use constant BUS_NODE_FIELD => 4; +use constant BUS_POS_FIELD => 5; +use constant BUS_ORDINAL_FIELD => 6; +use constant DIMM_POS_FIELD => 7; use constant CDIMM_RID_NODE_MULTIPLIER => 32; @@ -779,7 +844,7 @@ foreach my $i (@{$memBus->{'memory-bus'}}) "n$i->{mba}->{target}->{node}:p$i->{mba}->{target}->{position}:mba" . $i->{mba}->{target}->{chipUnit}, "n$i->{dimm}->{target}->{node}:p$i->{dimm}->{target}->{position}", - $i->{dimm}->{'instance-path'}, $i->{'fsi-link'}, + $i->{dimm}->{'instance-path'}, $i->{mcs}->{target}->{node}, $i->{mcs}->{target}->{position}, 0, $i->{dimm}->{'instance-path'} ]; @@ -945,7 +1010,8 @@ my $sys = 0; generate_sys(); my $node = 0; -my $Mproc = 0; +my @mprocs; +my $altMproc = 0; my $fru_id = 0; my @fru_paths; my $hasProc = 0; @@ -957,7 +1023,6 @@ for (my $curnode = 0; $curnode <= $MAXNODE; $curnode++) { $node = $curnode; -$hasProc = 0; # find master proc of this node for my $i ( 0 .. $#Fsis ) @@ -965,13 +1030,11 @@ for my $i ( 0 .. $#Fsis ) my $nodeId = lc($Fsis[$i][FSI_TARGET_FIELD]); $nodeId =~ s/.*n(.*):.*$/$1/; if ((lc($Fsis[$i][FSI_TYPE_FIELD]) eq "fsp master") && - (($Fsis[$i][FSI_TARGET_TYPE]) eq "pu") && + (($Fsis[$i][FSI_TARGET_TYPE_FIELD]) eq "pu") && ($nodeId eq $node)) { - $Mproc = $Fsis[$i][FSI_TARGET_FIELD]; - $Mproc =~ s/.*p(.*)/$1/; - $hasProc = 1; - last; + push @mprocs, $Fsis[$i][FSI_TARGET_FIELD]; + #print "Mproc = $Fsis[$i][FSI_TARGET_FIELD]\n"; } } @@ -989,7 +1052,8 @@ foreach my $fsp ( keys %FSPs ) } } -if ($hasProc == 0) +# Node has no master processor, maybe it is just a control node? +if ($#mprocs < 0) { next; } @@ -1088,28 +1152,45 @@ for (my $do_core = 0, my $i = 0; $i <= $#STargets; $i++) push @fru_paths, [ $fru_path, $fru_id ]; } } - if ($proc eq $Mproc) + + my @fsi; + for (my $j = 0; $j <= $#Fsis; $j++) { - generate_proc($proc, $ipath, $lognode, $logid, - $proc_ordinal_id, 1, 0, 0,$fru_id,$hwTopology); + if (($Fsis[$j][FSI_TARGET_FIELD] eq "n${node}:p$proc") && + ($Fsis[$j][FSI_TARGET_TYPE_FIELD] eq "pu") && + (lc($Fsis[$j][FSI_SLAVE_PORT_FIELD]) eq "fsi_slave0") && + (lc($Fsis[$j][FSI_TYPE_FIELD]) eq "hub master") ) + { + @fsi = @{@Fsis[$j]}; + last; + } } - else + + my @altfsi; + for (my $j = 0; $j <= $#Fsis; $j++) { - my $fsi; - for (my $j = 0; $j <= $#Fsis; $j++) + if (($Fsis[$j][FSI_TARGET_FIELD] eq "n${node}:p$proc") && + ($Fsis[$j][FSI_TARGET_TYPE_FIELD] eq "pu") && + (lc($Fsis[$j][FSI_SLAVE_PORT_FIELD]) eq "fsi_slave1") && + (lc($Fsis[$j][FSI_TYPE_FIELD]) eq "hub master") ) { - if (($Fsis[$j][FSI_TARGET_FIELD] eq "n${node}:p$proc") && - ($Fsis[$j][FSI_TARGET_TYPE] eq "pu") && - ($Fsis[$j][FSI_MASTER_FIELD] eq "n${node}:p$Mproc")) - { - $fsi = $Fsis[$j][FSI_LINK_FIELD]; - last; - } + @altfsi = @{@Fsis[$j]}; + last; } - generate_proc($proc, $ipath, $lognode, $logid, - $proc_ordinal_id, 0, 1, $fsi,$fru_id,$hwTopology); } + my $is_master = 0; + foreach my $m (@mprocs) + { + if ($m eq "n${node}:p$proc") + { + $is_master = 1; + } + } + + generate_proc($proc, $is_master, $ipath, $lognode, $logid, + $proc_ordinal_id, \@fsi, \@altfsi, $fru_id, $hwTopology); + # call to do any fsp per-proc targets (ie, occ, psi) do_plugin('fsp_proc_targets', $proc, $i, $proc_ordinal_id, $STargets[$i][NODE_FIELD], $STargets[$i][POS_FIELD]); @@ -1198,7 +1279,6 @@ for my $i ( 0 .. $#STargets ) if ($mba eq $centaur) { $membMcs = $Membuses[$j][MCS_TARGET_FIELD]; - $cfsi = $Membuses[$j][CFSI_LINK_FIELD]; $found = 1; last; } @@ -1208,6 +1288,32 @@ for my $i ( 0 .. $#STargets ) die "ERROR. Can't locate Centaur from memory bus table\n"; } + my @fsi; + for (my $j = 0; $j <= $#Fsis; $j++) + { + if (($Fsis[$j][FSI_TARGET_FIELD] eq "n${node}:p${memb}") && + ($Fsis[$j][FSI_TARGET_TYPE_FIELD] eq "memb") && + (lc($Fsis[$j][FSI_SLAVE_PORT_FIELD]) eq "fsi_slave0") && + (lc($Fsis[$j][FSI_TYPE_FIELD]) eq "cascaded master") ) + { + @fsi = @{@Fsis[$j]}; + last; + } + } + + my @altfsi; + for (my $j = 0; $j <= $#Fsis; $j++) + { + if (($Fsis[$j][FSI_TARGET_FIELD] eq "n${node}:p${memb}") && + ($Fsis[$j][FSI_TARGET_TYPE_FIELD] eq "memb") && + (lc($Fsis[$j][FSI_SLAVE_PORT_FIELD]) eq "fsi_slave1") && + (lc($Fsis[$j][FSI_TYPE_FIELD]) eq "cascaded master") ) + { + @altfsi = @{@Fsis[$j]}; + last; + } + } + my $relativeCentaurRid = $STargets[$i][PLUG_POS] + (CDIMM_RID_NODE_MULTIPLIER * $STargets[$i][NODE_FIELD]); @@ -1219,9 +1325,9 @@ for my $i ( 0 .. $#STargets ) my $vmem_id=$SortedVmem[$vmem_count][VMEM_ID_FIELD]; $vmem_count++; - generate_centaur( $memb, $membMcs, $cfsi, $ipath, - $STargets[$i][ORDINAL_FIELD],$relativeCentaurRid, - $vmem_id, $vmemDevPath, $vmemAddr, $ipath); + generate_centaur( $memb, $membMcs, \@fsi, \@altfsi, $ipath, + $STargets[$i][ORDINAL_FIELD],$relativeCentaurRid, + $vmem_id, $vmemDevPath, $vmemAddr, $ipath); } elsif ($STargets[$i][NAME_FIELD] eq "mba") { @@ -1837,8 +1943,11 @@ sub generate_system_node sub generate_proc { - my ($proc, $ipath, $lognode, $logid, $ordinalId, $master, $slave, $fsi, - $fruid,$hwTopology) = @_; + my ($proc, $is_master, $ipath, $lognode, $logid, $ordinalId, + $fsiA, $altfsiA, + $fruid, $hwTopology) = @_; + my @fsi = @{$fsiA}; + my @altfsi = @{$altfsiA}; my $uidstr = sprintf("0x%02X05%04X",${node},${proc}); my $vpdnum = ${proc}; my $position = ${proc}; @@ -1885,8 +1994,8 @@ sub generate_proc POSITION${position} SCOM_SWITCHES - useFsiScom$slave - useXscom$master + useFsiScom1 + useXscom0 useInbandScom0 reserved0 @@ -1924,33 +2033,54 @@ sub generate_proc $dcm_installed "; - if ($master) + ## Master value ## + if( $is_master ) { print " - PROC_MASTER_TYPE - ACTING_MASTER + MASTER_CANDIDATE "; - } - if ($slave) + else { print " - - - FSI_MASTER_CHIP - physical:sys-$sys/node-$node/proc-$Mproc - + PROC_MASTER_TYPE + NOT_MASTER + "; + } + + ## Setup FSI Attributes ## + if( ($#fsi <= 0) && ($#altfsi <= 0) ) + { + print " + FSI_MASTER_TYPE - MFSI - + NO_MASTER + "; + } + else + { + print " + - FSI_MASTER_PORT - $fsi - + FSI_MASTER_TYPE + MFSI + "; + } + + # if a proc is sometimes the master then it + # will have flipped ports + my $flipport = 0; + if( $is_master ) + { + $flipport = 1; + } + + # these values are common for both fsi ports + print " FSI_SLAVE_CASCADE 0 @@ -1958,22 +2088,72 @@ sub generate_proc FSI_OPTION_FLAGS - flipPort0 + flipPort$flipport reserved0 "; - #TODO RTC:35041 -- Parse out alternate FSI paths + + if( $#fsi <= 0 ) + { print " + - ALTFSI_MASTER_CHIP - physical:sys + FSI_MASTER_CHIP + physical:sys - ALTFSI_MASTER_PORT - 0xFF + FSI_MASTER_PORT + 0xFF "; + } + else + { + my $mNode = $fsi[FSI_MASTERNODE_FIELD]; + my $mPos = $fsi[FSI_MASTERPOS_FIELD]; + my $link = $fsi[FSI_LINK_FIELD]; + print " + + + FSI_MASTER_CHIP + physical:sys-$sys/node-$mNode/proc-$mPos + + + FSI_MASTER_PORT + $link + "; + } + if( $#altfsi <= 0 ) + { + print " + + + ALTFSI_MASTER_CHIP + physical:sys + + + ALTFSI_MASTER_PORT + 0xFF + \n"; } + else + { + my $mNode = $altfsi[FSI_MASTERNODE_FIELD]; + my $mPos = $altfsi[FSI_MASTERPOS_FIELD]; + my $link = $altfsi[FSI_LINK_FIELD]; + print " + + + ALTFSI_MASTER_CHIP + physical:sys-$sys/node-$mNode/proc-$mPos + + + ALTFSI_MASTER_PORT + $link + \n"; + } + print " \n"; + ## End FSI ## # add EEPROM attributes addEeproms($sys, $node, $proc); @@ -2816,8 +2996,10 @@ sub generate_logicalDimms sub generate_centaur { - my ($ctaur, $mcs, $cfsi, $ipath, $ordinalId, $relativeCentaurRid, + my ($ctaur, $mcs, $fsiA, $altfsiA, $ipath, $ordinalId, $relativeCentaurRid, $vmemId, $vmemDevPath, $vmemAddr, $ipath) = @_; + my @fsi = @{$fsiA}; + my @altfsi = @{$altfsiA}; my $scompath = $devpath->{chip}->{$ipath}->{'scom-path'}; my $scanpath = $devpath->{chip}->{$ipath}->{'scan-path'}; my $scomsize = length($scompath) + 1; @@ -2881,21 +3063,20 @@ sub generate_centaur EI_BUS_TX_MSBSWAP $msb_swap - + "; - - - FSI_MASTER_CHIP - physical:sys-$sys/node-$node/proc-$proc - + # FSI Connections # + if( $#fsi <= 0 ) + { + die "\n*** No valid FSI link found for Centaur $ctaur ***\n"; + } + + print "\n + FSI_MASTER_TYPE CMFSI - - FSI_MASTER_PORT - $cfsi - FSI_SLAVE_CASCADE 0 @@ -2906,7 +3087,55 @@ sub generate_centaur flipPort0 reserved0 + "; + + my $mNode = $fsi[FSI_MASTERNODE_FIELD]; + my $mPos = $fsi[FSI_MASTERPOS_FIELD]; + my $link = $fsi[FSI_LINK_FIELD]; + print " + + + FSI_MASTER_CHIP + physical:sys-$sys/node-$mNode/proc-$mPos + + + FSI_MASTER_PORT + $link + "; + + if( $#altfsi <= 0 ) + { + print " + + + ALTFSI_MASTER_CHIP + physical:sys + + ALTFSI_MASTER_PORT + 0xFF + \n"; + } + else + { + $mNode = $altfsi[FSI_MASTERNODE_FIELD]; + $mPos = $altfsi[FSI_MASTERPOS_FIELD]; + $link = $altfsi[FSI_LINK_FIELD]; + print " + + + ALTFSI_MASTER_CHIP + physical:sys-$sys/node-$mNode/proc-$mPos + + + ALTFSI_MASTER_PORT + $link + \n"; + } + print " \n"; + # End FSI # + + print " VPD_REC_NUM$ctaur EI_BUS_TX_LANE_INVERT diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 4fe142cfe..80c4fd32c 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -789,14 +789,16 @@ FSI_OPTION_FLAGS - Reserved for any special flags we might need to access FSI + + Reserved for any special flags we might need to access FSI + FSI flags flipPort - Set on master chips if their slave port is reversed when - the system is driven by the primary master chip. + Set on FSI master chips (procs) if that chip uses slaveB + to attach to the acting master chip. uint16_t 1 diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C index 43770aedf..c568ce8c6 100644 --- a/src/usr/targeting/targetservicestart.C +++ b/src/usr/targeting/targetservicestart.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* COPYRIGHT International Business Machines Corp. 2012,2014 */ /* */ /* p1 */ /* */ @@ -133,6 +133,14 @@ static void initializeAttributes(TargetService& i_targetService) if(l_pMasterProcChip) { + // Master uses xscom by default, needs to be set before + // doing any other scom accesses + ScomSwitches l_switches = + l_pMasterProcChip->getAttr(); + l_switches.useXscom = 1; + l_switches.useFsiScom = 0; + l_pMasterProcChip->setAttr(l_switches); + errlHndl_t l_errl = NULL; size_t l_size = sizeof(uint64_t); uint64_t l_data; @@ -160,6 +168,7 @@ static void initializeAttributes(TargetService& i_targetService) } } + if(l_isMpipl) { l_pTopLevel->setAttr(1); -- cgit v1.2.1