Lines Matching defs:hdev

12 static bool is_dram_va(struct hl_device *hdev, u64 virt_addr)
14 struct asic_fixed_properties *prop = &hdev->asic_prop;
23 * @hdev: habanalabs device structure.
31 int hl_mmu_init(struct hl_device *hdev)
33 if (hdev->mmu_enable)
34 return hdev->mmu_func.init(hdev);
41 * @hdev: habanalabs device structure.
49 void hl_mmu_fini(struct hl_device *hdev)
51 if (hdev->mmu_enable)
52 hdev->mmu_func.fini(hdev);
65 struct hl_device *hdev = ctx->hdev;
67 if (hdev->mmu_enable)
68 return hdev->mmu_func.ctx_init(ctx);
85 struct hl_device *hdev = ctx->hdev;
87 if (hdev->mmu_enable)
88 hdev->mmu_func.ctx_fini(ctx);
115 struct hl_device *hdev = ctx->hdev;
116 struct asic_fixed_properties *prop = &hdev->asic_prop;
123 if (!hdev->mmu_enable)
126 is_dram_addr = is_dram_va(hdev, virt_addr);
142 dev_err(hdev->dev,
153 rc = hdev->mmu_func.unmap(ctx, real_virt_addr, is_dram_addr);
161 hdev->mmu_func.flush(ctx);
191 struct hl_device *hdev = ctx->hdev;
192 struct asic_fixed_properties *prop = &hdev->asic_prop;
199 if (!hdev->mmu_enable)
202 is_dram_addr = is_dram_va(hdev, virt_addr);
218 dev_err(hdev->dev,
234 rc = hdev->mmu_func.map(ctx, real_virt_addr, real_phys_addr,
245 hdev->mmu_func.flush(ctx);
252 if (hdev->mmu_func.unmap(ctx, real_virt_addr, is_dram_addr))
253 dev_warn_ratelimited(hdev->dev,
259 hdev->mmu_func.flush(ctx);
272 struct hl_device *hdev = ctx->hdev;
274 if (hdev->mmu_enable)
275 hdev->mmu_func.swap_out(ctx);
286 struct hl_device *hdev = ctx->hdev;
288 if (hdev->mmu_enable)
289 hdev->mmu_func.swap_in(ctx);
292 int hl_mmu_if_set_funcs(struct hl_device *hdev)
294 if (!hdev->mmu_enable)
297 switch (hdev->asic_type) {
300 hl_mmu_v1_set_funcs(hdev);
303 dev_err(hdev->dev, "Unrecognized ASIC type %d\n",
304 hdev->asic_type);