aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/npu2.c')
-rw-r--r--hw/npu2.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/npu2.c b/hw/npu2.c
index 773ac07..43dfdcb 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -649,11 +649,12 @@ static int npu2_assign_gmb(struct npu2_dev *ndev)
npu2_get_gpu_base(ndev, &base, &size);
- /* Base address is in GB */
- base >>= 30;
- val = SETFIELD(NPU2_MEM_BAR_SEL_MEM, 0ULL, 4);
- val = SETFIELD(NPU2_MEM_BAR_NODE_ADDR, val, base);
- val = SETFIELD(NPU2_MEM_BAR_GROUP | NPU2_MEM_BAR_CHIP, val, p->chip_id);
+ NPU2DBG(p, "Setting BAR region dt:%llx\n", base);
+ val = SETFIELD(NPU2_MEM_BAR_EN, 0ULL, 1);
+ val = SETFIELD(NPU2_MEM_BAR_SEL_MEM, val, base >> (63-14));
+ val = SETFIELD(NPU2_MEM_BAR_GROUP, val, base >> (63-18));
+ val = SETFIELD(NPU2_MEM_BAR_CHIP, val, base >> (63-21));
+ val = SETFIELD(NPU2_MEM_BAR_NODE_ADDR, val, base >> (63-33));
val = SETFIELD(NPU2_MEM_BAR_POISON, val, 1);
val = SETFIELD(NPU2_MEM_BAR_GRANULE, val, 0);