[Skiboot] [PATCH 09/14] phb4: Split clearing REGB into new function

Michael Neuling mikey at neuling.org
Wed Jul 26 20:50:08 AEST 2017


So others can call it.

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

diff --git a/hw/phb4.c b/hw/phb4.c
index af15b71d06..f17a5eb483 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1690,6 +1690,17 @@ static void phb4_rc_err_clear(struct phb4 *p)
 			     0xffffffff);
 }
 
+static void phb4_err_clear_regb(struct phb4 *p)
+{
+	uint64_t val64;
+
+	val64 = phb4_read_reg(p, PHB_REGB_ERR_STATUS);
+	phb4_write_reg(p, PHB_REGB_ERR_STATUS, val64);
+	phb4_write_reg(p, PHB_REGB_ERR1_STATUS, 0x0ul);
+	phb4_write_reg(p, PHB_REGB_ERR_LOG_0, 0x0ul);
+	phb4_write_reg(p, PHB_REGB_ERR_LOG_1, 0x0ul);
+}
+
 /*
  * The function can be called during error recovery for all classes of
  * errors.  This is new to PHB4; previous revisions had separate
@@ -1716,11 +1727,7 @@ static void phb4_err_clear(struct phb4 *p)
 	phb4_write_reg(p, PHB_PBL_ERR_LOG_1, 0x0ul);
 
 	/* Rec 24...31: Clear REGB errors */
-	val64 = phb4_read_reg(p, PHB_REGB_ERR_STATUS);
-	phb4_write_reg(p, PHB_REGB_ERR_STATUS, val64);
-	phb4_write_reg(p, PHB_REGB_ERR1_STATUS, 0x0ul);
-	phb4_write_reg(p, PHB_REGB_ERR_LOG_0, 0x0ul);
-	phb4_write_reg(p, PHB_REGB_ERR_LOG_1, 0x0ul);
+	phb4_err_clear_regb(p);
 
 	/* Rec 32...59: Clear PHB error trap */
 	val64 = phb4_read_reg(p, PHB_TXE_ERR_STATUS);
-- 
2.11.0



More information about the Skiboot mailing list