Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASM_CRIS_SVINTO_H |
| 2 | #define _ASM_CRIS_SVINTO_H |
| 3 | |
| 4 | #include "sv_addr_ag.h" |
| 5 | |
| 6 | extern unsigned int genconfig_shadow; /* defined and set in head.S */ |
| 7 | |
| 8 | /* dma stuff */ |
| 9 | |
| 10 | enum { /* Available in: */ |
| 11 | d_eol = (1 << 0), /* flags */ |
| 12 | d_eop = (1 << 1), /* flags & status */ |
| 13 | d_wait = (1 << 2), /* flags */ |
| 14 | d_int = (1 << 3), /* flags */ |
| 15 | d_txerr = (1 << 4), /* flags */ |
| 16 | d_stop = (1 << 4), /* status */ |
| 17 | d_ecp = (1 << 4), /* flags & status */ |
| 18 | d_pri = (1 << 5), /* flags & status */ |
| 19 | d_alignerr = (1 << 6), /* status */ |
| 20 | d_crcerr = (1 << 7) /* status */ |
| 21 | }; |
| 22 | |
| 23 | /* Do remember that DMA does not go through the MMU and needs |
| 24 | * a real physical address, not an address virtually mapped or |
| 25 | * paged. Therefore the buf/next ptrs below are unsigned long instead |
| 26 | * of void * to give a warning if you try to put a pointer directly |
| 27 | * to them instead of going through virt_to_phys/phys_to_virt. |
| 28 | */ |
| 29 | |
| 30 | typedef struct etrax_dma_descr { |
| 31 | unsigned short sw_len; /* 0-1 */ |
| 32 | unsigned short ctrl; /* 2-3 */ |
| 33 | unsigned long next; /* 4-7 */ |
| 34 | unsigned long buf; /* 8-11 */ |
| 35 | unsigned short hw_len; /* 12-13 */ |
| 36 | unsigned char status; /* 14 */ |
| 37 | unsigned char fifo_len; /* 15 */ |
| 38 | } etrax_dma_descr; |
| 39 | |
| 40 | |
| 41 | /* Use this for constant numbers only */ |
| 42 | #define RESET_DMA_NUM( n ) \ |
| 43 | *R_DMA_CH##n##_CMD = IO_STATE( R_DMA_CH0_CMD, cmd, reset ) |
| 44 | |
| 45 | /* Use this for constant numbers or symbols, |
| 46 | * having two macros makes it possible to use constant expressions. |
| 47 | */ |
| 48 | #define RESET_DMA( n ) RESET_DMA_NUM( n ) |
| 49 | |
| 50 | |
| 51 | /* Use this for constant numbers only */ |
| 52 | #define WAIT_DMA_NUM( n ) \ |
| 53 | while( (*R_DMA_CH##n##_CMD & IO_MASK( R_DMA_CH0_CMD, cmd )) != \ |
| 54 | IO_STATE( R_DMA_CH0_CMD, cmd, hold ) ) |
| 55 | |
| 56 | /* Use this for constant numbers or symbols |
| 57 | * having two macros makes it possible to use constant expressions. |
| 58 | */ |
| 59 | #define WAIT_DMA( n ) WAIT_DMA_NUM( n ) |
| 60 | |
| 61 | extern void prepare_rx_descriptor(struct etrax_dma_descr *desc); |
| 62 | extern void flush_etrax_cache(void); |
| 63 | |
| 64 | #endif |