diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-11 10:39:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-12 03:36:53 -0400 |
commit | be20902ba67de70b38c995903321f4152dee57b7 (patch) | |
tree | 86f27d4d90b7408d421ce246527431e58a836bf3 /arch/arm/mach-realview | |
parent | 2fb3ec5c9503ba8874e24170de2b40e8f1a58370 (diff) |
ARM: use ARM_DMA_ZONE_SIZE to adjust the zone sizes
Rather than each platform providing its own function to adjust the
zone sizes, use the new ARM_DMA_ZONE_SIZE definition to perform this
adjustment. This ensures that the actual DMA zone size and the
ISA_DMA_THRESHOLD/MAX_DMA_ADDRESS definitions are consistent with
each other, and moves this complexity out of the platform code.
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>
Diffstat (limited to 'arch/arm/mach-realview')
-rw-r--r-- | arch/arm/mach-realview/core.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/memory.h | 6 |
2 files changed, 1 insertions, 24 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 75dbc8791d0..525ad17f826 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -56,25 +56,6 @@ | |||
56 | 56 | ||
57 | #include "core.h" | 57 | #include "core.h" |
58 | 58 | ||
59 | #ifdef CONFIG_ZONE_DMA | ||
60 | /* | ||
61 | * Adjust the zones if there are restrictions for DMA access. | ||
62 | */ | ||
63 | void __init realview_adjust_zones(unsigned long *size, unsigned long *hole) | ||
64 | { | ||
65 | unsigned long dma_size = SZ_256M >> PAGE_SHIFT; | ||
66 | |||
67 | if (!machine_is_realview_pbx() || size[0] <= dma_size) | ||
68 | return; | ||
69 | |||
70 | size[ZONE_NORMAL] = size[0] - dma_size; | ||
71 | size[ZONE_DMA] = dma_size; | ||
72 | hole[ZONE_NORMAL] = hole[0]; | ||
73 | hole[ZONE_DMA] = 0; | ||
74 | } | ||
75 | #endif | ||
76 | |||
77 | |||
78 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) | 59 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) |
79 | 60 | ||
80 | static int realview_flash_init(void) | 61 | static int realview_flash_init(void) |
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h index 973428d3f7c..1759fa673ee 100644 --- a/arch/arm/mach-realview/include/mach/memory.h +++ b/arch/arm/mach-realview/include/mach/memory.h | |||
@@ -29,11 +29,7 @@ | |||
29 | #define PLAT_PHYS_OFFSET UL(0x00000000) | 29 | #define PLAT_PHYS_OFFSET UL(0x00000000) |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA) | 32 | #ifdef CONFIG_ZONE_DMA |
33 | extern void realview_adjust_zones(unsigned long *size, unsigned long *hole); | ||
34 | #define arch_adjust_zones(size, hole) \ | ||
35 | realview_adjust_zones(size, hole) | ||
36 | |||
37 | #define ARM_DMA_ZONE_SIZE SZ_256M | 33 | #define ARM_DMA_ZONE_SIZE SZ_256M |
38 | #endif | 34 | #endif |
39 | 35 | ||