Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
[powerpc.git] / arch / x86_64 / kernel / tce.c
index 8d4c67f..f61fb8e 100644 (file)
@@ -1,8 +1,12 @@
 /*
+ * This file manages the translation entries for the IBM Calgary IOMMU.
+ *
  * Derived from arch/powerpc/platforms/pseries/iommu.c
  *
- * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation
- * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation
+ * Copyright (C) IBM Corporation, 2006
+ *
+ * Author: Jon Mason <jdmason@us.ibm.com>
+ * Author: Muli Ben-Yehuda <muli@il.ibm.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,7 +23,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
@@ -94,7 +97,6 @@ static inline unsigned int table_size_to_number_of_entries(unsigned char size)
 static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
 {
        unsigned int bitmapsz;
-       unsigned int tce_table_index;
        unsigned long bmppages;
        int ret;
 
@@ -103,15 +105,6 @@ static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
        /* set the tce table size - measured in entries */
        tbl->it_size = table_size_to_number_of_entries(specified_table_size);
 
-       tce_table_index = bus_to_phb(tbl->it_busno);
-       tbl->it_base = (unsigned long)tce_table_kva[tce_table_index];
-       if (!tbl->it_base) {
-               printk(KERN_ERR "Calgary: iommu_table_setparms: "
-                      "no table allocated?!\n");
-               ret = -ENOMEM;
-               goto done;
-       }
-
        /*
         * number of bytes needed for the bitmap size in number of
         * entries; we need one bit per entry
@@ -160,8 +153,6 @@ int build_tce_table(struct pci_dev *dev, void __iomem *bbar)
        if (ret)
                goto free_tbl;
 
-       tce_free(tbl, 0, tbl->it_size);
-
        tbl->bbar = bbar;
 
        /*