diff options
author | ayma <ayma@us.ibm.com> | 2012-12-05 13:06:55 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-12-07 15:35:41 -0600 |
commit | d8f2ffb580708b1a153108cbfd0cd94d1b3e8e66 (patch) | |
tree | b1795b0c0ca93ca2570bca3da19194f92b59bfb4 /src | |
parent | e3f7d59b30e0adfac95889f10819363229a9d382 (diff) | |
download | talos-hostboot-d8f2ffb580708b1a153108cbfd0cd94d1b3e8e66.tar.gz talos-hostboot-d8f2ffb580708b1a153108cbfd0cd94d1b3e8e66.zip |
Attributes for dynamic VIDS
RTC: 37517
Change-Id: I9cab78e87f6bde8848e29bc437ab26a27df70174
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2566
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 16 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 1 | ||||
-rwxr-xr-x | src/usr/targeting/xmltohb/genHwsvMrwXml.pl | 131 |
3 files changed, 146 insertions, 2 deletions
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index fc28a5c53..e82184232 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -7053,4 +7053,20 @@ Consumers: proc_build_gpstate_table.C (among others) </hwpfToHbAttrMap> </attribute> +<attribute> + <id>VMEM_ID</id> + <description>Voltage Memory Rail Manager ID. Currently HB only needs + to configured the Vmem voltage rail manger during the IPL. The ID + is an arbitary value and needed as correlation token between HB and + HWSV. It will be generated by the genHwsvMrwXml.pl. + </description> + <simpleType> + <uint16_t> + <default>0</default> + </uint16_t> + </simpleType> + <persistency>non-volatile</persistency> + <readable/> +</attribute> + </attributes> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 8a179814c..5b23df552 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -811,6 +811,7 @@ <default>0</default> </attribute> <attribute><id>MSS_CACHE_ENABLE</id></attribute> + <attribute><id>VMEM_ID</id></attribute> </targetType> <!-- Centaur MBS --> diff --git a/src/usr/targeting/xmltohb/genHwsvMrwXml.pl b/src/usr/targeting/xmltohb/genHwsvMrwXml.pl index 6f986146f..3f53f5d0c 100755 --- a/src/usr/targeting/xmltohb/genHwsvMrwXml.pl +++ b/src/usr/targeting/xmltohb/genHwsvMrwXml.pl @@ -121,6 +121,70 @@ foreach my $i (@{$powerbus->{'power-bus'}}) push @pbus, [ lc($endp2), lc($endp1) ]; } +open (FH, "<$mrwdir/${sysname}-vmem.xml") || + die "ERROR: unable to open $mrwdir/${sysname}-vmem.xml\n"; +close (FH); + +my $vmemCentaur = XMLin("$mrwdir/${sysname}-vmem.xml"); + +# Capture all pnor attributes into the @unsortedPnorTargets array +use constant VMEM_DEV_PATH_FIELD => 0; +use constant VMEM_I2C_ADDR_FIELD => 1; +use constant VMEM_NODE_FIELD => 2; +use constant VMEM_POS_FIELD => 3; +use constant VMEM_ID_FIELD => 4; + +my $vmemId = 0x0; + +my @unsortedVmem; +my @vmemArray; +my @vmemDevAddr; +my $vmemValue =0; +my $found=0; +my $loc=0; +my $newValue =0; + +foreach my $i (@{$vmemCentaur->{'centaur-vrd-connection'}}) +{ + my $vmemDev = $i->{'vrd'}->{'i2c-dev-path'}; + my $vmemAddr = $i->{'vrd'}->{'i2c-address'}; + + for my $j (0 .. $#vmemDevAddr) + { + if ( ($vmemDev eq $vmemDevAddr[$j][VMEM_DEV_PATH_FIELD]) && + ($vmemAddr eq $vmemDevAddr[$j][VMEM_I2C_ADDR_FIELD]) ) + { + $found =1; + $vmemValue=$vmemArray[$j]; + last; + } + else + { + $found=0; + } + } + if ($found ==1) + { + push (@vmemArray,$vmemValue); + } + else + { + $vmemValue=$newValue++; + push (@vmemArray,$vmemValue); + } + + push (@vmemDevAddr,[$vmemDev, $vmemAddr]); + + my $vmemNode = $i->{'centaur'}->{'target'}->{'node'}; + my $vmemPosition = $i->{'centaur'}->{'target'}->{'position'}; + + push (@unsortedVmem,[$vmemDev, $vmemAddr, $vmemNode, $vmemPosition, $vmemValue]); +} + + +my @SortedVmem = sort byVmemNodePos @unsortedVmem; + + open (FH, "<$mrwdir/${sysname}-lpc2spi.xml") || die "ERROR: unable to open $mrwdir/${sysname}-lpc2spi.xml\n"; close (FH); @@ -633,6 +697,10 @@ for (my $do_core = 0, my $i = 0; $i <= $#STargets; $i++) my $memb; my $membMcs; my $mba_count = 0; +my $vmem_id =0; +my $vmem_count =0; +my $vmemAddr_prev=""; +my $vmemDevPath_prev=""; for my $i ( 0 .. $#STargets ) { @@ -660,8 +728,19 @@ for my $i ( 0 .. $#STargets ) die "ERROR. Can't locate Centaur from memory bus table\n"; } my $relativeCentaurRid = $STargets[$i][PLUG_POS]; + + #should note that the $SortedVmem is sorted by node and position and currently + #$STargets is also sorted by node and postion. If this ever changes then + #will need to make a modification here + my $vmemDevPath=$SortedVmem[$vmem_count][VMEM_DEV_PATH_FIELD]; + my $vmemAddr=$SortedVmem[$vmem_count][VMEM_I2C_ADDR_FIELD]; + my $vmem_id=$SortedVmem[$vmem_count][VMEM_ID_FIELD]; + $vmem_count++; + generate_centaur( $memb, $membMcs, $cfsi, $ipath, - $STargets[$i][ORDINAL_FIELD],$relativeCentaurRid); + $STargets[$i][ORDINAL_FIELD],$relativeCentaurRid, + $vmem_id, $vmemDevPath, $vmemAddr); + } elsif ($STargets[$i][NAME_FIELD] eq "mba") { @@ -922,6 +1001,37 @@ sub byPnorNodePos($$) } ################################################################################ +# Compares two Vmem instances based on the node and position # +################################################################################ +sub byVmemNodePos($$) +{ + my $retVal = -1; + + my $lhsInstance_node = $_[0][VMEM_NODE_FIELD]; + my $rhsInstance_node = $_[1][VMEM_NODE_FIELD]; + if(int($lhsInstance_node) eq int($rhsInstance_node)) + { + my $lhsInstance_pos = $_[0][VMEM_POS_FIELD]; + my $rhsInstance_pos = $_[1][VMEM_POS_FIELD]; + if(int($lhsInstance_pos) eq int($rhsInstance_pos)) + { + die "ERROR: Duplicate vmem positions: 2 vmem 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; +} + +################################################################################ # Compares two PSI Units instances based on the node, position & chip unit # ################################################################################ sub byPSINodePosChpUnit($$) @@ -1131,6 +1241,10 @@ sub generate_system_node { print " <attribute> + <id>RID</id> + <default>0x800</default> + </attribute> + <attribute> <id>ORDINAL_ID</id> <default>$node</default> </attribute>"; @@ -1820,7 +1934,8 @@ sub generate_ax_buses sub generate_centaur { - my ($ctaur, $mcs, $cfsi, $ipath, $ordinalId, $relativeCentaurRid) = @_; + my ($ctaur, $mcs, $cfsi, $ipath, $ordinalId, $relativeCentaurRid, + $vmemId, $vmemDevPath, $vmemAddr) = @_; my $scompath = $devpath->{chip}->{$ipath}->{'scom-path'}; my $scanpath = $devpath->{chip}->{$ipath}->{'scan-path'}; my $scomsize = length($scompath) + 1; @@ -1847,6 +1962,10 @@ sub generate_centaur <id>AFFINITY_PATH</id> <default>affinity:sys-$sys/node-$node/proc-$proc/mcs-$mcs/membuf-$ctaur</default> </attribute> + <attribute> + <id>VMEM_ID</id> + <default>$vmemId</default> + </attribute> <!-- TODO When MRW provides the information, these two attributes should be included. values of X come from MRW. <attribute> @@ -1902,6 +2021,14 @@ sub generate_centaur <attribute> <id>ORDINAL_ID</id> <default>$ordinalId</default> + </attribute> + <attribute> + <id>FSP_VMEM_DEVICE_PATH</id> + <default>$vmemDevPath</default> + </attribute> + <attribute> + <id>FSP_VMEM_I2C_ADDR</id> + <default>$vmemAddr</default> </attribute>"; } print "\n</targetInstance>\n"; |