1 #ifndef __IDT_DMA_V_H__
2 #define __IDT_DMA_V_H__
4 /*******************************************************************************
6 * Copyright 2002 Integrated Device Technology, Inc.
9 * DMA register definition.
12 * Author : ryan.holmQVist@idt.com
16 * Revision 1.3 2002/06/06 18:34:03 astichte
17 * Added XXX_PhysicalAddress and XXX_VirtualAddress
19 * Revision 1.2 2002/06/05 18:30:46 astichte
22 * Revision 1.1 2002/05/29 17:33:21 sysarch
23 * jba File moved from vcode/include/idt/acacia
26 ******************************************************************************/
27 #include <asm/rc32434/dma.h>
28 #include <asm/rc32434/rc32434.h>
29 #define DMA_CHAN_OFFSET 0x14
30 #define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
31 #define DMA_COUNT(count) \
32 ((count) & DMAD_count_m)
34 #define DMA_HALT_TIMEOUT 500
37 static inline int rc32434_halt_dma(DMA_Chan_t ch
)
40 if (local_readl(&ch
->dmac
) & DMAC_run_m
) {
41 local_writel(0, &ch
->dmac
);
42 for (timeout
= DMA_HALT_TIMEOUT
; timeout
> 0; timeout
--) {
43 if (local_readl(&ch
->dmas
) & DMAS_h_m
) {
44 local_writel(0, &ch
->dmas
);
50 return timeout
? 0 : 1;
53 static inline void rc32434_start_dma(DMA_Chan_t ch
, u32 dma_addr
)
55 local_writel(0, &ch
->dmandptr
);
56 local_writel(dma_addr
, &ch
->dmadptr
);
59 static inline void rc32434_chain_dma(DMA_Chan_t ch
, u32 dma_addr
)
61 local_writel(dma_addr
, &ch
->dmandptr
);
64 #endif // __IDT_DMA_V_H__
This page took 0.046842 seconds and 5 git commands to generate.