hw/phb4: Factor out interrupt setup
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.
@@ -3528,6 +3528,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;
@@ -5307,11 +5317,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);
