summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2015-11-18 14:01:33 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-03-24 10:27:41 -0400
commitb19c61f81dacb5088180946c5f415909965dd1fa (patch)
treedc5d723cfba93998f68c0e85de11d05ab07b8b3c /src/build
parent16ff4c0894f726ea97362536af36a413b1f255cd (diff)
downloadblackbird-hostboot-b19c61f81dacb5088180946c5f415909965dd1fa.tar.gz
blackbird-hostboot-b19c61f81dacb5088180946c5f415909965dd1fa.zip
Changes related to packaging of memory vpd on Nimbus - part 1
Lower level vpd and targeting plumbing changes for Nimbus direct memory Change-Id: I6ac97404f5ef7432d14192945f9a1e258ed66dd3 RTC: 128112 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/711 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build')
-rw-r--r--src/build/mkrules/dist.targets.mk2
-rwxr-xr-xsrc/build/simics/hb-pnor-vpd-preload.pl119
-rwxr-xr-xsrc/build/simics/hb-pnor-vpd-preload.py17
-rwxr-xr-xsrc/build/simics/standalone.simics7
4 files changed, 88 insertions, 57 deletions
diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk
index 0256f55e6..8eb31011a 100644
--- a/src/build/mkrules/dist.targets.mk
+++ b/src/build/mkrules/dist.targets.mk
@@ -65,6 +65,7 @@ COPY_FILES = \
img/dimmspd.dat:vpo \
img/procmvpd.dat:vpo \
img/cvpd.dat:vpo \
+ img/dvpd.dat:vpo \
obj/genfiles/fapiAttrInfo.csv:vpo \
obj/genfiles/fapiAttrEnumInfo.csv:vpo \
obj/genfiles/targAttrInfo.csv:vpo \
@@ -193,6 +194,7 @@ simics.tar_CONTENTS = \
img/procmvpd_ven.dat \
img/procmvpd_p9n.dat \
img/cvpd.dat \
+ img/dvpd.dat \
#@TODO RTC:142088
# obj/genfiles/fapiAttrInfo.csv \
obj/genfiles/fapiAttrEnumInfo.csv \
diff --git a/src/build/simics/hb-pnor-vpd-preload.pl b/src/build/simics/hb-pnor-vpd-preload.pl
index bf1832942..25a1c5a24 100755
--- a/src/build/simics/hb-pnor-vpd-preload.pl
+++ b/src/build/simics/hb-pnor-vpd-preload.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2012,2015
+# Contributors Listed Below - COPYRIGHT 2012,2016
# [+] International Business Machines Corp.
#
#
@@ -30,9 +30,11 @@ my $DEBUG = 0;
my $numProcs;
my $numCentPerProc;
+my $numMcsPerProc = 8;
+my $procChipType;
my $dataPath = ".";
my $outputPath = ".";
-my $machine = "NIMBUS";
+my $machine;
my $procConfig = "uninit";
my $centConfig = "uninit";
my $maxProcs = 8;
@@ -48,17 +50,19 @@ my $emptySPD;
($emptySPDfh, $emptySPD) = tempfile();
# Create temp file for CVPD
-my $emptyCVPDfh;
-my $emptyCVPD;
-($emptyCVPDfh, $emptyCVPD) = tempfile();
+my $emptyMemVPDfh;
+my $emptyMemVPD;
+($emptyMemVPDfh, $emptyMemVPD) = tempfile();
my $mvpdFile = "procmvpd.dat";
my $mvpdFile_ven = "procmvpd_ven.dat";
my $mvpdFile_p9n = "procmvpd_p9n.dat";
my $cvpdFile = "cvpd.dat";
+my $dvpdFile = "dvpd.dat";
+my $memVpdFile = $cvpdFile;
my $spdFile = "dimmspd.dat";
my $sysMVPD = "sysmvpd.dat";
-my $sysCVPD = "syscvpd.dat";
+my $sysMemVPD = "sysmemvpd.dat";
my $sysSPD = "sysspd.dat";
@@ -88,6 +92,12 @@ while( $ARGV = shift )
$numCentPerProc = shift;
debugMsg( "Num Centaurs Per Proc: $numCentPerProc" );
}
+ elsif( $ARGV =~ m/--procChipType/ ||
+ $ARGV =~ m/-pct/ )
+ {
+ $procChipType = shift;
+ debugMsg( "Proc Chip Type: $procChipType" );
+ }
elsif( $ARGV =~ m/--dataPath/ ||
$ARGV =~ m/-dp/ )
{
@@ -161,7 +171,7 @@ if($machine eq "HABANERO")
exit 0;
}
-getCentaurConfig();
+getMemoryConfig();
createMVPDData();
createCVPDData();
createSPDData();
@@ -180,6 +190,7 @@ exit 0;
sub usage
{
print "Usage: $0 --numProcs <value> [--numCentPerProc <value>]\n";
+ print " [--procChipType <value>]\n";
print " [--dataPath <path> ] [-m | --machine <value>]\n";
print " [-mp | --maxProcs <value>]\n";
print " [-fp | --forceProc <value ] [-fc | -forceCent <value>]\n";
@@ -194,6 +205,7 @@ sub usage
print " behind each processor. Must always\n";
print " contain info for 8 Centaurs\n";
print " --numCentPerProc\n";
+ print " -pct --procChipType Processor Chip Type, ie p9n\n";
print " -m --machine Text machine to build data for.\n";
print " Default: MURANO\n";
print " -dp --dataPath Path to VPD data files.\n";
@@ -286,11 +298,7 @@ sub createMVPDData
{
$sourceFile = "$dataPath/$mvpdFile_ven";
}
- elsif( $machine eq "NIMBUS")
- {
- $sourceFile = "$dataPath/$mvpdFile_p9n";
- }
- elsif( $machine eq "ZZTOP")
+ elsif( $procChipType eq "p9n")
{
$sourceFile = "$dataPath/$mvpdFile_p9n";
}
@@ -327,63 +335,64 @@ sub createMVPDData
#====================================================================
sub createCVPDData
{
- print "Creating CVPD Data...\n";
+ print "Creating Mem VPD Data...\n";
my $cmd;
my $result;
my $sourceFile;
- my $sysCVPDFile = "$outputPath/$sysCVPD";
- my $sysCVPDFileECC = $sysCVPDFile . ".ecc";
+ my $sysMemVPDFile = "$outputPath/$sysMemVPD";
+ my $sysMemVPDFileECC = $sysMemVPDFile . ".ecc";
- if( -e $sysCVPDFile )
+ if( -e $sysMemVPDFile )
{
# Cleanup any existing files
- system( "rm -rf $sysCVPDFile" );
+ system( "rm -rf $sysMemVPDFile" );
}
#Centaurs are populated based on populated Processors and special
#MCS plugging rules. We can look at $procConfig and $maxProcs
#to determine processor config. Centaur plugging is contained
- #in $mcsArray, populated by getCentaurConfig()
+ #in $mcsArray, populated by getMemoryConfig()
+ #For direct access memory, $mcsArray has which MCSs are present
- # Create empty CVPD data chunk
- $cmd = " echo \"000FFF: 00\" \| xxd -r \> $emptyCVPD";
- system( $cmd ) == 0 or die "Creating $emptyCVPD failed!";
+ # Create empty Mem VPD data chunk
+ $cmd = " echo \"000FFF: 00\" \| xxd -r \> $emptyMemVPD";
+ system( $cmd ) == 0 or die "Creating $emptyMemVPD failed!";
for( my $proc = 0; $proc < $maxProcs; $proc++ )
{
- for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ )
+ for( my $mcs = 0; $mcs < $MAX_MCS; $mcs++ )
{
- if( ($mcsArray[$cent] == 1) &&
+ if( ($mcsArray[$mcs] == 1) &&
substr($procConfig,$proc,1) =~ /1/ )
{
- debugMsg( "$machine( $proc, $cent): Real File" );
+ debugMsg( "$machine( $proc, $mcs): Real File" );
# Use the real data to the full image
- $sourceFile = "$dataPath/$cvpdFile";
+ $sourceFile = "$dataPath/$memVpdFile";
}
else
{
- debugMsg( "$machine( $proc, $cent): Empty file" );
- # No Centaur, use empty data chunk
- $sourceFile = $emptyCVPD;
+ debugMsg( "$machine( $proc, $mcs): Empty file" );
+ # No Centaur/MCS, use empty data chunk
+ $sourceFile = $emptyMemVPD;
}
- $result = `dd if=$sourceFile of=$sysCVPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`;
+ $result = `dd if=$sourceFile of=$sysMemVPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`;
if( $? )
{
- die "Error building CVPD file! proc=$proc cent=$cent\n";
+ die "Error building Mem VPD file! proc=$proc cent=$mcs\n";
}
}
}
- if( -e $sysCVPDFile )
+ if( -e $sysMemVPDFile )
{
- system( "chmod 775 $sysCVPDFile" );
- system( "ecc --inject $sysCVPDFile --output $sysCVPDFileECC --p8" );
- system( "chmod 775 $sysCVPDFileECC" );
+ system( "chmod 775 $sysMemVPDFile" );
+ system( "ecc --inject $sysMemVPDFile --output $sysMemVPDFileECC --p8" );
+ system( "chmod 775 $sysMemVPDFileECC" );
}
- debugMsg( "CVPD Done." );
+ debugMsg( "Mem VPD Done." );
}
@@ -412,20 +421,20 @@ sub createSPDData
for( my $proc = 0; $proc < $maxProcs; $proc++ )
{
- for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ )
+ for( my $mcs = 0; $mcs < $MAX_MCS; $mcs++ )
{
for( my $dimm = 0; $dimm < $MAX_DIMMS_PER_CENT; $dimm++ )
{
- if( ($mcsArray[$cent] == 1) &&
- substr($procConfig,$proc,1) =~ /1/ )
+ if( ($mcsArray[$mcs] == 1) &&
+ substr($procConfig,$proc,1) =~ /1/ )
{
- debugMsg( "$machine( $proc, $cent, $dimm ): Real File" );
+ debugMsg( "$machine( $proc, $mcs, $dimm ): Real File" );
# Use the real data to the full image
$sourceFile = "$dataPath/$spdFile";
}
else
{
- debugMsg( "$machine( $proc, $cent, $dimm ): Empty file" );
+ debugMsg( "$machine( $proc, $mcs, $dimm ): Empty file" );
# No dimm, use empty data chunk
$sourceFile = $emptySPD;
}
@@ -433,7 +442,7 @@ sub createSPDData
$result = `dd if=$sourceFile of=$sysSPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`;
if( $? )
{
- die "Error building SPD file! $proc $cent $dimm\n";
+ die "Error building SPD file! $proc $mcs $dimm\n";
}
}
}
@@ -450,9 +459,16 @@ sub createSPDData
}
-sub getCentaurConfig
+sub getMemoryConfig
{
- debugMsg( "getCentaurConfig $machine" );
+ debugMsg( "getMemoryConfig $machine" );
+
+ #Select direct memory vpd file or Centaur vpd file
+ if( $procChipType eq "p9n")
+ {
+ $memVpdFile = $dvpdFile;
+ $numMcsPerProc = 4;
+ }
#First check if explicit Centaur Plugging rules were provided
if( $centConfig !~ m/uninit/ )
@@ -522,15 +538,14 @@ sub getCentaurConfig
}
}
}
- elsif( $machine eq "NIMBUS")
- {
- #as there are no centaurs within a NIMBUS machine NO configuration
- #for centaur chips is required
- }
- elsif( $machine eq "ZZTOP")
+ elsif( $procChipType eq "p9n")
{
- #as there are no centaurs within a NIMBUS machine NO configuration
- #for centaur chips is required
+ #There are no centaurs within a NIMBUS machine, but need to set
+ #up the mcs array.
+ if( $mcs < $numMcsPerProc)
+ {
+ $mcsArray[$mcs] = 1;
+ }
}
else
{
@@ -539,7 +554,7 @@ sub getCentaurConfig
}
}
- debugMsg( "@mcsArray" );
+ debugMsg( "mcsArray=@mcsArray" );
}
diff --git a/src/build/simics/hb-pnor-vpd-preload.py b/src/build/simics/hb-pnor-vpd-preload.py
index c11d795e6..49d97e2a2 100755
--- a/src/build/simics/hb-pnor-vpd-preload.py
+++ b/src/build/simics/hb-pnor-vpd-preload.py
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2012,2015
+# Contributors Listed Below - COPYRIGHT 2012,2016
# [+] International Business Machines Corp.
#
#
@@ -32,9 +32,18 @@ import shlex
toolLoc = os.environ.get("HB_TOOLPATH");
thisSys = os.environ.get("HB_MACHINE").upper();
numProcs = os.environ.get( "NUM_PROCS");
-#@TODO RTC 128112
-numCentaurPerProc = "0"; # os.environ.get( "GFW_P9_%s_CENTAURS_PER_PROC" % thisSys );
-cmd = toolLoc + "/hb-pnor-vpd-preload.pl --numProcs " + numProcs + " --numCentPerProc " + numCentaurPerProc + " --machine " + thisSys + " --dataPath " + toolLoc
+numCentaurPerProcParm = "";
+numCentaurPerProc = "0";
+if os.environ.has_key( "GFW_P9_%s_CENTAURS_PER_PROC" % thisSys ):
+ numCentaurPerProc=os.environ.get( "GFW_P9_%s_CENTAURS_PER_PROC" % thisSys );
+ numCentaurPerProcParm=" --numCentPerProc " + numCentaurPerProc;
+pass
+procChipTypeParm = "";
+if os.environ.has_key('HB_PROC_CHIP_TYPE'):
+ procChipType = os.environ.get('HB_PROC_CHIP_TYPE');
+ procChipTypeParm=" --procChipType " + procChipType;
+pass
+cmd = toolLoc + "/hb-pnor-vpd-preload.pl --numProcs " + numProcs + numCentaurPerProcParm + procChipTypeParm + " --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 );
diff --git a/src/build/simics/standalone.simics b/src/build/simics/standalone.simics
index bd8d4fdb3..a078563e5 100755
--- a/src/build/simics/standalone.simics
+++ b/src/build/simics/standalone.simics
@@ -5,11 +5,16 @@
($hb_masterproc).proc_fsi2host_mbox->responder_enable=1
# Preload VPD in PNOR
+# Pass processor chip type. All proc chip types should be the same.
+ if (get-object-list p9_proc) {
+ $procChipType=(get-object-list p9_proc)[0]->chip_type
+ python "os.environ['HB_PROC_CHIP_TYPE'] = \""+$procChipType+"\""
+ }
try {
run-python-file (lookup-file hbfw/hb-pnor-vpd-preload.py)
($hb_pnor).sfc_master_mem.load-file ./sysmvpd.dat.ecc 0x1C5000
($hb_pnor).sfc_master_mem.load-file ./sysspd.dat.ecc 0x17D000
- ($hb_pnor).sfc_master_mem.load-file ./syscvpd.dat.ecc 0x255000
+ ($hb_pnor).sfc_master_mem.load-file ./sysmemvpd.dat.ecc 0x255000
} except { echo "ERROR: Failed to preload VPD into PNOR." }
#Write the PNOR MMIO addr into Scratch 2, 0x283A
OpenPOWER on IntegriCloud