aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/iommu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/iommu.h')
-rw-r--r--include/asm-powerpc/iommu.h34
1 files changed, 13 insertions, 21 deletions
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index 39fad685ffab..f85dbd305558 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -34,7 +34,9 @@
34#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) 34#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1))
35#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) 35#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
36 36
37#ifndef __ASSEMBLY__ 37/* Boot time flags */
38extern int iommu_is_off;
39extern int iommu_force_on;
38 40
39/* Pure 2^n version of get_order */ 41/* Pure 2^n version of get_order */
40static __inline__ __attribute_const__ int get_iommu_order(unsigned long size) 42static __inline__ __attribute_const__ int get_iommu_order(unsigned long size)
@@ -42,8 +44,6 @@ static __inline__ __attribute_const__ int get_iommu_order(unsigned long size)
42 return __ilog2((size - 1) >> IOMMU_PAGE_SHIFT) + 1; 44 return __ilog2((size - 1) >> IOMMU_PAGE_SHIFT) + 1;
43} 45}
44 46
45#endif /* __ASSEMBLY__ */
46
47 47
48/* 48/*
49 * IOMAP_MAX_ORDER defines the largest contiguous block 49 * IOMAP_MAX_ORDER defines the largest contiguous block
@@ -70,39 +70,31 @@ struct iommu_table {
70struct scatterlist; 70struct scatterlist;
71struct device_node; 71struct device_node;
72 72
73#ifdef CONFIG_PPC_MULTIPLATFORM
74
75/* Walks all buses and creates iommu tables */
76extern void iommu_setup_pSeries(void);
77extern void iommu_setup_dart(void);
78
79/* Frees table for an individual device node */ 73/* Frees table for an individual device node */
80extern void iommu_free_table(struct device_node *dn); 74extern void iommu_free_table(struct device_node *dn);
81 75
82#endif /* CONFIG_PPC_MULTIPLATFORM */
83
84/* Initializes an iommu_table based in values set in the passed-in 76/* Initializes an iommu_table based in values set in the passed-in
85 * structure 77 * structure
86 */ 78 */
87extern struct iommu_table *iommu_init_table(struct iommu_table * tbl, 79extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
88 int nid); 80 int nid);
89 81
90extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 82extern int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
91 struct scatterlist *sglist, int nelems, unsigned long mask, 83 int nelems, unsigned long mask,
92 enum dma_data_direction direction); 84 enum dma_data_direction direction);
93extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, 85extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
94 int nelems, enum dma_data_direction direction); 86 int nelems, enum dma_data_direction direction);
95 87
96extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 88extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
97 dma_addr_t *dma_handle, unsigned long mask, 89 dma_addr_t *dma_handle, unsigned long mask,
98 gfp_t flag, int node); 90 gfp_t flag, int node);
99extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, 91extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
100 void *vaddr, dma_addr_t dma_handle); 92 void *vaddr, dma_addr_t dma_handle);
101extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 93extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
102 size_t size, unsigned long mask, 94 size_t size, unsigned long mask,
103 enum dma_data_direction direction); 95 enum dma_data_direction direction);
104extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, 96extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
105 size_t size, enum dma_data_direction direction); 97 size_t size, enum dma_data_direction direction);
106 98
107extern void iommu_init_early_pSeries(void); 99extern void iommu_init_early_pSeries(void);
108extern void iommu_init_early_iSeries(void); 100extern void iommu_init_early_iSeries(void);