diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-stmp3xxx/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-stmp3xxx/include/mach/memory.h | 30 |
3 files changed, 37 insertions, 1 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f9079d634bf5..d0666b09e6c5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -557,6 +557,7 @@ config ARCH_STMP3XXX select GENERIC_CLOCKEVENTS select GENERIC_GPIO select USB_ARCH_HAS_EHCI + select ZONE_DMA help Support for systems based on the SigmaTel 3xxx CPUs. diff --git a/arch/arm/mach-stmp3xxx/Kconfig b/arch/arm/mach-stmp3xxx/Kconfig index b1d4dd60ce47..d1579570efc5 100644 --- a/arch/arm/mach-stmp3xxx/Kconfig +++ b/arch/arm/mach-stmp3xxx/Kconfig @@ -81,4 +81,11 @@ config STMP378X_RAM_DDR endchoice +config DMA_ZONE_SIZE + int "DMA memory zone size" + range 0 32 + default 12 + help + This is the size in MB for the DMA zone. The DMA zone is used for + dedicated memory for large contiguous video buffers endif diff --git a/arch/arm/mach-stmp3xxx/include/mach/memory.h b/arch/arm/mach-stmp3xxx/include/mach/memory.h index e6ea91270d62..591130440844 100644 --- a/arch/arm/mach-stmp3xxx/include/mach/memory.h +++ b/arch/arm/mach-stmp3xxx/include/mach/memory.h @@ -14,12 +14,40 @@ #ifndef __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H +#include <asm/page.h> +#include <asm/sizes.h> + /* * Physical DRAM offset. */ #define PHYS_OFFSET UL(0x40000000) #define BUS_OFFSET UL(0x40000000) +#ifndef __ASSEMBLY__ + +#ifdef CONFIG_DMA_ZONE_SIZE +#define MXC_DMA_ZONE_SIZE ((CONFIG_DMA_ZONE_SIZE * SZ_1M) >> PAGE_SHIFT) +#else +#define MXC_DMA_ZONE_SIZE ((12 * SZ_1M) >> PAGE_SHIFT) +#endif + +static inline void __arch_adjust_zones(int node, unsigned long *zone_size, + unsigned long *zhole_size) +{ + if (node != 0) + return; + /* Create separate zone to reserve memory for DMA */ + zone_size[1] = zone_size[0] - MXC_DMA_ZONE_SIZE; + zone_size[0] = MXC_DMA_ZONE_SIZE; + zhole_size[1] = zhole_size[0]; + zhole_size[0] = 0; +} + +#define arch_adjust_zones(node, size, holes) \ + __arch_adjust_zones(node, size, holes) + +#endif + /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an @@ -32,6 +60,6 @@ #define ISA_DMA_THRESHOLD (0x0003ffffULL) -#define CONSISTENT_DMA_SIZE SZ_4M +#define CONSISTENT_DMA_SIZE SZ_32M #endif |