aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/iommu.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index c42219c0afda..8f1f4e539c4b 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -453,9 +453,6 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
453struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) 453struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
454{ 454{
455 unsigned long sz; 455 unsigned long sz;
456 unsigned long start_index, end_index;
457 unsigned long entries_per_4g;
458 unsigned long index;
459 static int welcomed = 0; 456 static int welcomed = 0;
460 struct page *page; 457 struct page *page;
461 458
@@ -477,6 +474,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
477 474
478#ifdef CONFIG_CRASH_DUMP 475#ifdef CONFIG_CRASH_DUMP
479 if (ppc_md.tce_get) { 476 if (ppc_md.tce_get) {
477 unsigned long index;
480 unsigned long tceval; 478 unsigned long tceval;
481 unsigned long tcecount = 0; 479 unsigned long tcecount = 0;
482 480
@@ -507,23 +505,6 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
507 ppc_md.tce_free(tbl, tbl->it_offset, tbl->it_size); 505 ppc_md.tce_free(tbl, tbl->it_offset, tbl->it_size);
508#endif 506#endif
509 507
510 /*
511 * DMA cannot cross 4 GB boundary. Mark last entry of each 4
512 * GB chunk as reserved.
513 */
514 if (protect4gb) {
515 entries_per_4g = 0x100000000l >> IOMMU_PAGE_SHIFT;
516
517 /* Mark the last bit before a 4GB boundary as used */
518 start_index = tbl->it_offset | (entries_per_4g - 1);
519 start_index -= tbl->it_offset;
520
521 end_index = tbl->it_size;
522
523 for (index = start_index; index < end_index - 1; index += entries_per_4g)
524 __set_bit(index, tbl->it_map);
525 }
526
527 if (!welcomed) { 508 if (!welcomed) {
528 printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n", 509 printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
529 novmerge ? "disabled" : "enabled"); 510 novmerge ? "disabled" : "enabled");