dma-sh.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * arch/sh/drivers/dma/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 <cpu/dma.h>
  14. /* Definitions for the SuperH DMAC */
  15. #define REQ_L 0x00000000
  16. #define REQ_E 0x00080000
  17. #define RACK_H 0x00000000
  18. #define RACK_L 0x00040000
  19. #define ACK_R 0x00000000
  20. #define ACK_W 0x00020000
  21. #define ACK_H 0x00000000
  22. #define ACK_L 0x00010000
  23. #define DM_INC 0x00004000
  24. #define DM_DEC 0x00008000
  25. #define SM_INC 0x00001000
  26. #define SM_DEC 0x00002000
  27. #define RS_IN 0x00000200
  28. #define RS_OUT 0x00000300
  29. #define TS_BLK 0x00000040
  30. #define TM_BUR 0x00000020
  31. #define CHCR_DE 0x00000001
  32. #define CHCR_TE 0x00000002
  33. #define CHCR_IE 0x00000004
  34. /* DMAOR definitions */
  35. #define DMAOR_AE 0x00000004
  36. #define DMAOR_NMIF 0x00000002
  37. #define DMAOR_DME 0x00000001
  38. /*
  39. * Define the default configuration for dual address memory-memory transfer.
  40. * The 0x400 value represents auto-request, external->external.
  41. */
  42. #define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32)
  43. #define MAX_DMAC_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
  44. /*
  45. * Subtypes that have fewer channels than this simply need to change
  46. * CONFIG_NR_ONCHIP_DMA_CHANNELS. Likewise, subtypes with a larger number
  47. * of channels should expand on this.
  48. *
  49. * For most subtypes we can easily figure these values out with some
  50. * basic calculation, unfortunately on other subtypes these are more
  51. * scattered, so we just leave it unrolled for simplicity.
  52. */
  53. #define SAR ((unsigned long[]){SH_DMAC_BASE + 0x00, SH_DMAC_BASE + 0x10, \
  54. SH_DMAC_BASE + 0x20, SH_DMAC_BASE + 0x30, \
  55. SH_DMAC_BASE + 0x50, SH_DMAC_BASE + 0x60})
  56. #define DAR ((unsigned long[]){SH_DMAC_BASE + 0x04, SH_DMAC_BASE + 0x14, \
  57. SH_DMAC_BASE + 0x24, SH_DMAC_BASE + 0x34, \
  58. SH_DMAC_BASE + 0x54, SH_DMAC_BASE + 0x64})
  59. #define DMATCR ((unsigned long[]){SH_DMAC_BASE + 0x08, SH_DMAC_BASE + 0x18, \
  60. SH_DMAC_BASE + 0x28, SH_DMAC_BASE + 0x38, \
  61. SH_DMAC_BASE + 0x58, SH_DMAC_BASE + 0x68})
  62. #define CHCR ((unsigned long[]){SH_DMAC_BASE + 0x0c, SH_DMAC_BASE + 0x1c, \
  63. SH_DMAC_BASE + 0x2c, SH_DMAC_BASE + 0x3c, \
  64. SH_DMAC_BASE + 0x5c, SH_DMAC_BASE + 0x6c})
  65. #define DMAOR (SH_DMAC_BASE + 0x40)
  66. #endif /* __DMA_SH_H */