dma-sh.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * arch/sh/include/asm/dma-sh.h
  3. *
  4. * Copyright (C) 2000 Takashi YOSHII
  5. * Copyright (C) 2003 Paul Mundt
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file "COPYING" in the main directory of this archive
  9. * for more details.
  10. */
  11. #ifndef __DMA_SH_H
  12. #define __DMA_SH_H
  13. #include <asm/dma-register.h>
  14. #include <cpu/dma-register.h>
  15. #include <cpu/dma.h>
  16. /* DMAOR contorl: The DMAOR access size is different by CPU.*/
  17. #if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
  18. defined(CONFIG_CPU_SUBTYPE_SH7724) || \
  19. defined(CONFIG_CPU_SUBTYPE_SH7780) || \
  20. defined(CONFIG_CPU_SUBTYPE_SH7785)
  21. #define dmaor_read_reg(n) \
  22. (n ? __raw_readw(SH_DMAC_BASE1 + DMAOR) \
  23. : __raw_readw(SH_DMAC_BASE0 + DMAOR))
  24. #define dmaor_write_reg(n, data) \
  25. (n ? __raw_writew(data, SH_DMAC_BASE1 + DMAOR) \
  26. : __raw_writew(data, SH_DMAC_BASE0 + DMAOR))
  27. #else /* Other CPU */
  28. #define dmaor_read_reg(n) __raw_readw(SH_DMAC_BASE0 + DMAOR)
  29. #define dmaor_write_reg(n, data) __raw_writew(data, SH_DMAC_BASE0 + DMAOR)
  30. #endif
  31. static int dmte_irq_map[] __maybe_unused = {
  32. #if (MAX_DMA_CHANNELS >= 4)
  33. DMTE0_IRQ,
  34. DMTE0_IRQ + 1,
  35. DMTE0_IRQ + 2,
  36. DMTE0_IRQ + 3,
  37. #endif
  38. #if (MAX_DMA_CHANNELS >= 6)
  39. DMTE4_IRQ,
  40. DMTE4_IRQ + 1,
  41. #endif
  42. #if (MAX_DMA_CHANNELS >= 8)
  43. DMTE6_IRQ,
  44. DMTE6_IRQ + 1,
  45. #endif
  46. #if (MAX_DMA_CHANNELS >= 12)
  47. DMTE8_IRQ,
  48. DMTE9_IRQ,
  49. DMTE10_IRQ,
  50. DMTE11_IRQ,
  51. #endif
  52. };
  53. /*
  54. * Define the default configuration for dual address memory-memory transfer.
  55. * The 0x400 value represents auto-request, external->external.
  56. */
  57. #define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_INDEX2VAL(XMIT_SZ_32BIT))
  58. /* DMA base address */
  59. static u32 dma_base_addr[] __maybe_unused = {
  60. #if (MAX_DMA_CHANNELS >= 4)
  61. SH_DMAC_BASE0 + 0x00, /* channel 0 */
  62. SH_DMAC_BASE0 + 0x10,
  63. SH_DMAC_BASE0 + 0x20,
  64. SH_DMAC_BASE0 + 0x30,
  65. #endif
  66. #if (MAX_DMA_CHANNELS >= 6)
  67. SH_DMAC_BASE0 + 0x50,
  68. SH_DMAC_BASE0 + 0x60,
  69. #endif
  70. #if (MAX_DMA_CHANNELS >= 8)
  71. SH_DMAC_BASE1 + 0x00,
  72. SH_DMAC_BASE1 + 0x10,
  73. #endif
  74. #if (MAX_DMA_CHANNELS >= 12)
  75. SH_DMAC_BASE1 + 0x20,
  76. SH_DMAC_BASE1 + 0x30,
  77. SH_DMAC_BASE1 + 0x50,
  78. SH_DMAC_BASE1 + 0x60, /* channel 11 */
  79. #endif
  80. };
  81. #endif /* __DMA_SH_H */