aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2018-11-23 09:54:39 +0100
committerStewart Smith <stewart@linux.ibm.com>2018-11-28 17:51:58 +1100
commite1a8469a208c7f8357aa7ca8454ab691b62bf60b (patch)
tree332c851389a8b9e9e19eff33b61b4040ad88f0e9
parent64d06b1feed160c42d447750b6c5c0601d15487c (diff)
downloadskiboot-e1a8469a208c7f8357aa7ca8454ab691b62bf60b.zip
skiboot-e1a8469a208c7f8357aa7ca8454ab691b62bf60b.tar.gz
skiboot-e1a8469a208c7f8357aa7ca8454ab691b62bf60b.tar.bz2
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>
-rw-r--r--hw/npu2-opencapi.c29
-rw-r--r--include/npu2-regs.h5
2 files changed, 33 insertions, 1 deletions
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index da86b46..65f623c 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, &reg);
+ 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,
diff --git a/include/npu2-regs.h b/include/npu2-regs.h
index c5096dd..10a2816 100644
--- a/include/npu2-regs.h
+++ b/include/npu2-regs.h
@@ -751,4 +751,9 @@ void npu2_scom_write(uint64_t gcid, uint64_t scom_base,
#define OB3_ODL1_TRAINING_STATUS 0xC01082F
#define OB_ODL_TRAINING_STATUS_STS_RX_PATTERN_B PPC_BITMASK(8, 15)
+#define OB0_ODL0_ENDPOINT_INFO 0x9010832
+#define OB0_ODL1_ENDPOINT_INFO 0x9010833
+#define OB3_ODL0_ENDPOINT_INFO 0xC010832
+#define OB3_ODL1_ENDPOINT_INFO 0xC010833
+
#endif /* __NPU2_REGS_H */