diff mbox series

[RFC,20/23] hw/phb4: Convert to generic FRESET

Message ID 20190403090920.362-21-oohall@gmail.com
State RFC
Headers show
Series [RFC,01/23] platform/firenze-pci: Remove freset | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch master (050d8165ab05b6d9cdf4bfee42d9776969c77029)
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Oliver O'Halloran April 3, 2019, 9:09 a.m. UTC
At this point phb4_freset doesn't have much real functionality over
the generic version, so use the generic version.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hw/phb4.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)
diff mbox series

Patch

diff --git a/hw/phb4.c b/hw/phb4.c
index 02dca9e5238f..99e694059a80 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -3018,41 +3018,11 @@  static int64_t phb4_freset(struct pci_slot *slot)
 	switch(slot->state) {
 	case PHB4_SLOT_NORMAL:
 	case PHB4_SLOT_FRESET_START:
-		PHBDBG(p, "FRESET: Starts\n");
-
-		/* Reset max link speed for training */
 		p->max_link_speed = phb4_get_max_link_speed(p, NULL);
-
-		PHBDBG(p, "FRESET: Prepare for link down\n");
-		phb4_prepare_link_change(slot, false);
-
-		if (!p->skip_perst) {
-			PHBDBG(p, "FRESET: Assert\n");
-			phb4_assert_perst(slot, true);
-			pci_slot_set_state(slot, PHB4_SLOT_FRESET_ASSERT_DELAY);
-
-			/* 250ms assert time aligns with powernv */
-			return pci_slot_set_sm_timeout(slot, msecs_to_tb(250));
-		}
-
-		/* To skip the assert during boot time */
-		PHBDBG(p, "FRESET: Assert skipped\n");
-		pci_slot_set_state(slot, PHB4_SLOT_FRESET_ASSERT_DELAY);
-		p->skip_perst = false;
-		/* fall through */
-	case PHB4_SLOT_FRESET_ASSERT_DELAY:
-
-		PHBDBG(p, "FRESET: Deassert\n");
-		phb4_assert_perst(slot, false);
-
-		pci_slot_set_state(slot, PHB4_SLOT_LINK_START);
-		return slot->ops.poll_link(slot);
-	default:
-		PHBERR(p, "Unexpected slot state %08x\n", slot->state);
+		break;
 	}
 
-	pci_slot_set_state(slot, PHB4_SLOT_NORMAL);
-	return OPAL_HARDWARE;
+	return pci_slot_generic_freset(slot);
 }
 
 static int64_t load_capp_ucode(struct phb4 *p)