From 73ccee37e739bb15d5bc7844125a4d2f9fd77235 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 26 Jul 2017 20:50:11 +1000 Subject: phb4: Set REGB error enables based on link state 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 Signed-off-by: Stewart Smith --- hw/phb4.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/phb4.c b/hw/phb4.c index 2799f29..ba074c2 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); -- cgit v1.1