From a753459c20affff821477924808ea5b9412504c5 Mon Sep 17 00:00:00 2001 From: Adam Muhle Date: Mon, 21 Jan 2013 16:52:43 -0600 Subject: CVPD Device Driver updates. Implemented Device Driver support for Centaur VPD. Since CVPD is almost identical to MVPD, I moved the MVPD code to a base class so the actual logic is now common between the two. To support CVPD in the standalone configs, the hb-preload script was updated to populate the CVPD partition as well. I also started migrating the VPD code to a common trace buffer. RTC: 44009 Change-Id: I6e96d5e993d6d74d40df3d296cdcf8f34e4b5cc5 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3029 Reviewed-by: Daniel M. Crowell Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert Reviewed-by: A. Patrick Williams III --- src/build/simics/hb-pnor-vpd-preload.pl | 180 +++++++++++++++++++++++--------- src/build/simics/standalone.simics | 1 + 2 files changed, 130 insertions(+), 51 deletions(-) (limited to 'src/build/simics') diff --git a/src/build/simics/hb-pnor-vpd-preload.pl b/src/build/simics/hb-pnor-vpd-preload.pl index d99516fc2..262379212 100755 --- a/src/build/simics/hb-pnor-vpd-preload.pl +++ b/src/build/simics/hb-pnor-vpd-preload.pl @@ -1,26 +1,26 @@ #!/usr/bin/perl -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# $Source: src/build/simics/hb-pnor-mvpd-preload.pl $ +# $Source: src/build/simics/hb-pnor-vpd-preload.pl $ # -# IBM CONFIDENTIAL +# IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2012 +# COPYRIGHT International Business Machines Corp. 2012,2013 # -# p1 +# p1 # -# Object Code Only (OCO) source materials -# Licensed Internal Code Source Materials -# IBM HostBoot Licensed Internal Code +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code # -# The source code for this program is not published or other- -# wise divested of its trade secrets, irrespective of what has -# been deposited with the U.S. Copyright Office. +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. # -# Origin: 30 +# Origin: 30 # -# IBM_PROLOG_END_TAG +# IBM_PROLOG_END_TAG use strict; use File::Temp qw/ tempfile tempdir /; @@ -44,15 +44,24 @@ my $emptySPDfh; my $emptySPD; ($emptySPDfh, $emptySPD) = tempfile(); +# Create temp file for CVPD +my $emptyCVPDfh; +my $emptyCVPD; +($emptyCVPDfh, $emptyCVPD) = tempfile(); + my $mvpdFile = "procmvpd.dat"; +my $cvpdFile = "cvpd.dat"; my $spdFile = "dimmspd.dat"; my $sysMVPD = "sysmvpd.dat"; +my $sysCVPD = "syscvpd.dat"; my $sysSPD = "sysspd.dat"; my $MAX_CENT_PER_PROC = 8; my $MAX_DIMMS_PER_CENT = 8; my $MAX_MCS = 8; +my @mcsArray = ( 0,0,0,0,0,0,0,0 ); + while( $ARGV = shift ) { @@ -124,7 +133,9 @@ elsif(length($procConfig) != $maxProcs) exit 1; } +getCentaurConfig(); createMVPDData(); +createCVPDData(); createSPDData(); cleanup(); @@ -237,6 +248,68 @@ sub createMVPDData debugMsg( "MVPD Done." ); } +#==================================================================== +# Create the CVPD data for PNOR +#==================================================================== +sub createCVPDData +{ + print "Creating CVPD Data...\n"; + + my $cmd; + my $result; + my $sourceFile; + my $sysCVPDFile = "$outputPath/$sysCVPD"; + + if( -e $sysCVPDFile ) + { + # Cleanup any existing files + system( "rm -rf $sysCVPDFile" ); + } + + #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() + + # Create empty CVPD data chunk + $cmd = " echo \"000FFF: 00\" \| xxd -r \> $emptyCVPD"; + system( $cmd ) == 0 or die "Creating $emptyCVPD failed!"; + + for( my $proc = 0; $proc < $maxProcs; $proc++ ) + { + for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ ) + { + if( ($mcsArray[$cent] == 1) && + substr($procConfig,$proc,1) =~ /1/ ) + { + debugMsg( "$machine( $proc, $cent): Real File" ); + # Use the real data to the full image + $sourceFile = "$dataPath/$cvpdFile"; + } + else + { + debugMsg( "$machine( $proc, $cent): Empty file" ); + # No Centaur, use empty data chunk + $sourceFile = $emptyCVPD; + } + + $result = `dd if=$sourceFile of=$sysCVPDFile conv=notrunc oflag=append 2>&1 1>/dev/null`; + if( $? ) + { + die "Error building CVPD file! proc=$proc cent=$cent\n"; + } + + } + } + + if( -e $sysCVPDFile ) + { + system( "chmod 775 $sysCVPDFile" ); + } + debugMsg( "CVPD Done." ); +} + + #==================================================================== # Create the SPD data for PNOR #==================================================================== @@ -248,7 +321,6 @@ sub createSPDData my $result; my $sourceFile; my $sysSPDFile = "$outputPath/$sysSPD"; - my @mcsArray = ( 0,0,0,0,0,0,0,0 ); if( -e $sysSPDFile ) { @@ -260,9 +332,48 @@ 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 $proc = 0; $proc < $maxProcs; $proc++ ) + { + for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ ) + { + for( my $dimm = 0; $dimm < $MAX_DIMMS_PER_CENT; $dimm++ ) + { + if( ($mcsArray[$cent] == 1) && + substr($procConfig,$proc,1) =~ /1/ ) + { + 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; + } + + $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"; + } + } + } + } + + + if( -e $sysSPDFile ) + { + system( "chmod 775 $sysSPDFile" ); + } + debugMsg( "SPD Done." ); +} + + +sub getCentaurConfig +{ + debugMsg( "getCentaurConfig $machine" ); + for( my $mcs = 0; $mcs < $MAX_MCS; $mcs++ ) { debugMsg( "Mcs: $mcs" ); @@ -335,39 +446,6 @@ sub createSPDData } debugMsg( "@mcsArray" ); - for( my $proc = 0; $proc < $maxProcs; $proc++ ) - { - for( my $cent = 0; $cent < $MAX_CENT_PER_PROC; $cent++ ) - { - for( my $dimm = 0; $dimm < $MAX_DIMMS_PER_CENT; $dimm++ ) - { - if( ($mcsArray[$cent] == 1) && - substr($procConfig,$proc,1) =~ /1/ ) - { - 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; - } - $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"; - } - } - } - } - - if( -e $sysSPDFile ) - { - system( "chmod 775 $sysSPDFile" ); - } - debugMsg( "SPD Done." ); } diff --git a/src/build/simics/standalone.simics b/src/build/simics/standalone.simics index 76519d6e1..3fdd07561 100755 --- a/src/build/simics/standalone.simics +++ b/src/build/simics/standalone.simics @@ -5,6 +5,7 @@ try { run-python-file (lookup-file hbfw/hb-pnor-vpd-preload.py) fpga0.sfc_master_mem.load-file ./sysmvpd.dat 0x3E0A000 fpga0.sfc_master_mem.load-file ./sysspd.dat 0x3DCA000 + fpga0.sfc_master_mem.load-file ./syscvpd.dat 0x3E8A000 } except { echo "ERROR: Failed to preload VPD into PNOR." } #Trigger a power on to cec-chip -- cgit v1.2.1