Skip to content

Commit

Permalink
npu3: Expose remaining ATSD launch registers
Browse files Browse the repository at this point in the history
List all 16 ATSD registers in the device tree, not just the first 8.

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
rarbab authored and oohal committed Aug 16, 2019
1 parent 82b5768 commit 2422c10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
21 changes: 12 additions & 9 deletions hw/npu3-nvlink.c
Expand Up @@ -1383,6 +1383,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;
Expand Down Expand Up @@ -1478,16 +1489,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);
}
Expand Down
1 change: 1 addition & 0 deletions include/npu3-regs.h
Expand Up @@ -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 */

0 comments on commit 2422c10

Please sign in to comment.