diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-04-27 11:38:25 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-05-21 09:56:07 -0400 |
commit | f2224ff07f345f3f9716071cc90ee50e29af7497 (patch) | |
tree | 47c4a680969a571040feb51fe7abc42ebbbb0496 | |
parent | a6029d1c8cfc9ac2609195f31c2e70b584d3496e (diff) |
microblaze: use generic dma-mapping-broken.h
Microblaze does not support the Linux DMA mapping API
at this point, so disable CONFIG_NO_DMA. This lets
us use the generic dma-mapping-broken.h implementation
instead of providing a different copy.
Any drivers that try to use DMA mapping now get
omitted from Kconfig or produce a link error, rather
than failing silently at run time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>
-rw-r--r-- | arch/microblaze/Kconfig | 2 | ||||
-rw-r--r-- | arch/microblaze/include/asm/dma-mapping.h | 130 |
2 files changed, 2 insertions, 130 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index e6af7dd01fe6..f8e0722df0cf 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig | |||
@@ -59,7 +59,7 @@ config PCI | |||
59 | 59 | ||
60 | config NO_DMA | 60 | config NO_DMA |
61 | depends on !MMU | 61 | depends on !MMU |
62 | def_bool n | 62 | def_bool y |
63 | 63 | ||
64 | source "init/Kconfig" | 64 | source "init/Kconfig" |
65 | 65 | ||
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index 17336252a9b8..d00e40099165 100644 --- a/arch/microblaze/include/asm/dma-mapping.h +++ b/arch/microblaze/include/asm/dma-mapping.h | |||
@@ -1,129 +1 @@ | |||
1 | /* | #include <asm-generic/dma-mapping-broken.h> | |
2 | * Copyright (C) 2006 Atmark Techno, Inc. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ASM_MICROBLAZE_DMA_MAPPING_H | ||
10 | #define _ASM_MICROBLAZE_DMA_MAPPING_H | ||
11 | |||
12 | #include <asm/cacheflush.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/bug.h> | ||
15 | |||
16 | struct scatterlist; | ||
17 | |||
18 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
19 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
20 | |||
21 | /* FIXME */ | ||
22 | static inline int | ||
23 | dma_supported(struct device *dev, u64 mask) | ||
24 | { | ||
25 | return 1; | ||
26 | } | ||
27 | |||
28 | static inline dma_addr_t | ||
29 | dma_map_page(struct device *dev, struct page *page, | ||
30 | unsigned long offset, size_t size, | ||
31 | enum dma_data_direction direction) | ||
32 | { | ||
33 | BUG(); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static inline void | ||
38 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | ||
39 | enum dma_data_direction direction) | ||
40 | { | ||
41 | BUG(); | ||
42 | } | ||
43 | |||
44 | static inline int | ||
45 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
46 | enum dma_data_direction direction) | ||
47 | { | ||
48 | BUG(); | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static inline void | ||
53 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | ||
54 | enum dma_data_direction direction) | ||
55 | { | ||
56 | BUG(); | ||
57 | } | ||
58 | |||
59 | static inline void | ||
60 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
61 | enum dma_data_direction direction) | ||
62 | { | ||
63 | BUG(); | ||
64 | } | ||
65 | |||
66 | static inline void | ||
67 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, | ||
68 | size_t size, enum dma_data_direction direction) | ||
69 | { | ||
70 | BUG(); | ||
71 | } | ||
72 | |||
73 | static inline void | ||
74 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, | ||
75 | enum dma_data_direction direction) | ||
76 | { | ||
77 | BUG(); | ||
78 | } | ||
79 | |||
80 | static inline void | ||
81 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | ||
82 | enum dma_data_direction direction) | ||
83 | { | ||
84 | BUG(); | ||
85 | } | ||
86 | |||
87 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
88 | { | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | ||
93 | dma_addr_t *dma_handle, int flag) | ||
94 | { | ||
95 | return NULL; /* consistent_alloc(flag, size, dma_handle); */ | ||
96 | } | ||
97 | |||
98 | static inline void dma_free_coherent(struct device *dev, size_t size, | ||
99 | void *vaddr, dma_addr_t dma_handle) | ||
100 | { | ||
101 | BUG(); | ||
102 | } | ||
103 | |||
104 | static inline dma_addr_t | ||
105 | dma_map_single(struct device *dev, void *ptr, size_t size, | ||
106 | enum dma_data_direction direction) | ||
107 | { | ||
108 | BUG_ON(direction == DMA_NONE); | ||
109 | |||
110 | return virt_to_bus(ptr); | ||
111 | } | ||
112 | |||
113 | static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, | ||
114 | size_t size, | ||
115 | enum dma_data_direction direction) | ||
116 | { | ||
117 | switch (direction) { | ||
118 | case DMA_FROM_DEVICE: | ||
119 | flush_dcache_range((unsigned)dma_addr, | ||
120 | (unsigned)dma_addr + size); | ||
121 | /* Fall through */ | ||
122 | case DMA_TO_DEVICE: | ||
123 | break; | ||
124 | default: | ||
125 | BUG(); | ||
126 | } | ||
127 | } | ||
128 | |||
129 | #endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */ | ||