|
@@ -1,5 +1,4 @@
|
|
/*
|
|
/*
|
|
- * iommu.h
|
|
|
|
* Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
|
|
* Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
|
|
* Rewrite, cleanup:
|
|
* Rewrite, cleanup:
|
|
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation
|
|
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation
|
|
@@ -29,44 +28,11 @@
|
|
|
|
|
|
/*
|
|
/*
|
|
* IOMAP_MAX_ORDER defines the largest contiguous block
|
|
* IOMAP_MAX_ORDER defines the largest contiguous block
|
|
- * of dma (tce) space we can get. IOMAP_MAX_ORDER = 13
|
|
|
|
|
|
+ * of dma space we can get. IOMAP_MAX_ORDER = 13
|
|
* allows up to 2**12 pages (4096 * 4096) = 16 MB
|
|
* allows up to 2**12 pages (4096 * 4096) = 16 MB
|
|
*/
|
|
*/
|
|
#define IOMAP_MAX_ORDER 13
|
|
#define IOMAP_MAX_ORDER 13
|
|
|
|
|
|
-/*
|
|
|
|
- * Tces come in two formats, one for the virtual bus and a different
|
|
|
|
- * format for PCI
|
|
|
|
- */
|
|
|
|
-#define TCE_VB 0
|
|
|
|
-#define TCE_PCI 1
|
|
|
|
-
|
|
|
|
-/* tce_entry
|
|
|
|
- * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's
|
|
|
|
- * abstracted so layout is irrelevant.
|
|
|
|
- */
|
|
|
|
-union tce_entry {
|
|
|
|
- unsigned long te_word;
|
|
|
|
- struct {
|
|
|
|
- unsigned int tb_cacheBits :6; /* Cache hash bits - not used */
|
|
|
|
- unsigned int tb_rsvd :6;
|
|
|
|
- unsigned long tb_rpn :40; /* Real page number */
|
|
|
|
- unsigned int tb_valid :1; /* Tce is valid (vb only) */
|
|
|
|
- unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */
|
|
|
|
- unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */
|
|
|
|
- unsigned int tb_pciwr :1; /* Write allowed (pci only) */
|
|
|
|
- unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */
|
|
|
|
- } te_bits;
|
|
|
|
-#define te_cacheBits te_bits.tb_cacheBits
|
|
|
|
-#define te_rpn te_bits.tb_rpn
|
|
|
|
-#define te_valid te_bits.tb_valid
|
|
|
|
-#define te_allio te_bits.tb_allio
|
|
|
|
-#define te_lpindex te_bits.tb_lpindex
|
|
|
|
-#define te_pciwr te_bits.tb_pciwr
|
|
|
|
-#define te_rdwr te_bits.tb_rdwr
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-
|
|
|
|
struct iommu_table {
|
|
struct iommu_table {
|
|
unsigned long it_busno; /* Bus number this table belongs to */
|
|
unsigned long it_busno; /* Bus number this table belongs to */
|
|
unsigned long it_size; /* Size of iommu table in entries */
|
|
unsigned long it_size; /* Size of iommu table in entries */
|