Skip to content

Commit 2fb3ec5

Browse files
author
Russell King
committed
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>
1 parent 78fca1b commit 2fb3ec5

9 files changed

Lines changed: 13 additions & 16 deletions

File tree

‎arch/arm/include/asm/dma.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
/*
77
* This is the maximum virtual address which can be DMA'd from.
88
*/
9-
#ifndef MAX_DMA_ADDRESS
9+
#ifndef ARM_DMA_ZONE_SIZE
1010
#define MAX_DMA_ADDRESS 0xffffffff
11+
#else
12+
#define MAX_DMA_ADDRESS (PAGE_OFFSET + ARM_DMA_ZONE_SIZE)
1113
#endif
1214

1315
#ifdef CONFIG_ISA_DMA_API

‎arch/arm/include/asm/memory.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,10 @@ static inline unsigned long __phys_to_virt(unsigned long x)
209209
* allocations. This must be the smallest DMA mask in the system,
210210
* so a successful GFP_DMA allocation will always satisfy this.
211211
*/
212-
#ifndef ISA_DMA_THRESHOLD
212+
#ifndef ARM_DMA_ZONE_SIZE
213213
#define ISA_DMA_THRESHOLD (0xffffffffULL)
214+
#else
215+
#define ISA_DMA_THRESHOLD (PHYS_OFFSET + ARM_DMA_ZONE_SIZE - 1)
214216
#endif
215217

216218
#ifndef arch_adjust_zones

‎arch/arm/mach-davinci/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ __arch_adjust_zones(unsigned long *size, unsigned long *holes)
5959
#define arch_adjust_zones(zone_size, holes) \
6060
if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(zone_size, holes)
6161

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
6463

6564
#endif
6665

‎arch/arm/mach-h720x/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* There should not be more than (0xd0000000 - 0xc0000000)
1414
* bytes of RAM.
1515
*/
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
1817

1918
#endif

‎arch/arm/mach-ixp4xx/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ void ixp4xx_adjust_zones(unsigned long *size, unsigned long *holes);
2121
#define arch_adjust_zones(size, holes) \
2222
ixp4xx_adjust_zones(size, holes)
2323

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
2625

2726
#endif
2827

‎arch/arm/mach-pxa/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
2323
#define arch_adjust_zones(size, holes) \
2424
cmx2xx_pci_adjust_zones(size, holes)
2525

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
2827
#endif
2928

3029
#endif

‎arch/arm/mach-realview/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ extern void realview_adjust_zones(unsigned long *size, unsigned long *hole);
3434
#define arch_adjust_zones(size, hole) \
3535
realview_adjust_zones(size, hole)
3636

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
3938
#endif
4039

4140
#ifdef CONFIG_SPARSEMEM

‎arch/arm/mach-sa1100/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ void sa1111_adjust_zones(unsigned long *size, unsigned long *holes);
2222
#define arch_adjust_zones(size, holes) \
2323
sa1111_adjust_zones(size, holes)
2424

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
2726

2827
#endif
2928
#endif

‎arch/arm/mach-shark/include/mach/memory.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ static inline void __arch_adjust_zones(unsigned long *zone_size, unsigned long *
3232
#define arch_adjust_zones(size, holes) \
3333
__arch_adjust_zones(size, holes)
3434

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
3736

3837
#endif
3938

0 commit comments

Comments
 (0)