[Skiboot] [PATCH 2/5] nvlink: Clear error registers at the end of the reset procedure

Russell Currey ruscur at russell.cc
Thu Jan 7 14:36:29 AEDT 2016


Once the NPU has been reset, it should no longer have any fixable errors.
Clear any relevant error registers at the end of the reset procedure.

There may be other error registers that should be cleared, if found they
will be added later.

Signed-off-by: Russell Currey <ruscur at russell.cc>
---
 hw/npu-hw-procedures.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/npu-hw-procedures.c b/hw/npu-hw-procedures.c
index 24f3b2c..c2a2be0 100644
--- a/hw/npu-hw-procedures.c
+++ b/hw/npu-hw-procedures.c
@@ -154,6 +154,12 @@ static uint32_t reset_npu_dl(struct npu_dev *npu_dev)
 	xscom_write(npu_dev->npu->chip_id, npu_dev->xscom + NX_TL_CMD_D_CR, PPC_BIT(0));
 	xscom_write(npu_dev->npu->chip_id, npu_dev->xscom + NX_TL_RSP_CR, PPC_BIT(15));
 	xscom_write(npu_dev->npu->chip_id, npu_dev->xscom + NX_TL_RSP_D_CR, PPC_BIT(15));
+
+	/* Reset error registers. TODO: are there more we should clear here? */
+	npu_ioda_sel(npu_dev->npu, NPU_IODA_TBL_PESTB, 0, true);
+	for (val = 0; val < npu_dev->npu->total_devices; val++)
+		out_be64(npu_dev->npu->at_regs + NPU_IODA_DATA0, 0);
+
 	return PROCEDURE_COMPLETE;
 }
 DEFINE_PROCEDURE(reset_npu_dl);
-- 
2.6.4



More information about the Skiboot mailing list