summaryrefslogtreecommitdiffstats
path: root/src/build/simics
diff options
context:
space:
mode:
authorTerry J. Opie <opiet@us.ibm.com>2012-04-25 11:39:05 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-18 16:38:55 -0500
commite9de3b17d17a3c230ae9db3ed7d4139950cd4963 (patch)
treed71fec7cbd502e07d94c64590cff1401c9f3b155 /src/build/simics
parente14f34f3648159c2fd5d62900ee5568ca2b78af3 (diff)
downloadtalos-hostboot-e9de3b17d17a3c230ae9db3ed7d4139950cd4963.tar.gz
talos-hostboot-e9de3b17d17a3c230ae9db3ed7d4139950cd4963.zip
Preload PNOR VPD correctly
- Handle Venice, Murano, Tuleta - Change SPD code to use VPD_REC_NUM attribute - Modify FAPI/HWPF tests to use present DIMM targets Change-Id: I2348a2da90ea85a966f3724f8b3694a0b8f03916 RTC: 40774 Depends-on: I7d1b41c9f9e87baa9d42b78bf4351e3b6d774cb5 RTC: 39133 Depends-on: Ia0f22c87f8bc3959324fa8347e191f2b47b4325c RTC: 35835 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/950 Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/simics')
-rwxr-xr-xsrc/build/simics/hb-pnor-mvpd-preload.pl93
-rwxr-xr-xsrc/build/simics/hb-pnor-mvpd-preload.py2
2 files changed, 88 insertions, 7 deletions
diff --git a/src/build/simics/hb-pnor-mvpd-preload.pl b/src/build/simics/hb-pnor-mvpd-preload.pl
index 503064e1b..54a144965 100755
--- a/src/build/simics/hb-pnor-mvpd-preload.pl
+++ b/src/build/simics/hb-pnor-mvpd-preload.pl
@@ -30,6 +30,7 @@ my $numProcs;
my $numCentPerProc;
my $dataPath = ".";
my $outputPath = ".";
+my $machine = "MURANO";
# Create temp file for MVPD
my $emptyMVPDfh;
@@ -49,6 +50,7 @@ my $sysSPD = "sysspd.dat";
my $MAX_PROCS = 8;
my $MAX_CENT_PER_PROC = 8;
my $MAX_DIMMS_PER_CENT = 8;
+my $MAX_MCS = 8;
while( $ARGV = shift )
@@ -57,16 +59,25 @@ while( $ARGV = shift )
$ARGV =~ m/-np/ )
{
$numProcs = shift;
+ debugMsg( "Num Procs: $numProcs" );
}
elsif( $ARGV =~ m/--numCentPerProc/ ||
$ARGV =~ m/-ncpp/ )
{
$numCentPerProc = shift;
+ debugMsg( "Num Centaurs Per Proc: $numCentPerProc" );
}
elsif( $ARGV =~ m/--dataPath/ ||
- $ARGV =~ m/-dp/ )
+ $ARGV =~ m/-dp/ )
{
$dataPath = shift;
+ debugMsg( "Data Path: $dataPath" );
+ }
+ elsif( $ARGV =~ m/--machine/ ||
+ $ARGV =~ m/-m/ )
+ {
+ $machine = shift;
+ debugMsg( "Machine: $machine" );
}
elsif( $ARGV =~ m/--outputPath/ ||
$ARGV =~ m/-op/ )
@@ -79,9 +90,6 @@ while( $ARGV = shift )
}
}
-debugMsg( "numProcs: $numProcs" );
-debugMsg( "numCentPerProc: $numCentPerProc" );
-
createMVPDData();
createSPDData();
cleanup();
@@ -99,10 +107,12 @@ exit 0;
sub usage
{
print "Usage: $0 -numProcs <value> -numCentPerProc <value> [-dataPath]\n";
- print " [-h | --help]\n";
+ print " [-m | --machine <value>] [-h | --help]\n";
print "\n";
print " -np --numProcs Number of Processors in the drawer.\n";
print " -ncpp --numCentPerProc Number of Centaurs per Processor.\n";
+ print " -m --machine Text machine to build data for.\n";
+ print " Default: MURANO\n";
print " -dp --dataPath Path to where VPD data files are located.\n";
print " -op --outputPath Path where VPD files should end up.\n";
print " Default: ./\n";
@@ -151,6 +161,12 @@ sub createMVPDData
system( "rm -rf $sysMVPDFile" );
}
+ # Currently it looks like all processors are populated in the order that
+ # they are numbered. The following logic should work for every platform.
+ # If this ever changes, building the MVPD data and SPD data will need to
+ # be combined to not duplicate the logic for determining which processors
+ # have which DIMMs.
+
# Create empty processor MVPD chunk.
$cmd = "echo \"00FFFF: 00\" \| xxd -r \> $emptyMVPD";
system( $cmd ) == 0 or die "Creating $emptyMVPD failed!";
@@ -194,6 +210,7 @@ sub createSPDData
my $result;
my $sourceFile;
my $sysSPDFile = "$outputPath/$sysSPD";
+ my @mcsArray = ( 0,0,0,0,0,0,0,0 );
if( -e $sysSPDFile )
{
@@ -205,20 +222,83 @@ sub createSPDData
$cmd = " echo \"0001FF: 00\" \| xxd -r \> $emptySPD";
system( $cmd ) == 0 or die "Creating $emptySPD failed!";
+ # Populating DIMMs is different across every system. The following case
+ # statement will handle populating DIMMs based on the system type
+ debugMsg( "Preload DIMMs for $machine" );
+ for( my $mcs = 0; $mcs < $MAX_MCS; $mcs++ )
+ {
+ debugMsg( "Mcs: $mcs" );
+ if( $machine eq "MURANO" )
+ {
+ # Plugging order is:
+ # Processor 0 - 3
+ # MCS 4 - 7 (1 Centaur/MCS)
+ if( $mcs >= 4 &&
+ $mcs <= (4 + ($numCentPerProc - 1)) )
+ {
+ $mcsArray[$mcs] = 1;
+ }
+ }
+ elsif( $machine eq "VENICE" )
+ {
+ # Plugging order is:
+ # Processor 0 - 7
+ # MCS 4 - 7, then 0 - 3
+ if( ($numCentPerProc <= 4) &&
+ ($mcs >= 4) &&
+ ($mcs <= (4 + ($numCentPerProc - 1))) )
+ {
+ $mcsArray[$mcs] = 1;
+ }
+ elsif( $numCentPerProc > 4 )
+ {
+ if( $mcs >= 4 &&
+ $mcs <= 7 )
+ {
+ $mcsArray[$mcs] = 1;
+ }
+ elsif( $mcs >= 0 &&
+ $mcs < ($numCentPerProc - 4) )
+ {
+ $mcsArray[$mcs] = 1;
+ }
+ }
+ }
+ elsif( $machine eq "TULETA" )
+ {
+ # Plugging order is:
+ # Processor 0 - 3
+ # MCS 7 - 4 (1 Centaury/MCS)
+ if( $mcs >= (7 - ($numCentPerProc - 1)) &&
+ $mcs <= 7 )
+ {
+ $mcsArray[$mcs] = 1;
+ }
+ }
+ else
+ {
+ die "Invalid machine ($machine)!!! Cannot preload DIMM VPD \
+ data...exiting.";
+ }
+ }
+
+ debugMsg( "@mcsArray" );
for( my $proc = 0; $proc < $MAX_PROCS; $proc++ )
{
for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ )
{
for( my $dimm = 0; $dimm < $MAX_DIMMS_PER_CENT; $dimm++ )
{
- if( ($cent < $numCentPerProc) &&
+ if( ($mcsArray[$cent] == 1) &&
($proc < $numProcs) )
{
+ debugMsg( "$machine( $proc, $cent, $dimm ): Real File" );
# Use the real data to the full image
$sourceFile = "$dataPath/$spdFile";
}
else
{
+ debugMsg( "$machine( $proc, $cent, $dimm ): Empty file" );
# No dimm, use empty data chunk
$sourceFile = $emptySPD;
}
@@ -232,6 +312,7 @@ sub createSPDData
}
}
+
if( -e $sysSPDFile )
{
system( "chmod 775 $sysSPDFile" );
diff --git a/src/build/simics/hb-pnor-mvpd-preload.py b/src/build/simics/hb-pnor-mvpd-preload.py
index 4e5c0c0c7..67c926a3f 100755
--- a/src/build/simics/hb-pnor-mvpd-preload.py
+++ b/src/build/simics/hb-pnor-mvpd-preload.py
@@ -31,7 +31,7 @@ toolLoc = os.environ.get("HB_TOOLPATH");
thisSys = os.environ.get("HB_MACHINE").upper();
numProcs = os.environ.get( "GFW_P8_%s_NUM_PROCS" % thisSys );
numCentaurPerProc = os.environ.get( "GFW_P8_%s_CENTAURS_PER_PROC" % thisSys );
-cmd = toolLoc + "/hb-pnor-mvpd-preload.pl --numProcs " + numProcs + " --numCentPerProc " + numCentaurPerProc + " --dataPath " + toolLoc
+cmd = toolLoc + "/hb-pnor-mvpd-preload.pl --numProcs " + numProcs + " --numCentPerProc " + numCentaurPerProc + " --machine " + thisSys + " --dataPath " + toolLoc
print "Generate PNOR VPD for " + numProcs + " processor(s), and " + numCentaurPerProc + " Centaur(s) per Processor.";
args = shlex.split( cmd );
subprocess.call( args );
OpenPOWER on IntegriCloud