Lines Matching refs:iova
415 unsigned long iova, phys_addr_t paddr, int prot, in arm_v7s_init_pte() argument
431 tblp = ptep - ARM_V7S_LVL_IDX(iova, lvl); in arm_v7s_init_pte()
432 if (WARN_ON(__arm_v7s_unmap(data, NULL, iova + i * sz, in arm_v7s_init_pte()
475 static int __arm_v7s_map(struct arm_v7s_io_pgtable *data, unsigned long iova, in __arm_v7s_map() argument
484 ptep += ARM_V7S_LVL_IDX(iova, lvl); in __arm_v7s_map()
488 return arm_v7s_init_pte(data, iova, paddr, prot, in __arm_v7s_map()
519 return __arm_v7s_map(data, iova, paddr, size, prot, lvl + 1, cptep, gfp); in __arm_v7s_map()
522 static int arm_v7s_map(struct io_pgtable_ops *ops, unsigned long iova, in arm_v7s_map() argument
533 if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias) || in arm_v7s_map()
537 ret = __arm_v7s_map(data, iova, paddr, size, prot, 1, data->pgd, gfp); in arm_v7s_map()
543 io_pgtable_tlb_flush_walk(iop, iova, size, in arm_v7s_map()
570 unsigned long iova, int idx, int lvl, in arm_v7s_split_cont() argument
591 io_pgtable_tlb_flush_leaf(iop, iova, size, size); in arm_v7s_split_cont()
597 unsigned long iova, size_t size, in arm_v7s_split_blk_unmap() argument
611 unmap_idx = ARM_V7S_LVL_IDX(iova, 2); in arm_v7s_split_blk_unmap()
633 return __arm_v7s_unmap(data, gather, iova, size, 2, tablep); in arm_v7s_split_blk_unmap()
636 io_pgtable_tlb_add_page(&data->iop, gather, iova, size); in arm_v7s_split_blk_unmap()
642 unsigned long iova, size_t size, int lvl, in __arm_v7s_unmap() argument
653 idx = ARM_V7S_LVL_IDX(iova, lvl); in __arm_v7s_unmap()
675 pte[0] = arm_v7s_split_cont(data, iova, idx, lvl, ptep); in __arm_v7s_unmap()
688 io_pgtable_tlb_flush_walk(iop, iova, blk_size, in __arm_v7s_unmap()
700 io_pgtable_tlb_add_page(iop, gather, iova, blk_size); in __arm_v7s_unmap()
702 iova += blk_size; in __arm_v7s_unmap()
710 return arm_v7s_split_blk_unmap(data, gather, iova, size, pte[0], in __arm_v7s_unmap()
716 return __arm_v7s_unmap(data, gather, iova, size, lvl + 1, ptep); in __arm_v7s_unmap()
719 static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova, in arm_v7s_unmap() argument
724 if (WARN_ON(upper_32_bits(iova))) in arm_v7s_unmap()
727 return __arm_v7s_unmap(data, gather, iova, size, 1, data->pgd); in arm_v7s_unmap()
731 unsigned long iova) in arm_v7s_iova_to_phys() argument
739 ptep += ARM_V7S_LVL_IDX(iova, ++lvl); in arm_v7s_iova_to_phys()
750 return iopte_to_paddr(pte, lvl, &data->iop.cfg) | (iova & ~mask); in arm_v7s_iova_to_phys()
856 static void __init dummy_tlb_flush(unsigned long iova, size_t size, in dummy_tlb_flush() argument
864 unsigned long iova, size_t granule, in dummy_tlb_add_page() argument
867 dummy_tlb_flush(iova, granule, granule, cookie); in dummy_tlb_add_page()
894 unsigned int iova, size, iova_start; in arm_v7s_do_selftests() local
923 iova = 0; in arm_v7s_do_selftests()
926 if (ops->map(ops, iova, iova, size, IOMMU_READ | in arm_v7s_do_selftests()
933 if (!ops->map(ops, iova, iova + size, size, in arm_v7s_do_selftests()
937 if (ops->iova_to_phys(ops, iova + 42) != (iova + 42)) in arm_v7s_do_selftests()
940 iova += SZ_16M; in arm_v7s_do_selftests()
963 iova = 0; in arm_v7s_do_selftests()
967 if (ops->unmap(ops, iova, size, NULL) != size) in arm_v7s_do_selftests()
970 if (ops->iova_to_phys(ops, iova + 42)) in arm_v7s_do_selftests()
974 if (ops->map(ops, iova, iova, size, IOMMU_WRITE, GFP_KERNEL)) in arm_v7s_do_selftests()
977 if (ops->iova_to_phys(ops, iova + 42) != (iova + 42)) in arm_v7s_do_selftests()
980 iova += SZ_16M; in arm_v7s_do_selftests()