hfc_sx.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /* $Id: hfc_sx.h,v 1.2.6.1 2001/09/23 22:24:48 kai Exp $
  2. *
  3. * specific defines for CCD's HFC 2BDS0 S+,SP chips
  4. *
  5. * Author Werner Cornelius
  6. * based on existing driver for CCD HFC PCI cards
  7. * Copyright by Werner Cornelius <werner@isdn4linux.de>
  8. *
  9. * This software may be used and distributed according to the terms
  10. * of the GNU General Public License, incorporated herein by reference.
  11. *
  12. */
  13. /*********************************************/
  14. /* thresholds for transparent B-channel mode */
  15. /* change mask and threshold simultaneously */
  16. /*********************************************/
  17. #define HFCSX_BTRANS_THRESHOLD 128
  18. #define HFCSX_BTRANS_THRESMASK 0x00
  19. /* GCI/IOM bus monitor registers */
  20. #define HFCSX_C_I 0x02
  21. #define HFCSX_TRxR 0x03
  22. #define HFCSX_MON1_D 0x0A
  23. #define HFCSX_MON2_D 0x0B
  24. /* GCI/IOM bus timeslot registers */
  25. #define HFCSX_B1_SSL 0x20
  26. #define HFCSX_B2_SSL 0x21
  27. #define HFCSX_AUX1_SSL 0x22
  28. #define HFCSX_AUX2_SSL 0x23
  29. #define HFCSX_B1_RSL 0x24
  30. #define HFCSX_B2_RSL 0x25
  31. #define HFCSX_AUX1_RSL 0x26
  32. #define HFCSX_AUX2_RSL 0x27
  33. /* GCI/IOM bus data registers */
  34. #define HFCSX_B1_D 0x28
  35. #define HFCSX_B2_D 0x29
  36. #define HFCSX_AUX1_D 0x2A
  37. #define HFCSX_AUX2_D 0x2B
  38. /* GCI/IOM bus configuration registers */
  39. #define HFCSX_MST_EMOD 0x2D
  40. #define HFCSX_MST_MODE 0x2E
  41. #define HFCSX_CONNECT 0x2F
  42. /* Interrupt and status registers */
  43. #define HFCSX_TRM 0x12
  44. #define HFCSX_B_MODE 0x13
  45. #define HFCSX_CHIP_ID 0x16
  46. #define HFCSX_CIRM 0x18
  47. #define HFCSX_CTMT 0x19
  48. #define HFCSX_INT_M1 0x1A
  49. #define HFCSX_INT_M2 0x1B
  50. #define HFCSX_INT_S1 0x1E
  51. #define HFCSX_INT_S2 0x1F
  52. #define HFCSX_STATUS 0x1C
  53. /* S/T section registers */
  54. #define HFCSX_STATES 0x30
  55. #define HFCSX_SCTRL 0x31
  56. #define HFCSX_SCTRL_E 0x32
  57. #define HFCSX_SCTRL_R 0x33
  58. #define HFCSX_SQ 0x34
  59. #define HFCSX_CLKDEL 0x37
  60. #define HFCSX_B1_REC 0x3C
  61. #define HFCSX_B1_SEND 0x3C
  62. #define HFCSX_B2_REC 0x3D
  63. #define HFCSX_B2_SEND 0x3D
  64. #define HFCSX_D_REC 0x3E
  65. #define HFCSX_D_SEND 0x3E
  66. #define HFCSX_E_REC 0x3F
  67. /****************/
  68. /* FIFO section */
  69. /****************/
  70. #define HFCSX_FIF_SEL 0x10
  71. #define HFCSX_FIF_Z1L 0x80
  72. #define HFCSX_FIF_Z1H 0x84
  73. #define HFCSX_FIF_Z2L 0x88
  74. #define HFCSX_FIF_Z2H 0x8C
  75. #define HFCSX_FIF_INCF1 0xA8
  76. #define HFCSX_FIF_DWR 0xAC
  77. #define HFCSX_FIF_F1 0xB0
  78. #define HFCSX_FIF_F2 0xB4
  79. #define HFCSX_FIF_INCF2 0xB8
  80. #define HFCSX_FIF_DRD 0xBC
  81. /* bits in status register (READ) */
  82. #define HFCSX_SX_PROC 0x02
  83. #define HFCSX_NBUSY 0x04
  84. #define HFCSX_TIMER_ELAP 0x10
  85. #define HFCSX_STATINT 0x20
  86. #define HFCSX_FRAMEINT 0x40
  87. #define HFCSX_ANYINT 0x80
  88. /* bits in CTMT (Write) */
  89. #define HFCSX_CLTIMER 0x80
  90. #define HFCSX_TIM3_125 0x04
  91. #define HFCSX_TIM25 0x10
  92. #define HFCSX_TIM50 0x14
  93. #define HFCSX_TIM400 0x18
  94. #define HFCSX_TIM800 0x1C
  95. #define HFCSX_AUTO_TIMER 0x20
  96. #define HFCSX_TRANSB2 0x02
  97. #define HFCSX_TRANSB1 0x01
  98. /* bits in CIRM (Write) */
  99. #define HFCSX_IRQ_SELMSK 0x07
  100. #define HFCSX_IRQ_SELDIS 0x00
  101. #define HFCSX_RESET 0x08
  102. #define HFCSX_FIFO_RESET 0x80
  103. /* bits in INT_M1 and INT_S1 */
  104. #define HFCSX_INTS_B1TRANS 0x01
  105. #define HFCSX_INTS_B2TRANS 0x02
  106. #define HFCSX_INTS_DTRANS 0x04
  107. #define HFCSX_INTS_B1REC 0x08
  108. #define HFCSX_INTS_B2REC 0x10
  109. #define HFCSX_INTS_DREC 0x20
  110. #define HFCSX_INTS_L1STATE 0x40
  111. #define HFCSX_INTS_TIMER 0x80
  112. /* bits in INT_M2 */
  113. #define HFCSX_PROC_TRANS 0x01
  114. #define HFCSX_GCI_I_CHG 0x02
  115. #define HFCSX_GCI_MON_REC 0x04
  116. #define HFCSX_IRQ_ENABLE 0x08
  117. /* bits in STATES */
  118. #define HFCSX_STATE_MSK 0x0F
  119. #define HFCSX_LOAD_STATE 0x10
  120. #define HFCSX_ACTIVATE 0x20
  121. #define HFCSX_DO_ACTION 0x40
  122. #define HFCSX_NT_G2_G3 0x80
  123. /* bits in HFCD_MST_MODE */
  124. #define HFCSX_MASTER 0x01
  125. #define HFCSX_SLAVE 0x00
  126. /* remaining bits are for codecs control */
  127. /* bits in HFCD_SCTRL */
  128. #define SCTRL_B1_ENA 0x01
  129. #define SCTRL_B2_ENA 0x02
  130. #define SCTRL_MODE_TE 0x00
  131. #define SCTRL_MODE_NT 0x04
  132. #define SCTRL_LOW_PRIO 0x08
  133. #define SCTRL_SQ_ENA 0x10
  134. #define SCTRL_TEST 0x20
  135. #define SCTRL_NONE_CAP 0x40
  136. #define SCTRL_PWR_DOWN 0x80
  137. /* bits in SCTRL_E */
  138. #define HFCSX_AUTO_AWAKE 0x01
  139. #define HFCSX_DBIT_1 0x04
  140. #define HFCSX_IGNORE_COL 0x08
  141. #define HFCSX_CHG_B1_B2 0x80
  142. /**********************************/
  143. /* definitions for FIFO selection */
  144. /**********************************/
  145. #define HFCSX_SEL_D_RX 5
  146. #define HFCSX_SEL_D_TX 4
  147. #define HFCSX_SEL_B1_RX 1
  148. #define HFCSX_SEL_B1_TX 0
  149. #define HFCSX_SEL_B2_RX 3
  150. #define HFCSX_SEL_B2_TX 2
  151. #define MAX_D_FRAMES 15
  152. #define MAX_B_FRAMES 31
  153. #define B_SUB_VAL_32K 0x0200
  154. #define B_FIFO_SIZE_32K (0x2000 - B_SUB_VAL_32K)
  155. #define B_SUB_VAL_8K 0x1A00
  156. #define B_FIFO_SIZE_8K (0x2000 - B_SUB_VAL_8K)
  157. #define D_FIFO_SIZE 512
  158. #define D_FREG_MASK 0xF
  159. /************************************************************/
  160. /* structure holding additional dynamic data -> send marker */
  161. /************************************************************/
  162. struct hfcsx_extra {
  163. unsigned short marker[2 * (MAX_B_FRAMES + 1) + (MAX_D_FRAMES + 1)];
  164. };
  165. extern void main_irq_hfcsx(struct BCState *bcs);
  166. extern void releasehfcsx(struct IsdnCardState *cs);