dma.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * include/asm-xtensa/dma.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2003 - 2005 Tensilica Inc.
  9. */
  10. #ifndef _XTENSA_DMA_H
  11. #define _XTENSA_DMA_H
  12. #include <linux/config.h>
  13. #include <asm/io.h> /* need byte IO */
  14. #include <xtensa/config/core.h>
  15. /*
  16. * This is only to be defined if we have PC-like DMA.
  17. * By default this is not true on an Xtensa processor,
  18. * however on boards with a PCI bus, such functionality
  19. * might be emulated externally.
  20. *
  21. * NOTE: there still exists driver code that assumes
  22. * this is defined, eg. drivers/sound/soundcard.c (as of 2.4).
  23. */
  24. #define MAX_DMA_CHANNELS 8
  25. /*
  26. * The maximum virtual address to which DMA transfers
  27. * can be performed on this platform.
  28. *
  29. * NOTE: This is board (platform) specific, not processor-specific!
  30. *
  31. * NOTE: This assumes DMA transfers can only be performed on
  32. * the section of physical memory contiguously mapped in virtual
  33. * space for the kernel. For the Xtensa architecture, this
  34. * means the maximum possible size of this DMA area is
  35. * the size of the statically mapped kernel segment
  36. * (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB.
  37. *
  38. * NOTE: When the entire KSEG area is DMA capable, we substract
  39. * one from the max address so that the virt_to_phys() macro
  40. * works correctly on the address (otherwise the address
  41. * enters another area, and virt_to_phys() may not return
  42. * the value desired).
  43. */
  44. #define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KSEG_CACHED_SIZE - 1)
  45. /* Reserve and release a DMA channel */
  46. extern int request_dma(unsigned int dmanr, const char * device_id);
  47. extern void free_dma(unsigned int dmanr);
  48. #ifdef CONFIG_PCI
  49. extern int isa_dma_bridge_buggy;
  50. #else
  51. #define isa_dma_bridge_buggy (0)
  52. #endif
  53. #endif