dma-sh4a.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H
  2. #define __ASM_SH_CPU_SH4_DMA_SH7780_H
  3. #if defined(CONFIG_CPU_SUBTYPE_SH7343) || \
  4. defined(CONFIG_CPU_SUBTYPE_SH7722) || \
  5. defined(CONFIG_CPU_SUBTYPE_SH7730)
  6. #define DMTE0_IRQ 48
  7. #define DMTE4_IRQ 76
  8. #define DMAE0_IRQ 78 /* DMA Error IRQ*/
  9. #define SH_DMAC_BASE0 0xFE008020
  10. #define SH_DMARS_BASE 0xFE009000
  11. #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
  12. defined(CONFIG_CPU_SUBTYPE_SH7764)
  13. #define DMTE0_IRQ 34
  14. #define DMTE4_IRQ 44
  15. #define DMAE0_IRQ 38
  16. #define SH_DMAC_BASE0 0xFF608020
  17. #define SH_DMARS_BASE 0xFF609000
  18. #elif defined(CONFIG_CPU_SUBTYPE_SH7723) || \
  19. defined(CONFIG_CPU_SUBTYPE_SH7724)
  20. #define DMTE0_IRQ 48 /* DMAC0A*/
  21. #define DMTE4_IRQ 40 /* DMAC0B */
  22. #define DMTE6_IRQ 42
  23. #define DMTE8_IRQ 76 /* DMAC1A */
  24. #define DMTE9_IRQ 77
  25. #define DMTE10_IRQ 72 /* DMAC1B */
  26. #define DMTE11_IRQ 73
  27. #define DMAE0_IRQ 78 /* DMA Error IRQ*/
  28. #define DMAE1_IRQ 74 /* DMA Error IRQ*/
  29. #define SH_DMAC_BASE0 0xFE008020
  30. #define SH_DMAC_BASE1 0xFDC08020
  31. #define SH_DMARS_BASE 0xFDC09000
  32. #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  33. #define DMTE0_IRQ 34
  34. #define DMTE4_IRQ 44
  35. #define DMTE6_IRQ 46
  36. #define DMTE8_IRQ 92
  37. #define DMTE9_IRQ 93
  38. #define DMTE10_IRQ 94
  39. #define DMTE11_IRQ 95
  40. #define DMAE0_IRQ 38 /* DMA Error IRQ */
  41. #define SH_DMAC_BASE0 0xFC808020
  42. #define SH_DMAC_BASE1 0xFC818020
  43. #define SH_DMARS_BASE 0xFC809000
  44. #else /* SH7785 */
  45. #define DMTE0_IRQ 33
  46. #define DMTE4_IRQ 37
  47. #define DMTE6_IRQ 52
  48. #define DMTE8_IRQ 54
  49. #define DMTE9_IRQ 55
  50. #define DMTE10_IRQ 56
  51. #define DMTE11_IRQ 57
  52. #define DMAE0_IRQ 39 /* DMA Error IRQ0 */
  53. #define DMAE1_IRQ 58 /* DMA Error IRQ1 */
  54. #define SH_DMAC_BASE0 0xFC808020
  55. #define SH_DMAC_BASE1 0xFCC08020
  56. #define SH_DMARS_BASE 0xFC809000
  57. #endif
  58. #define REQ_HE 0x000000C0
  59. #define REQ_H 0x00000080
  60. #define REQ_LE 0x00000040
  61. #define TM_BURST 0x0000020
  62. #define TS_8 0x00000000
  63. #define TS_16 0x00000008
  64. #define TS_32 0x00000010
  65. #define TS_16BLK 0x00000018
  66. #define TS_32BLK 0x00100000
  67. /*
  68. * The SuperH DMAC supports a number of transmit sizes, we list them here,
  69. * with their respective values as they appear in the CHCR registers.
  70. *
  71. * Defaults to a 64-bit transfer size.
  72. */
  73. enum {
  74. XMIT_SZ_8BIT,
  75. XMIT_SZ_16BIT,
  76. XMIT_SZ_32BIT,
  77. XMIT_SZ_128BIT,
  78. XMIT_SZ_256BIT,
  79. };
  80. /*
  81. * The DMA count is defined as the number of bytes to transfer.
  82. */
  83. static unsigned int ts_shift[] __maybe_unused = {
  84. [XMIT_SZ_8BIT] = 0,
  85. [XMIT_SZ_16BIT] = 1,
  86. [XMIT_SZ_32BIT] = 2,
  87. [XMIT_SZ_128BIT] = 4,
  88. [XMIT_SZ_256BIT] = 5,
  89. };
  90. #endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */