Lines Matching refs:da
242 static u32 iommu_report_fault(struct omap_iommu *obj, u32 *da) in iommu_report_fault() argument
249 *da = 0; in iommu_report_fault()
254 *da = fault_addr; in iommu_report_fault()
319 if (e->da & ~(get_cam_va_mask(e->pgsz))) { in iotlb_alloc_cr()
321 e->da); in iotlb_alloc_cr()
329 cr->cam = (e->da & MMU_CAM_VATAG_MASK) | e->prsvd | e->pgsz | e->valid; in iotlb_alloc_cr()
418 static void flush_iotlb_page(struct omap_iommu *obj, u32 da) in flush_iotlb_page() argument
435 if ((start <= da) && (da < start + bytes)) { in flush_iotlb_page()
437 __func__, start, da, bytes); in flush_iotlb_page()
446 dev_dbg(obj->dev, "%s: no page for %08x\n", __func__, da); in flush_iotlb_page()
498 static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd, u32 da) in iopte_alloc() argument
527 iopte = iopte_offset(iopgd, da); in iopte_alloc()
531 __func__, da, iopgd, *iopgd, iopte, *iopte); in iopte_alloc()
536 static int iopgd_alloc_section(struct omap_iommu *obj, u32 da, u32 pa, u32 prot) in iopgd_alloc_section() argument
538 u32 *iopgd = iopgd_offset(obj, da); in iopgd_alloc_section()
540 if ((da | pa) & ~IOSECTION_MASK) { in iopgd_alloc_section()
542 __func__, da, pa, IOSECTION_SIZE); in iopgd_alloc_section()
551 static int iopgd_alloc_super(struct omap_iommu *obj, u32 da, u32 pa, u32 prot) in iopgd_alloc_super() argument
553 u32 *iopgd = iopgd_offset(obj, da); in iopgd_alloc_super()
556 if ((da | pa) & ~IOSUPER_MASK) { in iopgd_alloc_super()
558 __func__, da, pa, IOSUPER_SIZE); in iopgd_alloc_super()
568 static int iopte_alloc_page(struct omap_iommu *obj, u32 da, u32 pa, u32 prot) in iopte_alloc_page() argument
570 u32 *iopgd = iopgd_offset(obj, da); in iopte_alloc_page()
571 u32 *iopte = iopte_alloc(obj, iopgd, da); in iopte_alloc_page()
580 __func__, da, pa, iopte, *iopte); in iopte_alloc_page()
585 static int iopte_alloc_large(struct omap_iommu *obj, u32 da, u32 pa, u32 prot) in iopte_alloc_large() argument
587 u32 *iopgd = iopgd_offset(obj, da); in iopte_alloc_large()
588 u32 *iopte = iopte_alloc(obj, iopgd, da); in iopte_alloc_large()
591 if ((da | pa) & ~IOLARGE_MASK) { in iopte_alloc_large()
593 __func__, da, pa, IOLARGE_SIZE); in iopte_alloc_large()
638 err = fn(obj, e->da, e->pa, prot); in iopgtable_store_entry_core()
654 flush_iotlb_page(obj, e->da); in omap_iopgtable_store_entry()
669 iopgtable_lookup_entry(struct omap_iommu *obj, u32 da, u32 **ppgd, u32 **ppte) in iopgtable_lookup_entry() argument
673 iopgd = iopgd_offset(obj, da); in iopgtable_lookup_entry()
678 iopte = iopte_offset(iopgd, da); in iopgtable_lookup_entry()
684 static size_t iopgtable_clear_entry_core(struct omap_iommu *obj, u32 da) in iopgtable_clear_entry_core() argument
687 u32 *iopgd = iopgd_offset(obj, da); in iopgtable_clear_entry_core()
695 u32 *iopte = iopte_offset(iopgd, da); in iopgtable_clear_entry_core()
701 iopte = iopte_offset(iopgd, (da & IOLARGE_MASK)); in iopgtable_clear_entry_core()
722 iopgd = iopgd_offset(obj, (da & IOSUPER_MASK)); in iopgtable_clear_entry_core()
737 static size_t iopgtable_clear_entry(struct omap_iommu *obj, u32 da) in iopgtable_clear_entry() argument
743 bytes = iopgtable_clear_entry_core(obj, da); in iopgtable_clear_entry()
744 flush_iotlb_page(obj, da); in iopgtable_clear_entry()
758 u32 da; in iopgtable_clear_entry_all() local
761 da = i << IOPGD_SHIFT; in iopgtable_clear_entry_all()
762 iopgd = iopgd_offset(obj, da); in iopgtable_clear_entry_all()
784 u32 da, errs; in iommu_fault_handler() local
793 errs = iommu_report_fault(obj, &da); in iommu_fault_handler()
798 if (!report_iommu_fault(domain, obj->dev, da, 0)) in iommu_fault_handler()
803 iopgd = iopgd_offset(obj, da); in iommu_fault_handler()
807 obj->name, errs, da, iopgd, *iopgd); in iommu_fault_handler()
811 iopte = iopte_offset(iopgd, da); in iommu_fault_handler()
814 obj->name, errs, da, iopgd, *iopgd, iopte, *iopte); in iommu_fault_handler()
1021 static u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa, int pgsz) in iotlb_init_entry() argument
1025 e->da = da; in iotlb_init_entry()
1036 static int omap_iommu_map(struct iommu_domain *domain, unsigned long da, in omap_iommu_map() argument
1052 dev_dbg(dev, "mapping da 0x%lx to pa %pa size 0x%x\n", da, &pa, bytes); in omap_iommu_map()
1054 iotlb_init_entry(&e, da, pa, omap_pgsz); in omap_iommu_map()
1063 static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da, in omap_iommu_unmap() argument
1070 dev_dbg(dev, "unmapping da 0x%lx size %u\n", da, size); in omap_iommu_unmap()
1072 return iopgtable_clear_entry(oiommu, da); in omap_iommu_unmap()
1197 dma_addr_t da) in omap_iommu_iova_to_phys() argument
1205 iopgtable_lookup_entry(oiommu, da, &pgd, &pte); in omap_iommu_iova_to_phys()
1209 ret = omap_iommu_translate(*pte, da, IOPTE_MASK); in omap_iommu_iova_to_phys()
1211 ret = omap_iommu_translate(*pte, da, IOLARGE_MASK); in omap_iommu_iova_to_phys()
1214 (unsigned long long)da); in omap_iommu_iova_to_phys()
1217 ret = omap_iommu_translate(*pgd, da, IOSECTION_MASK); in omap_iommu_iova_to_phys()
1219 ret = omap_iommu_translate(*pgd, da, IOSUPER_MASK); in omap_iommu_iova_to_phys()
1222 (unsigned long long)da); in omap_iommu_iova_to_phys()