From: 黄涛 Date: Sat, 2 Jul 2011 10:23:18 +0000 (+0800) Subject: rk29: memory.h: fix for 1G memory, limit DMA zone only 512MB X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=38d52487ad6e717faf3a928e082b349cba76c058;p=firefly-linux-kernel-4.4.55.git rk29: memory.h: fix for 1G memory, limit DMA zone only 512MB --- 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 */