dma.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* linux/include/asm-arm/plat-s3c24xx/dma.h
  2. *
  3. * Copyright (C) 2006 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * Samsung S3C24XX DMA support
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. extern struct sysdev_class dma_sysclass;
  13. extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
  14. #define DMA_CH_VALID (1<<31)
  15. #define DMA_CH_NEVER (1<<30)
  16. struct s3c24xx_dma_addr {
  17. unsigned long from;
  18. unsigned long to;
  19. };
  20. /* struct s3c24xx_dma_map
  21. *
  22. * this holds the mapping information for the channel selected
  23. * to be connected to the specified device
  24. */
  25. struct s3c24xx_dma_map {
  26. const char *name;
  27. struct s3c24xx_dma_addr hw_addr;
  28. unsigned long channels[S3C2410_DMA_CHANNELS];
  29. #if defined (CONFIG_CPU_S3C6400) || defined (CONFIG_CPU_S3C6410)
  30. unsigned long sdma_sel;
  31. #endif
  32. };
  33. struct s3c24xx_dma_selection {
  34. struct s3c24xx_dma_map *map;
  35. unsigned long map_size;
  36. unsigned long dcon_mask;
  37. void (*select)(struct s3c2410_dma_chan *chan,
  38. struct s3c24xx_dma_map *map);
  39. };
  40. extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);
  41. /* struct s3c24xx_dma_order_ch
  42. *
  43. * channel map for one of the `enum dma_ch` dma channels. the list
  44. * entry contains a set of low-level channel numbers, orred with
  45. * DMA_CH_VALID, which are checked in the order in the array.
  46. */
  47. struct s3c24xx_dma_order_ch {
  48. unsigned int list[S3C2410_DMA_CHANNELS]; /* list of channels */
  49. unsigned int flags; /* flags */
  50. };
  51. /* struct s3c24xx_dma_order
  52. *
  53. * information provided by either the core or the board to give the
  54. * dma system a hint on how to allocate channels
  55. */
  56. struct s3c24xx_dma_order {
  57. struct s3c24xx_dma_order_ch channels[DMACH_MAX];
  58. };
  59. extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map);
  60. /* DMA init code, called from the cpu support code */
  61. extern int s3c2410_dma_init(void);
  62. extern int s3c24xx_dma_init(unsigned int channels, unsigned int irq,
  63. unsigned int stride);