diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2017-06-01 14:05:18 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-06-08 10:10:23 -0400 |
commit | f195e428f6b6494c5789c0833291321f564b058e (patch) | |
tree | ebb1485e5fd0a5b5eb0aaa5be754bbb6fb0d0e57 /src/build/debug/Hostboot/Istep.pm | |
parent | 4c586e2298ffafed3c1979784e1626868bd46f58 (diff) | |
download | talos-hostboot-f195e428f6b6494c5789c0833291321f564b058e.tar.gz talos-hostboot-f195e428f6b6494c5789c0833291321f564b058e.zip |
Dynamic ATTR Override support via debug interface
-Supported by debug tools (ecmd-debug-framework/Cronus)
Only in istep mode and between isteps
Requires HB to be running
-Uses output of attributeOverride tool (same format as ATTR_TMP)
-Introduces two new "debug" isteps
255,4,set_attr_overrides
255,5,clear_attr_overrides
-Once istep is triggered Hostboot sends down address/size
and the debug tool uses putmempba to push data to cache/mem.
Then Hostboot consumes just like ATTR_TMP
Change-Id: I4ade7b85acac077a15bdb36bba1ef9df4263b428
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41271
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>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/debug/Hostboot/Istep.pm')
-rwxr-xr-x | src/build/debug/Hostboot/Istep.pm | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/src/build/debug/Hostboot/Istep.pm b/src/build/debug/Hostboot/Istep.pm index be9029d32..8982cc8e9 100755 --- a/src/build/debug/Hostboot/Istep.pm +++ b/src/build/debug/Hostboot/Istep.pm @@ -97,6 +97,7 @@ my $opt_command = 0; my $opt_list = 0; my $opt_resume = 0; my $opt_clear_trace = 0; +my $attr_bin_file = ""; my $command = ""; @@ -245,6 +246,12 @@ sub main $opt_clear_trace = 1; $options[$i] = ""; } + if ( m/^\-{0,2}attr_bin$/ ) + { + $attr_bin_file = $args->{"attr_bin"}; + $options[$i] = ""; + } + } ## endfor ## if there's anything left after this, assume it is a single command @@ -376,9 +383,10 @@ sub checkDebugBuf { my $SCRATCH_MBOX1 = 0x00050038; my $SCRATCH_MBOX2 = 0x00050039; - my $MSG_TYPE_MASK = 0xFF00000000000000; - my $MSG_TYPE_TRACE = 0x0000000000000000; - my $MSG_TYPE_ATTR = 0x0100000000000000; + my $MSG_TYPE_MASK = 0xFF00000000000000; + my $MSG_TYPE_TRACE = 0x0000000000000000; + my $MSG_TYPE_ATTR = 0x0100000000000000; + my $MSG_TYPE_SET_ATTR = 0x0200000000000000; my $dbgAddr = ""; my $dbgSize = ""; @@ -407,6 +415,10 @@ sub checkDebugBuf { handleAttrDump($buffAddr, $buffSize); } + elsif ($msgType == $MSG_TYPE_SET_ATTR) + { + handleAttrOverride($buffAddr, $buffSize); + } #Write 0 to let HB know we extracted buf and it can continue ::writeScom($SCRATCH_MBOX1, 8, 0x0); @@ -481,6 +493,43 @@ sub handleAttrDump } } +## --------------------------------------------------------------------------- +## Push an ATTR override bin to memory +## --------------------------------------------------------------------------- +sub handleAttrOverride +{ + my $buffAddr = shift; + my $buffSize = shift; + + #Check to see if attr.bin file set + if ($attr_bin_file eq "") + { + ::userDisplay "\nATTR BIN File not set, + use [--tool-options='attr_bin=<file> set_attr_overrides']\n"; + exit 1; + } + + #Open the file, get the size + my $attrBinFile; + open ($attrBinFile, '<', $attr_bin_file) or + die "Can't open '$attr_bin_file' $!"; + my $size = -s $attr_bin_file; + + #Check that file size is less than HB allocated size + if ($size > $buffSize) + { + ::userDisplay "BIN file [$attr_bin_file] too big, $size vs $buffSize"; + exit 1; + } + + #Read in file data and actually write to mem + my $contents; + read($attrBinFile,$contents,$size); + ::writeData($buffAddr, $size, $contents); + close $attrBinFile ; +} + + ## --------------------------------------------------------------------------- ## Dump environment variable specified. |