diff options
author | Frederic Barrat <fbarrat@linux.ibm.com> | 2018-11-23 09:54:39 +0100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-11-28 17:51:58 +1100 |
commit | e1a8469a208c7f8357aa7ca8454ab691b62bf60b (patch) | |
tree | 332c851389a8b9e9e19eff33b61b4040ad88f0e9 /hw/npu2-opencapi.c | |
parent | 64d06b1feed160c42d447750b6c5c0601d15487c (diff) | |
download | blackbird-skiboot-e1a8469a208c7f8357aa7ca8454ab691b62bf60b.tar.gz blackbird-skiboot-e1a8469a208c7f8357aa7ca8454ab691b62bf60b.zip |
npu2-opencapi: Log ODL endpoint information register
If the link trains in degraded mode, log the ODL endpoint information
register for debug. Its content is specific to the DLx and TLx
implementation, so this is really information useful for the hardware
team.
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/npu2-opencapi.c')
-rw-r--r-- | hw/npu2-opencapi.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c index da86b46c..65f623c7 100644 --- a/hw/npu2-opencapi.c +++ b/hw/npu2-opencapi.c @@ -174,6 +174,30 @@ static uint64_t get_odl_training_status(uint32_t gcid, uint64_t index) return reg; } +static uint64_t get_odl_endpoint_info(uint32_t gcid, uint64_t index) +{ + uint64_t status_xscom, reg; + + switch (index) { + case 2: + status_xscom = OB0_ODL0_ENDPOINT_INFO; + break; + case 3: + status_xscom = OB0_ODL1_ENDPOINT_INFO; + break; + case 4: + status_xscom = OB3_ODL1_ENDPOINT_INFO; + break; + case 5: + status_xscom = OB3_ODL0_ENDPOINT_INFO; + break; + default: + assert(false); + } + xscom_read(gcid, status_xscom, ®); + return reg; +} + static void disable_nvlink(uint32_t gcid, int index) { uint64_t phy_config_scom, reg; @@ -1047,9 +1071,12 @@ static int64_t npu2_opencapi_get_link_state(struct pci_slot *slot, uint8_t *val) static void check_trained_link(struct npu2_dev *dev, uint64_t odl_status) { - if (get_link_width(odl_status) != OPAL_SHPC_LINK_UP_x8) + if (get_link_width(odl_status) != OPAL_SHPC_LINK_UP_x8) { OCAPIERR(dev, "Link trained in degraded mode (%016llx)\n", odl_status); + OCAPIDBG(dev, "Link endpoint info: %016llx\n", + get_odl_endpoint_info(dev->npu->chip_id, dev->brick_index)); + } } static int64_t npu2_opencapi_retry_state(struct pci_slot *slot, |