aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-iop13xx/include/mach
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-10-13 12:13:56 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-10-13 12:13:56 -0400
commite758936e02700ff88a0b08b722a3847b95283ef2 (patch)
tree50c919bef1b459a778b85159d5929de95b6c4a01 /arch/arm/mach-iop13xx/include/mach
parent239cfbde1f5843c4a24199f117d5f67f637d72d5 (diff)
parent4480f15b3306f43bbb0310d461142b4e897ca45b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: include/asm-x86/statfs.h
Diffstat (limited to 'arch/arm/mach-iop13xx/include/mach')
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h61
-rw-r--r--arch/arm/mach-iop13xx/include/mach/pci.h2
2 files changed, 40 insertions, 23 deletions
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index e8b59d8f1bb9..b82602d529bf 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -7,9 +7,6 @@
7 * Physical DRAM offset. 7 * Physical DRAM offset.
8 */ 8 */
9#define PHYS_OFFSET UL(0x00000000) 9#define PHYS_OFFSET UL(0x00000000)
10#define TASK_SIZE UL(0x3f000000)
11#define PAGE_OFFSET UL(0x40000000)
12#define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3)
13 10
14#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
15 12
@@ -29,32 +26,52 @@
29 26
30/* RAM has 1:1 mapping on the PCIe/x Busses */ 27/* RAM has 1:1 mapping on the PCIe/x Busses */
31#define __virt_to_bus(x) (__virt_to_phys(x)) 28#define __virt_to_bus(x) (__virt_to_phys(x))
32#define __bus_to_virt(x) (__phys_to_virt(x)) 29#define __bus_to_virt(x) (__phys_to_virt(x))
33 30
34#define virt_to_lbus(x) \ 31static inline dma_addr_t __virt_to_lbus(unsigned long x)
35(( ((void*)(x) >= (void*)IOP13XX_PMMR_V_START) && \ 32{
36((void*)(x) < (void*)IOP13XX_PMMR_V_END) ) ? \ 33 return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE;
37((x) - IOP13XX_PMMR_VIRT_MEM_BASE + IOP13XX_PMMR_PHYS_MEM_BASE) : \ 34}
38((x) - PAGE_OFFSET + PHYS_OFFSET))
39 35
40#define lbus_to_virt(x) \ 36static inline unsigned long __lbus_to_virt(dma_addr_t x)
41(( ((x) >= IOP13XX_PMMR_P_START) && ((x) < IOP13XX_PMMR_P_END) ) ? \ 37{
42((x) - IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_VIRT_MEM_BASE ) : \ 38 return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE;
43((x) - PHYS_OFFSET + PAGE_OFFSET)) 39}
40
41#define __is_lbus_dma(a) \
42 ((a) >= IOP13XX_PMMR_P_START && (a) < IOP13XX_PMMR_P_END)
43
44#define __is_lbus_virt(a) \
45 ((a) >= IOP13XX_PMMR_V_START && (a) < IOP13XX_PMMR_V_END)
44 46
45/* Device is an lbus device if it is on the platform bus of the IOP13XX */ 47/* Device is an lbus device if it is on the platform bus of the IOP13XX */
46#define is_lbus_device(dev) (dev &&\ 48#define is_lbus_device(dev) \
47 (strncmp(dev->bus->name, "platform", 8) == 0)) 49 (dev && strncmp(dev->bus->name, "platform", 8) == 0)
48 50
49#define __arch_page_to_dma(dev, page) \ 51#define __arch_dma_to_virt(dev, addr) \
50({is_lbus_device(dev) ? (dma_addr_t)virt_to_lbus(page_address(page)) : \ 52 ({ \
51(dma_addr_t)__virt_to_bus(page_address(page));}) 53 unsigned long __virt; \
54 dma_addr_t __dma = addr; \
55 if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \
56 __virt = __lbus_to_virt(__dma); \
57 else \
58 __virt = __bus_to_virt(__dma); \
59 (void *)__virt; \
60 })
52 61
53#define __arch_dma_to_virt(dev, addr) \ 62#define __arch_virt_to_dma(dev, addr) \
54({is_lbus_device(dev) ? lbus_to_virt(addr) : __bus_to_virt(addr);}) 63 ({ \
64 unsigned long __virt = (unsigned long)addr; \
65 dma_addr_t __dma; \
66 if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \
67 __dma = __virt_to_lbus(__virt); \
68 else \
69 __dma = __virt_to_bus(__virt); \
70 __dma; \
71 })
55 72
56#define __arch_virt_to_dma(dev, addr) \ 73#define __arch_page_to_dma(dev, page) \
57({is_lbus_device(dev) ? virt_to_lbus(addr) : __virt_to_bus(addr);}) 74 __arch_virt_to_dma(dev, page_address(page))
58 75
59#endif /* CONFIG_ARCH_IOP13XX */ 76#endif /* CONFIG_ARCH_IOP13XX */
60#endif /* !ASSEMBLY */ 77#endif /* !ASSEMBLY */
diff --git a/arch/arm/mach-iop13xx/include/mach/pci.h b/arch/arm/mach-iop13xx/include/mach/pci.h
index 17b5515af8b1..59f42b535572 100644
--- a/arch/arm/mach-iop13xx/include/mach/pci.h
+++ b/arch/arm/mach-iop13xx/include/mach/pci.h
@@ -1,7 +1,7 @@
1#ifndef _IOP13XX_PCI_H_ 1#ifndef _IOP13XX_PCI_H_
2#define _IOP13XX_PCI_H_ 2#define _IOP13XX_PCI_H_
3#include <linux/io.h>
3#include <mach/irqs.h> 4#include <mach/irqs.h>
4#include <asm/io.h>
5 5
6struct pci_sys_data; 6struct pci_sys_data;
7struct hw_pci; 7struct hw_pci;