[Skiboot] [PATCH 1/5] xscom: Abstract error recovery registers

Michael Neuling mikey at neuling.org
Wed Mar 22 13:59:41 AEDT 2017


Abstract error recovery registers to get ready for POWER9.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hw/xscom.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/hw/xscom.c b/hw/xscom.c
index d7b8627d8b..4a5f0f2d73 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 local, target1, target2;
 
 	/* Clear errors in HMER */
 	mtspr(SPR_HMER, HMER_CLR_MASK);
 
+	/* Setup local and target scom addresses */
+	local = 0x202000f;
+	target1 = 0x2020007;
+	target2 = 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, local), 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, target1), 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, target2), 0);
 	hmer = xscom_wait_done();
 	if (hmer & SPR_HMER_XSCOM_FAIL)
 		goto fail;
-- 
2.9.3



More information about the Skiboot mailing list