From: Kuo-Jung Su Date: Mon, 29 Jul 2013 05:51:43 +0000 (+0800) Subject: arm: dma_alloc_coherent: malloc() -> memalign() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=771f74c3d31a265bae103b2b407286ec03a4589b;p=u-boot.git arm: dma_alloc_coherent: malloc() -> memalign() Even though the MMU/D-cache is off, some DMA engines still expect strict address alignment. For example, the incoming Faraday FTMAC110 & FTGMAC100 ethernet controllers expect the tx/rx descriptors should always be aligned to 16-bytes boundary. Signed-off-by: Kuo-Jung Su CC: Albert ARIBAUD --- diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 009863beec..55a4e266a0 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -16,7 +16,7 @@ enum dma_data_direction { static void *dma_alloc_coherent(size_t len, unsigned long *handle) { - *handle = (unsigned long)malloc(len); + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); return (void *)*handle; }