[Skiboot] [PATCH 2/2] hmi: Print CAPP FIR information when handling CAPP malfunction alerts
Andrew Donnellan
andrew.donnellan at au1.ibm.com
Wed Mar 1 10:58:17 AEDT 2017
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 at linux.vnet.ibm.com>
Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
---
core/hmi.c | 29 +++++++++++++++++++++++++++++
include/capp.h | 7 +++++--
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/core/hmi.c b/core/hmi.c
index 31a23ec7..e55a85b2 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 c76258b3..14f65be6 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
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com IBM Australia Limited
More information about the Skiboot
mailing list