aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2018-02-28 17:52:12 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-02-28 20:28:39 -0600
commitfbdc91e693fc3103f7e2a65054ed32bfb26a2e17 (patch)
treed3f6b3335d631ec42afde41941e2ba53a3213188 /hw
parent18d7ee718bef3c95787473e3537be5f0653470c4 (diff)
downloadskiboot-fbdc91e693fc3103f7e2a65054ed32bfb26a2e17.zip
skiboot-fbdc91e693fc3103f7e2a65054ed32bfb26a2e17.tar.gz
skiboot-fbdc91e693fc3103f7e2a65054ed32bfb26a2e17.tar.bz2
NPU2 HMIs: dump out a *LOT* of npu2 registers for debugging
This is not the way we want to end up doing this. This is a hack to make folk happy and not require crondump to debug nvidia/npu2 issues. Cc: stable Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/slw.c4
-rw-r--r--hw/xscom.c36
2 files changed, 24 insertions, 16 deletions
diff --git a/hw/slw.c b/hw/slw.c
index f3c8374..db238ec 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -1620,7 +1620,7 @@ void slw_update_timer_expiry(uint64_t new_target)
/* Grab generation and spin if odd */
_xscom_lock();
for (;;) {
- rc = _xscom_read(slw_timer_chip, 0xE0006, &gen, false);
+ rc = _xscom_read(slw_timer_chip, 0xE0006, &gen, false, false);
if (rc) {
prerror("SLW: Error %lld reading tmr gen "
" count\n", rc);
@@ -1664,7 +1664,7 @@ void slw_update_timer_expiry(uint64_t new_target)
}
/* Re-check gen count */
- rc = _xscom_read(slw_timer_chip, 0xE0006, &gen2, false);
+ rc = _xscom_read(slw_timer_chip, 0xE0006, &gen2, false, false);
if (rc) {
prerror("SLW: Error %lld re-reading tmr gen "
" count\n", rc);
diff --git a/hw/xscom.c b/hw/xscom.c
index 0501278..1bcfd47 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -215,8 +215,9 @@ static int xscom_clear_error(uint32_t gcid, uint32_t pcb_addr)
}
static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_addr,
- bool is_write, int64_t retries,
- int64_t *xscom_clear_retries)
+ bool is_write, int64_t retries,
+ int64_t *xscom_clear_retries,
+ bool ignore_error)
{
unsigned int stat = GETFIELD(SPR_HMER_XSCOM_STATUS, hmer);
int64_t rc = OPAL_HARDWARE;
@@ -277,9 +278,12 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
}
/* XXX: Create error log entry ? */
- log_simple_error(&e_info(OPAL_RC_XSCOM_RW),
- "XSCOM: %s error gcid=0x%x pcb_addr=0x%x stat=0x%x\n",
- is_write ? "write" : "read", gcid, pcb_addr, stat);
+ if (!ignore_error)
+ log_simple_error(&e_info(OPAL_RC_XSCOM_RW),
+ "XSCOM: %s error gcid=0x%x "
+ "pcb_addr=0x%x stat=0x%x\n",
+ is_write ? "write" : "read", gcid,
+ pcb_addr, stat);
/* We need to reset the XSCOM or we'll hang on the next access */
xscom_reset(gcid, false);
@@ -322,14 +326,16 @@ static inline bool xscom_is_multicast_addr(uint32_t addr)
* Low level XSCOM access functions, perform a single direct xscom
* access via MMIO
*/
-static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val)
+static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val,
+ bool ignore_error)
{
uint64_t hmer;
int64_t ret, retries;
int64_t xscom_clear_retries = XSCOM_CLEAR_MAX_RETRIES;
if (!xscom_gcid_ok(gcid)) {
- prerror("%s: invalid XSCOM gcid 0x%x\n", __func__, gcid);
+ if (!ignore_error)
+ prerror("%s: invalid XSCOM gcid 0x%x\n", __func__, gcid);
return OPAL_PARAMETER;
}
@@ -351,7 +357,7 @@ static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val)
/* Handle error and possibly eventually retry */
ret = xscom_handle_error(hmer, gcid, pcb_addr, false, retries,
- &xscom_clear_retries);
+ &xscom_clear_retries, ignore_error);
if (ret != OPAL_BUSY)
break;
}
@@ -370,7 +376,8 @@ static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val)
if (proc_gen == proc_gen_p9 && ret == OPAL_XSCOM_CHIPLET_OFF)
return ret;
- prerror("XSCOM: Read failed, ret = %lld\n", ret);
+ if (!ignore_error)
+ prerror("XSCOM: Read failed, ret = %lld\n", ret);
return ret;
}
@@ -403,7 +410,7 @@ static int __xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val)
/* Handle error and possibly eventually retry */
ret = xscom_handle_error(hmer, gcid, pcb_addr, true, retries,
- &xscom_clear_retries);
+ &xscom_clear_retries, false);
if (ret != OPAL_BUSY)
break;
}
@@ -451,7 +458,7 @@ static int xscom_indirect_read_form0(uint32_t gcid, uint64_t pcb_addr,
/* Wait for completion */
for (retries = 0; retries < XSCOM_IND_MAX_RETRIES; retries++) {
- rc = __xscom_read(gcid, addr, &data);
+ rc = __xscom_read(gcid, addr, &data, false);
if (rc)
goto bail;
if ((data & XSCOM_DATA_IND_COMPLETE) &&
@@ -513,7 +520,7 @@ static int xscom_indirect_write_form0(uint32_t gcid, uint64_t pcb_addr,
/* Wait for completion */
for (retries = 0; retries < XSCOM_IND_MAX_RETRIES; retries++) {
- rc = __xscom_read(gcid, addr, &data);
+ rc = __xscom_read(gcid, addr, &data, false);
if (rc)
goto bail;
if ((data & XSCOM_DATA_IND_COMPLETE) &&
@@ -588,7 +595,8 @@ void _xscom_unlock(void)
/*
* External API
*/
-int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock)
+int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val,
+ bool take_lock, bool ignore_error)
{
uint32_t gcid;
int rc;
@@ -635,7 +643,7 @@ int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_loc
if (pcb_addr & XSCOM_ADDR_IND_FLAG)
rc = xscom_indirect_read(gcid, pcb_addr, val);
else
- rc = __xscom_read(gcid, pcb_addr & 0x7fffffff, val);
+ rc = __xscom_read(gcid, pcb_addr & 0x7fffffff, val, ignore_error);
/* Unlock it */
if (take_lock)