[Skiboot] [PATCH 2/5] phb4: Implement root port initialization

Russell Currey ruscur at russell.cc
Fri Jun 9 16:06:03 AEST 2017


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 <ruscur at russell.cc>
---
 hw/phb4.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index c97861aa..3957a051 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,
-- 
2.13.1



More information about the Skiboot mailing list