Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fb3ec5c authored by Russell King's avatar Russell King
Browse files

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: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 78fca1b9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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
+3 −1
Original line number Diff line number Diff line
@@ -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
+1 −2
Original line number Diff line number Diff line
@@ -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

+1 −2
Original line number Diff line number Diff line
@@ -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
+1 −2
Original line number Diff line number Diff line
@@ -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

Loading