summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wenning <wenning@us.ibm.com>2012-02-24 10:23:56 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-02-29 16:43:24 -0600
commit94dd36baefb33d78d4923867fbe986782b33ea53 (patch)
treea349a5b43a93df8a13da4851d70f114f07d0871d /src
parente1ff6eea604a68433f2d228a5700f10ef95da5df (diff)
downloadtalos-hostboot-94dd36baefb33d78d4923867fbe986782b33ea53.tar.gz
talos-hostboot-94dd36baefb33d78d4923867fbe986782b33ea53.zip
Fix for VBU_Cacheline.pm -
- branch hb-istep_debug Change-Id: Id1f78ed62374bec9cca40baac080cf842ade4809 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/693 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/build/vpo/VBU_Cacheline.pm28
-rwxr-xr-xsrc/build/vpo/hb-istep79
2 files changed, 81 insertions, 26 deletions
diff --git a/src/build/vpo/VBU_Cacheline.pm b/src/build/vpo/VBU_Cacheline.pm
index 3c9197ed2..f54333fa1 100755
--- a/src/build/vpo/VBU_Cacheline.pm
+++ b/src/build/vpo/VBU_Cacheline.pm
@@ -71,13 +71,14 @@ sub SetFlags;
############################################
## constants
-## use constant MAX_NUM_TRACE_BUFFERS => 24;
############################################
-my $CLfile = "./istepmodereg.dma";
+my $curDir = getcwd();
+my $CLfile = "$curDir/istepmodereg.dma";
my $CORE = "-c3";
-## my $SIM_CLOCKS = "4000000";
-my $SIM_CLOCKS = "2000000";
+## my $SIM_CLOCKS = "4000000";
+## my $SIM_CLOCKS = "2000000";
+my $SIM_CLOCKS = "3000000";
#############################################
## Internal Globals
@@ -102,9 +103,14 @@ my $RUNCLKSCMD = "simclock";
## @todo $$$$$
## NOTE: need to be able to specify thread (-t ) and core (-c ), they
## should not be hardwired
-my $QUERYCMD = "$vbuToolsDir/p8_thread_control.x86 -query $CORE -t0";
-my $STOPCMD = "$vbuToolsDir/p8_thread_control.x86 -stop $CORE -tall";
-my $STARTCMD = "$vbuToolsDir/p8_thread_control.x86 -start $CORE -tall";
+##my $QUERYCMD = "$vbuToolsDir/p8_thread_control.x86 -query $CORE -t0";
+##my $STOPCMD = "$vbuToolsDir/p8_thread_control.x86 -stop $CORE -tall";
+##my $STARTCMD = "$vbuToolsDir/p8_thread_control.x86 -start $CORE -tall";
+
+## Jim McGuire's older versions.
+my $QUERYCMD = "/gsa/pokgsa/home/m/c/mcguirej/public/auto/rel/P8bin/p8_ins_query";
+my $STOPCMD = "/gsa/pokgsa/home/m/c/mcguirej/public/auto/rel/P8bin/p8_ins_stop";
+my $STARTCMD = "/gsa/pokgsa/home/m/c/mcguirej/public/auto/rel/P8bin/p8_ins_start";
my $RESETCMD = "$vbuToolsDir/p8_thread_control.x86 -sreset_auto $CORE";
@@ -237,11 +243,15 @@ sub P8_Ins_Query()
$retstr = `$cmd`;
if ( $? != 0 ) { die "$cmd failed $? : $! \n"; }
- if ( $retstr =~ m/Quiesced/ )
+ if ( ($retstr =~ m/Quiesced/)
+ || ($retstr =~ m/STOPPED/)
+ )
{
return "STOPPED";
}
- elsif ( $retstr =~ m/Running/ )
+ elsif ( ($retstr =~ m/Running/)
+ ||($retstr =~ m/RUNNING/)
+ )
{
return "RUNNING";
}
diff --git a/src/build/vpo/hb-istep b/src/build/vpo/hb-istep
index da29eaf00..b12e80ec5 100755
--- a/src/build/vpo/hb-istep
+++ b/src/build/vpo/hb-istep
@@ -71,6 +71,7 @@ sub find_in_inlist;
sub parse_command;
sub setMode;
sub resume_istep;
+sub getShutDownStatus;
#------------------------------------------------------------------------------
# Constants
@@ -126,6 +127,19 @@ if ( ! defined( $hbDir) || ( $hbDir eq "" ) )
$hbDir = $pgmDir; ## Set to tool directory
}
+## Future - VBUTOOLS is not used yet, but will be.
+## from Jim McGuire
+# my $vbuToolsDir = "/gsa/ausgsa/projects/h/hostboot/vbutools/latest";
+my $vbuToolsDir = $ENV{'VBUTOOLS'};
+if (defined ($vbuToolsDir))
+{
+ unless ($vbuToolsDir ne "")
+ {
+ $vbuToolsDir = "/gsa/ausgsa/projects/h/hostboot/vbutools/dev";
+ }
+}
+
+
my $CSVfile = "$hbDir/isteplist.csv";
my $hbSymsFile = "$hbDir/hbicore.syms"; #Use hbicore.syms
@@ -170,6 +184,12 @@ chomp $commandreg;
my $statusreg = `grep "SPLESS::g_SPLess_Status_Reg" $hbSymsFile | awk -F"," '{print \$2}'` ;
chomp $statusreg;
+my $shutdownflag = `grep "CpuManager::cv_shutdown_requested" $hbSymsFile | awk -F"," '{print \$2}'` ;
+chomp $shutdownflag;
+
+my $shutdownsts = `grep "CpuManager::cv_shutdown_status" $hbSymsFile | awk -F"," '{print \$2}'` ;
+chomp $shutdownsts;
+
##-----------------------------------------------------------------------------
## Start processing options
@@ -177,22 +197,24 @@ chomp $statusreg;
if ( $opt_debug )
{
print STDERR "\n----- DEBUG: ----------------------------------- \n";
- print STDERR "help = $opt_help\n";
- print STDERR "istepmode = $opt_istepmode\n";
- print STDERR "normalmode = $opt_normalmode\n";
- print STDERR "list = $opt_list\n";
- print STDERR "command = $opt_command\n";
- print STDERR "cmdfile = $opt_cmdfile\n";
- print STDERR "setup = $opt_setup\n";
- print STDERR "clear-trace = $opt_clear_trace\n";
- print STDERR "debug = $opt_debug\n";
+ print STDERR "help = $opt_help\n";
+ print STDERR "istepmode = $opt_istepmode\n";
+ print STDERR "normalmode = $opt_normalmode\n";
+ print STDERR "list = $opt_list\n";
+ print STDERR "command = $opt_command\n";
+ print STDERR "cmdfile = $opt_cmdfile\n";
+ print STDERR "setup = $opt_setup\n";
+ print STDERR "clear-trace = $opt_clear_trace\n";
+ print STDERR "debug = $opt_debug\n";
- print STDERR "pgmDir = $pgmDir\n";
- print STDERR "hbDir = $hbDir\n";
- print STDERR "hbSymsFile = $hbSymsFile\n";
- print STDERR "istepmodereg = $istepmodereg\n";
- print STDERR "commandreg = $commandreg\n";
- print STDERR "statusreg = $statusreg\n";
+ print STDERR "pgmDir = $pgmDir\n";
+ print STDERR "hbDir = $hbDir\n";
+ print STDERR "hbSymsFile = $hbSymsFile\n";
+ print STDERR "istepmodereg = $istepmodereg\n";
+ print STDERR "commandreg = $commandreg\n";
+ print STDERR "statusreg = $statusreg\n";
+ print STDERR "shutdownflag reg = $shutdownflag\n";
+ print STDERR "shutdownsts reg = $shutdownsts\n";
VBU_Cacheline::SetFlags( 1, 0 );
@@ -235,10 +257,16 @@ sub main()
my $qstr = VBU_Cacheline::P8_Ins_Query();
if ( $qstr ne "STOPPED" )
{
- print STDOUT "VPO is \"$qstr\", setting to STOPPED.\n";
+ print STDOUT "Setting P8 Instructions to STOPPED.\n";
VBU_Cacheline::P8_Ins_Stop();
}
+ ( my $flag, my $sts ) = getShutDownStatus();
+ if ( $flag )
+ {
+ print STDOUT "Sorry, HostBoot has already shut down with status $sts, cannot run isteps.\n";
+ exit;
+ }
##
## Process resume
@@ -390,6 +418,23 @@ sub find_in_inList( $ )
}
##
+## Check if HostBoot has already run and shutdown.
+sub getShutDownStatus()
+{
+
+ my $flag = VBU_Cacheline::CLread( $shutdownflag );
+ my $status = VBU_Cacheline::CLread( $shutdownsts );
+
+ if ( $opt_debug )
+ {
+ print STDERR "Shutdown Flag = $flag\n";
+ print STDERR "Shutdown Status = $status\n";
+ }
+
+ return ( $flag, $status );
+}
+
+##
## keep trying to get status until seqnum syncs up
##
sub getSyncStatus( )
@@ -410,7 +455,7 @@ sub getSyncStatus( )
VBU_Cacheline::RunClocks();
## dump printk similar to the Jim McGuire's script
- ## dumpPrintk();
+ ## NOPE, CRASHES AWAN dumpPrintk();
$result = VBU_Cacheline::CLread( $statusreg );
$seqnum = ( ( $result & 0x3f00000000000000 ) >> 56 );
OpenPOWER on IntegriCloud