diff options
author | Reza Arbab <arbab@linux.vnet.ibm.com> | 2017-11-13 16:19:16 -0600 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-11-13 17:48:13 -0600 |
commit | 072d246a54eec05ebdcd19c8a4fe46e09394d6ec (patch) | |
tree | 83f567204be25e0d03f33d72d85df1f6ff41055c /hw | |
parent | 3fb06a94830bdc39afd62156a2417811c9b93448 (diff) | |
download | skiboot-072d246a54eec05ebdcd19c8a4fe46e09394d6ec.zip skiboot-072d246a54eec05ebdcd19c8a4fe46e09394d6ec.tar.gz skiboot-072d246a54eec05ebdcd19c8a4fe46e09394d6ec.tar.bz2 |
npu2: hw-procedures: Add phy_rx_clock_sel()
Change the RX clk mux control to be done by software instead of HW. This
avoids glitches caused by changing the mux setting.
Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
Reviewed-By: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
(cherry picked from commit ac6f1599ff330fa602b3c9557a08f31f1158a55f)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/npu2-hw-procedures.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c index 7a5d188..c24489f 100644 --- a/hw/npu2-hw-procedures.c +++ b/hw/npu2-hw-procedures.c @@ -561,6 +561,23 @@ static uint32_t phy_rx_dccal_complete(struct npu2_dev *ndev) return PROCEDURE_NEXT; } +static uint32_t phy_rx_clock_sel(struct npu2_dev *ndev) +{ + /* + * Change the RX clk mux control to be done by software instead of HW. This + * avoids glitches caused by changing the mux setting. + * + * Work around a known DL bug by doing these writes twice. + */ + npu2_write_mask_4b(ndev->npu, NPU2_NTL_DL_CLK_CTRL(ndev), 0x80000003, 0x80000003); + npu2_write_mask_4b(ndev->npu, NPU2_NTL_DL_CLK_CTRL(ndev), 0x80000003, 0x80000003); + + npu2_write_mask_4b(ndev->npu, NPU2_NTL_DL_CLK_CTRL(ndev), 0x80000001, 0x80000003); + npu2_write_mask_4b(ndev->npu, NPU2_NTL_DL_CLK_CTRL(ndev), 0x80000001, 0x80000003); + + return PROCEDURE_NEXT; +} + /* Procedure 1.2.5 - IO PHY Tx FIFO Init */ static uint32_t phy_tx_fifo_init(struct npu2_dev *ndev) { @@ -577,7 +594,8 @@ static uint32_t phy_tx_fifo_init(struct npu2_dev *ndev) /* We group TX FIFO init in here mainly because that's what was done * on NVLink1 */ -DEFINE_PROCEDURE(phy_rx_dccal, phy_rx_dccal_complete, phy_tx_fifo_init); +DEFINE_PROCEDURE(phy_rx_dccal, phy_rx_dccal_complete, phy_rx_clock_sel, + phy_tx_fifo_init); /* Procedure 1.2.7 - I/O PHY Upstream Link Training */ static uint32_t phy_rx_training(struct npu2_dev *ndev) |