aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-09-13 14:45:25 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-09-13 15:50:41 +1000
commitd6a64f99f3c9c39b00d0821cc04dc9a51fe06490 (patch)
treeee643edc85667f8cc3ba2a28b82efdaa1c210375 /hw
parentbe4843f47baa5f1b36c2c6e7ad6bc4743a8bc43f (diff)
downloadskiboot-d6a64f99f3c9c39b00d0821cc04dc9a51fe06490.zip
skiboot-d6a64f99f3c9c39b00d0821cc04dc9a51fe06490.tar.gz
skiboot-d6a64f99f3c9c39b00d0821cc04dc9a51fe06490.tar.bz2
xscom: Map all HMER status codes to OPAL errors
Instead of mapping them to just 3 different codes, define an OPAL error code for all known HMER error status, as different recovery path might be needed at the call site, and it allows for more informative logging. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xscom.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/xscom.c b/hw/xscom.c
index 149e158..e51f182 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -130,6 +130,7 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
{
struct timespec ts;
unsigned int stat = GETFIELD(SPR_HMER_XSCOM_STATUS, hmer);
+ int64_t rc = OPAL_HARDWARE;
/* XXX Figure out error codes from doc and error
* recovery procedures
@@ -167,16 +168,25 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
"XSCOM: %s-busy error gcid=0x%x pcb_addr=0x%x "
"stat=0x%x\n", is_write ? "write" : "read",
gcid, pcb_addr, stat);
- return OPAL_BUSY;
+ return OPAL_XSCOM_BUSY;
case 2: /* CPU is asleep, reset XSCOM engine and return */
xscom_reset(gcid);
- return OPAL_WRONG_STATE;
+ return OPAL_XSCOM_CHIPLET_OFF;
case 3: /* Partial good */
+ rc = OPAL_XSCOM_PARTIAL_GOOD;
+ break;
case 4: /* Invalid address / address error */
+ rc = OPAL_XSCOM_ADDR_ERROR;
+ break;
case 5: /* Clock error */
+ rc = OPAL_XSCOM_CLOCK_ERROR;
+ break;
case 6: /* Parity error */
+ rc = OPAL_XSCOM_PARITY_ERROR;
+ break;
case 7: /* Time out */
+ rc = OPAL_XSCOM_TIMEOUT;
break;
}
@@ -189,7 +199,7 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
xscom_reset(gcid);
/* Non recovered ... just fail */
- return OPAL_HARDWARE;
+ return rc;
}
static void xscom_handle_ind_error(uint64_t data, uint32_t gcid,