dma.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef __ASM_CPU_SH4_DMA_H
  2. #define __ASM_CPU_SH4_DMA_H
  3. #define DMAOR_INIT ( 0x8000 | DMAOR_DME )
  4. /* SH7751/7760/7780 DMA IRQ sources */
  5. #define DMTE0_IRQ 34
  6. #define DMTE1_IRQ 35
  7. #define DMTE2_IRQ 36
  8. #define DMTE3_IRQ 37
  9. #define DMTE4_IRQ 44
  10. #define DMTE5_IRQ 45
  11. #define DMTE6_IRQ 46
  12. #define DMTE7_IRQ 47
  13. #define DMAE_IRQ 38
  14. #ifdef CONFIG_CPU_SH4A
  15. #define SH_DMAC_BASE 0xfc808020
  16. #define CHCR_TS_MASK 0x18
  17. #define CHCR_TS_SHIFT 3
  18. #include <asm/cpu/dma-sh7780.h>
  19. #else
  20. #define SH_DMAC_BASE 0xffa00000
  21. /* Definitions for the SuperH DMAC */
  22. #define TM_BURST 0x0000080
  23. #define TS_8 0x00000010
  24. #define TS_16 0x00000020
  25. #define TS_32 0x00000030
  26. #define TS_64 0x00000000
  27. #define CHCR_TS_MASK 0x70
  28. #define CHCR_TS_SHIFT 4
  29. #define DMAOR_COD 0x00000008
  30. /*
  31. * The SuperH DMAC supports a number of transmit sizes, we list them here,
  32. * with their respective values as they appear in the CHCR registers.
  33. *
  34. * Defaults to a 64-bit transfer size.
  35. */
  36. enum {
  37. XMIT_SZ_64BIT,
  38. XMIT_SZ_8BIT,
  39. XMIT_SZ_16BIT,
  40. XMIT_SZ_32BIT,
  41. XMIT_SZ_256BIT,
  42. };
  43. /*
  44. * The DMA count is defined as the number of bytes to transfer.
  45. */
  46. static unsigned int ts_shift[] __maybe_unused = {
  47. [XMIT_SZ_64BIT] = 3,
  48. [XMIT_SZ_8BIT] = 0,
  49. [XMIT_SZ_16BIT] = 1,
  50. [XMIT_SZ_32BIT] = 2,
  51. [XMIT_SZ_256BIT] = 5,
  52. };
  53. #endif
  54. #endif /* __ASM_CPU_SH4_DMA_H */