diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2011-07-18 15:05:10 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-07-18 15:29:41 -0400 |
commit | 650320181a08b64d4421c65c639cf47ad8cc2cd6 (patch) | |
tree | 5458b989faf4dd0a1216e07da3a76d9d30885c03 /arch/arm/mm | |
parent | 022ae537b23cb14a391565e9ad9e9945f4b17138 (diff) |
ARM: change ARM_DMA_ZONE_SIZE into a variable
Having this value defined at compile time prevents multiple machines with
conflicting definitions to coexist. Move it to a variable in preparation
for having a per machine value selected at run time. This is relevant
only when CONFIG_ZONE_DMA is selected.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/init.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 17d6cd0c57ed..4a8a01e0c3ab 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/sizes.h> | 28 | #include <asm/sizes.h> |
29 | #include <asm/tlb.h> | 29 | #include <asm/tlb.h> |
30 | #include <asm/fixmap.h> | 30 | #include <asm/fixmap.h> |
31 | #include <asm/memory.h> | ||
31 | 32 | ||
32 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
33 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
@@ -212,6 +213,14 @@ static void __init arm_bootmem_init(unsigned long start_pfn, | |||
212 | } | 213 | } |
213 | 214 | ||
214 | #ifdef CONFIG_ZONE_DMA | 215 | #ifdef CONFIG_ZONE_DMA |
216 | |||
217 | #ifdef ARM_DMA_ZONE_SIZE | ||
218 | unsigned long arm_dma_zone_size = ARM_DMA_ZONE_SIZE; | ||
219 | #else | ||
220 | unsigned long arm_dma_zone_size __read_mostly; | ||
221 | #endif | ||
222 | EXPORT_SYMBOL(arm_dma_zone_size); | ||
223 | |||
215 | /* | 224 | /* |
216 | * The DMA mask corresponding to the maximum bus address allocatable | 225 | * The DMA mask corresponding to the maximum bus address allocatable |
217 | * using GFP_DMA. The default here places no restriction on DMA | 226 | * using GFP_DMA. The default here places no restriction on DMA |
@@ -275,19 +284,17 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | |||
275 | #endif | 284 | #endif |
276 | } | 285 | } |
277 | 286 | ||
278 | #ifdef ARM_DMA_ZONE_SIZE | 287 | #ifdef CONFIG_ZONE_DMA |
279 | #ifndef CONFIG_ZONE_DMA | ||
280 | #error ARM_DMA_ZONE_SIZE set but no DMA zone to limit allocations | ||
281 | #endif | ||
282 | |||
283 | /* | 288 | /* |
284 | * Adjust the sizes according to any special requirements for | 289 | * Adjust the sizes according to any special requirements for |
285 | * this machine type. | 290 | * this machine type. |
286 | */ | 291 | */ |
287 | arm_adjust_dma_zone(zone_size, zhole_size, | 292 | if (arm_dma_zone_size) { |
288 | ARM_DMA_ZONE_SIZE >> PAGE_SHIFT); | 293 | arm_adjust_dma_zone(zone_size, zhole_size, |
289 | 294 | arm_dma_zone_size >> PAGE_SHIFT); | |
290 | arm_dma_limit = PHYS_OFFSET + ARM_DMA_ZONE_SIZE - 1; | 295 | arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; |
296 | } else | ||
297 | arm_dma_limit = 0xffffffff; | ||
291 | #endif | 298 | #endif |
292 | 299 | ||
293 | free_area_init_node(0, zone_size, min, zhole_size); | 300 | free_area_init_node(0, zone_size, min, zhole_size); |