Message ID | 20180912034500.14858-1-andrew.donnellan@au1.ibm.com |
---|---|
State | Accepted |
Headers | show |
Series | hw/npu2-hw-procedures: Enable RX auto recal on OpenCAPI links | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | master/apply_patch Successfully applied |
snowpatch_ozlabs/make_check | success | Test make_check on branch master |
Le 12/09/2018 à 05:45, Andrew Donnellan a écrit : > 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> > hw/npu2-hw-procedures.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c > index 86864629a66b..c30e1b03e8aa 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 */ >
On Wed, Sep 12, 2018 at 01:45:00PM +1000, Andrew Donnellan wrote: >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. Acked-by: Reza Arbab <arbab@linux.ibm.com>
Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes: > 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> > --- > hw/npu2-hw-procedures.c | 8 ++++++++ > 1 file changed, 8 insertions(+) Thanks, merged to master as of c38bdc3984a2691fb6ef38d370e0ecbe956d3186
diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c index 86864629a66b..c30e1b03e8aa 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 */
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> --- hw/npu2-hw-procedures.c | 8 ++++++++ 1 file changed, 8 insertions(+)