summaryrefslogtreecommitdiffstats
path: root/src/build/debug
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2018-05-31 17:03:24 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-06-04 17:32:40 -0400
commit41daed137d2f31ba125a1ada241755e42f36868c (patch)
tree5067edb244a9ed4bd0bc7a04b792df15c0a93619 /src/build/debug
parentcbacafbc508accc492c63d4f18e509a6082e8f45 (diff)
downloadblackbird-hostboot-41daed137d2f31ba125a1ada241755e42f36868c.tar.gz
blackbird-hostboot-41daed137d2f31ba125a1ada241755e42f36868c.zip
Write Hostboot HRMOR into core scratch reg 1
Hostboot code will write the current HRMOR value into core scratch reg 1 (scom=xx010A87, spr=0x08) at initial boot. This data is ORed into the memory size data that was already present. The bootloader code will do the same. Also updated the debug tools to key off of this data if it is available to avoid any HRMOR hardcoding. The purpose of this change is to provide a method for the FSP code to handle various memory remapping scenarios that are currently in plan without needing any explicit communication from Hostboot. Change-Id: Ia3c81980ebd780ae182956cddae785dd408fbed9 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59699 Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/build/debug')
-rwxr-xr-xsrc/build/debug/ecmd-debug-framework.pl22
-rwxr-xr-xsrc/build/debug/fsp-memdump.sh12
2 files changed, 33 insertions, 1 deletions
diff --git a/src/build/debug/ecmd-debug-framework.pl b/src/build/debug/ecmd-debug-framework.pl
index 15439c66a..0fadd554b 100755
--- a/src/build/debug/ecmd-debug-framework.pl
+++ b/src/build/debug/ecmd-debug-framework.pl
@@ -35,6 +35,7 @@ use Hostboot::_DebugFramework;
use constant DEFAULT_HRMOR => 128*1024*1024; # 128 MB.
use constant PER_NODE_OFFSET => 32*1024*1024*1024*1024; # 32 TB.
+use constant UNSET_HRMOR => 0xFFFFFFFFFFFFFFFF;
my $filename = basename (__FILE__);
my $self = ($0 =~ m/$filename/);
@@ -49,6 +50,7 @@ my $forceHRMOR = 0;
my $node = 0; # -nX parm to ecmd
my $proc = 0; # -pX parm to ecmd
my $memMode = "check";
+my $hrmor = UNSET_HRMOR;
my $imgPath = "";
my $hbDir = $ENV{'HB_IMGDIR'};
@@ -152,9 +154,27 @@ sub getHRMOR
{
return $forceHRMOR;
}
+ elsif( $hrmor != UNSET_HRMOR )
+ {
+ # we already calculated everything
+ return $hrmor;
+ }
else
{
- return DEFAULT_HRMOR + ($node * PER_NODE_OFFSET);
+ # read Core Scratch 1 (multicast to all cores)
+ my $scratch1 = readScom( 0x41010A87, 8 );
+ # Bits 4:51 are the current HRMOR in MB (see memstate.H)
+ my $hrmor = ($scratch1 & 0x0FFFFFFFFFFFF000)>>12;
+ if( $hrmor == 0 )
+ {
+ $hrmor = DEFAULT_HRMOR + ($node * PER_NODE_OFFSET);
+ }
+ else
+ {
+ $hrmor = $hrmor*1024; #value is in MB
+ }
+
+ return $hrmor;
}
}
diff --git a/src/build/debug/fsp-memdump.sh b/src/build/debug/fsp-memdump.sh
index ef1b096ed..f62ae120f 100755
--- a/src/build/debug/fsp-memdump.sh
+++ b/src/build/debug/fsp-memdump.sh
@@ -93,6 +93,18 @@ limit_memory()
esac
}
+# @fn find_hrmor
+# Discover the stashed away HRMOR.
+find_hrmor()
+{
+ # HRMOR is stored in bits 4:51 of core scratch 1
+ # See memstate.H for details
+ fullreg=`getscom pu 41010A87 4 48`
+ #multiply result by 1024 since it is in MB
+ #take NODE into account
+ #fixme
+}
+
# Read filename and state.
FILE=$1
STATE=$2
OpenPOWER on IntegriCloud