at_hdmac.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Header file for the Atmel AHB DMA Controller driver
  3. *
  4. * Copyright (C) 2008 Atmel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #ifndef AT_HDMAC_H
  12. #define AT_HDMAC_H
  13. #include <linux/dmaengine.h>
  14. /**
  15. * struct at_dma_platform_data - Controller configuration parameters
  16. * @nr_channels: Number of channels supported by hardware (max 8)
  17. * @cap_mask: dma_capability flags supported by the platform
  18. */
  19. struct at_dma_platform_data {
  20. unsigned int nr_channels;
  21. dma_cap_mask_t cap_mask;
  22. };
  23. /**
  24. * struct at_dma_slave - Controller-specific information about a slave
  25. * @dma_dev: required DMA master device
  26. * @cfg: Platform-specific initializer for the CFG register
  27. */
  28. struct at_dma_slave {
  29. struct device *dma_dev;
  30. u32 cfg;
  31. };
  32. /* Platform-configurable bits in CFG */
  33. #define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */
  34. #define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */
  35. #define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */
  36. #define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */
  37. #define ATC_SRC_H2SEL_SW (0x0 << 9)
  38. #define ATC_SRC_H2SEL_HW (0x1 << 9)
  39. #define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */
  40. #define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */
  41. #define ATC_DST_H2SEL_SW (0x0 << 13)
  42. #define ATC_DST_H2SEL_HW (0x1 << 13)
  43. #define ATC_SOD (0x1 << 16) /* Stop On Done */
  44. #define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */
  45. #define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */
  46. #define ATC_LOCK_IF_L (0x1 << 22) /* Master Interface Arbiter Lock */
  47. #define ATC_LOCK_IF_L_CHUNK (0x0 << 22)
  48. #define ATC_LOCK_IF_L_BUFFER (0x1 << 22)
  49. #define ATC_AHB_PROT_MASK (0x7 << 24) /* AHB Protection */
  50. #define ATC_FIFOCFG_MASK (0x3 << 28) /* FIFO Request Configuration */
  51. #define ATC_FIFOCFG_LARGESTBURST (0x0 << 28)
  52. #define ATC_FIFOCFG_HALFFIFO (0x1 << 28)
  53. #define ATC_FIFOCFG_ENOUGHSPACE (0x2 << 28)
  54. #endif /* AT_HDMAC_H */