diff mbox

[PATCHv3,01/11] staging: tidspbridge: replace iommu custom for opensource implementation

Message ID AANLkTin+n8KsHz2jTtkbk2MnuiANrxpskThYU9FVu3CE@mail.gmail.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

Felipe Contreras Oct. 17, 2010, 10:36 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/staging/tidspbridge/core/io_sm.c
b/drivers/staging/tidspbridge/core/io_sm.c
index 842b8db..16cf246 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -541,6 +541,14 @@  int bridge_io_on_loaded(struct io_mgr *hio_mgr)
 					ae_proc[ndx].ul_dsp_va *
 					hio_mgr->word_size, page_size[i]);
 				ndx++;
+			} else {
+				u32 tmp_curr;
+				tmp_curr = iommu_kmap(mmu, va_curr, pa_curr, page_size[i],
+						IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32);
+				if (IS_ERR_VALUE(tmp_curr)) {
+					status = (int)tmp_curr;
+					goto func_end;
+				}
 			}
 			pa_curr += page_size[i];
 			va_curr += page_size[i];
@@ -593,6 +601,15 @@  int bridge_io_on_loaded(struct io_mgr *hio_mgr)
 					"DSP_VA 0x%x\n", ae_proc[ndx].ul_gpp_pa,
 					ae_proc[ndx].ul_dsp_va);
 				ndx++;
+			} else {
+				u32 tmp_curr;
+				tmp_curr = iommu_kmap(mmu,
+						hio_mgr->ext_proc_info.ty_tlb[i].ul_dsp_virt,
+						hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys,
+						0x100000,
+						IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32);
+				if (IS_ERR_VALUE(tmp_curr))
+					status = (int)tmp_curr;
 			}
 		}
 		if (status)
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c
b/drivers/staging/tidspbridge/core/tiomap3430.c
index c2f5105..92774fc 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -1195,7 +1195,7 @@  static int get_io_pages(struct mm_struct *mm,
u32 uva, unsigned pages,
 	struct page *pg;

 	for (i = 0; i < pages; i++) {
-		pa = user_va2_pa(mm, uva);
+		pa = user_va2_pa(mm, uva + i * PAGE_SIZE);

 		if (!pfn_valid(__phys_to_pfn(pa)))