Lines Matching refs:iopte
468 static void iopte_free(struct omap_iommu *obj, u32 *iopte, bool dma_valid) in iopte_free() argument
473 if (iopte) { in iopte_free()
475 pt_dma = virt_to_phys(iopte); in iopte_free()
480 kmem_cache_free(iopte_cachep, iopte); in iopte_free()
487 u32 *iopte; in iopte_alloc() local
498 iopte = kmem_cache_zalloc(iopte_cachep, GFP_KERNEL); in iopte_alloc()
502 if (!iopte) in iopte_alloc()
505 *pt_dma = dma_map_single(obj->dev, iopte, IOPTE_TABLE_SIZE, in iopte_alloc()
509 iopte_free(obj, iopte, false); in iopte_alloc()
517 if (WARN_ON(*pt_dma != virt_to_phys(iopte))) { in iopte_alloc()
521 iopte_free(obj, iopte, false); in iopte_alloc()
525 *iopgd = virt_to_phys(iopte) | IOPGD_TABLE; in iopte_alloc()
528 dev_vdbg(obj->dev, "%s: a new pte:%p\n", __func__, iopte); in iopte_alloc()
531 iopte_free(obj, iopte, false); in iopte_alloc()
535 iopte = iopte_offset(iopgd, da); in iopte_alloc()
539 __func__, da, iopgd, *iopgd, iopte, *iopte); in iopte_alloc()
541 return iopte; in iopte_alloc()
582 u32 *iopte = iopte_alloc(obj, iopgd, &pt_dma, da); in iopte_alloc_page() local
585 if (IS_ERR(iopte)) in iopte_alloc_page()
586 return PTR_ERR(iopte); in iopte_alloc_page()
588 *iopte = (pa & IOPAGE_MASK) | prot | IOPTE_SMALL; in iopte_alloc_page()
592 __func__, da, pa, iopte, *iopte); in iopte_alloc_page()
601 u32 *iopte = iopte_alloc(obj, iopgd, &pt_dma, da); in iopte_alloc_large() local
611 if (IS_ERR(iopte)) in iopte_alloc_large()
612 return PTR_ERR(iopte); in iopte_alloc_large()
615 *(iopte + i) = (pa & IOLARGE_MASK) | prot | IOPTE_LARGE; in iopte_alloc_large()
687 u32 *iopgd, *iopte = NULL; in iopgtable_lookup_entry() local
694 iopte = iopte_offset(iopgd, da); in iopgtable_lookup_entry()
697 *ppte = iopte; in iopgtable_lookup_entry()
714 u32 *iopte = iopte_offset(iopgd, da); in iopgtable_clear_entry_core() local
717 if (*iopte & IOPTE_LARGE) { in iopgtable_clear_entry_core()
720 iopte = iopte_offset(iopgd, (da & IOLARGE_MASK)); in iopgtable_clear_entry_core()
723 memset(iopte, 0, nent * sizeof(*iopte)); in iopgtable_clear_entry_core()
730 iopte = iopte_offset(iopgd, 0); in iopgtable_clear_entry_core()
732 if (iopte[i]) in iopgtable_clear_entry_core()
735 iopte_free(obj, iopte, true); in iopgtable_clear_entry_core()
807 u32 *iopgd, *iopte; in iommu_fault_handler() local
833 iopte = iopte_offset(iopgd, da); in iommu_fault_handler()
836 obj->name, errs, da, iopgd, *iopgd, iopte, *iopte); in iommu_fault_handler()