From cd48b15b132a5c7ea30ae3fa6f2144236b9ea88b Mon Sep 17 00:00:00 2001 From: Russell Currey Date: Fri, 9 Jun 2017 16:06:03 +1000 Subject: phb4: Implement root port initialization phb4_root_port_init() was a NOP before, so fix that. Nothing PHB4-specific here. Something may be required in future. Signed-off-by: Russell Currey Signed-off-by: Stewart Smith --- hw/phb4.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'hw') diff --git a/hw/phb4.c b/hw/phb4.c index c97861a..3957a05 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -486,16 +486,22 @@ static int64_t phb4_get_reserved_pe_number(struct phb *phb) } -static void phb4_root_port_init(struct phb *phb __unused, - struct pci_device *dev __unused, - int ecap __unused, - int aercap __unused) +static void phb4_root_port_init(struct phb *phb, struct pci_device *dev, + int ecap, int aercap) { -#if 0 uint16_t bdfn = dev->bdfn; uint16_t val16; uint32_t val32; + /* + * Use the PHB's callback so that UTL events will be masked or + * unmasked when the link is down or up. + */ + if (dev->slot && dev->slot->ops.prepare_link_change && + phb->slot && phb->slot->ops.prepare_link_change) + dev->slot->ops.prepare_link_change = + phb->slot->ops.prepare_link_change; + // FIXME: check recommended init values for phb4 /* Enable SERR and parity checking */ @@ -549,7 +555,6 @@ static void phb4_root_port_init(struct phb *phb __unused, PCIECAP_AER_RERR_CMD_NFE | PCIECAP_AER_RERR_CMD_CE); pci_cfg_write32(phb, bdfn, aercap + PCIECAP_AER_RERR_CMD, val32); -#endif } static void phb4_switch_port_init(struct phb *phb, -- cgit v1.1