pata.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * ATAPI Masks
  3. */
  4. #ifndef __BFIN_PERIPHERAL_PATA__
  5. #define __BFIN_PERIPHERAL_PATA__
  6. /* Bit masks for ATAPI_CONTROL */
  7. #define PIO_START 0x1 /* Start PIO/Reg Op */
  8. #define MULTI_START 0x2 /* Start Multi-DMA Op */
  9. #define ULTRA_START 0x4 /* Start Ultra-DMA Op */
  10. #define XFER_DIR 0x8 /* Transfer Direction */
  11. #define IORDY_EN 0x10 /* IORDY Enable */
  12. #define FIFO_FLUSH 0x20 /* Flush FIFOs */
  13. #define SOFT_RST 0x40 /* Soft Reset */
  14. #define DEV_RST 0x80 /* Device Reset */
  15. #define TFRCNT_RST 0x100 /* Trans Count Reset */
  16. #define END_ON_TERM 0x200 /* End/Terminate Select */
  17. #define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
  18. #define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
  19. /* Bit masks for ATAPI_STATUS */
  20. #define PIO_XFER_ON 0x1 /* PIO transfer in progress */
  21. #define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
  22. #define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
  23. #define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
  24. /* Bit masks for ATAPI_DEV_ADDR */
  25. #define DEV_ADDR 0x1f /* Device Address */
  26. /* Bit masks for ATAPI_INT_MASK */
  27. #define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
  28. #define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
  29. #define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
  30. #define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
  31. #define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
  32. #define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
  33. #define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
  34. #define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
  35. #define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
  36. /* Bit masks for ATAPI_INT_STATUS */
  37. #define ATAPI_DEV_INT 0x1 /* Device interrupt status */
  38. #define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
  39. #define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
  40. #define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
  41. #define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
  42. #define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
  43. #define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
  44. #define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
  45. #define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
  46. /* Bit masks for ATAPI_LINE_STATUS */
  47. #define ATAPI_INTR 0x1 /* Device interrupt to host line status */
  48. #define ATAPI_DASP 0x2 /* Device dasp to host line status */
  49. #define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
  50. #define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
  51. #define ATAPI_ADDR 0x70 /* ATAPI address line status */
  52. #define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
  53. #define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
  54. #define ATAPI_DIOWN 0x200 /* ATAPI write line status */
  55. #define ATAPI_DIORN 0x400 /* ATAPI read line status */
  56. #define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
  57. /* Bit masks for ATAPI_SM_STATE */
  58. #define PIO_CSTATE 0xf /* PIO mode state machine current state */
  59. #define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
  60. #define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
  61. #define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
  62. /* Bit masks for ATAPI_TERMINATE */
  63. #define ATAPI_HOST_TERM 0x1 /* Host terminationation */
  64. /* Bit masks for ATAPI_REG_TIM_0 */
  65. #define T2_REG 0xff /* End of cycle time for register access transfers */
  66. #define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
  67. /* Bit masks for ATAPI_PIO_TIM_0 */
  68. #define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
  69. #define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
  70. #define T4_REG 0xf000 /* DIOW data hold */
  71. /* Bit masks for ATAPI_PIO_TIM_1 */
  72. #define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
  73. /* Bit masks for ATAPI_MULTI_TIM_0 */
  74. #define TD 0xff /* DIOR/DIOW asserted pulsewidth */
  75. #define TM 0xff00 /* Time from address valid to DIOR/DIOW */
  76. /* Bit masks for ATAPI_MULTI_TIM_1 */
  77. #define TKW 0xff /* Selects DIOW negated pulsewidth */
  78. #define TKR 0xff00 /* Selects DIOR negated pulsewidth */
  79. /* Bit masks for ATAPI_MULTI_TIM_2 */
  80. #define TH 0xff /* Selects DIOW data hold */
  81. #define TEOC 0xff00 /* Selects end of cycle for DMA */
  82. /* Bit masks for ATAPI_ULTRA_TIM_0 */
  83. #define TACK 0xff /* Selects setup and hold times for TACK */
  84. #define TENV 0xff00 /* Selects envelope time */
  85. /* Bit masks for ATAPI_ULTRA_TIM_1 */
  86. #define TDVS 0xff /* Selects data valid setup time */
  87. #define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
  88. /* Bit masks for ATAPI_ULTRA_TIM_2 */
  89. #define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
  90. #define TMLI 0xff00 /* Selects interlock time */
  91. /* Bit masks for ATAPI_ULTRA_TIM_3 */
  92. #define TZAH 0xff /* Selects minimum delay required for output */
  93. #define READY_PAUSE 0xff00 /* Selects ready to pause */
  94. /* Bit masks for ATAPI_CONTROL */
  95. #define PIO_START 0x1 /* Start PIO/Reg Op */
  96. #define MULTI_START 0x2 /* Start Multi-DMA Op */
  97. #define ULTRA_START 0x4 /* Start Ultra-DMA Op */
  98. #define XFER_DIR 0x8 /* Transfer Direction */
  99. #define IORDY_EN 0x10 /* IORDY Enable */
  100. #define FIFO_FLUSH 0x20 /* Flush FIFOs */
  101. #define SOFT_RST 0x40 /* Soft Reset */
  102. #define DEV_RST 0x80 /* Device Reset */
  103. #define TFRCNT_RST 0x100 /* Trans Count Reset */
  104. #define END_ON_TERM 0x200 /* End/Terminate Select */
  105. #define PIO_USE_DMA 0x400 /* PIO-DMA Enable */
  106. #define UDMAIN_FIFO_THRS 0xf000 /* Ultra DMA-IN FIFO Threshold */
  107. /* Bit masks for ATAPI_STATUS */
  108. #define PIO_XFER_ON 0x1 /* PIO transfer in progress */
  109. #define MULTI_XFER_ON 0x2 /* Multi-word DMA transfer in progress */
  110. #define ULTRA_XFER_ON 0x4 /* Ultra DMA transfer in progress */
  111. #define ULTRA_IN_FL 0xf0 /* Ultra DMA Input FIFO Level */
  112. /* Bit masks for ATAPI_DEV_ADDR */
  113. #define DEV_ADDR 0x1f /* Device Address */
  114. /* Bit masks for ATAPI_INT_MASK */
  115. #define ATAPI_DEV_INT_MASK 0x1 /* Device interrupt mask */
  116. #define PIO_DONE_MASK 0x2 /* PIO transfer done interrupt mask */
  117. #define MULTI_DONE_MASK 0x4 /* Multi-DMA transfer done interrupt mask */
  118. #define UDMAIN_DONE_MASK 0x8 /* Ultra-DMA in transfer done interrupt mask */
  119. #define UDMAOUT_DONE_MASK 0x10 /* Ultra-DMA out transfer done interrupt mask */
  120. #define HOST_TERM_XFER_MASK 0x20 /* Host terminate current transfer interrupt mask */
  121. #define MULTI_TERM_MASK 0x40 /* Device terminate Multi-DMA transfer interrupt mask */
  122. #define UDMAIN_TERM_MASK 0x80 /* Device terminate Ultra-DMA-in transfer interrupt mask */
  123. #define UDMAOUT_TERM_MASK 0x100 /* Device terminate Ultra-DMA-out transfer interrupt mask */
  124. /* Bit masks for ATAPI_INT_STATUS */
  125. #define ATAPI_DEV_INT 0x1 /* Device interrupt status */
  126. #define PIO_DONE_INT 0x2 /* PIO transfer done interrupt status */
  127. #define MULTI_DONE_INT 0x4 /* Multi-DMA transfer done interrupt status */
  128. #define UDMAIN_DONE_INT 0x8 /* Ultra-DMA in transfer done interrupt status */
  129. #define UDMAOUT_DONE_INT 0x10 /* Ultra-DMA out transfer done interrupt status */
  130. #define HOST_TERM_XFER_INT 0x20 /* Host terminate current transfer interrupt status */
  131. #define MULTI_TERM_INT 0x40 /* Device terminate Multi-DMA transfer interrupt status */
  132. #define UDMAIN_TERM_INT 0x80 /* Device terminate Ultra-DMA-in transfer interrupt status */
  133. #define UDMAOUT_TERM_INT 0x100 /* Device terminate Ultra-DMA-out transfer interrupt status */
  134. /* Bit masks for ATAPI_LINE_STATUS */
  135. #define ATAPI_INTR 0x1 /* Device interrupt to host line status */
  136. #define ATAPI_DASP 0x2 /* Device dasp to host line status */
  137. #define ATAPI_CS0N 0x4 /* ATAPI chip select 0 line status */
  138. #define ATAPI_CS1N 0x8 /* ATAPI chip select 1 line status */
  139. #define ATAPI_ADDR 0x70 /* ATAPI address line status */
  140. #define ATAPI_DMAREQ 0x80 /* ATAPI DMA request line status */
  141. #define ATAPI_DMAACKN 0x100 /* ATAPI DMA acknowledge line status */
  142. #define ATAPI_DIOWN 0x200 /* ATAPI write line status */
  143. #define ATAPI_DIORN 0x400 /* ATAPI read line status */
  144. #define ATAPI_IORDY 0x800 /* ATAPI IORDY line status */
  145. /* Bit masks for ATAPI_SM_STATE */
  146. #define PIO_CSTATE 0xf /* PIO mode state machine current state */
  147. #define DMA_CSTATE 0xf0 /* DMA mode state machine current state */
  148. #define UDMAIN_CSTATE 0xf00 /* Ultra DMA-In mode state machine current state */
  149. #define UDMAOUT_CSTATE 0xf000 /* ATAPI IORDY line status */
  150. /* Bit masks for ATAPI_TERMINATE */
  151. #define ATAPI_HOST_TERM 0x1 /* Host terminationation */
  152. /* Bit masks for ATAPI_REG_TIM_0 */
  153. #define T2_REG 0xff /* End of cycle time for register access transfers */
  154. #define TEOC_REG 0xff00 /* Selects DIOR/DIOW pulsewidth */
  155. /* Bit masks for ATAPI_PIO_TIM_0 */
  156. #define T1_REG 0xf /* Time from address valid to DIOR/DIOW */
  157. #define T2_REG_PIO 0xff0 /* DIOR/DIOW pulsewidth */
  158. #define T4_REG 0xf000 /* DIOW data hold */
  159. /* Bit masks for ATAPI_PIO_TIM_1 */
  160. #define TEOC_REG_PIO 0xff /* End of cycle time for PIO access transfers. */
  161. /* Bit masks for ATAPI_MULTI_TIM_0 */
  162. #define TD 0xff /* DIOR/DIOW asserted pulsewidth */
  163. #define TM 0xff00 /* Time from address valid to DIOR/DIOW */
  164. /* Bit masks for ATAPI_MULTI_TIM_1 */
  165. #define TKW 0xff /* Selects DIOW negated pulsewidth */
  166. #define TKR 0xff00 /* Selects DIOR negated pulsewidth */
  167. /* Bit masks for ATAPI_MULTI_TIM_2 */
  168. #define TH 0xff /* Selects DIOW data hold */
  169. #define TEOC 0xff00 /* Selects end of cycle for DMA */
  170. /* Bit masks for ATAPI_ULTRA_TIM_0 */
  171. #define TACK 0xff /* Selects setup and hold times for TACK */
  172. #define TENV 0xff00 /* Selects envelope time */
  173. /* Bit masks for ATAPI_ULTRA_TIM_1 */
  174. #define TDVS 0xff /* Selects data valid setup time */
  175. #define TCYC_TDVS 0xff00 /* Selects cycle time - TDVS time */
  176. /* Bit masks for ATAPI_ULTRA_TIM_2 */
  177. #define TSS 0xff /* Selects time from STROBE edge to negation of DMARQ or assertion of STOP */
  178. #define TMLI 0xff00 /* Selects interlock time */
  179. /* Bit masks for ATAPI_ULTRA_TIM_3 */
  180. #define TZAH 0xff /* Selects minimum delay required for output */
  181. #define READY_PAUSE 0xff00 /* Selects ready to pause */
  182. #endif /* __BFIN_PERIPHERAL_PATA__ */