From 38d52487ad6e717faf3a928e082b349cba76c058 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Sat, 2 Jul 2011 18:23:18 +0800 Subject: [PATCH] rk29: memory.h: fix for 1G memory, limit DMA zone only 512MB --- arch/arm/mach-rk29/include/mach/memory.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/mach-rk29/include/mach/memory.h b/arch/arm/mach-rk29/include/mach/memory.h index d9f2d2c03c52..da68f41527c7 100644 --- a/arch/arm/mach-rk29/include/mach/memory.h +++ b/arch/arm/mach-rk29/include/mach/memory.h @@ -16,11 +16,35 @@ #ifndef __ASM_ARCH_RK29_MEMORY_H #define __ASM_ARCH_RK29_MEMORY_H +#include +#include + /* physical offset of RAM */ #define PHYS_OFFSET UL(0x60000000) #define CONSISTENT_DMA_SIZE SZ_8M +#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA) + +static inline void +__arch_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size) +{ + unsigned long dma_size = SZ_512M >> PAGE_SHIFT; + + if (node || (zone_size[0] <= dma_size)) + return; + + zone_size[1] = zone_size[0] - dma_size; + zone_size[0] = dma_size; + zhole_size[1] = zhole_size[0]; + zhole_size[0] = 0; +} + +#define arch_adjust_zones(node, zone_size, zhole_size) \ + __arch_adjust_zones(node, zone_size, zhole_size) + +#endif /* CONFIG_ZONE_DMA */ + /* * SRAM memory whereabouts */ -- 2.34.1