aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-06-25 08:47:32 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-06 19:30:48 +1000
commit53a9d925e2832cebb8814df47f949b01ce9b24ff (patch)
treeb38fd8b061b6fd986901df8f5414b1e0957fff4d
parent0a0200d7ccd07e34390806c5939c6b87f30edb9a (diff)
downloadskiboot-53a9d925e2832cebb8814df47f949b01ce9b24ff.zip
skiboot-53a9d925e2832cebb8814df47f949b01ce9b24ff.tar.gz
skiboot-53a9d925e2832cebb8814df47f949b01ce9b24ff.tar.bz2
xscom: A few P9 updates
More to go, especially we need to review recovery, but at least this enables indirect and errors out on not-yet-supported EX targeting. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/xscom.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/hw/xscom.c b/hw/xscom.c
index f6ce4d8..d574c32 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -135,11 +135,12 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
* recovery procedures
*/
switch(stat) {
- /*
- * XSCOM engine is blocked, need to retry. Reset XSCOM engine
- * after crossing retry threshold before retrying again.
- */
case 1:
+ /*
+ * XSCOM engine is blocked, need to retry. Reset XSCOM
+ * engine after crossing retry threshold before
+ * retrying again.
+ */
if (retries && !(retries % XSCOM_BUSY_RESET_THRESHOLD)) {
prlog(PR_NOTICE, "XSCOM: Busy even after %d retries, "
"resetting XSCOM now. Total retries = %lld\n",
@@ -168,9 +169,14 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add
gcid, pcb_addr, stat);
return OPAL_BUSY;
- /* CPU is asleep, don't retry */
- case 2:
+ case 2: /* CPU is asleep, don't retry */
return OPAL_WRONG_STATE;
+ case 3: /* Partial good */
+ case 4: /* Invalid address / address error */
+ case 5: /* Clock error */
+ case 6: /* Parity error */
+ case 7: /* Time out */
+ break;
}
/* XXX: Create error log entry ? */
@@ -294,7 +300,7 @@ static int xscom_indirect_read(uint32_t gcid, uint64_t pcb_addr, uint64_t *val)
uint64_t data;
int rc, retries;
- if (proc_gen != proc_gen_p8) {
+ if (proc_gen < proc_gen_p8) {
*val = (uint64_t)-1;
return OPAL_UNSUPPORTED;
}
@@ -337,7 +343,7 @@ static int xscom_indirect_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val)
uint64_t data;
int rc, retries;
- if (proc_gen != proc_gen_p8)
+ if (proc_gen < proc_gen_p8)
return OPAL_UNSUPPORTED;
/* Write indirect address & data */
@@ -374,8 +380,13 @@ static uint32_t xscom_decode_chiplet(uint32_t partid, uint64_t *pcb_addr)
uint32_t gcid = (partid & 0x0fffffff) >> 4;
uint32_t core = partid & 0xf;
- *pcb_addr |= P8_EX_PCB_SLAVE_BASE;
- *pcb_addr |= core << 24;
+ if (proc_gen == proc_gen_p9) {
+ /* XXX Not supported */
+ *pcb_addr = 0;
+ } else {
+ *pcb_addr |= P8_EX_PCB_SLAVE_BASE;
+ *pcb_addr |= core << 24;
+ }
return gcid;
}
@@ -397,6 +408,8 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
return centaur_xscom_read(partid, pcb_addr, val);
case 4: /* EX chiplet */
gcid = xscom_decode_chiplet(partid, &pcb_addr);
+ if (pcb_addr == 0)
+ return OPAL_UNSUPPORTED;
break;
default:
return OPAL_PARAMETER;