aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/dma-mapping.h10
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ks8695/include/mach/memory.h7
-rw-r--r--arch/arm/plat-omap/include/mach/memory.h7
4 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 5d78eb163953..f06d80c22748 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -20,6 +20,11 @@ static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
20 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); 20 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page));
21} 21}
22 22
23static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
24{
25 return pfn_to_page(__bus_to_pfn(addr));
26}
27
23static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 28static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
24{ 29{
25 return (void *)__bus_to_virt(addr); 30 return (void *)__bus_to_virt(addr);
@@ -35,6 +40,11 @@ static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
35 return __arch_page_to_dma(dev, page); 40 return __arch_page_to_dma(dev, page);
36} 41}
37 42
43static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
44{
45 return __arch_dma_to_page(dev, addr);
46}
47
38static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 48static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
39{ 49{
40 return __arch_dma_to_virt(dev, addr); 50 return __arch_dma_to_virt(dev, addr);
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index 42ae29b288a1..25b1da9a5035 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -64,6 +64,8 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
64 (dma_addr_t)page_to_phys(page); \ 64 (dma_addr_t)page_to_phys(page); \
65 }) 65 })
66 66
67#define __arch_dma_to_page(dev, addr) phys_to_page(addr)
68
67#endif /* CONFIG_ARCH_IOP13XX */ 69#endif /* CONFIG_ARCH_IOP13XX */
68#endif /* !ASSEMBLY */ 70#endif /* !ASSEMBLY */
69 71
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h
index 76e5308685a4..ffa19aae6e05 100644
--- a/arch/arm/mach-ks8695/include/mach/memory.h
+++ b/arch/arm/mach-ks8695/include/mach/memory.h
@@ -41,6 +41,13 @@ extern struct bus_type platform_bus_type;
41 __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \ 41 __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
42 __dma; }) 42 __dma; })
43 43
44#define __arch_dma_to_page(dev, x) \
45 ({ dma_addr_t __dma = x; \
46 if (!is_lbus_device(dev)) \
47 __dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \
48 phys_to_page(__dma); \
49 })
50
44#endif 51#endif
45 52
46#endif 53#endif
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/mach/memory.h
index 9ad41dc484c1..3325f7b49eaa 100644
--- a/arch/arm/plat-omap/include/mach/memory.h
+++ b/arch/arm/plat-omap/include/mach/memory.h
@@ -68,6 +68,13 @@
68 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \ 68 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
69 __dma; }) 69 __dma; })
70 70
71#define __arch_dma_to_page(dev, addr) \
72 ({ dma_addr_t __dma = addr; \
73 if (is_lbus_device(dev)) \
74 __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \
75 phys_to_page(__dma); \
76 })
77
71#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ 78#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
72 lbus_to_virt(addr) : \ 79 lbus_to_virt(addr) : \
73 __phys_to_virt(addr)); }) 80 __phys_to_virt(addr)); })