aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2017-03-01 10:58:17 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-03-16 17:17:32 +1100
commit9ffc890d500ed553c0053fb56f97803696fc9f4d (patch)
tree5e19caca2975b6b9a54519b3a985daa257695276
parentb2dc494a4950927cdda5f009e1a482aabcb25afa (diff)
downloadskiboot-9ffc890d500ed553c0053fb56f97803696fc9f4d.zip
skiboot-9ffc890d500ed553c0053fb56f97803696fc9f4d.tar.gz
skiboot-9ffc890d500ed553c0053fb56f97803696fc9f4d.tar.bz2
hmi: Print CAPP FIR information when handling CAPP malfunction alerts
When diagnosing or debugging CAPP errors, it's rather useful to have the CAPP FIR, which often provides very helpful information. Print the CAPP FIR to the log when we handle a Malfunction Alert HMI for a CAPP error. Cc: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/hmi.c29
-rw-r--r--include/capp.h7
2 files changed, 34 insertions, 2 deletions
diff --git a/core/hmi.c b/core/hmi.c
index 31a23ec..e55a85b 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -25,6 +25,7 @@
#include <chip.h>
#include <npu-regs.h>
#include <npu.h>
+#include <capp.h>
/*
* HMER register layout:
@@ -387,8 +388,36 @@ static void find_capp_checkstop_reason(int flat_chip_id,
int capp_index;
struct proc_chip *chip = get_chip(flat_chip_id);
int capp_num = CHIP_IS_NAPLES(chip) ? 2 : 1;
+ uint32_t reg_offset;
+ uint64_t capp_fir;
+ uint64_t capp_fir_mask;
+ uint64_t capp_fir_action0;
+ uint64_t capp_fir_action1;
for (capp_index = 0; capp_index < capp_num; capp_index++) {
+ reg_offset = capp_index ? CAPP1_REG_OFFSET : 0x0;
+
+ if (xscom_read(flat_chip_id,
+ CAPP_FIR + reg_offset, &capp_fir) ||
+ xscom_read(flat_chip_id,
+ CAPP_FIR_MASK + reg_offset, &capp_fir_mask) ||
+ xscom_read(flat_chip_id,
+ CAPP_FIR_ACTION0 + reg_offset, &capp_fir_action0) ||
+ xscom_read(flat_chip_id,
+ CAPP_FIR_ACTION1 + reg_offset, &capp_fir_action1)) {
+ prerror("CAPP: Couldn't read CAPP#%d FIR registers by XSCOM!\n",
+ capp_index);
+ continue;
+ }
+
+ if (!(capp_fir & ~capp_fir_mask))
+ continue;
+
+ prlog(PR_DEBUG, "HMI: CAPP#%d: FIR 0x%016llx mask 0x%016llx\n",
+ capp_index, capp_fir, capp_fir_mask);
+ prlog(PR_DEBUG, "HMI: CAPP#%d: ACTION0 0x%016llx, ACTION1 0x%016llx\n",
+ capp_index, capp_fir_action0, capp_fir_action1);
+
if (is_capp_recoverable(flat_chip_id, capp_index)) {
if (handle_capp_recoverable(flat_chip_id, capp_index)) {
hmi_evt->severity = OpalHMI_SEV_NO_ERROR;
diff --git a/include/capp.h b/include/capp.h
index c76258b..14f65be 100644
--- a/include/capp.h
+++ b/include/capp.h
@@ -67,8 +67,11 @@ enum capp_reg {
#define CAPP_SNP_ARRAY_WRITE_REG 0x2013801
#define CAPP_APC_MASTER_ARRAY_WRITE_REG 0x2013802
-#define CAPP_FIR 0x2013000
-#define CAPP_ERR_RPT_CLR 0x2013013
+#define CAPP_FIR 0x2013000
+#define CAPP_FIR_MASK 0x2013003
+#define CAPP_FIR_ACTION0 0x2013006
+#define CAPP_FIR_ACTION1 0x2013007
+#define CAPP_ERR_RPT_CLR 0x2013013
#define APC_MASTER_PB_CTRL 0x2013018
#define APC_MASTER_CAPI_CTRL 0x2013019
#define TRANSPORT_CONTROL 0x201301C