diff options
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8f5813bbffb5..c21d06c7dd7e 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/highmem.h> | 20 | #include <linux/highmem.h> |
21 | #include <linux/gfp.h> | 21 | #include <linux/gfp.h> |
22 | #include <linux/memblock.h> | 22 | #include <linux/memblock.h> |
23 | #include <linux/dma-contiguous.h> | ||
23 | 24 | ||
24 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
25 | #include <asm/memblock.h> | 26 | #include <asm/memblock.h> |
@@ -226,6 +227,17 @@ static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, | |||
226 | } | 227 | } |
227 | #endif | 228 | #endif |
228 | 229 | ||
230 | void __init setup_dma_zone(struct machine_desc *mdesc) | ||
231 | { | ||
232 | #ifdef CONFIG_ZONE_DMA | ||
233 | if (mdesc->dma_zone_size) { | ||
234 | arm_dma_zone_size = mdesc->dma_zone_size; | ||
235 | arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; | ||
236 | } else | ||
237 | arm_dma_limit = 0xffffffff; | ||
238 | #endif | ||
239 | } | ||
240 | |||
229 | static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | 241 | static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, |
230 | unsigned long max_high) | 242 | unsigned long max_high) |
231 | { | 243 | { |
@@ -273,12 +285,9 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | |||
273 | * Adjust the sizes according to any special requirements for | 285 | * Adjust the sizes according to any special requirements for |
274 | * this machine type. | 286 | * this machine type. |
275 | */ | 287 | */ |
276 | if (arm_dma_zone_size) { | 288 | if (arm_dma_zone_size) |
277 | arm_adjust_dma_zone(zone_size, zhole_size, | 289 | arm_adjust_dma_zone(zone_size, zhole_size, |
278 | arm_dma_zone_size >> PAGE_SHIFT); | 290 | arm_dma_zone_size >> PAGE_SHIFT); |
279 | arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; | ||
280 | } else | ||
281 | arm_dma_limit = 0xffffffff; | ||
282 | #endif | 291 | #endif |
283 | 292 | ||
284 | free_area_init_node(0, zone_size, min, zhole_size); | 293 | free_area_init_node(0, zone_size, min, zhole_size); |
@@ -364,6 +373,12 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) | |||
364 | if (mdesc->reserve) | 373 | if (mdesc->reserve) |
365 | mdesc->reserve(); | 374 | mdesc->reserve(); |
366 | 375 | ||
376 | /* | ||
377 | * reserve memory for DMA contigouos allocations, | ||
378 | * must come from DMA area inside low memory | ||
379 | */ | ||
380 | dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit)); | ||
381 | |||
367 | arm_memblock_steal_permitted = false; | 382 | arm_memblock_steal_permitted = false; |
368 | memblock_allow_resize(); | 383 | memblock_allow_resize(); |
369 | memblock_dump_all(); | 384 | memblock_dump_all(); |