Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: Replace platform definition of ISA_DMA_THRESHOLD/MAX_DMA_ADDRESS

The values of ISA_DMA_THRESHOLD and MAX_DMA_ADDRESS are related; one is
the physical/bus address, the other is the virtual address. Both need
to be kept in step, so rather than having platforms define both, allow
them to define a single macro which sets both of these macros
appropraitely.

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+13 -16
+3 -1
arch/arm/include/asm/dma.h
··· 6 6 /* 7 7 * This is the maximum virtual address which can be DMA'd from. 8 8 */ 9 - #ifndef MAX_DMA_ADDRESS 9 + #ifndef ARM_DMA_ZONE_SIZE 10 10 #define MAX_DMA_ADDRESS 0xffffffff 11 + #else 12 + #define MAX_DMA_ADDRESS (PAGE_OFFSET + ARM_DMA_ZONE_SIZE) 11 13 #endif 12 14 13 15 #ifdef CONFIG_ISA_DMA_API
+3 -1
arch/arm/include/asm/memory.h
··· 209 209 * allocations. This must be the smallest DMA mask in the system, 210 210 * so a successful GFP_DMA allocation will always satisfy this. 211 211 */ 212 - #ifndef ISA_DMA_THRESHOLD 212 + #ifndef ARM_DMA_ZONE_SIZE 213 213 #define ISA_DMA_THRESHOLD (0xffffffffULL) 214 + #else 215 + #define ISA_DMA_THRESHOLD (PHYS_OFFSET + ARM_DMA_ZONE_SIZE - 1) 214 216 #endif 215 217 216 218 #ifndef arch_adjust_zones
+1 -2
arch/arm/mach-davinci/include/mach/memory.h
··· 59 59 #define arch_adjust_zones(zone_size, holes) \ 60 60 if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(zone_size, holes) 61 61 62 - #define ISA_DMA_THRESHOLD (PHYS_OFFSET + (128<<20) - 1) 63 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + (128<<20)) 62 + #define ARM_DMA_ZONE_SIZE SZ_128M 64 63 65 64 #endif 66 65
+1 -2
arch/arm/mach-h720x/include/mach/memory.h
··· 13 13 * There should not be more than (0xd0000000 - 0xc0000000) 14 14 * bytes of RAM. 15 15 */ 16 - #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1) 17 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M) 16 + #define ARM_DMA_ZONE_SIZE SZ_256M 18 17 19 18 #endif
+1 -2
arch/arm/mach-ixp4xx/include/mach/memory.h
··· 21 21 #define arch_adjust_zones(size, holes) \ 22 22 ixp4xx_adjust_zones(size, holes) 23 23 24 - #define ISA_DMA_THRESHOLD (SZ_64M - 1) 25 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) 24 + #define ARM_DMA_ZONE_SIZE SZ_64M 26 25 27 26 #endif 28 27
+1 -2
arch/arm/mach-pxa/include/mach/memory.h
··· 23 23 #define arch_adjust_zones(size, holes) \ 24 24 cmx2xx_pci_adjust_zones(size, holes) 25 25 26 - #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1) 27 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M) 26 + #define ARM_DMA_ZONE_SIZE SZ_64M 28 27 #endif 29 28 30 29 #endif
+1 -2
arch/arm/mach-realview/include/mach/memory.h
··· 34 34 #define arch_adjust_zones(size, hole) \ 35 35 realview_adjust_zones(size, hole) 36 36 37 - #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1) 38 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M) 37 + #define ARM_DMA_ZONE_SIZE SZ_256M 39 38 #endif 40 39 41 40 #ifdef CONFIG_SPARSEMEM
+1 -2
arch/arm/mach-sa1100/include/mach/memory.h
··· 22 22 #define arch_adjust_zones(size, holes) \ 23 23 sa1111_adjust_zones(size, holes) 24 24 25 - #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1) 26 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_1M) 25 + #define ARM_DMA_ZONE_SIZE SZ_1M 27 26 28 27 #endif 29 28 #endif
+1 -2
arch/arm/mach-shark/include/mach/memory.h
··· 32 32 #define arch_adjust_zones(size, holes) \ 33 33 __arch_adjust_zones(size, holes) 34 34 35 - #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_4M - 1) 36 - #define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_4M) 35 + #define ARM_DMA_ZONE_SIZE SZ_4M 37 36 38 37 #endif 39 38