Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 1 | /* |
Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 2 | * This file is derived from asm-powerpc/tce.h. |
| 3 | * |
Muli Ben-Yehuda | aa0a9f3 | 2006-07-10 17:06:15 +0200 | [diff] [blame] | 4 | * Copyright (C) IBM Corporation, 2006 |
| 5 | * |
| 6 | * Author: Muli Ben-Yehuda <muli@il.ibm.com> |
| 7 | * Author: Jon Mason <jdmason@us.ibm.com> |
| 8 | * |
Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | */ |
| 23 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 24 | #ifndef _ASM_X86_TCE_H |
| 25 | #define _ASM_X86_TCE_H |
Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 26 | |
Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 27 | extern unsigned int specified_table_size; |
| 28 | struct iommu_table; |
| 29 | |
| 30 | #define TCE_ENTRY_SIZE 8 /* in bytes */ |
| 31 | |
| 32 | #define TCE_READ_SHIFT 0 |
| 33 | #define TCE_WRITE_SHIFT 1 |
| 34 | #define TCE_HUBID_SHIFT 2 /* unused */ |
| 35 | #define TCE_RSVD_SHIFT 8 /* unused */ |
| 36 | #define TCE_RPN_SHIFT 12 |
| 37 | #define TCE_UNUSED_SHIFT 48 /* unused */ |
| 38 | |
| 39 | #define TCE_RPN_MASK 0x0000fffffffff000ULL |
| 40 | |
| 41 | extern void tce_build(struct iommu_table *tbl, unsigned long index, |
Joe Perches | 7c4d478 | 2008-03-23 01:03:40 -0700 | [diff] [blame] | 42 | unsigned int npages, unsigned long uaddr, int direction); |
Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 43 | extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages); |
Randy Dunlap | e6b3322 | 2007-07-31 00:37:32 -0700 | [diff] [blame] | 44 | extern void * __init alloc_tce_table(void); |
| 45 | extern void __init free_tce_table(void *tbl); |
| 46 | extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar); |
Jon Mason | e465058 | 2006-06-26 13:58:14 +0200 | [diff] [blame] | 47 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 48 | #endif /* _ASM_X86_TCE_H */ |