Lines Matching refs:iova
152 static unsigned int iova_pd_index(unsigned long iova) in iova_pd_index() argument
154 return (iova >> SMMU_PDE_SHIFT) & (SMMU_NUM_PDE - 1); in iova_pd_index()
157 static unsigned int iova_pt_index(unsigned long iova) in iova_pt_index() argument
159 return (iova >> SMMU_PTE_SHIFT) & (SMMU_NUM_PTE - 1); in iova_pt_index()
215 unsigned long iova) in smmu_flush_tlb_section() argument
220 SMMU_TLB_FLUSH_VA_SECTION(iova); in smmu_flush_tlb_section()
226 unsigned long iova) in smmu_flush_tlb_group() argument
231 SMMU_TLB_FLUSH_VA_GROUP(iova); in smmu_flush_tlb_group()
511 static void tegra_smmu_set_pde(struct tegra_smmu_as *as, unsigned long iova, in tegra_smmu_set_pde() argument
514 unsigned int pd_index = iova_pd_index(iova); in tegra_smmu_set_pde()
528 smmu_flush_tlb_section(smmu, as->id, iova); in tegra_smmu_set_pde()
532 static u32 *tegra_smmu_pte_offset(struct page *pt_page, unsigned long iova) in tegra_smmu_pte_offset() argument
536 return pt + iova_pt_index(iova); in tegra_smmu_pte_offset()
539 static u32 *tegra_smmu_pte_lookup(struct tegra_smmu_as *as, unsigned long iova, in tegra_smmu_pte_lookup() argument
542 unsigned int pd_index = iova_pd_index(iova); in tegra_smmu_pte_lookup()
553 return tegra_smmu_pte_offset(pt_page, iova); in tegra_smmu_pte_lookup()
556 static u32 *as_get_pte(struct tegra_smmu_as *as, dma_addr_t iova, in as_get_pte() argument
559 unsigned int pde = iova_pd_index(iova); in as_get_pte()
586 tegra_smmu_set_pde(as, iova, SMMU_MK_PDE(dma, SMMU_PDE_ATTR | in as_get_pte()
596 return tegra_smmu_pte_offset(as->pts[pde], iova); in as_get_pte()
599 static void tegra_smmu_pte_get_use(struct tegra_smmu_as *as, unsigned long iova) in tegra_smmu_pte_get_use() argument
601 unsigned int pd_index = iova_pd_index(iova); in tegra_smmu_pte_get_use()
606 static void tegra_smmu_pte_put_use(struct tegra_smmu_as *as, unsigned long iova) in tegra_smmu_pte_put_use() argument
608 unsigned int pde = iova_pd_index(iova); in tegra_smmu_pte_put_use()
620 tegra_smmu_set_pde(as, iova, 0); in tegra_smmu_pte_put_use()
628 static void tegra_smmu_set_pte(struct tegra_smmu_as *as, unsigned long iova, in tegra_smmu_set_pte() argument
639 smmu_flush_tlb_group(smmu, as->id, iova); in tegra_smmu_set_pte()
643 static int tegra_smmu_map(struct iommu_domain *domain, unsigned long iova, in tegra_smmu_map() argument
650 pte = as_get_pte(as, iova, &pte_dma); in tegra_smmu_map()
656 tegra_smmu_pte_get_use(as, iova); in tegra_smmu_map()
658 tegra_smmu_set_pte(as, iova, pte, pte_dma, in tegra_smmu_map()
664 static size_t tegra_smmu_unmap(struct iommu_domain *domain, unsigned long iova, in tegra_smmu_unmap() argument
671 pte = tegra_smmu_pte_lookup(as, iova, &pte_dma); in tegra_smmu_unmap()
675 tegra_smmu_set_pte(as, iova, pte, pte_dma, 0); in tegra_smmu_unmap()
676 tegra_smmu_pte_put_use(as, iova); in tegra_smmu_unmap()
682 dma_addr_t iova) in tegra_smmu_iova_to_phys() argument
689 pte = tegra_smmu_pte_lookup(as, iova, &pte_dma); in tegra_smmu_iova_to_phys()