dma-sh4a.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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_SH7730)
  5. #define DMTE0_IRQ 48
  6. #define DMTE4_IRQ 76
  7. #define DMAE0_IRQ 78 /* DMA Error IRQ*/
  8. #define SH_DMAC_BASE0 0xFE008020
  9. #define SH_DMARS_BASE0 0xFE009000
  10. #define CHCR_TS_LOW_MASK 0x00000018
  11. #define CHCR_TS_LOW_SHIFT 3
  12. #define CHCR_TS_HIGH_MASK 0
  13. #define CHCR_TS_HIGH_SHIFT 0
  14. #elif defined(CONFIG_CPU_SUBTYPE_SH7722)
  15. #define DMTE0_IRQ 48
  16. #define DMTE4_IRQ 76
  17. #define DMAE0_IRQ 78 /* DMA Error IRQ*/
  18. #define SH_DMAC_BASE0 0xFE008020
  19. #define SH_DMARS_BASE0 0xFE009000
  20. #define CHCR_TS_LOW_MASK 0x00000018
  21. #define CHCR_TS_LOW_SHIFT 3
  22. #define CHCR_TS_HIGH_MASK 0x00300000
  23. #define CHCR_TS_HIGH_SHIFT 20
  24. #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
  25. defined(CONFIG_CPU_SUBTYPE_SH7764)
  26. #define DMTE0_IRQ 34
  27. #define DMTE4_IRQ 44
  28. #define DMAE0_IRQ 38
  29. #define SH_DMAC_BASE0 0xFF608020
  30. #define SH_DMARS_BASE0 0xFF609000
  31. #define CHCR_TS_LOW_MASK 0x00000018
  32. #define CHCR_TS_LOW_SHIFT 3
  33. #define CHCR_TS_HIGH_MASK 0
  34. #define CHCR_TS_HIGH_SHIFT 0
  35. #elif defined(CONFIG_CPU_SUBTYPE_SH7723)
  36. #define DMTE0_IRQ 48 /* DMAC0A*/
  37. #define DMTE4_IRQ 76 /* DMAC0B */
  38. #define DMTE6_IRQ 40
  39. #define DMTE8_IRQ 42 /* DMAC1A */
  40. #define DMTE9_IRQ 43
  41. #define DMTE10_IRQ 72 /* DMAC1B */
  42. #define DMTE11_IRQ 73
  43. #define DMAE0_IRQ 78 /* DMA Error IRQ*/
  44. #define DMAE1_IRQ 74 /* DMA Error IRQ*/
  45. #define SH_DMAC_BASE0 0xFE008020
  46. #define SH_DMAC_BASE1 0xFDC08020
  47. #define SH_DMARS_BASE0 0xFDC09000
  48. #define CHCR_TS_LOW_MASK 0x00000018
  49. #define CHCR_TS_LOW_SHIFT 3
  50. #define CHCR_TS_HIGH_MASK 0
  51. #define CHCR_TS_HIGH_SHIFT 0
  52. #elif defined(CONFIG_CPU_SUBTYPE_SH7724)
  53. #define DMTE0_IRQ 48 /* DMAC0A*/
  54. #define DMTE4_IRQ 76 /* DMAC0B */
  55. #define DMTE6_IRQ 40
  56. #define DMTE8_IRQ 42 /* DMAC1A */
  57. #define DMTE9_IRQ 43
  58. #define DMTE10_IRQ 72 /* DMAC1B */
  59. #define DMTE11_IRQ 73
  60. #define DMAE0_IRQ 78 /* DMA Error IRQ*/
  61. #define DMAE1_IRQ 74 /* DMA Error IRQ*/
  62. #define SH_DMAC_BASE0 0xFE008020
  63. #define SH_DMAC_BASE1 0xFDC08020
  64. #define SH_DMARS_BASE0 0xFE009000
  65. #define SH_DMARS_BASE1 0xFDC09000
  66. #define CHCR_TS_LOW_MASK 0x00000018
  67. #define CHCR_TS_LOW_SHIFT 3
  68. #define CHCR_TS_HIGH_MASK 0x00600000
  69. #define CHCR_TS_HIGH_SHIFT 21
  70. #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  71. #define DMTE0_IRQ 34
  72. #define DMTE4_IRQ 44
  73. #define DMTE6_IRQ 46
  74. #define DMTE8_IRQ 92
  75. #define DMTE9_IRQ 93
  76. #define DMTE10_IRQ 94
  77. #define DMTE11_IRQ 95
  78. #define DMAE0_IRQ 38 /* DMA Error IRQ */
  79. #define SH_DMAC_BASE0 0xFC808020
  80. #define SH_DMAC_BASE1 0xFC818020
  81. #define SH_DMARS_BASE0 0xFC809000
  82. #define CHCR_TS_LOW_MASK 0x00000018
  83. #define CHCR_TS_LOW_SHIFT 3
  84. #define CHCR_TS_HIGH_MASK 0
  85. #define CHCR_TS_HIGH_SHIFT 0
  86. #else /* SH7785 */
  87. #define DMTE0_IRQ 33
  88. #define DMTE4_IRQ 37
  89. #define DMTE6_IRQ 52
  90. #define DMTE8_IRQ 54
  91. #define DMTE9_IRQ 55
  92. #define DMTE10_IRQ 56
  93. #define DMTE11_IRQ 57
  94. #define DMAE0_IRQ 39 /* DMA Error IRQ0 */
  95. #define DMAE1_IRQ 58 /* DMA Error IRQ1 */
  96. #define SH_DMAC_BASE0 0xFC808020
  97. #define SH_DMAC_BASE1 0xFCC08020
  98. #define SH_DMARS_BASE0 0xFC809000
  99. #define CHCR_TS_LOW_MASK 0x00000018
  100. #define CHCR_TS_LOW_SHIFT 3
  101. #define CHCR_TS_HIGH_MASK 0
  102. #define CHCR_TS_HIGH_SHIFT 0
  103. #endif
  104. #define REQ_HE 0x000000C0
  105. #define REQ_H 0x00000080
  106. #define REQ_LE 0x00000040
  107. #define TM_BURST 0x00000020
  108. /*
  109. * The SuperH DMAC supports a number of transmit sizes, we list them here,
  110. * with their respective values as they appear in the CHCR registers.
  111. *
  112. * Defaults to a 64-bit transfer size.
  113. */
  114. enum {
  115. XMIT_SZ_8BIT = 0,
  116. XMIT_SZ_16BIT = 1,
  117. XMIT_SZ_32BIT = 2,
  118. XMIT_SZ_64BIT = 7,
  119. XMIT_SZ_128BIT = 3,
  120. XMIT_SZ_256BIT = 4,
  121. XMIT_SZ_128BIT_BLK = 0xb,
  122. XMIT_SZ_256BIT_BLK = 0xc,
  123. };
  124. /*
  125. * The DMA count is defined as the number of bytes to transfer.
  126. */
  127. #define TS_SHIFT { \
  128. [XMIT_SZ_8BIT] = 0, \
  129. [XMIT_SZ_16BIT] = 1, \
  130. [XMIT_SZ_32BIT] = 2, \
  131. [XMIT_SZ_64BIT] = 3, \
  132. [XMIT_SZ_128BIT] = 4, \
  133. [XMIT_SZ_256BIT] = 5, \
  134. [XMIT_SZ_128BIT_BLK] = 4, \
  135. [XMIT_SZ_256BIT_BLK] = 5, \
  136. }
  137. #define TS_INDEX2VAL(i) ((((i) & 3) << CHCR_TS_LOW_SHIFT) | \
  138. ((((i) >> 2) & 3) << CHCR_TS_HIGH_SHIFT))
  139. #endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */