summaryrefslogtreecommitdiffstats
path: root/src/build/vpo
diff options
context:
space:
mode:
authorMark Wenning <wenning@us.ibm.com>2012-04-02 17:27:57 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-04-17 11:34:02 -0500
commitb97e806c5c044abd0cc12cbca41c8358c67eade1 (patch)
tree6f16776b8247eec8c6be8465e1ffd1daad65534b /src/build/vpo
parentb3c9d1540732ead1232098cf3c5c1ebcbc89e573 (diff)
downloadtalos-hostboot-b97e806c5c044abd0cc12cbca41c8358c67eade1.tar.gz
talos-hostboot-b97e806c5c044abd0cc12cbca41c8358c67eade1.zip
Add IStep Stubs for all ISteps in IPL Flow Document
Add stubs for all remaining ISteps, based on HostBoot_IPL_Flow_v1.01.odt document. Task 39253 1 -5 Not applicable, performed by SBE 6 - Save SBE (HWAS) ALL, Brian is moving some of them from 4 7 - Start Clocks on Nest Chiplets ALL 8 - EDI, EI init ALL 9 - Activate PowerBus ALL 10 - Centaur Init already implemented 11 - DMI Training already implemented 12 - MC Init already Implemented 13 - Dram Training already Implemented 14 - Dram Initialization ALL 15 - Build Winkle Images ALL 16 - Core Activate ALL 17 - Init PSI marked FSP, not implemented 18 - Establish System SMP 18.8, 9, 10 only, the rest are marked FSP 19 - Build and Load Host Image marked FSP, not implemented 20 - Load Payload ALL 21 - Start Payload ALL RTC: 38196 Change-Id: I4e853f58caafe7dd472d57b42883724eaaa2e8a3 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/826 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/vpo')
-rwxr-xr-xsrc/build/vpo/VBU_Cacheline.pm256
-rwxr-xr-xsrc/build/vpo/hb-istep103
2 files changed, 204 insertions, 155 deletions
diff --git a/src/build/vpo/VBU_Cacheline.pm b/src/build/vpo/VBU_Cacheline.pm
index 596e7fcde..af9a502a1 100755
--- a/src/build/vpo/VBU_Cacheline.pm
+++ b/src/build/vpo/VBU_Cacheline.pm
@@ -22,13 +22,13 @@
#
# IBM_PROLOG_END
#
-# Name: hb-modify-cacheline.pm
+# Name: src/build/vpo/VBU_Cacheline.pm
#
-# Purpose: routines for reading and writing a 64-bit value into L3 in an
+# Purpose: routines for reading and writing a 64-bit value into L3 in an
# AWAN session. Accepts an address into L3, and 64-bit data hex word
# (write).
-# VBU can only read/write to memory in 128-byte cachelines, so if
-# we want to write a memory location we must read in the entire
+# VBU can only read/write to memory in 128-byte cachelines, so if
+# we want to write a memory location we must read in the entire
# cacheline, modify the correct byte(s) and then write it back.
# Called from shell script do_p8vbu_script_hbi*
# Written in perl because that is what is being used for the debug
@@ -43,7 +43,7 @@ require Exporter;
our @ISA = qw( Exporter );
our @EXPORT = qw( CLread CLwrite RunClocks P8_Ins_Start P8_Ins_Stop P8_Ins_Query SetFlags);
-
+
#------------------------------------------------------------------------------
# Specify perl modules to use
#------------------------------------------------------------------------------
@@ -76,17 +76,17 @@ my $curDir = getcwd();
my $CLfile = "$curDir/istepmodereg.dma";
my $CORE = "-c3";
-## my $SIM_CLOCKS = "4000000";
-## my $SIM_CLOCKS = "2000000";
-my $SIM_CLOCKS = "3000000";
+## my $SIM_CLOCKS = "4000000";
+## my $SIM_CLOCKS = "2000000";
+my $SIM_CLOCKS = "3000000";
#############################################
## Internal Globals
#############################################
my $CLdebug = 0;
-my $CLtest = 0;
+my $CLtest = 0;
-## flushed Flag, if 0, it means the L2 cache has not been flushed.
+## flushed Flag, if 0, it means the L2 cache has not been flushed.
## It must be flushed once before doing L3 reads
my $L2_Flushed = 0;
@@ -106,72 +106,72 @@ my $FLUSHQUERY = "$vbuToolsDir/p8_check_l3";
my $RUNCLKSCMD = "simclock";
## @todo $$$$$
-## NOTE: need to be able to specify thread (-t ) and core (-c ), they
-## should not be hardwired
-##my $QUERYCMD = "$vbuToolsDir/proc_thread_control.x86 -query $CORE -t0";
+## NOTE: need to be able to specify thread (-t ) and core (-c ), they
+## should not be hardwired
+##my $QUERYCMD = "$vbuToolsDir/proc_thread_control.x86 -query $CORE -t0";
##my $STOPCMD = "$vbuToolsDir/proc_thread_control.x86 -stop $CORE -tall";
##my $STARTCMD = "$vbuToolsDir/proc_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 $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/proc_thread_control.x86 -sreset_auto $CORE";
-##
+##
#==============================================================================
# SUBROUTINES
#==============================================================================
##
-## Read the cacheline at addr from L3 and dump it to a binary file.
-## Assumes that the input address is a binary addr on a 128 byte boundary
+## Read the cacheline at addr from L3 and dump it to a binary file.
+## Assumes that the input address is a binary addr on a 128 byte boundary
##
sub readcacheline( $ )
{
- my ( $addr ) = @_;
+ my ( $addr ) = @_;
my $cmd;
## my $hexaddr = sprintf( "0x%x", $addr );
- my $hexaddr = sprintf( "%x", $addr );
-
+ my $hexaddr = sprintf( "%x", $addr );
+
if ( $CLdebug ) { print STDERR __LINE__, "-- Read cacheline at $hexaddr...\n"; }
-
+
## Stop simulation so we can read L3 properly
- P8_Ins_Stop();
-
+ ## $$ P8_Ins_Stop();
+
## flush L2 if necessary
- P8_Flush_L2();
-
+ ## $$ P8_Flush_L2();
+
$cmd = "$DUMPCMD $hexaddr 1 -f $CLfile -b $CORE";
- if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
- ( system( $cmd ) == 0 )
+ if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
+ ( system( $cmd ) == 0 )
or die "$cmd failed $? : $! \n";
-
- ## Start simulation back up.
- ## P8_Ins_Start();
-
+
+ ## Start simulation back up.
+ ## P8_Ins_Start();
+
}
##
## derived from Perl Cookbook, 8.13
## pack/unpack format is unsigned big endian 32-bit hi, lo
-## however, the input data from getopts still assumes that perl is compiled
+## however, the input data from getopts still assumes that perl is compiled
## for 64-bit #s
##
sub modifycacheline( $$ )
{
my ( $offset, $data ) = @_;
-
+
my $typedef = 'N N'; # 2 32-bit network order
my $sizeof = length( pack($typedef,() ) );
my $filesize = -s $CLfile;
my $buffer;
-
+
open( FH, "+< $CLfile") or die "can't open $CLfile : $!";
- binmode FH; ## not really necessary, but....
+ binmode FH; ## not really necessary, but....
seek( FH, $offset, SEEK_SET) or die "seek $CLfile failed: $!";
read( FH, $buffer, $sizeof) == $sizeof or die "read failed: $!";
@@ -186,13 +186,13 @@ sub modifycacheline( $$ )
seek( FH, -$sizeof, SEEK_CUR) or die "seek $CLfile failed: $!";
print FH $buffer;
-
- close( FH ) or die "close $CLfile failed: $!";
-}
+
+ close( FH ) or die "close $CLfile failed: $!";
+}
##
## Write modified file back to L3 cacheline.
-## This assumes that addr has already been converted to binary addr on a
+## This assumes that addr has already been converted to binary addr on a
## 128 byte boundary
##
sub writecacheline( $ )
@@ -200,20 +200,20 @@ sub writecacheline( $ )
my ( $addr ) = @_;
my $cmd;
## my $hexaddr = sprintf( "0x%x", $addr );
- my $hexaddr = sprintf( "%x", $addr );
+ my $hexaddr = sprintf( "%x", $addr );
## Stop simulation so we can write L3
P8_Ins_Stop();
-
+
$cmd = "$LOADCMD -o $hexaddr -f $CLfile -b $CORE";
- if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
- ( system( $cmd ) == 0 )
+ if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
+ ( system( $cmd ) == 0 )
or die "$cmd failed, $? : $! \n";
-
+
## Start sim back up
## P8_Ins_Start();
-
-}
+
+}
##
@@ -223,20 +223,20 @@ sub P8_Ins_Query()
{
my $cmd = "$QUERYCMD";
my $retstr = "";
-
- if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
-
+
+ if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
+
## execute it with backticks so we can get the output.
- $retstr = `$cmd`;
+ $retstr = `$cmd`;
if ( $? != 0 ) { die "$cmd failed $? : $! \n"; }
-
+
if ( ($retstr =~ m/Quiesced/)
|| ($retstr =~ m/STOPPED/)
- )
+ )
{
return "STOPPED";
}
- elsif ( ($retstr =~ m/Running/)
+ elsif ( ($retstr =~ m/Running/)
||($retstr =~ m/RUNNING/)
)
{
@@ -245,7 +245,7 @@ sub P8_Ins_Query()
else
{
die "invalid string \"$retstr\" from P8_Ins_Query\n";
- }
+ }
}
@@ -255,26 +255,26 @@ sub P8_Ins_Query()
sub P8_Ins_Start()
{
my $cmd = "$STARTCMD";
-
+
if ( P8_Ins_Query() eq "STOPPED" )
{
- if ( !$CLdebug )
+ if ( !$CLdebug )
{ $cmd .= " -quiet"; }
else
- { print STDERR __LINE__, "-- run $cmd ...\n"; }
+ { print STDERR __LINE__, "-- run $cmd ...\n"; }
- ( system( $cmd ) == 0 )
+ ( system( $cmd ) == 0 )
or die "$cmd failed $? : $! \n";
-
+
## reset the flushFlag, need to flush again before a read.
$L2_Flushed = 0;
}
else
{
if ($CLdebug) { print STDERR __LINE__, "-- P8_Ins_Start: already RUNNING\n"; }
- }
-
+ }
+
}
@@ -284,31 +284,31 @@ sub P8_Ins_Start()
sub P8_Ins_Stop()
{
my $cmd = "$STOPCMD";
-
+
if ( P8_Ins_Query() eq "RUNNING" )
- {
+ {
if ( ! $CLdebug )
{ $cmd .= " -quiet"; }
else
{ print STDERR __LINE__, "-- run $cmd ...\n"; }
-
- ( system( $cmd ) == 0 )
+
+ ( system( $cmd ) == 0 )
or die "$cmd failed $? : $! \n";
-
+
}
else
{
if ($CLdebug) { print STDERR __LINE__, "-- P8_Ins_Stop: already STOPPED\n"; }
- }
-
+ }
+
}
##
-## Check if cache is flushed.
+## Check if cache is flushed.
## $TODO
-## p8_check_L3 will scan the L3 directory for unfilled cachelines and
+## p8_check_L3 will scan the L3 directory for unfilled cachelines and
## return a string:
-## $ p8_check_l3 100 4 -c3 -f $labhome/foo -x -o
+## $ p8_check_l3 100 4 -c3 -f $labhome/foo -x -o
## p8_check_l3 - address (0x100) not found in L3 directory.
##
## $ p8_check_l3 100 4 -c3 -f $labhome/foo -x -o
@@ -320,41 +320,41 @@ sub P8_Check_Flushed
my $tmpfile = "./tmpflush";
my $cmd = "$FLUSHQUERY";
my $rc = 0;
-
+
## execute it with backticks so we can get the output.
- my $retstr = `$cmd $CORE -f $tmpfile -x -o`;
+ my $retstr = `$cmd $CORE -f $tmpfile -x -o`;
if ( $? != 0 ) { die "$cmd failed $? : $! \n"; }
-
+
chomp( $retstr );
-
+
if ( $retstr =~ /^.*.all addresses.*/ )
{
$rc = 1;
}
-
+
return $rc;
}
##
## Flush L2 Cache
-## This only needs to be done once after the clock is stopped,
+## This only needs to be done once after the clock is stopped,
## thus the toggle flag
##
sub P8_Flush_L2()
{
my $cmd = "$FLUSHCMD";
-
- if ( !$L2_Flushed )
- {
- if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
- ( system( $cmd ) == 0 )
+
+ ## if ( !$L2_Flushed )
+ ##{
+ if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
+ ( system( $cmd ) == 0 )
or die "$cmd failed $? : $! \n";
-
- ## mark the CPU as flushed.
- $L2_Flushed = 1;
- }
- if ($CLdebug) { print STDERR __LINE__, "-- P8_FLush_L2 : $L2_Flushed\n"; }
+ ## ## mark the CPU as flushed.
+ ## $L2_Flushed = 1;
+ ## }
+ ##
+ ##if ($CLdebug) { print STDERR __LINE__, "-- P8_FLush_L2 : $L2_Flushed\n"; }
}
@@ -365,26 +365,26 @@ sub P8_Flush_L2()
sub RunClocks()
{
my $cmd = 0;
-
+
if ( $CLdebug ) { printf STDERR __LINE__, "-- RunClocks()\n"; }
-
+
## Check, and start instructions if necessary
if ( P8_Ins_Query( ) ne "RUNNING" )
{
-
+
P8_Ins_Start();
}
$cmd = "$RUNCLKSCMD $SIM_CLOCKS -quiet";
- if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
- ( system( $cmd ) == 0 )
- or die "$cmd failed, $? : $! \n";
-
-}
+ if ( $CLdebug ) { print STDERR __LINE__, "-- run $cmd ...\n"; }
+ ( system( $cmd ) == 0 )
+ or die "$cmd failed, $? : $! \n";
+
+}
##
-## Read a 64-bit value from L3 at hex addr.
+## Read a 64-bit value from L3 at hex addr.
## Input is expected to be a hex ascii string
##
sub CLread( $ )
@@ -394,9 +394,9 @@ sub CLread( $ )
my $CLbase = ( hex($addr) & 0xffffff80);
my $CLoffset = ( hex($addr) & (~0xffffff80) );
my $result = 0; ## 64-bit hex
-
+
if ( $CLdebug ) { printf STDERR __LINE__, "-- CLread( %s ) : CLbase=0x%x, CLoffset=0x%x\n", $addr, $CLbase, $CLoffset }
-
+
readcacheline( $CLbase );
## extract quadword from cacheline file
@@ -405,24 +405,24 @@ sub CLread( $ )
my $filesize = -s $CLfile;
my $buffer;
open( FH, "+< $CLfile") or die "can't open $CLfile : $!";
- binmode FH; ## not really necessary, but....
+ binmode FH; ## not really necessary, but....
seek( FH, $CLoffset, SEEK_SET) or die "seek $CLfile failed: $!";
read( FH, $buffer, $sizeof) == $sizeof or die "read failed: $!";
- close( FH ) or die "close $CLfile failed: $!";
-
+ close( FH ) or die "close $CLfile failed: $!";
+
## unpack and reassemble as big-endian
- ( my $hi, my $lo ) = unpack($typedef, $buffer);
+ ( my $hi, my $lo ) = unpack($typedef, $buffer);
$result = ( ( ( $hi << 32 ) & 0xffffffff00000000 ) | $lo );
-
- if ( $CLdebug )
- {
- printf STDERR __LINE__, "-- CLread( %s ) = 0x%lx ", $addr, $result;
+
+ if ( $CLdebug )
+ {
+ printf STDERR __LINE__, "-- CLread( %s ) = 0x%lx ", $addr, $result;
dumpcacheline(" " );
}
- return ( $result );
+ return ( $result );
}
-
+
##
## Write command byte to cacheline
## Inputs are expected to be hex ascii strings
@@ -434,8 +434,8 @@ sub CLwrite( $$ )
my $CLoffset = ( hex($addr) & (~0xffffff80) );
my $CLdata = hex($data);
my $result = 0;
-
- if ( $CLdebug ) { printf STDERR __LINE__, "-- CLwrite( %s, %s ) : CLbase=0x%x, CLoffset=0x%x, CLdata=0x%lx\n",
+
+ if ( $CLdebug ) { printf STDERR __LINE__, "-- CLwrite( %s, %s ) : CLbase=0x%x, CLoffset=0x%x, CLdata=0x%lx\n",
$addr, $data, $CLbase, $CLoffset, $CLdata; }
## clear the cacheline file
@@ -445,49 +445,49 @@ sub CLwrite( $$ )
readcacheline( $CLbase );
## dumpcacheline( "after read", $CLfile );
-
+
## modify the cacheline file
modifycacheline( $CLoffset, $data );
## dumpcacheline( "after modify", $CLfile );
## write the cacheline back to L3
- writecacheline( $CLbase );
+ writecacheline( $CLbase );
if ( $CLdebug )
{
## check, clear the cacheline file and read again
system( "rm -f $CLfile" );
readcacheline( $CLbase );
- dumpcacheline( "Readback", $CLfile );
- }
-
+ dumpcacheline( "Readback", $CLfile );
+ }
+
}
sub dumpcacheline()
{
my ( $comment ) = @_;
-
- if ( $CLdebug )
- {
- print STDERR __LINE__, "-- $comment, dump cache file :\n";
- system( "xxd $CLfile" );
- }
-
+
+ if ( $CLdebug )
+ {
+ print STDERR __LINE__, "-- $comment, dump cache file :\n";
+ system( "xxd $CLfile" );
+ }
+
}
sub SetFlags( $$ )
{
my ( $debug, $test ) = @_;
-
+
$CLdebug = $debug;
$CLtest = $test;
-
- if ( $CLdebug )
- {
- print STDERR __LINE__, "-- CLdebug=$CLdebug, CLtest=$CLtest\n";
- }
+
+ if ( $CLdebug )
+ {
+ print STDERR __LINE__, "-- CLdebug=$CLdebug, CLtest=$CLtest\n";
+ }
}
diff --git a/src/build/vpo/hb-istep b/src/build/vpo/hb-istep
index 38ba578f9..6f586feac 100755
--- a/src/build/vpo/hb-istep
+++ b/src/build/vpo/hb-istep
@@ -87,6 +87,9 @@ use constant SPLESS_SINGLE_ISTEP_CMD => 0x00;
use constant SPLESS_RESUME_ISTEP_CMD => 0x01;
use constant SPLESS_CLEAR_TRACE_CMD => 0x02;
+use constant MAX_ISTEPS => 25;
+use constant MAX_SUBSTEPS => 25;
+
#------------------------------------------------------------------------------
# Globals
@@ -103,11 +106,11 @@ my $opt_cmdfile = 0; ## batchmode, later
my $opt_setup = ""; ## run Jim's script to start up the model
my @inList;
-$inList[10][10] = ();
+$inList[MAX_ISTEPS][MAX_SUBSTEPS] = ();
## initialize inList to "undefined"
-for( my $i = 0; $i <= $#inList; $i++)
+for( my $i = 0; $i < MAX_ISTEPS; $i++)
{
- for(my $j = 0; $j <= $#inList; $j++)
+ for(my $j = 0; $j < MAX_SUBSTEPS; $j++)
{
undef( $inList[$i][$j] );
}
@@ -222,8 +225,7 @@ if ( $opt_debug )
print STDERR "shutdownflag reg = $shutdownflag\n";
print STDERR "shutdownsts reg = $shutdownsts\n";
- VBU_Cacheline::SetFlags( 1, 0 );
-
+ VBU_Cacheline::SetFlags( 1, 0 );
}
if ( $opt_help )
@@ -265,6 +267,7 @@ sub main()
{
print STDOUT "Setting P8 Instructions to STOPPED.\n";
VBU_Cacheline::P8_Ins_Stop();
+ VBU_Cacheline::P8_Flush_L2();
}
( my $flag, my $sts ) = getShutDownStatus();
@@ -340,9 +343,9 @@ sub printUsage()
print STDOUT " [--command <foo>..<bar>] (run named isteps \"foo\" through \"bar\")\n" ;
print STDOUT " [--resume] (resume an istep that is at a break point)\n" ;
print STDOUT "\n" ;
+ print STDOUT " [--clear-trace] (clear trace buffers before starting)\n";
## print STDOUT " [--cmdfile] (get commands from a batchfile)\n";
## print STDOUT " [--setup] (bring up AWAN and wait for further commands)\n";
-## print STDOUT " [--clear-trace] (clear trace buffers before starting)\n";
## print STDOUT "\n" ;
}
@@ -374,9 +377,13 @@ sub get_istep_list()
chomp;
( $istep, $substep, $name) = split( ",", $_ );
+ chomp $name;
## print STDERR "$_, $istep, $substep, $name\n" ;
- $inList[$istep][$substep] = $name;
+ if ( defined($name) && ( $name ne "" ) )
+ {
+ $inList[$istep][$substep] = $name;
+ }
}
close( FH );
@@ -393,12 +400,12 @@ sub print_istep_list( )
print STDOUT " IStep Name\n";
print STDOUT "---------------------------------------------------\n";
- for(my $i = 4; $i <= $#inList; $i++)
+ for(my $i = 0; $i < MAX_ISTEPS; $i++)
{
- for(my $j = 0; $j <= $#inList; $j++)
+ for(my $j = 0; $j < MAX_SUBSTEPS; $j++)
{
- ## print all substeps
- # print "==$inList[$i][$j] \n";
+
+ ## print "==$i.$j $inList[$i][$j] \n";
if ( defined( $inList[$i][$j] ) )
{
if ( $hdrflag )
@@ -422,9 +429,9 @@ sub find_in_inList( $ )
{
my ( $substepname ) = @_;
- for(my $i = 0; $i <= $#inList; $i++)
+ for(my $i = 0; $i < MAX_ISTEPS; $i++)
{
- for(my $j = 0; $j <= $#inList; $j++)
+ for(my $j = 0; $j < MAX_SUBSTEPS; $j++)
{
## if ( defined($inList[$i][$j]) ) { print ".$inList[$i][$j]?$substepname. \n"; }
@@ -436,7 +443,7 @@ sub find_in_inList( $ )
}
}
- return ( $#inList, $#inList, 0 )
+ return ( MAX_ISTEPS, MAX_SUBSTEPS, 0 )
}
##
@@ -466,23 +473,46 @@ sub getSyncStatus( )
my $count = 1000;
my $result = 0;
my $seqnum = 0;
+ my $running = 0;
## get response. sendCmd() should have bumped g_SeqNum, so we will sit
## here for a reasonable amount of time waiting for the correct sequence
## number to come back.
while(1)
{
+
+
## advance HostBoot code by a certain # of cycles, then check the
## sequence number to see if it has changed. rinse and repeat.
+ ## Note: RunClocks will start instructions
VBU_Cacheline::RunClocks();
+
+ ## Stop instructions, flush L2
+ VBU_Cacheline::P8_Ins_Stop();
+ VBU_Cacheline::P8_Flush_L2();
+
## dump printk similar to the Jim McGuire's script
## NOPE, CRASHES AWAN dumpPrintk();
- $result = VBU_Cacheline::CLread( $statusreg );
- $seqnum = ( ( $result & 0x3f00000000000000 ) >> 56 );
- if ( $seqnum == $g_SeqNum )
+ ## check for system crash
+ my ( $flag, $status ) = getShutDownStatus();
+ if ( $flag )
+ {
+ print STDOUT "HostBoot has shut down with status $status";
+ return -1;
+ }
+
+ $result = VBU_Cacheline::CLread( $statusreg );
+
+ printf STDERR "===== count=%d, result=0x%lx\n", $count, $result ;
+
+ $seqnum = ( ( $result & 0x3f00000000000000 ) >> 56 );
+ $running = ( ( $result & 0x8000000000000000 ) >> 63 );
+ ## if ( ( $running == 0 )
+ ## && ( $seqnum == $g_SeqNum )
+ if ( $seqnum == $g_SeqNum )
{
return $result;
}
@@ -552,9 +582,18 @@ sub runIStep( $$ )
}
else
{
- printf STDOUT "Istep %d.%d returned Status: 0x%x\n", $stsIStep, $stsSubstep, $istepStatus ;
+ printf STDOUT "Istep %d.%d returned Status: 0x%x", $stsIStep, $stsSubstep, $istepStatus ;
+ if ( $istepStatus == 0xa )
+ {
+ printf STDOUT ": not implemented yet.\n";
+ }
+ else
+ {
+ printf STDOUT "\n";
+ }
}
- print STDOUT "-----------------------------------------------------------------\n";
+
+ print STDOUT "-------------------------------------------------------------- $g_SeqNum\n";
}
}
@@ -568,13 +607,6 @@ sub sCommand( $ )
my $i = $scommand;
my $j = 0;
- # sanity check
- if ( !defined($inList[$i][0]) )
- {
- printf STDOUT "IStep %d.0 does not exist.\n", $i;
- return -1;
- }
-
# execute all the substeps in the IStep
for( $j=0; $j<$#inList; $j++ )
{
@@ -658,7 +690,10 @@ sub parse_command( $ )
for( my $y=$substepM; $y<$substepN+1; $y++ )
{
## print STDOUT "run $x $y $inList[$x][$y]\n";
- runIStep( $x, $y );
+ if ( defined( $inList[$x][$y] ) )
+ {
+ runIStep( $x, $y );
+ }
}
}
@@ -709,6 +744,20 @@ sub setMode( $ )
## advance HostBoot code by a certain # of cycles, then check the
## sequence number to see if it has changed. rinse and repeat.
VBU_Cacheline::RunClocks();
+
+ ## Stop instructions, flush L2
+ VBU_Cacheline::P8_Ins_Stop();
+ VBU_Cacheline::P8_Flush_L2();
+
+
+
+ ## check for system crash
+ my ( $flag, $status ) = getShutDownStatus();
+ if ( $flag )
+ {
+ print STDOUT "HostBoot has shut down with status $status";
+ return -1;
+ }
$result = VBU_Cacheline::CLread( $statusreg );
OpenPOWER on IntegriCloud