From e1bfc5116bcb66259192148f0fa9a0751b906aef Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Thu, 23 Mar 2017 17:15:05 +1100 Subject: xscom: Abstract error recovery registers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abstract error recovery registers to get ready for POWER9. Signed-off-by: Michael Neuling Reviewed-by: Cédric Le Goater Signed-off-by: Stewart Smith --- hw/xscom.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'hw/xscom.c') diff --git a/hw/xscom.c b/hw/xscom.c index d7b8627..dd7aeca 100644 --- a/hw/xscom.c +++ b/hw/xscom.c @@ -95,22 +95,28 @@ static uint64_t xscom_wait_done(void) static void xscom_reset(uint32_t gcid) { u64 hmer; + uint32_t recv_status_reg, log_reg, err_reg; /* Clear errors in HMER */ mtspr(SPR_HMER, HMER_CLR_MASK); + /* Setup local and target scom addresses */ + recv_status_reg = 0x202000f; + log_reg = 0x2020007; + err_reg = 0x2020009; + /* First we need to write 0 to a register on our chip */ - out_be64(xscom_addr(this_cpu()->chip_id, 0x202000f), 0); + out_be64(xscom_addr(this_cpu()->chip_id, recv_status_reg), 0); hmer = xscom_wait_done(); if (hmer & SPR_HMER_XSCOM_FAIL) goto fail; /* Then we need to clear those two other registers on the target */ - out_be64(xscom_addr(gcid, 0x2020007), 0); + out_be64(xscom_addr(gcid, log_reg), 0); hmer = xscom_wait_done(); if (hmer & SPR_HMER_XSCOM_FAIL) goto fail; - out_be64(xscom_addr(gcid, 0x2020009), 0); + out_be64(xscom_addr(gcid, err_reg), 0); hmer = xscom_wait_done(); if (hmer & SPR_HMER_XSCOM_FAIL) goto fail; -- cgit v1.1