MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-nios2nommu / dma.h
blobea098d5fc3c01c8ccb27d367590f42f97adfa200
1 /* $Id: dma.h,v 1.1 2006/07/05 06:20:25 gerg Exp $
3 * Copyright 2004 (C) Microtronix Datacom Ltd.
5 * All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
15 * NON INFRINGEMENT. See the GNU General Public License for more
16 * details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _ASM_NIOS2_DMA_H
25 #define _ASM_NIOS2_DMA_H
27 #include <linux/kernel.h>
28 #include <asm/asm-offsets.h>
30 #define MAX_DMA_ADDRESS (LINUX_SDRAM_END)
32 int request_dma(unsigned int, const char *);
33 void free_dma(unsigned int);
34 void enable_dma(unsigned int dmanr);
35 void disable_dma(unsigned int dmanr);
36 void set_dma_count(unsigned int dmanr, unsigned int count);
37 int get_dma_residue(unsigned int dmanr);
38 void nios2_set_dma_data_width(unsigned int dmanr, unsigned int width);
40 void nios2_set_dma_handler(unsigned int dmanr, int (*handler)(void*, int), void* user);
41 int nios2_request_dma(const char *);
43 void nios2_set_dma_mode(unsigned int dmanr, unsigned int mode);
44 void nios2_set_dma_rcon(unsigned int dmanr, unsigned int set);
45 void nios2_set_dma_wcon(unsigned int dmanr, unsigned int set);
46 void nios2_set_dma_raddr(unsigned int dmanr, unsigned int a);
47 void nios2_set_dma_waddr(unsigned int dmanr, unsigned int a);
49 static inline unsigned long claim_dma_lock(void)
53 static inline void release_dma_lock(unsigned long flags)
57 #ifdef CONFIG_PCI
58 extern int isa_dma_bridge_buggy;
59 #else
60 #define isa_dma_bridge_buggy (0)
61 #endif
63 #endif /* !(_ASM_NIOS2_DMA_H) */