Skip to content

Commit

Permalink
ARM: Replace platform definition of ISA_DMA_THRESHOLD/MAX_DMA_ADDRESS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed May 12, 2011
1 parent 78fca1b commit 2fb3ec5
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 16 deletions.
4 changes: 3 additions & 1 deletion arch/arm/include/asm/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
/*
* This is the maximum virtual address which can be DMA'd from.
*/
#ifndef MAX_DMA_ADDRESS
#ifndef ARM_DMA_ZONE_SIZE
#define MAX_DMA_ADDRESS 0xffffffff
#else
#define MAX_DMA_ADDRESS (PAGE_OFFSET + ARM_DMA_ZONE_SIZE)
#endif

#ifdef CONFIG_ISA_DMA_API
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ static inline unsigned long __phys_to_virt(unsigned long x)
* allocations. This must be the smallest DMA mask in the system,
* so a successful GFP_DMA allocation will always satisfy this.
*/
#ifndef ISA_DMA_THRESHOLD
#ifndef ARM_DMA_ZONE_SIZE
#define ISA_DMA_THRESHOLD (0xffffffffULL)
#else
#define ISA_DMA_THRESHOLD (PHYS_OFFSET + ARM_DMA_ZONE_SIZE - 1)
#endif

#ifndef arch_adjust_zones
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-davinci/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ __arch_adjust_zones(unsigned long *size, unsigned long *holes)
#define arch_adjust_zones(zone_size, holes) \
if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(zone_size, holes)

#define ISA_DMA_THRESHOLD (PHYS_OFFSET + (128<<20) - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + (128<<20))
#define ARM_DMA_ZONE_SIZE SZ_128M

#endif

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-h720x/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* There should not be more than (0xd0000000 - 0xc0000000)
* bytes of RAM.
*/
#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
#define ARM_DMA_ZONE_SIZE SZ_256M

#endif
3 changes: 1 addition & 2 deletions arch/arm/mach-ixp4xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ void ixp4xx_adjust_zones(unsigned long *size, unsigned long *holes);
#define arch_adjust_zones(size, holes) \
ixp4xx_adjust_zones(size, holes)

#define ISA_DMA_THRESHOLD (SZ_64M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
#define ARM_DMA_ZONE_SIZE SZ_64M

#endif

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-pxa/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
#define arch_adjust_zones(size, holes) \
cmx2xx_pci_adjust_zones(size, holes)

#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
#define ARM_DMA_ZONE_SIZE SZ_64M
#endif

#endif
3 changes: 1 addition & 2 deletions arch/arm/mach-realview/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ extern void realview_adjust_zones(unsigned long *size, unsigned long *hole);
#define arch_adjust_zones(size, hole) \
realview_adjust_zones(size, hole)

#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
#define ARM_DMA_ZONE_SIZE SZ_256M
#endif

#ifdef CONFIG_SPARSEMEM
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-sa1100/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ void sa1111_adjust_zones(unsigned long *size, unsigned long *holes);
#define arch_adjust_zones(size, holes) \
sa1111_adjust_zones(size, holes)

#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_1M)
#define ARM_DMA_ZONE_SIZE SZ_1M

#endif
#endif
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-shark/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ static inline void __arch_adjust_zones(unsigned long *zone_size, unsigned long *
#define arch_adjust_zones(size, holes) \
__arch_adjust_zones(size, holes)

#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_4M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_4M)
#define ARM_DMA_ZONE_SIZE SZ_4M

#endif

Expand Down

0 comments on commit 2fb3ec5

Please sign in to comment.