Path: blob/master/arch/unicore32/include/mach/dma.h
10819 views
/*1* linux/arch/unicore32/include/mach/dma.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __MACH_PUV3_DMA_H__12#define __MACH_PUV3_DMA_H__1314/*15* The PKUnity has six internal DMA channels.16*/17#define MAX_DMA_CHANNELS 61819typedef enum {20DMA_PRIO_HIGH = 0,21DMA_PRIO_MEDIUM = 1,22DMA_PRIO_LOW = 223} puv3_dma_prio;2425/*26* DMA registration27*/2829extern int puv3_request_dma(char *name,30puv3_dma_prio prio,31void (*irq_handler)(int, void *),32void (*err_handler)(int, void *),33void *data);3435extern void puv3_free_dma(int dma_ch);3637static inline void puv3_stop_dma(int ch)38{39writel(readl(DMAC_CONFIG(ch)) & ~DMAC_CONFIG_EN, DMAC_CONFIG(ch));40}4142static inline void puv3_resume_dma(int ch)43{44writel(readl(DMAC_CONFIG(ch)) | DMAC_CONFIG_EN, DMAC_CONFIG(ch));45}4647#endif /* __MACH_PUV3_DMA_H__ */484950