/*1* Derived from include/asm-powerpc/iommu.h2*3* Copyright IBM Corporation, 2006-20074*5* Author: Jon Mason <[email protected]>6* Author: Muli Ben-Yehuda <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223#ifndef _ASM_X86_CALGARY_H24#define _ASM_X86_CALGARY_H2526#include <linux/spinlock.h>27#include <linux/device.h>28#include <linux/dma-mapping.h>29#include <linux/timer.h>30#include <asm/types.h>3132struct iommu_table {33struct cal_chipset_ops *chip_ops; /* chipset specific funcs */34unsigned long it_base; /* mapped address of tce table */35unsigned long it_hint; /* Hint for next alloc */36unsigned long *it_map; /* A simple allocation bitmap for now */37void __iomem *bbar; /* Bridge BAR */38u64 tar_val; /* Table Address Register */39struct timer_list watchdog_timer;40spinlock_t it_lock; /* Protects it_map */41unsigned int it_size; /* Size of iommu table in entries */42unsigned char it_busno; /* Bus number this table belongs to */43};4445struct cal_chipset_ops {46void (*handle_quirks)(struct iommu_table *tbl, struct pci_dev *dev);47void (*tce_cache_blast)(struct iommu_table *tbl);48void (*dump_error_regs)(struct iommu_table *tbl);49};5051#define TCE_TABLE_SIZE_UNSPECIFIED ~052#define TCE_TABLE_SIZE_64K 053#define TCE_TABLE_SIZE_128K 154#define TCE_TABLE_SIZE_256K 255#define TCE_TABLE_SIZE_512K 356#define TCE_TABLE_SIZE_1M 457#define TCE_TABLE_SIZE_2M 558#define TCE_TABLE_SIZE_4M 659#define TCE_TABLE_SIZE_8M 76061extern int use_calgary;6263#ifdef CONFIG_CALGARY_IOMMU64extern int detect_calgary(void);65#else66static inline int detect_calgary(void) { return -ENODEV; }67#endif6869#endif /* _ASM_X86_CALGARY_H */707172