[Skiboot] [RFC PATCH 20/23] hw/phb4: Convert to generic FRESET
Oliver O'Halloran
oohall at gmail.com
Wed Apr 3 20:09:17 AEDT 2019
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 at gmail.com>
---
hw/phb4.c | 34 ++--------------------------------
1 file changed, 2 insertions(+), 32 deletions(-)
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)
--
2.20.1
More information about the Skiboot
mailing list