ARM: move DMA alloc functions to dma.h
This better separates the DMA from the MMU functionality. Also move all drivers that only depends on asm/mmu.h for the alloc functions over to the common header. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
a0c4e2203f
commit
381f034ed6
|
@ -5,4 +5,27 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <asm/mmu.h>
|
||||
#include <common.h>
|
||||
|
||||
#define dma_alloc dma_alloc
|
||||
static inline void *dma_alloc(size_t size)
|
||||
{
|
||||
return xmemalign(64, ALIGN(size, 64));
|
||||
}
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
|
||||
{
|
||||
void *ret = xmemalign(4096, size);
|
||||
if (dma_handle)
|
||||
*dma_handle = (dma_addr_t)ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void dma_free_coherent(void *mem, dma_addr_t dma_handle,
|
||||
size_t size)
|
||||
{
|
||||
free(mem);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#define PMD_SECT_DEF_UNCACHED (PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT)
|
||||
#define PMD_SECT_DEF_CACHED (PMD_SECT_WB | PMD_SECT_DEF_UNCACHED)
|
||||
|
||||
#define DMA_ADDRESS_BROKEN NULL
|
||||
|
||||
struct arm_memory;
|
||||
|
||||
static inline void mmu_enable(void)
|
||||
|
@ -28,16 +26,7 @@ static inline void setup_dma_coherent(unsigned long offset)
|
|||
{
|
||||
}
|
||||
|
||||
#define dma_alloc dma_alloc
|
||||
static inline void *dma_alloc(size_t size)
|
||||
{
|
||||
return xmemalign(64, ALIGN(size, 64));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle);
|
||||
void dma_free_coherent(void *mem, dma_addr_t dma_handle, size_t size);
|
||||
|
||||
void dma_clean_range(unsigned long, unsigned long);
|
||||
void dma_flush_range(unsigned long, unsigned long);
|
||||
void dma_inv_range(unsigned long, unsigned long);
|
||||
|
@ -47,21 +36,6 @@ uint32_t mmu_get_pte_cached_flags(void);
|
|||
uint32_t mmu_get_pte_uncached_flags(void);
|
||||
|
||||
#else
|
||||
static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
|
||||
{
|
||||
void *ret = xmemalign(4096, size);
|
||||
if (dma_handle)
|
||||
*dma_handle = (dma_addr_t)ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void dma_free_coherent(void *mem, dma_addr_t dma_handle,
|
||||
size_t size)
|
||||
{
|
||||
free(mem);
|
||||
}
|
||||
|
||||
static inline void dma_clean_range(unsigned long s, unsigned long e)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <errno.h>
|
||||
#include <io.h>
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
#include <linux/list.h>
|
||||
#include <linux/err.h>
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <driver.h>
|
||||
#include <malloc.h>
|
||||
#include <errno.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#define HW_APBHX_CTRL0 0x000
|
||||
#define BM_APBH_CTRL0_APB_BURST8_EN (1 << 29)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <driver.h>
|
||||
#include <malloc.h>
|
||||
#include <clock.h>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/err.h>
|
||||
#include <of_mtd.h>
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <malloc.h>
|
||||
#include <errno.h>
|
||||
#include <driver.h>
|
||||
|
@ -33,7 +34,6 @@
|
|||
#include <io.h>
|
||||
#include <dma/apbh-dma.h>
|
||||
#include <stmp-device.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <mach/generic.h>
|
||||
|
||||
#define MX28_BLOCK_SFTRST (1 << 31)
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <net.h>
|
||||
#include <init.h>
|
||||
#include <clock.h>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <asm/mmu.h>
|
||||
#include <clock.h>
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <net.h>
|
||||
#include <io.h>
|
||||
#include <init.h>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <net.h>
|
||||
#include <clock.h>
|
||||
#include <malloc.h>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
#include <net.h>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <malloc.h>
|
||||
#include <net.h>
|
||||
#include <init.h>
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include <net.h>
|
||||
#include <clock.h>
|
||||
#include <dma.h>
|
||||
#include <malloc.h>
|
||||
#include <xfuncs.h>
|
||||
#include <init.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
#include <net.h>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
* MA 02110-1301 USA
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
#include <net.h>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <net.h>
|
||||
#include <malloc.h>
|
||||
#include <init.h>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <asm/mmu.h>
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <malloc.h>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <net.h>
|
||||
#include <clock.h>
|
||||
#include <malloc.h>
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <stmp-device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <mach/generic.h>
|
||||
#include <mach/clock.h>
|
||||
#include <mach/ssp.h>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <errno.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
|
@ -10,6 +11,8 @@
|
|||
#include <asm/byteorder.h>
|
||||
#include <linux/err.h>
|
||||
|
||||
#include <asm/mmu.h>
|
||||
|
||||
/* ### define USB registers here
|
||||
*/
|
||||
#define USB_MAX_CTRL_PAYLOAD 64
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
/*#define DEBUG */
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <usb/usb.h>
|
||||
#include <io.h>
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
* to activate workaround for bug #41 or this driver will NOT work!
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <clock.h>
|
||||
#include <malloc.h>
|
||||
#include <usb/usb.h>
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
//#define DEBUG
|
||||
#include <asm/mmu.h>
|
||||
#include <clock.h>
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
#include <linux/err.h>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
//#define DEBUG
|
||||
#include <asm/mmu.h>
|
||||
#include <clock.h>
|
||||
#include <common.h>
|
||||
#include <io.h>
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <mach/io.h>
|
||||
#include <mach/cpu.h>
|
||||
#include <errno.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#include "atmel_lcdfb.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <mach/io.h>
|
||||
#include <mach/cpu.h>
|
||||
#include <errno.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
#include "atmel_lcdfb.h"
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <io.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <malloc.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#include "atmel_lcdfb.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
#include <mach/imx35-regs.h>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <clock.h>
|
||||
#include <driver.h>
|
||||
#include <init.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <mach/generic.h>
|
||||
#include <mach/imx6-regs.h>
|
||||
#include <mach/imx53-regs.h>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#define pr_fmt(fmt) "IPU: " fmt
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <fb.h>
|
||||
#include <io.h>
|
||||
#include <driver.h>
|
||||
|
@ -21,7 +22,6 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <asm-generic/div64.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#include "imx-ipu-v3.h"
|
||||
#include "ipuv3-plane.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <driver.h>
|
||||
#include <dma.h>
|
||||
#include <fb.h>
|
||||
#include <errno.h>
|
||||
#include <xfuncs.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dma.h>
|
||||
#include <driver.h>
|
||||
#include <errno.h>
|
||||
#include <fb.h>
|
||||
|
@ -37,7 +38,6 @@
|
|||
#include <mach/pxafb.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <asm-generic/div64.h>
|
||||
|
||||
/* PXA LCD DMA descriptor */
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include <dma-dir.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#define DMA_ADDRESS_BROKEN NULL
|
||||
|
||||
#ifndef dma_alloc
|
||||
static inline void *dma_alloc(size_t size)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue