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

VxWorks

开发平台:

C/C++

  1. /* mpc107Msg.h - MPC107 Message Unit  register numbers and values  */
  2. /* Copyright 1984-2000 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,06jun00,bri written
  7. */
  8. #ifndef __INCmpc107Msgh
  9. #define __INCmpc107Msgh
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /* includes */
  14. #include "mpc107.h"
  15. /* defines */
  16. /* MPC107 configuration registers for Message Unit  */
  17. #define MPC107_MSG_IMR0     0x50  /* Inbound message register 0 */
  18. #define MPC107_MSG_IMR1     0x54  /* Inbound message register 1 */
  19. #define MPC107_MSG_OMR0     0x58  /* Outbound message register 0 */
  20. #define MPC107_MSG_OMR1     0x5C  /* Outbound message register 1 */
  21. #define MPC107_MSG_ODBR     0x60  /* Outbound doorbell register */
  22. #define MPC107_MSG_IDBR     0x68  /* Inbound doorbell register */
  23. #define MPC107_MSG_EDBMR    0x70  /* Extended doorbell mask register */
  24. #define MPC107_MSG_EDBSR    0x78  /* Extended doorbell status register */
  25. #define MPC107_MSG_EDBW1C   0x80  /* Extended doorbell write 1 clear register */
  26. #define MPC107_MSG_EDBW1S   0x88  /* Extended doorbell write 1 set register */
  27. /* MPC107 Configuration registers for I2O */
  28. #define MPC107_MSG_I2O_IMISR    0x100 /* Inbound message interrupt status reg */
  29. #define MPC107_MSG_I2O_IMIMR    0x104 /* Inbound message interrupt mask reg */
  30. #define MPC107_MSG_I2O_IFHPR    0x120 /* Inbound free_FIFO head pointer reg */
  31. #define MPC107_MSG_I2O_IFTPR    0x128 /* Inbound free_FIFO tail pointer reg */
  32. #define MPC107_MSG_I2O_IPHPR    0x130 /* Inbound post_FIFO head pointer reg */
  33. #define MPC107_MSG_I2O_IPTPR    0x138 /* Inbound post_FIFO tail pointer reg */
  34. #define MPC107_MSG_I2O_OFHPR    0x140 /* Outbound free_FIFO head pointer reg */
  35. #define MPC107_MSG_I2O_OFTPR    0x148 /* Outbound free_FIFO tail pointer reg */
  36. #define MPC107_MSG_I2O_OPHPR    0x150 /* Outbound post_FIFO head pointer reg */
  37. #define MPC107_MSG_I2O_OPTPR    0x158 /* Outbound post_FIFO tail pointer reg */
  38. #define MPC107_MSG_I2O_MUCR     0x164 /* Messaging unit control reg */
  39. #define MPC107_MSG_I2O_QBAR     0x170 /* Queue base address register */
  40. #define MPC107_MSG_I2O_PCI_OMISR    0x30 /* Outbound message int status Reg */
  41. #define MPC107_MSG_I2O_PCI_OMIMR    0x34 /* Outbound message int mask Reg */
  42. #define MPC107_MSG_I2O_PCI_IFQPR    0x40 /* Inbound FIFO queue port reg */
  43. #define MPC107_MSG_I2O_PCI_OFQPR    0x44 /* Outbound FIFO queue port reg */
  44. /* Message Unit (I2O) Register Bit Definitions */
  45. /* Outbound Message Interrupt Status Register */
  46. #define MPC107_MSG_I2O_OPQI 0x00000020  /* Outbound Post Queue Interrupt */
  47. #define MPC107_MSG_I2O_ODI      0x00000008  /* Outbound Doorbell Interrupt */
  48. #define MPC107_MSG_I2O_OM1I     0x00000002  /* Outbound Message 1 Interrupt */
  49. #define MPC107_MSG_I2O_OM0I     0x00000001  /* Outbound Message 0 Interrupt */
  50. /* Outbound Message Interrupt Mask Register */
  51. #define MPC107_MSG_I2O_OPQIM    0x00000020  /* Out Post Queue Interrupt Mask */
  52. #define MPC107_MSG_I2O_ODIM     0x00000008  /* Out Doorbell Interrupt Mask */
  53. #define MPC107_MSG_I2O_OM1IM    0x00000002  /* Outbound Msg 1 Interrupt Mask */
  54. #define MPC107_MSG_I2O_OM0IM    0x00000001  /* Outbound Msg 0 Interrupt Mask */
  55. /* Inbound Message Interrupt Status Register */
  56. #define MPC107_MSG_I2O_OFOI 0x00000100  /* Outbound Free Overflow Int */
  57. #define MPC107_MSG_I2O_IPOI 0x00000080  /* Inbound Post Overflow Int */
  58. #define MPC107_MSG_I2O_IPQI     0x00000020  /* Inbound Post Queue Interrupt */
  59. #define MPC107_MSG_I2O_MCI 0x00000010  /* Machine Check Interrupt */
  60. #define MPC107_MSG_I2O_IDI      0x00000008  /* Inbound Doorbell Interrupt */
  61. #define MPC107_MSG_I2O_IM1I     0x00000002  /* Inbound Message 1 Interrupt */
  62. #define MPC107_MSG_I2O_IM0I     0x00000001  /* Inbound Message 0 Interrupt */
  63. /* Inbound Message Interrupt Mask Register */
  64. #define MPC107_MSG_I2O_OFOIM    0x00000100  /* Outbound Free Ovrflow Mask */
  65. #define MPC107_MSG_I2O_IPOIM    0x00000080  /* Inbound Post Overflow Mask */
  66. #define MPC107_MSG_I2O_IPQIM    0x00000020  /* Inbound Post Queue Mask */
  67. #define MPC107_MSG_I2O_MCIM     0x00000010  /* Machine Check Mask */
  68. #define MPC107_MSG_I2O_IDIM     0x00000008  /* Inbound Doorbell Mask */
  69. #define MPC107_MSG_I2O_IM1IM    0x00000002  /* Inbound Message 1 Mask */
  70. #define MPC107_MSG_I2O_IM0IM    0x00000001  /* Inbound Message 0 Mask */
  71. /* Inbound FIFO Pointer Registers */
  72. #define MPC107_MSG_I2O_IN_QBA    0xfff00000 /* Inbound Queue Base Addr */
  73. #define MPC107_MSG_I2O_IN_FIFOPTR  0x000ffffc /* In FIFO pointer offset */
  74. /* Outbound FIFO Pointer Registers */
  75. #define MPC107_MSG_I2O_OUT_QBA      0xfff00000   /* Outbound Queue Base Addr */
  76. #define MPC107_MSG_I2O_OUT_FIFOPTR  0x000ffffc   /* Out FIFO pointer offset */
  77. /* I2O Messaging Unit Control Register */
  78. #define MPC107_MSG_I2O_CQS      0x0000003e  /* circular queue size mask */
  79. #define MPC107_MSG_I2O_CQS_16K     0x00000002  /* 4K entries, 16K bytes */
  80. #define MPC107_MSG_I2O_CQS_32K     0x00000004  /* 8K entries, 32K bytes */
  81. #define MPC107_MSG_I2O_CQS_64K     0x00000008  /* 16K entries, 64K bytes */
  82. #define MPC107_MSG_I2O_CQS_128K     0x00000010  /* 32K entries, 128K bytes */
  83. #define MPC107_MSG_I2O_CQS_256K     0x00000020  /* 64K entries, 256K bytes */
  84. #define MPC107_MSG_I2O_CQE     0x00000001  /* circular queue enable */
  85. #define MPC107_MSG_I2O_MUCR_DEFAULT MPC107_MSG_I2O_CQS_16K /* Default CQ Size */
  86. #define MPC107_MSG_I2O_CQS_ALIGN    20          /* 1 Mb Memory alignment */
  87. #define MPC107_MSG_16KSIZE          0x1000                 /* 4K Words */
  88. #define MPC107_MSG_I2O_CQS_16K_SIZE    (MPC107_MSG_16KSIZE * 1) /* 4K Words */
  89. #define MPC107_MSG_I2O_CQS_32K_SIZE    (MPC107_MSG_16KSIZE * 2) /* 8K Words */
  90. #define MPC107_MSG_I2O_CQS_64K_SIZE    (MPC107_MSG_16KSIZE * 4) /* 16K Words */
  91. #define MPC107_MSG_I2O_CQS_128K_SIZE   (MPC107_MSG_16KSIZE * 8) /* 32K Words */
  92. #define MPC107_MSG_I2O_CQS_256K_SIZE   (MPC107_MSG_16KSIZE * 16)/* 64K Words */
  93. #define MPC107_MSG_I2O_MFRAME_SIZE  0x20 /* Message Frame size 128 bytes */
  94.                                              /* 32 words  */
  95. #define MPC107_MSG_I2O_MUCR_QBAR_ALIGN    0x100000 /* 1 Mbytes */
  96. /* Inbound/Outbound Door Bell Register Definitions */
  97. #define MPC107_MSG_IDBR_DATA_MASK   0xefffffff /* IDBR Data Mask */
  98. #define MPC107_MSG_IDBR_MC_SHIFT    31         /* IDBReg Machine Check Mask */
  99. #define MPC107_MSG_IDBR_MC_BIT     0x80000000    /* IDBR Machine Check Bit */
  100. #define MPC107_MSG_ODBR_DATA_MASK   0x1fffffff /* ODBR Data Mask */
  101. /* Extended Doorbell register definitions */
  102. #define MPC107_MSG_EDBMR_INTAIM_BIT   0x00000001 /* EDMBR INTA */
  103.                                                  /* Interrupt mask bit */
  104. #define MPC107_MSG_EDBMR_C0IM_BIT     0x00000008 /* EDMBR CPU */
  105.                                                  /* Interrupt mask bit */
  106. #define MPC107_MSG_EDBW1S_INTA_MSK    0xff000000 /* EDBW1S Reg INTA mask */
  107. #define MPC107_MSG_EDBW1S_INTA_SHIFT  24         /* EDBW1S Reg INTA shift */
  108. #define MPC107_MSG_EDBW1S_CP0_MSK     0x00ff0000 /* EDBW1S Reg CPU INT mask */
  109. #define MPC107_MSG_EDBW1S_CP0_SHIFT   16         /* EDBW1S Reg CPU INT shift */
  110. /* I2O Queue Base Address Register */
  111. #define MPC107_MSG_I2O_QBA 0xfff00000  /* queue base address bits */
  112. /* General definitions */
  113. #define MPC107_MSG_WRITE            0x0  /* Read */
  114. #define MPC107_MSG_READ             0x1  /* Write */
  115. #define MPC107_MSG_READ_OR_WRITE    0x2  /* Read OR Write */
  116. #define MPC107_MSG_READ_AND_WRITE   0x3  /* Read AND Write */
  117. #define MPC107_MSG_READ_ANDOR_WRITE 0x4  /* Read ANDOR Write */
  118. #define MPC107_MSG_INBOUND     0x01 /* In Bound */
  119. #define MPC107_MSG_OUTBOUND         0x02 /* Out Bound*/
  120. #define MPC107_MSG_GENERAL_LSB_MSK 0xff /* LSB Mask */
  121. #define MPC107_MSG_INTAGEN 0x0       /* Generate INTA Interrupt */
  122. #define MPC107_MSG_CP0GEN 0x1       /* Generate CPU Interrupt */
  123. #define MPC107_MSG_REGISTER0    0x0   /* Message Regiter 0 */
  124. #define MPC107_MSG_REGISTER1    0x1       /* Message Regiter 1 */
  125. #define MPC107_MSG_I2O_NO_FREE_MFA   0xffffffff  /* No MFA's are available */
  126. #define MPC107_MSG_I2O_FIFO_EMPTY    0xffffffff  /* FIFO is empty   */
  127. /* error Values  */
  128. #define MPC107_MSG_CHOUT_RANGE      0x10   /* Channel out of range */
  129. #define MPC107_MSG_REGOUT_RANGE     0x11   /* Register out of range */
  130. #define MPC107_MSG_UNDEF_REG        0x12   /* Undefined Register */
  131. #define MPC107_MSG_UNDEF_INT_TYPE   0x13   /* Undefined Interrupt type */
  132. /* function declarations */
  133. IMPORT void  mpc107MsgMessageHostInit(void);
  134. IMPORT void  mpc107MsgMessagePeripheralInit(void);
  135. IMPORT STATUS  mpc107MsgExtDoorbellInit (UINT32 cpuIntA);
  136. IMPORT STATUS  mpc107MsgMessageWrite (UINT32 inOutBound,
  137.                                        UINT32 messageRegNum,
  138.                                        UINT32 message);
  139. IMPORT STATUS  mpc107MsgMessageRead (UINT32 inOutBound, UINT32 messageRegNum,
  140.                                       UINT32 *pMessageRead );
  141. IMPORT STATUS  mpc107MsgDoorbellWrite (UINT32 inOutBound, UINT32 message,
  142.                                         UINT32 machineCheck);
  143. IMPORT STATUS  mpc107MsgDoorbellRead (UINT32 inOutBound,
  144.                                        UINT32 *pMsgDoorbellRead);
  145. IMPORT STATUS  mpc107MsgExtDoorbellSetWrite (UINT32 message, UINT32 cpuIntA);
  146. IMPORT ULONG  mpc107MsgExtDoorbellClrRead (void);
  147. IMPORT STATUS  mpc107MsgI2oInit (void);
  148. IMPORT void  mpc107MsgI2oInboundRead (void);
  149. IMPORT STATUS mpc107MsgI2oInboundWrite (UINT32 *pBuf);
  150. IMPORT void  mpc107MsgI2oOutboundRead (void);
  151. IMPORT void  mpc107MsgI2oOutboundWrite (UINT32 *pBuf);
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155. #endif /* __INCmpc107Msgh */