diff options
author | Nicolas Pitre <nico@cam.org> | 2008-09-09 15:54:13 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-03-15 21:01:21 -0400 |
commit | 58edb515724f9e63e569536d01ac8d8f8ddb367a (patch) | |
tree | 627d3eafefd38b031e776b48d8d04d764912ec92 /arch/arm/plat-omap | |
parent | 43377453af83b8ff8c1c731da1508bd6b84ebfea (diff) |
[ARM] make page_to_dma() highmem aware
If a machine class has a custom __virt_to_bus() implementation then it
must provide a __arch_page_to_dma() implementation as well which is
_not_ based on page_address() to support highmem.
This patch fixes existing __arch_page_to_dma() and provide a default
implementation otherwise. The default implementation for highmem is
based on __pfn_to_bus() which is defined only when no custom
__virt_to_bus() is provided by the machine class.
That leaves only ebsa110 and footbridge which cannot support highmem
until they provide their own __arch_page_to_dma() implementation.
But highmem support on those legacy platforms with limited memory is
certainly not a priority.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/mach/memory.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/mach/memory.h index d6b5ca6c7da2..99ed564d9277 100644 --- a/arch/arm/plat-omap/include/mach/memory.h +++ b/arch/arm/plat-omap/include/mach/memory.h | |||
@@ -61,9 +61,11 @@ | |||
61 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) | 61 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) |
62 | #define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0)) | 62 | #define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0)) |
63 | 63 | ||
64 | #define __arch_page_to_dma(dev, page) ({is_lbus_device(dev) ? \ | 64 | #define __arch_page_to_dma(dev, page) \ |
65 | (dma_addr_t)virt_to_lbus(page_address(page)) : \ | 65 | ({ dma_addr_t __dma = page_to_phys(page); \ |
66 | (dma_addr_t)__virt_to_phys(page_address(page));}) | 66 | if (is_lbus_device(dev)) \ |
67 | __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \ | ||
68 | __dma; }) | ||
67 | 69 | ||
68 | #define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ | 70 | #define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ |
69 | lbus_to_virt(addr) : \ | 71 | lbus_to_virt(addr) : \ |