alarmDataOperation.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * include/asm-alpha/dma.h
  3. *
  4. * This is essentially the same as the i386 DMA stuff, as the AlphaPCs
  5. * use ISA-compatible dma. The only extension is support for high-page
  6. * registers that allow to set the top 8 bits of a 32-bit DMA address.
  7. * This register should be written last when setting up a DMA address
  8. * as this will also enable DMA across 64 KB boundaries.
  9. */
  10. /* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $
  11. * linux/include/asm/dma.h: Defines for using and allocating dma channels.
  12. * Written by Hennus Bergman, 1992.
  13. * High DMA channel support & info by Hannu Savolainen
  14. * and John Boyd, Nov. 1992.
  15. */
  16. #ifndef _ASM_DMA_H
  17. #define _ASM_DMA_H
  18. #include <linux/spinlock.h>
  19. #include <asm/io.h>
  20. #define dma_outb outb
  21. #define dma_inb inb
  22. /*
  23. * NOTES about DMA transfers:
  24. *
  25. * controller 1: channels 0-3, byte operations, ports 00-1F
  26. * controller 2: channels 4-7, word operations, ports C0-DF
  27. *
  28. * - ALL registers are 8 bits only, regardless of transfer size
  29. * - channel 4 is not used - cascades 1 into 2.
  30. * - channels 0-3 are byte - addresses/counts are for physical bytes
  31. * - channels 5-7 are word - addresses/counts are for physical words
  32. * - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries
  33. * - transfer count loaded to registers is 1 less than actual count
  34. * - controller 2 offsets are all even (2x offsets for controller 1)
  35. * - page registers for 5-7 don't use data bit 0, represent 128K pages
  36. * - page registers for 0-3 use bit 0, represent 64K pages
  37. *
  38. * DMA transfers are limited to the lower 16MB of _physical_ memory.
  39. * Note that addresses loaded into registers must be _physical_ addresses,
  40. * not logical addresses (which may differ if paging is active).
  41. *
  42. * Address mapping for channels 0-3:
  43. *
  44. * A23 ... A16 A15 ... A8 A7 ... A0 (Physical addresses)
  45. * | ... | | ... | | ... |
  46. * | ... | | ... | | ... |
  47. * | ... | | ... | | ... |
  48. * P7 ... P0 A7 ... A0 A7 ... A0
  49. * | Page | Addr MSB | Addr LSB | (DMA registers)
  50. *
  51. * Address mapping for channels 5-7:
  52. *
  53. * A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0 (Physical addresses)
  54. * | ... | \ \ ... \ \ \ ... \ \
  55. * | ... | \ \ ... \ \ \ ... \ (not used)
  56. * | ... | \ \ ... \ \ \ ... \
  57. * P7 ... P1 (0) A7 A6 ... A0 A7 A6 ... A0
  58. * | Page | Addr MSB | Addr LSB | (DMA registers)
  59. *
  60. * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
  61. * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at
  62. * the hardware level, so odd-byte transfers aren't possible).
  63. *
  64. * Transfer count (_not # bytes_) is limited to 64K, represented as actual
  65. * count - 1 : 64K => 0xFFFF, 1 => 0x0000. Thus, count is always 1 or more,
  66. * and up to 128K bytes may be transferred on channels 5-7 in one operation.
  67. *
  68. */
  69. #define MAX_DMA_CHANNELS 8
  70. /*
  71. ISA DMA limitations on Alpha platforms,
  72. These may be due to SIO (PCI<->ISA bridge) chipset limitation, or
  73. just a wiring limit.
  74. */
  75. /* The maximum address for ISA DMA transfer on Alpha XL, due to an
  76. hardware SIO limitation, is 64MB.
  77. */
  78. #define ALPHA_XL_MAX_ISA_DMA_ADDRESS 0x04000000UL
  79. /* The maximum address for ISA DMA transfer on RUFFIAN,
  80. due to an hardware SIO limitation, is 16MB.
  81. */
  82. #define ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS 0x01000000UL
  83. /* The maximum address for ISA DMA transfer on SABLE, and some ALCORs,
  84. due to an hardware SIO chip limitation, is 2GB.
  85. */
  86. #define ALPHA_SABLE_MAX_ISA_DMA_ADDRESS 0x80000000UL
  87. #define ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS 0x80000000UL
  88. /*
  89. Maximum address for all the others is the complete 32-bit bus
  90. address space.
  91. */
  92. #define ALPHA_MAX_ISA_DMA_ADDRESS 0x100000000UL
  93. #ifdef CONFIG_ALPHA_GENERIC
  94. # define MAX_ISA_DMA_ADDRESS (alpha_mv.max_isa_dma_address)
  95. #else
  96. # if defined(CONFIG_ALPHA_XL)
  97. # define MAX_ISA_DMA_ADDRESS ALPHA_XL_MAX_ISA_DMA_ADDRESS
  98. # elif defined(CONFIG_ALPHA_RUFFIAN)
  99. # define MAX_ISA_DMA_ADDRESS ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS
  100. # elif defined(CONFIG_ALPHA_SABLE)
  101. # define MAX_ISA_DMA_ADDRESS ALPHA_SABLE_MAX_ISA_DMA_ADDRESS
  102. # elif defined(CONFIG_ALPHA_ALCOR)
  103. # define MAX_ISA_DMA_ADDRESS ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS