diff options
author | Frederic Barrat <fbarrat@linux.ibm.com> | 2019-10-09 21:38:06 +0200 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-10-22 17:31:42 +1100 |
commit | 7989d6edfcbbe9ba061b667f53b82f6860ffff01 (patch) | |
tree | dd69ab645a93e7a708f0ed69ae3f75e40155edc3 | |
parent | c5db832570a73e30fb5b668d8cce759178b2e4b7 (diff) | |
download | skiboot-7989d6edfcbbe9ba061b667f53b82f6860ffff01.zip skiboot-7989d6edfcbbe9ba061b667f53b82f6860ffff01.tar.gz skiboot-7989d6edfcbbe9ba061b667f53b82f6860ffff01.tar.bz2 |
npu2-opencapi: Simplify freset states
Let's get rid of one transitional state, since there's no need to
pause in between releasing the reset signals of the ODL and the
adapter.
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r-- | hw/npu2-opencapi.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c index 619d4be..ead6f5f 100644 --- a/hw/npu2-opencapi.c +++ b/hw/npu2-opencapi.c @@ -53,8 +53,7 @@ #define OCAPI_SLOT_FRESET_INIT (OCAPI_SLOT_FRESET + 2) #define OCAPI_SLOT_FRESET_ASSERT_DELAY (OCAPI_SLOT_FRESET + 3) #define OCAPI_SLOT_FRESET_DEASSERT_DELAY (OCAPI_SLOT_FRESET + 4) -#define OCAPI_SLOT_FRESET_DEASSERT_DELAY2 (OCAPI_SLOT_FRESET + 5) -#define OCAPI_SLOT_FRESET_INIT_DELAY (OCAPI_SLOT_FRESET + 6) +#define OCAPI_SLOT_FRESET_INIT_DELAY (OCAPI_SLOT_FRESET + 5) #define OCAPI_LINK_TRAINING_RETRIES 2 #define OCAPI_LINK_TRAINING_TIMEOUT 3000 /* ms */ @@ -1219,22 +1218,13 @@ static int64_t npu2_opencapi_freset(struct pci_slot *slot) case OCAPI_SLOT_FRESET_ASSERT_DELAY: npu2_opencapi_phy_reset(dev); deassert_odl_reset(chip_id, dev->brick_index); - pci_slot_set_state(slot, - OCAPI_SLOT_FRESET_DEASSERT_DELAY); - /* - * Minimal delay before taking adapter out of - * reset. Could be useless, but doesn't hurt - */ - return pci_slot_set_sm_timeout(slot, msecs_to_tb(1)); - - case OCAPI_SLOT_FRESET_DEASSERT_DELAY: deassert_adapter_reset(dev); pci_slot_set_state(slot, - OCAPI_SLOT_FRESET_DEASSERT_DELAY2); + OCAPI_SLOT_FRESET_DEASSERT_DELAY); /* give 250ms to device to be ready */ return pci_slot_set_sm_timeout(slot, msecs_to_tb(250)); - case OCAPI_SLOT_FRESET_DEASSERT_DELAY2: + case OCAPI_SLOT_FRESET_DEASSERT_DELAY: unfence_brick(dev); set_init_pattern(chip_id, dev); pci_slot_set_state(slot, |