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

VxWorks

开发平台:

C/C++

  1. /* pccchip.h - Peripheral Channel Controller header */
  2. /* Copyright 1984-1996 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,06aug96,dat  merged from windView branch
  7. 01c,17sep93,dzb  added TIC_X_COUNTER register defines.
  8. 01b,22sep92,rrr  added support for c++
  9. 01a,16jun92,ccc  created.
  10. */
  11. /*
  12. DESCRIPTION
  13. This file contains I/O addresses and related constants for the PCC
  14. chip.  PCC_BASE_ADRS and PRINTER must be defined.
  15. */
  16. #ifndef __INCpccchiph
  17. #define __INCpccchiph
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /* PCC addresses */
  22. #define SCSI_DMA_TABLE_ADRS     ((long *) (PCC_BASE_ADRS + 0x00))
  23. #define SCSI_PCC_DMA_ADRS       ((long *) (PCC_BASE_ADRS + 0x04))
  24. #define SCSI_DMA_BYTE_COUNT     ((long *) (PCC_BASE_ADRS + 0x08))
  25. #define TIC_1_PRELOAD           ((short *)(PCC_BASE_ADRS + 0x10))
  26. #define TIC_2_PRELOAD           ((short *)(PCC_BASE_ADRS + 0x14))
  27. #define TIC_1_COUNTER           ((short *)(PCC_BASE_ADRS + 0x12))
  28. #define TIC_2_COUNTER           ((short *)(PCC_BASE_ADRS + 0x16))
  29. #define TIC_1_INT_CTL           ((char *) (PCC_BASE_ADRS + 0x18))
  30. #define TIC_1_CSR               ((char *) (PCC_BASE_ADRS + 0x19))
  31. #define TIC_2_INT_CTL           ((char *) (PCC_BASE_ADRS + 0x1a))
  32. #define TIC_2_CSR               ((char *) (PCC_BASE_ADRS + 0x1b))
  33. #define ACFAIL_INT_CTL          ((char *) (PCC_BASE_ADRS + 0x1c))
  34. #define WDOG_CSR                ((char *) (PCC_BASE_ADRS + 0x1d))
  35. #define BERR_INT_CTL            ((char *) (PCC_BASE_ADRS + 0x22))
  36. #define ABORT_INT_CTL           ((char *) (PCC_BASE_ADRS + 0x24))
  37. #define PRINTER_INT_CTL         ((char *) (PCC_BASE_ADRS + 0x1e))
  38. #define PRINTER_CSR             ((char *) (PCC_BASE_ADRS + 0x1f))
  39. #define PRINTER_DATA            ((char *) (PRINTER + 0x00))
  40. #define PRINTER_STATUS          ((char *) (PRINTER + 0x00))
  41. #define SCSI_DMA_INT_CTL        ((char *) (PCC_BASE_ADRS + 0x20))
  42. #define SCSI_DMA_CSR            ((char *) (PCC_BASE_ADRS + 0x21))
  43. #define SCSI_DMA_TABLE_FC       ((char *) (PCC_BASE_ADRS + 0x25))
  44. #define SCSI_INT_CTL            ((char *) (PCC_BASE_ADRS + 0x2a))
  45. #define SERIAL_INT_CTL          ((char *) (PCC_BASE_ADRS + 0x26))
  46. #define LAN_INT_CTL             ((char *) (PCC_BASE_ADRS + 0x28))
  47. #define SOFT_1_INT_CTL          ((char *) (PCC_BASE_ADRS + 0x2c))
  48. #define SOFT_2_INT_CTL          ((char *) (PCC_BASE_ADRS + 0x2e))
  49. #define GP_CTL                  ((char *) (PCC_BASE_ADRS + 0x27))
  50. #define GP_STATUS               ((char *) (PCC_BASE_ADRS + 0x29))
  51. #define INT_BASE_CTL            ((char *) (PCC_BASE_ADRS + 0x2d))
  52. #define SLAVE_BASE_CTL          ((char *) (PCC_BASE_ADRS + 0x2b))
  53. #define PCC_REVISION            ((char *) (PCC_BASE_ADRS + 0x2f))
  54. /* PCC register bit definitions */
  55. #define TIC_1_INT_CTL_CLEAR     0x80    /* Clear tic 1 interrupt        */
  56. #define TIC_1_INT_CTL_ENABLE    0x08    /* Enable tic 1 interrupt       */
  57. #define TIC_1_INT_CTL_DISABLE   0x00    /* Disable tic 1 interrupt      */
  58. #define TIC_1_CSR_CLR_OVF       0x04    /* Clear overflow counter       */
  59. #define TIC_1_CSR_ENABLE        0x03    /* Enable counter               */
  60. #define TIC_1_CSR_DISABLE       0x01    /* Disable tic 1 counter        */
  61. #define TIC_1_CSR_STOP          0x00    /* Load preload                 */
  62. #define TIC_2_INT_CTL_CLEAR     0x80    /* Clear tic 2 interrupt        */
  63. #define TIC_2_INT_CTL_ENABLE    0x08    /* Enable tic 2 interrupt       */
  64. #define TIC_2_INT_CTL_DISABLE   0x00    /* Disable tic 2 interrupt      */
  65. #define TIC_2_CSR_CLR_OVF       0x04    /* Clear overflow counter       */
  66. #define TIC_2_CSR_ENABLE        0x03    /* Enable counter               */
  67. #define TIC_2_CSR_DISABLE       0x01    /* Disable tic 2 counter        */
  68. #define TIC_2_CSR_STOP          0x00    /* Load preload                 */
  69. #define ACFAIL_INT_CTL_CLEAR    0x80    /* Clear AC fail interrupt      */
  70. #define ACFAIL_INT_CTL_ENABLE   0x08    /* Enable AC fail interrupt     */
  71. #define ACFAIL_INT_CTL_DISABLE  0x00    /* Disable AC fail interrupt    */
  72. #define WDOG_CSR_TO_CLEAR       0x08    /* Clear wDog time-out          */
  73. #define WDOG_CSR_WD_RESET       0x04    /* wDog activates reset         */
  74. #define WDOG_CSR_WD_CLEAR       0x02    /* Clear wDog                   */
  75. #define WDOG_CSR_ENABLE         0x01    /* Enable wDog                  */
  76. #define WDOG_CSR_DISABLE        0x00    /* Disable wDog                 */
  77. #define BERR_INT_CTL_CLEAR      0x80    /* Clear bus error interrupt    */
  78. #define BERR_INT_CTL_ENABLE     0x08    /* Enable bus error interrupt   */
  79. #define BERR_INT_CTL_DISABLE    0x00    /* Disable bus error interrupt  */
  80. #define ABORT_INT_CTL_CLEAR     0x80    /* Clear abort interrupt        */
  81. #define ABORT_INT_CTL_ENABLE    0x08    /* Enable abort interrupt       */
  82. #define ABORT_INT_CTL_DISABLE   0x00    /* Disable abort interrupt      */
  83. #define SERIAL_INT_CTL_VECT_IN  0x10    /* Interrupt vector from PCC    */
  84. #define SERIAL_INT_CTL_VCHIP    0x00    /* Interrupt vector from chip   */
  85. #define SERIAL_INT_CTL_ENABLE   0x08    /* Enable serial interrupt      */
  86. #define SERIAL_INT_CTL_DISABLE  0x00    /* Disable serial interrupt     */
  87. #define GP_CTL_RST_SW_DISABLE   0xa0    /* Disable front panel reset    */
  88. #define GP_CTL_RST_SW_ENABLE    0x00    /* Enable front panel reset     */
  89. #define GP_CTL_MASTER_INT_EN    0x10    /* Master interrupt enable      */
  90. #define GP_CTL_MASTER_INT_DIS   0x00    /* Master interrupt disable     */
  91. #define GP_CTL_LOCAL_TO_EN      0x08    /* Enable local bus timeout     */
  92. #define GP_CTL_LOCAL_TO_DIS     0x00    /* Disable local bus timeout    */
  93. #define GP_CTL_PARITY_DISABLE   0x00    /* Disable parity checking      */
  94. #define GP_CTL_PARITY_ENABLE    0x01    /* Enable parity checking       */
  95. #define GP_STATUS_PU_CLEAR      0x02    /* Clear power-up reset         */
  96. #define GP_STATUS_PARITY_CLEAR  0x01    /* Clear parity error           */
  97. #define LAN_INT_CTL_ENABLE      0x08    /* Enable LAN interrupt         */
  98. #define LAN_INT_CTL_DISABLE     0x00    /* Disable LAN interrupt        */
  99. #define SOFT_1_INT_CTL_ENABLE   0x08    /* Enable software 1 interrupt  */
  100. #define SOFT_1_INT_CTL_DISABLE  0x00    /* Disable software 1 interrupt */
  101. #define SOFT_2_INT_CTL_ENABLE   0x08    /* Enable software 2 interrupt  */
  102. #define SOFT_2_INT_CTL_DISABLE  0x00    /* Disable software 2 interrupt */
  103. #define PRNT_INT_CTL_CLR_FAULT  0x40    /* Clear fault interrupt        */
  104. #define PRNT_INT_CTL_CLR_ACK    0x20    /* Clear ACK interrupt          */
  105. #define PRNT_INT_CTL_ACK_FALL   0x10    /* ACK on falling edge          */
  106. #define PRNT_INT_CTL_ACK_RISE   0x00    /* ACK on rising edge           */
  107. #define PRNT_INT_CTL_ENABLE     0x08    /* Enable printer interrupt     */
  108. #define PRNT_INT_CTL_DISABLE    0x00    /* Disable printer interrupt    */
  109. #define DMA_INT_CTL_PENDING     0x80    /* Interrupt pending            */
  110. #define DMA_INT_CTL_CLEAR       0x80    /* Clear pending interrupt      */
  111. #define DMA_INT_CTL_ENABLE      0x08    /* Enable DMA interrupt         */
  112. #define DMA_INT_CTL_DISABLE     0x00    /* Disable DMA interrupt        */
  113. #define DMA_CSR_ENABLE          0x01    /* Enable DMA controller        */
  114. #define DMA_CSR_DISABLE         0x00    /* Disable DMA controller       */
  115. #define DMA_CSR_TW              0x02    /* Use table address register   */
  116. #define DMA_CSR_READ            0x00    /* Transfer from SCSI bus       */
  117. #define DMA_CSR_WRITE           0x04    /* Transfer to SCSI bus         */
  118. #define SCSI_INT_CTL_RESET      0x40    /* Reset SCSI interrupt         */
  119. #define SCSI_INT_CTL_BUS_RESET  0x10    /* Reset SCSI bus               */
  120. #define SCSI_INT_CTL_ENABLE     0x08    /* Enable SCSI interrupt        */
  121. #define SCSI_INT_CTL_DISABLE    0x00    /* Disable SCSI interrupt       */
  122. /* function declarations */
  123. #ifndef _ASMLANGUAGE
  124. #if defined(__STDC__) || defined(__cplusplus)
  125. #if CPU_FAMILY == I960
  126. IMPORT STATUS sysIntDisable ();
  127. IMPORT STATUS sysIntEnable ();
  128. IMPORT int sysBusIntAck ();
  129. IMPORT STATUS sysBusIntGen ();
  130. IMPORT STATUS sysMailboxEnable ();
  131. #else /* CPU_FAMILY == I960 */
  132. IMPORT STATUS sysIntDisable (int intLevel);
  133. IMPORT STATUS sysIntEnable (int intLevel);
  134. IMPORT int sysBusIntAck (int intLevel);
  135. IMPORT STATUS sysBusIntGen (int level, int vector);
  136. IMPORT STATUS sysMailboxEnable (char *mailboxAdrs);
  137. #endif /* CPU_FAMILY == I960 */
  138. IMPORT STATUS sysMailboxConnect (FUNCPTR routine, int arg);
  139. #else /* __STDC__ */
  140. IMPORT STATUS sysIntDisable ();
  141. IMPORT STATUS sysIntEnable ();
  142. IMPORT int sysBusIntAck ();
  143. IMPORT STATUS sysBusIntGen ();
  144. IMPORT STATUS sysMailboxEnable ();
  145. IMPORT STATUS sysMailboxConnect ();
  146. #endif /* __STDC__ */
  147. #endif /* _ASMLANGUAGE */
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #endif /* __INCpccchiph */