summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2014-12-02 09:48:09 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-03 09:44:53 -0600
commit884df0a961451b7b00d99e07512b19f801ee7587 (patch)
treecdfe09c4b6265f6927dc1a5b4aeee5e87a26e9c8
parent1033b6f27ae04e22b2daccaff459b0266cb87c03 (diff)
downloadtalos-hostboot-884df0a961451b7b00d99e07512b19f801ee7587.tar.gz
talos-hostboot-884df0a961451b7b00d99e07512b19f801ee7587.zip
Allow ADU access to memory instead of PBA in ecmd debug tool
The mempba access procedures use PBA BAR3 to get to memory. The OCC also uses BAR3 so there is a collision with the tool if the OCC is running. Added an option to the ecmd framework to allow a user to force a method (pba/adu) and for the tool to check by default. Change-Id: I403cf1f08a8f753ea7f29e59501d80fb2daf432f Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14677 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-xsrc/build/debug/ecmd-debug-framework.pl63
1 files changed, 58 insertions, 5 deletions
diff --git a/src/build/debug/ecmd-debug-framework.pl b/src/build/debug/ecmd-debug-framework.pl
index 0ab7c44a9..99e9a2857 100755
--- a/src/build/debug/ecmd-debug-framework.pl
+++ b/src/build/debug/ecmd-debug-framework.pl
@@ -6,7 +6,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2014
+# [+] International Business Machines Corp.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -46,6 +48,7 @@ my $toolHelp = 0;
my $forceHRMOR = DEFAULT_HRMOR;
my $node = 0; # -nX parm to ecmd
my $proc = 0; # -pX parm to ecmd
+my $memMode = "check";
my $imgPath = "";
my $hbDir = $ENV{'HB_IMGDIR'};
@@ -71,6 +74,7 @@ GetOptions("tool:s" => \$tool,
"force-hrmor:o" => \$forceHRMOR,
"node:i" => \$node,
"proc:i" => \$proc,
+ "memmode:s" => \$memMode,
"man" => \$cfgMan) || pod2usage(-verbose => 0);
pod2usage(-verbose => 1) if $cfgHelp;
pod2usage(-verbose => 2) if $cfgMan;
@@ -85,6 +89,9 @@ else
# Determine the full image path.
$imgPath = determineImagePath($imgPath);
+ # Figure out the correct memory access method
+ determineMemMode();
+
# Parse tool options and call module.
parseToolOpts($toolOptions);
callToolModule($tool);
@@ -162,7 +169,10 @@ sub readData
my (undef, $debugfile) = tempfile(OPEN => 0);
my (undef, $filename) = tempfile(OPEN => 0);
- my $command = sprintf("cipgetmempba -n%d -p%d -fb %s %x %d -quiet > %s",
+ my $getmemcmd = "cipgetmempba";
+ if( $memMode =~ /adu/ ) { $getmemcmd = "getmemproc"; }
+ my $command = sprintf("%s -n%d -p%d -fb %s %x %d -quiet > %s",
+ $getmemcmd,
$node,
$proc,
$filename,
@@ -177,7 +187,7 @@ sub readData
my $result;
open FILE, $filename or die
- "ERROR: $filename not found attempting getmempba";
+ "ERROR: $filename not found attempting '$command'";
binmode FILE;
read FILE, $result, $size;
close FILE;
@@ -208,7 +218,11 @@ sub writeData
print $file $value;
close $file;
- my $command = sprintf("cipputmempba -n%d -p%d -cft -fb %s %x -quiet -mode inj > %s",
+ my $putmemcmd = "cipputmempba";
+ if( $memMode =~ /adu/ ) { $putmemcmd = "putmemproc"; }
+ my $command = sprintf(
+ "$putmemcmd -n%d -p%d -cft -fb %s %x -quiet -mode inj > %s",
+ $putmemcmd,
$node,
$proc,
$filename,
@@ -354,6 +368,38 @@ sub checkContTrace
}
+# @sub determinMemMode
+#
+# Determine the appropriate method to access memory
+#
+sub determineMemMode
+{
+ if( $memMode =~ /check/ )
+ {
+ # Cannot use pba access if the OCC is active
+ $bar0 = readScom( 0x02013F00, 64 ); #PBABAR0
+ if( $bar0 == 0 )
+ {
+ # BAR0 is zero so OCC is not in use
+ $memMode = "pba"; #use the PBA
+ }
+ else
+ {
+ $memMode = "adu"; #use the ADU
+ }
+ }
+ elsif( $memMode =~ /proc/ )
+ {
+ $memMode = "adu";
+ }
+ elsif( !($memMode =~ /pba/) && !($memMode =~ /adu/) )
+ {
+ ::userDisplay( "Unknown memmode parm - $memMode\n" );
+ exit 1;
+ }
+}
+
+
__END__
@@ -367,7 +413,7 @@ ecmd-debug-framework.pl [options] --tool=<module>
=head1 OPTIONS
-=over 8
+=over 9
=item B<--tool>=MODULE
@@ -403,6 +449,13 @@ Print a brief help message and exits.
Prints the manual page and exits.
+=item B<--memmode>=adu/pba
+
+Force a specific memory access method.
+ adu = getmemproc/putmemproc
+ pba = cipgetmemba/cipputmempba
+ Default action will use PBABAR0 to decide
+
=back
=head1 DESCRIPTION
OpenPOWER on IntegriCloud