Lines Matching refs:iova

141 static unsigned int iova_pd_index(unsigned long iova)  in iova_pd_index()  argument
143 return (iova >> SMMU_PDE_SHIFT) & (SMMU_NUM_PDE - 1); in iova_pd_index()
146 static unsigned int iova_pt_index(unsigned long iova) in iova_pt_index() argument
148 return (iova >> SMMU_PTE_SHIFT) & (SMMU_NUM_PTE - 1); in iova_pt_index()
204 unsigned long iova) in smmu_flush_tlb_section() argument
209 SMMU_TLB_FLUSH_VA_SECTION(iova); in smmu_flush_tlb_section()
215 unsigned long iova) in smmu_flush_tlb_group() argument
220 SMMU_TLB_FLUSH_VA_GROUP(iova); in smmu_flush_tlb_group()
500 static void tegra_smmu_set_pde(struct tegra_smmu_as *as, unsigned long iova, in tegra_smmu_set_pde() argument
503 unsigned int pd_index = iova_pd_index(iova); in tegra_smmu_set_pde()
517 smmu_flush_tlb_section(smmu, as->id, iova); in tegra_smmu_set_pde()
521 static u32 *tegra_smmu_pte_offset(struct page *pt_page, unsigned long iova) in tegra_smmu_pte_offset() argument
525 return pt + iova_pt_index(iova); in tegra_smmu_pte_offset()
528 static u32 *tegra_smmu_pte_lookup(struct tegra_smmu_as *as, unsigned long iova, in tegra_smmu_pte_lookup() argument
531 unsigned int pd_index = iova_pd_index(iova); in tegra_smmu_pte_lookup()
542 return tegra_smmu_pte_offset(pt_page, iova); in tegra_smmu_pte_lookup()
545 static u32 *as_get_pte(struct tegra_smmu_as *as, dma_addr_t iova, in as_get_pte() argument
548 unsigned int pde = iova_pd_index(iova); in as_get_pte()
575 tegra_smmu_set_pde(as, iova, SMMU_MK_PDE(dma, SMMU_PDE_ATTR | in as_get_pte()
585 return tegra_smmu_pte_offset(as->pts[pde], iova); in as_get_pte()
588 static void tegra_smmu_pte_get_use(struct tegra_smmu_as *as, unsigned long iova) in tegra_smmu_pte_get_use() argument
590 unsigned int pd_index = iova_pd_index(iova); in tegra_smmu_pte_get_use()
595 static void tegra_smmu_pte_put_use(struct tegra_smmu_as *as, unsigned long iova) in tegra_smmu_pte_put_use() argument
597 unsigned int pde = iova_pd_index(iova); in tegra_smmu_pte_put_use()
609 tegra_smmu_set_pde(as, iova, 0); in tegra_smmu_pte_put_use()
617 static void tegra_smmu_set_pte(struct tegra_smmu_as *as, unsigned long iova, in tegra_smmu_set_pte() argument
628 smmu_flush_tlb_group(smmu, as->id, iova); in tegra_smmu_set_pte()
632 static int tegra_smmu_map(struct iommu_domain *domain, unsigned long iova, in tegra_smmu_map() argument
639 pte = as_get_pte(as, iova, &pte_dma); in tegra_smmu_map()
645 tegra_smmu_pte_get_use(as, iova); in tegra_smmu_map()
647 tegra_smmu_set_pte(as, iova, pte, pte_dma, in tegra_smmu_map()
653 static size_t tegra_smmu_unmap(struct iommu_domain *domain, unsigned long iova, in tegra_smmu_unmap() argument
660 pte = tegra_smmu_pte_lookup(as, iova, &pte_dma); in tegra_smmu_unmap()
664 tegra_smmu_set_pte(as, iova, pte, pte_dma, 0); in tegra_smmu_unmap()
665 tegra_smmu_pte_put_use(as, iova); in tegra_smmu_unmap()
671 dma_addr_t iova) in tegra_smmu_iova_to_phys() argument
678 pte = tegra_smmu_pte_lookup(as, iova, &pte_dma); in tegra_smmu_iova_to_phys()