1 /* $Id: dma.h,v 1.1 2006/07/05 06:20:25 gerg Exp $
3 * Copyright 2004 (C) Microtronix Datacom Ltd.
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
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
)
58 extern int isa_dma_bridge_buggy
;
60 #define isa_dma_bridge_buggy (0)
63 #endif /* !(_ASM_NIOS2_DMA_H) */