aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2013-12-09 02:17:02 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-12-29 22:17:13 -0500
commit3a553170d35d69bea3877bffa508489dfa6f133d (patch)
tree9cb5b53ea4a60e10c9cfe2644f35a9fe4673d050 /arch/powerpc/platforms/cell
parente589a4404fa06730355de204d3d136ed9bbc7dea (diff)
powerpc/iommu: Add it_page_shift field to determine iommu page size
This patch adds a it_page_shift field to struct iommu_table and initiliases it to 4K for all platforms. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r--arch/powerpc/platforms/cell/iommu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index fc61b908eaf0..2b90ff8a93be 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -197,7 +197,7 @@ static int tce_build_cell(struct iommu_table *tbl, long index, long npages,
197 197
198 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); 198 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset);
199 199
200 for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE_4K) 200 for (i = 0; i < npages; i++, uaddr += tbl->it_page_shift)
201 io_pte[i] = base_pte | (__pa(uaddr) & CBE_IOPTE_RPN_Mask); 201 io_pte[i] = base_pte | (__pa(uaddr) & CBE_IOPTE_RPN_Mask);
202 202
203 mb(); 203 mb();
@@ -487,8 +487,10 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
487 window->table.it_blocksize = 16; 487 window->table.it_blocksize = 16;
488 window->table.it_base = (unsigned long)iommu->ptab; 488 window->table.it_base = (unsigned long)iommu->ptab;
489 window->table.it_index = iommu->nid; 489 window->table.it_index = iommu->nid;
490 window->table.it_offset = (offset >> IOMMU_PAGE_SHIFT_4K) + pte_offset; 490 window->table.it_page_shift = IOMMU_PAGE_SHIFT_4K;
491 window->table.it_size = size >> IOMMU_PAGE_SHIFT_4K; 491 window->table.it_offset =
492 (offset >> window->table.it_page_shift) + pte_offset;
493 window->table.it_size = size >> window->table.it_page_shift;
492 494
493 iommu_init_table(&window->table, iommu->nid); 495 iommu_init_table(&window->table, iommu->nid);
494 496