[Skiboot] [PATCH 4/5] hw/phb4: Factor out interrupt setup

Oliver O'Halloran oohall at gmail.com
Tue Jan 21 18:28:37 AEDT 2020


Move the unmasking (enabling) of the various PHB error and informational
interrupts out of the main init sequence. We'll need this elsewhere to
enable the PHB error interrupts.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hw/phb4.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index 7bbed8a8a829..5f8b9b8f7ac8 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -3501,6 +3501,16 @@ static struct pci_slot *phb4_slot_create(struct phb *phb)
 	return slot;
 }
 
+static void phb4_int_unmask_all(struct phb4 *p)
+{
+	/* Init_126..130 - Re-enable error interrupts */
+	out_be64(p->regs + PHB_ERR_IRQ_ENABLE,         0xca8880cc00000000ull);
+	out_be64(p->regs + PHB_TXE_ERR_IRQ_ENABLE,     0x2008400e08200000ull);
+	out_be64(p->regs + PHB_RXE_ARB_ERR_IRQ_ENABLE, 0xc40038fc01804070ull);
+	out_be64(p->regs + PHB_RXE_MRG_ERR_IRQ_ENABLE, 0x00006100008000a8ull);
+	out_be64(p->regs + PHB_RXE_TCE_ERR_IRQ_ENABLE, 0x60510050c0000000ull);
+}
+
 static uint64_t phb4_get_pesta(struct phb4 *p, uint64_t pe_number)
 {
 	uint64_t pesta;
@@ -5302,11 +5312,7 @@ static void phb4_init_hw(struct phb4 *p)
 			    PCI_CFG_STAT_RECV_PERR);
 
 	/* Init_126..130 - Re-enable error interrupts */
-	out_be64(p->regs + PHB_ERR_IRQ_ENABLE,			0xca8880cc00000000ull);
-	out_be64(p->regs + PHB_TXE_ERR_IRQ_ENABLE,		0x2008400e08200000ull);
-	out_be64(p->regs + PHB_RXE_ARB_ERR_IRQ_ENABLE,		0xc40038fc01804070ull);
-	out_be64(p->regs + PHB_RXE_MRG_ERR_IRQ_ENABLE,		0x00006100008000a8ull);
-	out_be64(p->regs + PHB_RXE_TCE_ERR_IRQ_ENABLE,	0x60510050c0000000ull);
+	phb4_int_unmask_all(p);
 
 	/* Init_131 - Re-enable LEM error mask */
 	out_be64(p->regs + PHB_LEM_ERROR_MASK,			0x0000000000000000ull);
-- 
2.21.1



More information about the Skiboot mailing list