Skip to content

Commit

Permalink
hw/npu2-hw-procedures: Enable RX auto recal on OpenCAPI links
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ajdlinux authored and stewartsmith committed Sep 18, 2018
1 parent 34ceb75 commit c38bdc3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hw/npu2-hw-procedures.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit c38bdc3

Please sign in to comment.