m68450.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:7k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* m68450.h - Tadpole TP32V system dependent library */
  2. /* Copyright 1984-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,26apr02,dat  Adding cplusplus protection, SPR 75017
  7. 01d,14mar95,vin  included in the h/drv/dma directory. included copyright.
  8. 01c,07sep93,vin  added dma channel macros and definitions made more generic;
  9.  changed the name of the file from scsiDma.h to m68450.h
  10. 01b,22jan91,tad  rewritten to conform to Wind River coding standards.
  11. 01a,01oct87,tad  written.
  12. */
  13. /*
  14. DESCRIPTION
  15. This module contains definitions needed when using the 68450 DMA controller
  16. on the Tadpole TP32V. The following macros need to be defined in target.h.
  17. DMAC_ADRS,DMAC_CHANNEL_0_OFFSET,DMAC_CHANNEL_1_OFFSET,DMAC_CHANNEL_2_OFFSET
  18. DMAC_CHANNEL_3_OFFSET,DMA_GCR
  19. */
  20. #ifndef __INCm68450h
  21. #define __INCm68450h
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #ifndef _ASMLANGUAGE
  26. /* This structure defines the register layout of the device in memory */
  27. struct dmaRegisters
  28.     {
  29.     UINT8 csr; /* Channel status register */
  30.     UINT8 cer; /* Channel error register */
  31.     UINT8 pad1[2];
  32.     UINT8 dcr; /* Device control register */
  33.     UINT8 ocr; /* Operation control register */
  34.     UINT8 scr; /* Sequence control register */
  35.     UINT8 ccr; /* Channel control register */
  36.     UINT8 pad2[2];
  37.     UINT16 mtcr; /* Memory transfer count register */
  38.     UINT32 mar; /* Memory address register */
  39.     UINT8 pad3[4];
  40.     UINT32 dar; /* Device address register  */
  41.     UINT8 pad4[2];
  42.     UINT16 btcr; /* Base transfer count register */
  43.     UINT32 bar; /* Base address register */
  44.     UINT8 pad5[5];
  45.     UINT8 nivr; /* Normal interrupt vector reg */
  46.     UINT8 pad6[1];
  47.     UINT8 eivr; /* Error interrupt vector reg */
  48.     UINT8 pad7[1];
  49.     UINT8 mfcr; /* Memory function code register */
  50.     UINT8 pad8[3];
  51.     UINT8 cpr; /* Channel priority register */
  52.     UINT8 pad9[3];
  53.     UINT8 dfcr; /* Device function code register */
  54.     UINT8 pad10[7];
  55.     UINT8 bfcr; /* Base function code register */
  56.     };
  57. /* Bitfield masks for registers in the dmaRegisters structure */
  58. /* DCR */
  59. #define DMA_XRM 0xC0 /* External request mode */
  60. #define DMA_DTYP 0x30 /* Device type */
  61. #define DMA_DPS 0x08 /* Device port size */
  62. #define DMA_PCL 0x07 /* Peripheral control line function */
  63. /* OCR */
  64. #define DMA_DIR 0x80 /* Transfer direction */
  65. #define DMA_SIZE 0x30 /* Operand size */
  66. #define DMA_CHAIN 0x0C /* Chain operation */
  67. #define DMA_REQG 0x03 /* Request generation */
  68. /* SCR */
  69. #define DMA_MAC 0x0C /* Memory address count */
  70. #define DMA_DAC 0x03 /* Device address count */
  71. /* CCR */
  72. #define DMA_STR 0x80 /* Start operation */
  73. #define DMA_CNT 0x40 /* Continue operation */
  74. #define DMA_HLT 0x20 /* Halt operation */
  75. #define DMA_SAB 0x10 /* Software abort */
  76. #define DMA_INT 0x08 /* Interrupt enable */
  77. /* CSR */
  78. #define DMA_COC 0x80 /* Channel operation complete */
  79. #define DMA_BTC 0x40 /* Block transfer complete */
  80. #define DMA_NDT 0x20 /* Normal device termination */
  81. #define DMA_ERR 0x10 /* Error */
  82. #define DMA_ACT 0x08 /* Channel active */
  83. #define DMA_PCT 0x02 /* PCL transition */
  84. #define DMA_PCS 0x01 /* PCL state */
  85. /* GCR */
  86. #define DMA_BT 0x0C /* Burst transfer time */
  87. #define DMA_BR 0x03 /* Bandwidth available to DMAC */
  88. /* Bitfield definitions for DCR */
  89. /* XRM */
  90. #define DMA_BURST 0x00 /* Burst transfer mode */
  91. #define DMA_CYCNH 0x80 /* Cycle steal without hold */
  92. #define DMA_CYCWH 0xC0 /* Cycle stel with hold */
  93. /* DTYP */
  94. #define DMA_THOU 0x00 /* 68000 compatible, explicitly addressed */
  95. #define DMA_HUN 0x10 /* 6800 compatible, explicitly addressed */
  96. #define DMA_ACK 0x20 /* Device with ACK */
  97. #define DMA_ACKRDY 0x30 /* Device with ACK & RDY */
  98. /* DPS */
  99. #define DMA_PORT8 0x00 /* 8-bit port */
  100. #define DMA_PORT16 0x08 /* 16-bit port */
  101. /* PCL */
  102. #define DMA_STATUSINP 0x00 /* Status input (level read in CSR) */
  103. #define DMA_STATINPINT 0x01 /* Status input with interrupt */
  104. #define DMA_SPULSE 0x02 /* Start pulse output */
  105. #define DMA_ABINP 0x03 /* Abort input */
  106. /* Bitfield definitions for OCR */
  107. /* DIR */
  108. #define DMA_MEMDEV 0x00 /* Memory to device */
  109. #define DMA_DEVMEM 0x80 /* Device to memory */
  110. /* SIZE */
  111. #define DMA_SZBYTE 0x00 /* Byte */
  112. #define DMA_SZWORD 0x10 /* Word */
  113. #define DMA_SZLWORD 0x20 /* Long word */
  114. #define DMA_SZBYTENP 0x30 /* Byte, no packing */
  115. /* CHAIN */
  116. #define DMA_CHAINDIS 0x00 /* Chaining disabled */
  117. #define DMA_CHAINARR 0x08 /* Array chaining enabled */
  118. #define DMA_CHAINARL 0x0C /* Linked array chaining enabled */
  119. /* REQG */
  120. #define DMA_INTLIM 0x00 /* Internal request at limited rate */
  121. #define DMA_INTMAX 0x01 /* Internal request at maximum rate */
  122. #define DMA_EXTERN 0x02 /* External request */
  123. #define DMA_EXTAUTO 0x03 /* External request, auto-start */
  124. /* Bitfield definitions for SCR */
  125. /* MAC */
  126. #define DMA_MNOCNT 0x00 /* MAR does not count */
  127. #define DMA_MUPCNT 0x04 /* MAR counts up */
  128. #define DMA_MDNCNT 0x80 /* MAR counts down */
  129. /* DAC */
  130. #define DMA_DNOCNT 0x00 /* DAR does not count */
  131. #define DMA_DUPCNT 0x01 /* DAR counts up */
  132. #define DMA_DDNCNT 0x20 /* DAR counts down */
  133. /* Bitfield definitions for CER */
  134. /* ERROR CODE */
  135. #define DMA_NOERR 0x00 /* No error */
  136. #define DMA_CONFIGERR 0x01 /* Configuration error */
  137. #define DMA_TIMEERR 0x02 /* Operation timing error */
  138. #define DMA_AMERR 0x05 /* Address error, MAR or MTCR */
  139. #define DMA_ADERR 0x06 /* Address error, DAR */
  140. #define DMA_ABERR 0x07 /* Address error, BAR or BTCR */
  141. #define DMA_BMERR 0x09 /* Bus error, MAR or MTCR */
  142. #define DMA_BDERR 0x0A /* Bus error, DAR */
  143. #define DMA_BBERR 0x0B /* Bus error, BAR or BTCR */
  144. #define DMA_CMERR 0x0D /* Count error, MAR or MTCR */
  145. #define DMA_CDERR 0x0E /* Count error, DAR */
  146. #define DMA_CBERR 0x0F /* Count error, BAR or BTCR */
  147. #define DMA_EXTAB 0x10 /* External abort */
  148. #define DMA_SFTAB 0x11 /* Software abort */
  149. /* Bitfield definitions for GCR */
  150. /* BT */
  151. #define DMA_BT16 0x00 /* 16 clocks */
  152. #define DMA_BT32 0x04 /* 32 clocks */
  153. #define DMA_BT64 0x08 /* 64 clocks */
  154. #define DMA_BT128 0x0C /* 128 clocks */
  155. /* BR */
  156. #define DMA_BW50 0x00 /* 50.00% bandwidth */
  157. #define DMA_BW25 0x01 /* 25.00% bandwidth */
  158. #define DMA_BW12 0x02 /* 12.50% bandwidth */
  159. #define DMA_BW6 0x03 /* 6.25% bandwidth */
  160. #define DMA_0 ((struct dmaRegisters *) DMAC_ADRS + 
  161.  DMAC_CHANNEL_0_OFFSET)
  162. #define DMA_1           ((struct dmaRegisters *) DMAC_ADRS + 
  163.  DMAC_CHANNEL_1_OFFSET)
  164. #define DMA_2           ((struct dmaRegisters *) DMAC_ADRS + 
  165.  DMAC_CHANNEL_2_OFFSET)
  166. #define DMA_3           ((struct dmaRegisters *) DMAC_ADRS + 
  167.  DMAC_CHANNEL_3_OFFSET)
  168. #endif  /* _ASMLANGUAGE */
  169. #ifdef __cplusplus
  170. }
  171. #endif
  172. #endif /* __INCm68450h  */