dma-dw.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Driver for the Synopsys DesignWare DMA Controller
  3. *
  4. * Copyright (C) 2007 Atmel Corporation
  5. * Copyright (C) 2010-2011 ST Microelectronics
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _PLATFORM_DATA_DMA_DW_H
  12. #define _PLATFORM_DATA_DMA_DW_H
  13. #include <linux/device.h>
  14. #define DW_DMA_MAX_NR_MASTERS 4
  15. #define DW_DMA_MAX_NR_CHANNELS 8
  16. /**
  17. * struct dw_dma_slave - Controller-specific information about a slave
  18. *
  19. * @dma_dev: required DMA master device
  20. * @src_id: src request line
  21. * @dst_id: dst request line
  22. * @m_master: memory master for transfers on allocated channel
  23. * @p_master: peripheral master for transfers on allocated channel
  24. * @hs_polarity:set active low polarity of handshake interface
  25. */
  26. struct dw_dma_slave {
  27. struct device *dma_dev;
  28. u8 src_id;
  29. u8 dst_id;
  30. u8 m_master;
  31. u8 p_master;
  32. bool hs_polarity;
  33. };
  34. /**
  35. * struct dw_dma_platform_data - Controller configuration parameters
  36. * @nr_channels: Number of channels supported by hardware (max 8)
  37. * @is_private: The device channels should be marked as private and not for
  38. * by the general purpose DMA channel allocator.
  39. * @is_memcpy: The device channels do support memory-to-memory transfers.
  40. * @is_idma32: The type of the DMA controller is iDMA32
  41. * @chan_allocation_order: Allocate channels starting from 0 or 7
  42. * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0.
  43. * @block_size: Maximum block size supported by the controller
  44. * @nr_masters: Number of AHB masters supported by the controller
  45. * @data_width: Maximum data width supported by hardware per AHB master
  46. * (in bytes, power of 2)
  47. * @multi_block: Multi block transfers supported by hardware per channel.
  48. */
  49. struct dw_dma_platform_data {
  50. unsigned int nr_channels;
  51. bool is_private;
  52. bool is_memcpy;
  53. bool is_idma32;
  54. #define CHAN_ALLOCATION_ASCENDING 0 /* zero to seven */
  55. #define CHAN_ALLOCATION_DESCENDING 1 /* seven to zero */
  56. unsigned char chan_allocation_order;
  57. #define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
  58. #define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
  59. unsigned char chan_priority;
  60. unsigned int block_size;
  61. unsigned char nr_masters;
  62. unsigned char data_width[DW_DMA_MAX_NR_MASTERS];
  63. unsigned char multi_block[DW_DMA_MAX_NR_CHANNELS];
  64. };
  65. #endif /* _PLATFORM_DATA_DMA_DW_H */