[Skiboot] [PATCH 12/14] phb4: Set REGB error enables based on link state

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


Currently we always set these enables when initing the PHB. If the
link is already down, we shouldn't set them as it may cause spurious
errors.

This changes the code to only sets them if the link is up.

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

diff --git a/hw/phb4.c b/hw/phb4.c
index 2799f291d2..ba074c2fdc 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -3809,9 +3809,15 @@ static void phb4_init_errors(struct phb4 *p)
 	/* Init_64..72 - REGB errors */
 	out_be64(p->regs + 0x1c00,	0xffffffffffffffffull);
 	out_be64(p->regs + 0x1c08,	0x0000000000000000ull);
-	out_be64(p->regs + 0x1c20,	0x2130006efca8bc00ull);
+	/* Enable/disable error status indicators that trigger irqs */
+	if (p->has_link) {
+		out_be64(p->regs + 0x1c20,	0x2130006efca8bc00ull);
+		out_be64(p->regs + 0x1c30,	0xde8fff91035743ffull);
+	} else {
+		out_be64(p->regs + 0x1c20,	0x0000000000000000ull);
+		out_be64(p->regs + 0x1c30,	0x0000000000000000ull);
+	}
 	out_be64(p->regs + 0x1c28,	0x0000000000000000ull);
-	out_be64(p->regs + 0x1c30,	0xde8fff91035743ffull);
 	out_be64(p->regs + 0x1c40,	0x0000000000000000ull);
 	out_be64(p->regs + 0x1c48,	0x0000000000000000ull);
 	out_be64(p->regs + 0x1c50,	0x0000000000000000ull);
-- 
2.11.0



More information about the Skiboot mailing list