Lines Matching full:pagetable

36 static size_t calc_pgsize(struct msm_iommu_pagetable *pagetable,  in calc_pgsize()  argument
46 pgsizes = pagetable->pgsize_bitmap & GENMASK(__fls(size), 0); in calc_pgsize()
62 pgsizes = pagetable->pgsize_bitmap & ~GENMASK(pgsize_idx, 0); in calc_pgsize()
94 struct msm_iommu_pagetable *pagetable = to_pagetable(mmu); in msm_iommu_pagetable_unmap() local
95 struct io_pgtable_ops *ops = pagetable->pgtbl_ops; in msm_iommu_pagetable_unmap()
100 pgsize = calc_pgsize(pagetable, iova, iova, size, &count); in msm_iommu_pagetable_unmap()
110 iommu_flush_iotlb_all(to_msm_iommu(pagetable->parent)->domain); in msm_iommu_pagetable_unmap()
118 struct msm_iommu_pagetable *pagetable = to_pagetable(mmu); in msm_iommu_pagetable_map() local
119 struct io_pgtable_ops *ops = pagetable->pgtbl_ops; in msm_iommu_pagetable_map()
132 pgsize = calc_pgsize(pagetable, addr, phys, size, &count); in msm_iommu_pagetable_map()
156 struct msm_iommu_pagetable *pagetable = to_pagetable(mmu); in msm_iommu_pagetable_destroy() local
157 struct msm_iommu *iommu = to_msm_iommu(pagetable->parent); in msm_iommu_pagetable_destroy()
159 dev_get_drvdata(pagetable->parent->dev); in msm_iommu_pagetable_destroy()
162 * If this is the last attached pagetable for the parent, in msm_iommu_pagetable_destroy()
168 free_io_pgtable_ops(pagetable->pgtbl_ops); in msm_iommu_pagetable_destroy()
169 kfree(pagetable); in msm_iommu_pagetable_destroy()
175 struct msm_iommu_pagetable *pagetable; in msm_iommu_pagetable_params() local
180 pagetable = to_pagetable(mmu); in msm_iommu_pagetable_params()
183 *ttbr = pagetable->ttbr; in msm_iommu_pagetable_params()
186 *asid = pagetable->asid; in msm_iommu_pagetable_params()
206 struct msm_iommu_pagetable *pagetable = cookie; in msm_iommu_tlb_flush_all() local
209 if (!pm_runtime_get_if_in_use(pagetable->iommu_dev)) in msm_iommu_tlb_flush_all()
212 adreno_smmu = dev_get_drvdata(pagetable->parent->dev); in msm_iommu_tlb_flush_all()
214 pagetable->tlb->tlb_flush_all((void *)adreno_smmu->cookie); in msm_iommu_tlb_flush_all()
216 pm_runtime_put_autosuspend(pagetable->iommu_dev); in msm_iommu_tlb_flush_all()
222 struct msm_iommu_pagetable *pagetable = cookie; in msm_iommu_tlb_flush_walk() local
225 if (!pm_runtime_get_if_in_use(pagetable->iommu_dev)) in msm_iommu_tlb_flush_walk()
228 adreno_smmu = dev_get_drvdata(pagetable->parent->dev); in msm_iommu_tlb_flush_walk()
230 pagetable->tlb->tlb_flush_walk(iova, size, granule, (void *)adreno_smmu->cookie); in msm_iommu_tlb_flush_walk()
232 pm_runtime_put_autosuspend(pagetable->iommu_dev); in msm_iommu_tlb_flush_walk()
253 struct msm_iommu_pagetable *pagetable; in msm_iommu_pagetable_create() local
258 /* Get the pagetable configuration from the domain */ in msm_iommu_pagetable_create()
269 pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL); in msm_iommu_pagetable_create()
270 if (!pagetable) in msm_iommu_pagetable_create()
273 msm_mmu_init(&pagetable->base, parent->dev, &pagetable_funcs, in msm_iommu_pagetable_create()
283 pagetable->pgtbl_ops = alloc_io_pgtable_ops(ARM_64_LPAE_S1, in msm_iommu_pagetable_create()
284 &ttbr0_cfg, pagetable); in msm_iommu_pagetable_create()
286 if (!pagetable->pgtbl_ops) { in msm_iommu_pagetable_create()
287 kfree(pagetable); in msm_iommu_pagetable_create()
292 * If this is the first pagetable that we've allocated, send it back to in msm_iommu_pagetable_create()
298 free_io_pgtable_ops(pagetable->pgtbl_ops); in msm_iommu_pagetable_create()
299 kfree(pagetable); in msm_iommu_pagetable_create()
305 pagetable->parent = parent; in msm_iommu_pagetable_create()
306 pagetable->tlb = ttbr1_cfg->tlb; in msm_iommu_pagetable_create()
307 pagetable->iommu_dev = ttbr1_cfg->iommu_dev; in msm_iommu_pagetable_create()
308 pagetable->pgsize_bitmap = ttbr0_cfg.pgsize_bitmap; in msm_iommu_pagetable_create()
309 pagetable->ttbr = ttbr0_cfg.arm_lpae_s1_cfg.ttbr; in msm_iommu_pagetable_create()
317 pagetable->asid = 0; in msm_iommu_pagetable_create()
319 return &pagetable->base; in msm_iommu_pagetable_create()