aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2-hw-procedures.c
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2018-09-12 13:45:00 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-09-17 21:39:00 -0500
commitc38bdc3984a2691fb6ef38d370e0ecbe956d3186 (patch)
tree31ac9111af44f9220e70c05f0748776265936811 /hw/npu2-hw-procedures.c
parent34ceb75f282952b40b615558f947c3fee533b1d4 (diff)
downloadskiboot-c38bdc3984a2691fb6ef38d370e0ecbe956d3186.zip
skiboot-c38bdc3984a2691fb6ef38d370e0ecbe956d3186.tar.gz
skiboot-c38bdc3984a2691fb6ef38d370e0ecbe956d3186.tar.bz2
hw/npu2-hw-procedures: Enable RX auto recal on OpenCAPI links
The RX_RC_ENABLE_AUTO_RECAL flag is required on OpenCAPI but not NVLink. Traditionally, Hostboot sets this value according to the machine type. However, now that Witherspoon supports both NVLink and OpenCAPI, it can't tell whether or not a link is OpenCAPI. So instead, set it in skiboot, where it will only be triggered after we've done device detection and found an OpenCAPI device. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Acked-by: Reza Arbab <arbab@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/npu2-hw-procedures.c')
-rw-r--r--hw/npu2-hw-procedures.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c
index 8686462..c30e1b0 100644
--- a/hw/npu2-hw-procedures.c
+++ b/hw/npu2-hw-procedures.c
@@ -96,6 +96,7 @@ struct npu2_phy_reg NPU2_PHY_TX_NSEG_MAIN_EN = {0x359, 51, 7};
struct npu2_phy_reg NPU2_PHY_RX_HIST_MIN_EYE_WIDTH = {0x24e, 54, 8};
struct npu2_phy_reg NPU2_PHY_RX_HIST_MIN_EYE_WIDTH_LANE = {0x24e, 49, 5};
struct npu2_phy_reg NPU2_PHY_RX_HIST_MIN_EYE_WIDTH_VALID= {0x24e, 48, 1};
+struct npu2_phy_reg NPU2_PHY_RX_RC_ENABLE_AUTO_RECAL = {0x25c, 51, 1};
struct npu2_phy_reg NPU2_PHY_RX_CLKDIST_PDWN = {0x204, 48, 3};
struct npu2_phy_reg NPU2_PHY_RX_IREF_PDWN = {0x230, 54, 1};
@@ -1009,6 +1010,13 @@ void npu2_opencapi_bump_ui_lane(struct npu2_dev *dev)
void npu2_opencapi_phy_setup(struct npu2_dev *dev)
{
+ /*
+ * This is only required for OpenCAPI - Hostboot tries to set this
+ * on systems where it can tell a link is OpenCAPI, but for
+ * Witherspoon it needs to be done in skiboot after device detection.
+ */
+ phy_write(dev, &NPU2_PHY_RX_RC_ENABLE_AUTO_RECAL, 0x1);
+
run_procedure(dev, 4); /* procedure_phy_reset */
run_procedure(dev, 5); /* procedure_phy_tx_zcal */
run_procedure(dev, 6); /* procedure_phy_rx_dccal */