[PATCH 4/4] RealView: Add sparsemem support for the RealView PBX platform
Russell King - ARM Linux
linux at arm.linux.org.uk
Mon Oct 19 11:46:01 EDT 2009
On Thu, Oct 15, 2009 at 01:22:09PM +0100, Catalin Marinas wrote:
> +#ifdef CONFIG_ZONE_DMA
> +/*
> + * Adjust the zones if there are restrictions for DMA access.
> + */
> +void __init realview_adjust_zones(int node, unsigned long *size,
> + unsigned long *hole)
> +{
> + unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
> +
> + if (!machine_is_realview_pbx() || node || (size[0] <= dma_size))
> + return;
> +
> + size[ZONE_NORMAL] = size[0] - dma_size;
> + size[ZONE_DMA] = dma_size;
> + hole[ZONE_NORMAL] = hole[0];
> + hole[ZONE_DMA] = 0;
> +}
You also need to set ISA_DMA_THRESHOLD and MAX_DMA_ADDRESS:
#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
so that other bits of code know what to expect from a GFP_DMA-type
allocation.
More information about the linux-arm-kernel
mailing list