OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [dma.h] - Blame information for rev 1633

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef __ASM_ARM_DMA_H
2
#define __ASM_ARM_DMA_H
3
 
4
typedef unsigned int dmach_t;
5
 
6
#include <asm/irq.h>
7
#include <asm/arch/dma.h>
8
 
9
typedef struct {
10
        unsigned long address;
11
        unsigned long length;
12
} dmasg_t;
13
 
14
extern const char dma_str[];
15
 
16
/* Clear the 'DMA Pointer Flip Flop'.
17
 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
18
 *
19
 * NOTE: This is an architecture specific function, and should
20
 *       be hidden from the drivers.
21
 */
22
#define clear_dma_ff(channel)
23
 
24
/* Set only the page register bits of the transfer address.
25
 *
26
 * NOTE: This is an architecture specific function, and should
27
 *       be hidden from the drivers
28
 */
29
static __inline__ void set_dma_page(dmach_t channel, char pagenr)
30
{
31
        printk(dma_str, "set_dma_page", channel);
32
}
33
 
34
/* Request a DMA channel
35
 *
36
 * Some architectures may need to do allocate an interrupt
37
 */
38
extern int  request_dma(dmach_t channel, const char * device_id);
39
 
40
/* Free a DMA channel
41
 *
42
 * Some architectures may need to do free an interrupt
43
 */
44
extern void free_dma(dmach_t channel);
45
 
46
/* Enable DMA for this channel
47
 *
48
 * On some architectures, this may have other side effects like
49
 * enabling an interrupt and setting the DMA registers.
50
 */
51
extern void enable_dma(dmach_t channel);
52
 
53
/* Disable DMA for this channel
54
 *
55
 * On some architectures, this may have other side effects like
56
 * disabling an interrupt or whatever.
57
 */
58
extern void disable_dma(dmach_t channel);
59
 
60
/* Set the DMA scatter gather list for this channel
61
 *
62
 * This should not be called if a DMA channel is enabled,
63
 * especially since some DMA architectures don't update the
64
 * DMA address immediately, but defer it to the enable_dma().
65
 */
66
extern void set_dma_sg(dmach_t channel, dmasg_t *sg, int nr_sg);
67
 
68
/* Set the DMA address for this channel
69
 *
70
 * This should not be called if a DMA channel is enabled,
71
 * especially since some DMA architectures don't update the
72
 * DMA address immediately, but defer it to the enable_dma().
73
 */
74
extern void set_dma_addr(dmach_t channel, unsigned long physaddr);
75
 
76
/* Set the DMA byte count for this channel
77
 *
78
 * This should not be called if a DMA channel is enabled,
79
 * especially since some DMA architectures don't update the
80
 * DMA count immediately, but defer it to the enable_dma().
81
 */
82
extern void set_dma_count(dmach_t channel, unsigned long count);
83
 
84
/* Set the transfer direction for this channel
85
 *
86
 * This should not be called if a DMA channel is enabled,
87
 * especially since some DMA architectures don't update the
88
 * DMA transfer direction immediately, but defer it to the
89
 * enable_dma().
90
 */
91
extern void set_dma_mode(dmach_t channel, dmamode_t mode);
92
 
93
/* Get DMA residue count. After a DMA transfer, this
94
 * should return zero. Reading this while a DMA transfer is
95
 * still in progress will return unpredictable results.
96
 * If called before the channel has been used, it may return 1.
97
 * Otherwise, it returns the number of _bytes_ left to transfer.
98
 */
99
extern int  get_dma_residue(dmach_t channel);
100
 
101
#ifndef NO_DMA
102
#define NO_DMA 255
103
#endif
104
 
105
#endif /* _ARM_DMA_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.