dma-sh4a.h 2.4 KB

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