Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[powerpc.git] / include / asm-x86_64 / calgary.h
index 6e1654f..7ee9006 100644 (file)
@@ -1,8 +1,10 @@
 /*
  * Derived from include/asm-powerpc/iommu.h
  *
- * 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
@@ -22,7 +24,6 @@
 #ifndef _ASM_X86_64_CALGARY_H
 #define _ASM_X86_64_CALGARY_H
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
@@ -32,12 +33,12 @@ struct iommu_table {
        unsigned long  it_base;      /* mapped address of tce table */
        unsigned long  it_hint;      /* Hint for next alloc */
        unsigned long *it_map;       /* A simple allocation bitmap for now */
+       void __iomem  *bbar;         /* Bridge BAR */
+       u64            tar_val;      /* Table Address Register */
+       struct timer_list watchdog_timer;
        spinlock_t     it_lock;      /* Protects it_map */
        unsigned int   it_size;      /* Size of iommu table in entries */
        unsigned char  it_busno;     /* Bus number this table belongs to */
-       void __iomem  *bbar;
-       u64            tar_val;
-       struct timer_list watchdog_timer;
 };
 
 #define TCE_TABLE_SIZE_UNSPECIFIED     ~0
@@ -50,6 +51,8 @@ struct iommu_table {
 #define TCE_TABLE_SIZE_4M              6
 #define TCE_TABLE_SIZE_8M              7
 
+extern int use_calgary;
+
 #ifdef CONFIG_CALGARY_IOMMU
 extern int calgary_iommu_init(void);
 extern void detect_calgary(void);
@@ -58,9 +61,4 @@ static inline int calgary_iommu_init(void) { return 1; }
 static inline void detect_calgary(void) { return; }
 #endif
 
-static inline unsigned int bus_to_phb(unsigned char busno)
-{
-       return ((busno % 15 == 0) ? 0 : busno / 2 + 1);
-}
-
 #endif /* _ASM_X86_64_CALGARY_H */