summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndres Lugo-Reyes <aalugore@us.ibm.com>2018-07-02 17:20:22 -0500
committerAndres A. Lugo-Reyes <aalugore@us.ibm.com>2018-07-13 11:35:04 -0400
commit7f75f89c885f491dc0b5dbdcd9bf2ed8953fb45a (patch)
tree2b27f3f3cc543caef45513e9cbc15bdd39f983e6 /src
parentb8a8037ca194fc690ff1a859b5c0ddf08e708b81 (diff)
downloadtalos-occ-7f75f89c885f491dc0b5dbdcd9bf2ed8953fb45a.tar.gz
talos-occ-7f75f89c885f491dc0b5dbdcd9bf2ed8953fb45a.zip
Update occtoolp9 to handle parsing WOF Reset reason in opal-prd
Change-Id: I0eb77ae38408d767e13b21dd6b02c3047d818058 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61904 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/tools/occtoolp956
1 files changed, 55 insertions, 1 deletions
diff --git a/src/tools/occtoolp9 b/src/tools/occtoolp9
index 51d8cc0..d4c2cf9 100755..100644
--- a/src/tools/occtoolp9
+++ b/src/tools/occtoolp9
@@ -6,7 +6,7 @@
#
# OpenPOWER OnChipController Project
#
-# Contributors Listed Below - COPYRIGHT 2017
+# Contributors Listed Below - COPYRIGHT 2017,2018
# [+] International Business Machines Corp.
#
#
@@ -144,6 +144,7 @@ function usage
echo " -I = HTMGT info"
echo " -IF <newValue> = Read/Set HTMGT internalFlags"
echo " -ES = Attempt to Exit Safe mode"
+ echo " -W = Get WOF reset reasons for ALL OCCs"
echo ""
echo " CRONUS Only Commands:"
echo " -P = Send POLL command to the OCC and collect/purge any elog, if found"
@@ -294,6 +295,10 @@ while [ -n "$(echo $1 | grep '-')" ]; do
action="TMGTInfo"
;;
+ -W )
+ action="WOFRR"
+ ;;
+
-IF )
action="TMGTFlags"
if [ -n "$2" ]; then
@@ -1436,6 +1441,48 @@ function tmgt_info
} # end tmgt_info()
+
+function wof_reset_reasons
+{
+ ### Dump WOF reset reasons and OCC instance ID
+ echo "==> opal-prd --expert-mode htmgt-passthru 0x0A"
+ $sudo opal-prd --expert-mode htmgt-passthru 0x0A | sed 's/\s//g' > /tmp/wofrr.bin
+ # get status of first cmd in piped cmdline
+ let rc=${PIPESTATUS[0]}
+ if [ $rc -eq 0 ]; then
+ while read line; do
+ if [ ${#line} -gt 0 ]; then
+ #First read the output data into one variable
+ alldata=$alldata$line
+ fi
+ done < /tmp/wofrr.bin
+ else
+ echo "ERROR: opal-prd occ passthru command failed with rc=$rc"
+ fi
+
+ # Data length should be multiple of 10. Each OCC has a 2 digit ID followed
+ # by the 8 digit WOF Reset reason vector
+ if [ $((${#alldata}%10)) -ne 0 ]; then
+ echo "ERROR: Data is unexpected length. Aborting..."
+ else
+ numOccs=$((${#alldata}/10))
+ current_index=0
+ for (( i=0; i<$numOccs; i++ ))
+ do
+ #Move to the next 10 digit block
+ current_line=${alldata:${current_index}:10}
+ #Extract OCC Instance
+ let occId=0x${current_line:0:2}
+ #Extract wof_disabled bit vector
+ let wofRR=0x${current_line:2:8}
+ printf "OCC%X WOF Reset Reasons: 0x%08X\n" $occId $wofRR
+ #Increment index
+ current_index=$current_index+10
+ done
+ fi
+} # end wof_reset_reasons
+
+
function tmgt_flags
{
### Dump HTMGT Internal Flags
@@ -1695,6 +1742,13 @@ if [ -n "$action" ]; then
else
echo -e "${red}ERROR: Command only supported with opal-prd${normal} (not $interface)"
fi
+ elif [ "$action" == "WOFRR" ]; then
+
+ if [ "$interface" == "opal" ]; then
+ wof_reset_reasons
+ else
+ echo -e "${red}ERROR: Command only supported with opal-prd${normal} (not $interface)"
+ fi
elif [ "$action" == "TMGTFlags" ]; then
if [ "$interface" == "opal" ]; then
OpenPOWER on IntegriCloud