dma-s3c24xx.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* linux/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
  2. *
  3. * Copyright (C) 2006 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * Samsung S3C24XX DMA support - per SoC functions
  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. #include <plat/dma-core.h>
  13. extern struct bus_type dma_subsys;
  14. extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS];
  15. #define DMA_CH_VALID (1<<31)
  16. #define DMA_CH_NEVER (1<<30)
  17. /* struct s3c24xx_dma_map
  18. *
  19. * this holds the mapping information for the channel selected
  20. * to be connected to the specified device
  21. */
  22. struct s3c24xx_dma_map {
  23. const char *name;
  24. unsigned long channels[S3C_DMA_CHANNELS];
  25. };
  26. struct s3c24xx_dma_selection {
  27. struct s3c24xx_dma_map *map;
  28. unsigned long map_size;
  29. unsigned long dcon_mask;
  30. void (*select)(struct s3c2410_dma_chan *chan,
  31. struct s3c24xx_dma_map *map);
  32. };
  33. extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);
  34. /* struct s3c24xx_dma_order_ch
  35. *
  36. * channel map for one of the `enum dma_ch` dma channels. the list
  37. * entry contains a set of low-level channel numbers, orred with
  38. * DMA_CH_VALID, which are checked in the order in the array.
  39. */
  40. struct s3c24xx_dma_order_ch {
  41. unsigned int list[S3C_DMA_CHANNELS]; /* list of channels */
  42. unsigned int flags; /* flags */
  43. };
  44. /* struct s3c24xx_dma_order
  45. *
  46. * information provided by either the core or the board to give the
  47. * dma system a hint on how to allocate channels
  48. */
  49. struct s3c24xx_dma_order {
  50. struct s3c24xx_dma_order_ch channels[DMACH_MAX];
  51. };
  52. extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map);
  53. /* DMA init code, called from the cpu support code */
  54. extern int s3c2410_dma_init(void);
  55. extern int s3c24xx_dma_init(unsigned int channels, unsigned int irq,
  56. unsigned int stride);