From 53a9d925e2832cebb8814df47f949b01ce9b24ff Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sat, 25 Jun 2016 08:47:32 +1000 Subject: 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 Acked-by: Michael Neuling Signed-off-by: Stewart Smith --- hw/xscom.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'hw') 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; -- cgit v1.1