dma.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __SDMA_H
  2. #define __SDMA_H
  3. /* Copyright (C) 2011
  4. * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. /* Functions */
  22. void omap3_dma_init(void);
  23. int omap3_dma_conf_transfer(uint32_t chan, uint32_t *src, uint32_t *dst,
  24. uint32_t sze);
  25. int omap3_dma_start_transfer(uint32_t chan);
  26. int omap3_dma_wait_for_transfer(uint32_t chan);
  27. int omap3_dma_conf_chan(uint32_t chan, struct dma4_chan *config);
  28. int omap3_dma_get_conf_chan(uint32_t chan, struct dma4_chan *config);
  29. /* Register settings */
  30. #define CSDP_DATA_TYPE_8BIT 0x0
  31. #define CSDP_DATA_TYPE_16BIT 0x1
  32. #define CSDP_DATA_TYPE_32BIT 0x2
  33. #define CSDP_SRC_BURST_SINGLE (0x0 << 7)
  34. #define CSDP_SRC_BURST_EN_16BYTES (0x1 << 7)
  35. #define CSDP_SRC_BURST_EN_32BYTES (0x2 << 7)
  36. #define CSDP_SRC_BURST_EN_64BYTES (0x3 << 7)
  37. #define CSDP_DST_BURST_SINGLE (0x0 << 14)
  38. #define CSDP_DST_BURST_EN_16BYTES (0x1 << 14)
  39. #define CSDP_DST_BURST_EN_32BYTES (0x2 << 14)
  40. #define CSDP_DST_BURST_EN_64BYTES (0x3 << 14)
  41. #define CSDP_DST_ENDIAN_LOCK_ADAPT (0x0 << 18)
  42. #define CSDP_DST_ENDIAN_LOCK_LOCK (0x1 << 18)
  43. #define CSDP_DST_ENDIAN_LITTLE (0x0 << 19)
  44. #define CSDP_DST_ENDIAN_BIG (0x1 << 19)
  45. #define CSDP_SRC_ENDIAN_LOCK_ADAPT (0x0 << 20)
  46. #define CSDP_SRC_ENDIAN_LOCK_LOCK (0x1 << 20)
  47. #define CSDP_SRC_ENDIAN_LITTLE (0x0 << 21)
  48. #define CSDP_SRC_ENDIAN_BIG (0x1 << 21)
  49. #define CCR_READ_PRIORITY_LOW (0x0 << 6)
  50. #define CCR_READ_PRIORITY_HIGH (0x1 << 6)
  51. #define CCR_ENABLE_DISABLED (0x0 << 7)
  52. #define CCR_ENABLE_ENABLE (0x1 << 7)
  53. #define CCR_SRC_AMODE_CONSTANT (0x0 << 12)
  54. #define CCR_SRC_AMODE_POST_INC (0x1 << 12)
  55. #define CCR_SRC_AMODE_SINGLE_IDX (0x2 << 12)
  56. #define CCR_SRC_AMODE_DOUBLE_IDX (0x3 << 12)
  57. #define CCR_DST_AMODE_CONSTANT (0x0 << 14)
  58. #define CCR_DST_AMODE_POST_INC (0x1 << 14)
  59. #define CCR_DST_AMODE_SINGLE_IDX (0x2 << 14)
  60. #define CCR_DST_AMODE_SOUBLE_IDX (0x3 << 14)
  61. #define CCR_RD_ACTIVE_MASK (1 << 9)
  62. #define CCR_WR_ACTIVE_MASK (1 << 10)
  63. #define CSR_TRANS_ERR (1 << 8)
  64. #define CSR_SUPERVISOR_ERR (1 << 10)
  65. #define CSR_MISALIGNED_ADRS_ERR (1 << 11)
  66. /* others */
  67. #define CHAN_NR_MIN 0
  68. #define CHAN_NR_MAX 31
  69. #endif /* __SDMA_H */