[Skiboot] [PATCH] npu3: Expose remaining ATSD launch registers

Reza Arbab arbab at linux.ibm.com
Thu Aug 8 02:21:42 AEST 2019


List all 16 ATSD registers in the device tree, not just the first 8.

Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
---
 hw/npu3-nvlink.c    | 21 ++++++++++++---------
 include/npu3-regs.h |  1 +
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/hw/npu3-nvlink.c b/hw/npu3-nvlink.c
index c8e1a0abf31b..7dc54be59dc4 100644
--- a/hw/npu3-nvlink.c
+++ b/hw/npu3-nvlink.c
@@ -1387,6 +1387,17 @@ static void npu3_dev_create_pvd(struct npu3_dev *dev)
 	npu3_cfg_populate(dev);
 }
 
+static void npu3_dt_add_mmio_atsd(struct npu3 *npu)
+{
+	struct dt_node *dn = npu->nvlink.phb.dt_node;
+	uint64_t mmio_atsd[NPU3_XTS_ATSD_MAX];
+
+	for (uint32_t i = 0; i < NPU3_XTS_ATSD_MAX; i++)
+		mmio_atsd[i] = npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(i);
+
+	dt_add_property(dn, "ibm,mmio-atsd", mmio_atsd, sizeof(mmio_atsd));
+}
+
 static void npu3_dt_add_mmio_window(struct npu3 *npu)
 {
 	struct dt_node *dn = npu->nvlink.phb.dt_node;
@@ -1482,16 +1493,8 @@ static void npu3_dt_add_props(struct npu3 *npu)
 	dt_add_property_cells(dn, "ibm,links", NPU3_LINKS_PER_NPU);
 
 	dt_add_property(dn, "reg", npu->regs, sizeof(npu->regs));
-	dt_add_property_u64s(dn, "ibm,mmio-atsd",
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(0),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(1),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(2),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(3),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(4),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(5),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(6),
-			     npu->regs[0] + NPU3_XTS_ATSD_LAUNCH(7));
 
+	npu3_dt_add_mmio_atsd(npu);
 	npu3_dt_add_mmio_window(npu);
 	npu3_dt_add_interrupts(npu);
 }
diff --git a/include/npu3-regs.h b/include/npu3-regs.h
index 341d652899c3..380fb5491590 100644
--- a/include/npu3-regs.h
+++ b/include/npu3-regs.h
@@ -248,5 +248,6 @@
 
 /* NPU_XTS_ATSD block registers */
 #define NPU3_XTS_ATSD_LAUNCH(n)			(NPU3_BLOCK_NPU_XTS_ATSD(n) + 0x000)
+#define NPU3_XTS_ATSD_MAX			16
 
 #endif /* __NPU3_REGS_H */
-- 
1.8.3.1



More information about the Skiboot mailing list