dma-sh.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 CHCR_DE 0x00000001
  31. #define CHCR_TE 0x00000002
  32. #define CHCR_IE 0x00000004
  33. /* DMAOR definitions */
  34. #define DMAOR_AE 0x00000004
  35. #define DMAOR_NMIF 0x00000002
  36. #define DMAOR_DME 0x00000001
  37. /*
  38. * Define the default configuration for dual address memory-memory transfer.
  39. * The 0x400 value represents auto-request, external->external.
  40. */
  41. #define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32)
  42. #define MAX_DMAC_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
  43. /*
  44. * Subtypes that have fewer channels than this simply need to change
  45. * CONFIG_NR_ONCHIP_DMA_CHANNELS. Likewise, subtypes with a larger number
  46. * of channels should expand on this.
  47. *
  48. * For most subtypes we can easily figure these values out with some
  49. * basic calculation, unfortunately on other subtypes these are more
  50. * scattered, so we just leave it unrolled for simplicity.
  51. */
  52. #define SAR ((unsigned long[]){SH_DMAC_BASE + 0x00, SH_DMAC_BASE + 0x10, \
  53. SH_DMAC_BASE + 0x20, SH_DMAC_BASE + 0x30, \
  54. SH_DMAC_BASE + 0x50, SH_DMAC_BASE + 0x60})
  55. #define DAR ((unsigned long[]){SH_DMAC_BASE + 0x04, SH_DMAC_BASE + 0x14, \
  56. SH_DMAC_BASE + 0x24, SH_DMAC_BASE + 0x34, \
  57. SH_DMAC_BASE + 0x54, SH_DMAC_BASE + 0x64})
  58. #define DMATCR ((unsigned long[]){SH_DMAC_BASE + 0x08, SH_DMAC_BASE + 0x18, \
  59. SH_DMAC_BASE + 0x28, SH_DMAC_BASE + 0x38, \
  60. SH_DMAC_BASE + 0x58, SH_DMAC_BASE + 0x68})
  61. #define CHCR ((unsigned long[]){SH_DMAC_BASE + 0x0c, SH_DMAC_BASE + 0x1c, \
  62. SH_DMAC_BASE + 0x2c, SH_DMAC_BASE + 0x3c, \
  63. SH_DMAC_BASE + 0x5c, SH_DMAC_BASE + 0x6c})
  64. #define DMAOR (SH_DMAC_BASE + 0x40)
  65. #endif /* __DMA_SH_H */