This source file includes following definitions.
- __phys_to_dma
- __dma_to_phys
1
2
3
4
5 #include <linux/dma-direct.h>
6 #include <asm/ip32/crime.h>
7
8
9
10
11
12
13
14
15
16
17
18
19 #define RAM_OFFSET_MASK 0x3fffffffUL
20
21 dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
22 {
23 dma_addr_t dma_addr = paddr & RAM_OFFSET_MASK;
24
25 if (!dev)
26 dma_addr += CRIME_HI_MEM_BASE;
27 return dma_addr;
28 }
29
30 phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr)
31 {
32 phys_addr_t paddr = dma_addr & RAM_OFFSET_MASK;
33
34 if (dma_addr >= 256*1024*1024)
35 paddr += CRIME_HI_MEM_BASE;
36 return paddr;
37 }