dma.h 1.3 KB

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