svinto.h 2.1 KB

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