smsc-ircc2.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /*********************************************************************
  2. *
  3. * Description: Definitions for the SMC IrCC chipset
  4. * Status: Experimental.
  5. * Author: Daniele Peri (peri@csai.unipa.it)
  6. *
  7. * Copyright (c) 2002 Daniele Peri
  8. * All Rights Reserved.
  9. *
  10. * Based on smc-ircc.h:
  11. *
  12. * Copyright (c) 1999-2000, Dag Brattli <dagb@cs.uit.no>
  13. * Copyright (c) 1998-1999, Thomas Davis (tadavis@jps.net>
  14. * All Rights Reserved
  15. *
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  30. * MA 02111-1307 USA
  31. *
  32. ********************************************************************/
  33. #ifndef SMSC_IRCC2_H
  34. #define SMSC_IRCC2_H
  35. /* DMA modes needed */
  36. #define DMA_TX_MODE 0x08 /* Mem to I/O, ++, demand. */
  37. #define DMA_RX_MODE 0x04 /* I/O to mem, ++, demand. */
  38. /* Master Control Register */
  39. #define IRCC_MASTER 0x07
  40. #define IRCC_MASTER_POWERDOWN 0x80
  41. #define IRCC_MASTER_RESET 0x40
  42. #define IRCC_MASTER_INT_EN 0x20
  43. #define IRCC_MASTER_ERROR_RESET 0x10
  44. /* Register block 0 */
  45. /* Interrupt Identification */
  46. #define IRCC_IIR 0x01
  47. #define IRCC_IIR_ACTIVE_FRAME 0x80
  48. #define IRCC_IIR_EOM 0x40
  49. #define IRCC_IIR_RAW_MODE 0x20
  50. #define IRCC_IIR_FIFO 0x10
  51. /* Interrupt Enable */
  52. #define IRCC_IER 0x02
  53. #define IRCC_IER_ACTIVE_FRAME 0x80
  54. #define IRCC_IER_EOM 0x40
  55. #define IRCC_IER_RAW_MODE 0x20
  56. #define IRCC_IER_FIFO 0x10
  57. /* Line Status Register */
  58. #define IRCC_LSR 0x03
  59. #define IRCC_LSR_UNDERRUN 0x80
  60. #define IRCC_LSR_OVERRUN 0x40
  61. #define IRCC_LSR_FRAME_ERROR 0x20
  62. #define IRCC_LSR_SIZE_ERROR 0x10
  63. #define IRCC_LSR_CRC_ERROR 0x80
  64. #define IRCC_LSR_FRAME_ABORT 0x40
  65. /* Line Status Address Register */
  66. #define IRCC_LSAR 0x03
  67. #define IRCC_LSAR_ADDRESS_MASK 0x07
  68. /* Line Control Register A */
  69. #define IRCC_LCR_A 0x04
  70. #define IRCC_LCR_A_FIFO_RESET 0x80
  71. #define IRCC_LCR_A_FAST 0x40
  72. #define IRCC_LCR_A_GP_DATA 0x20
  73. #define IRCC_LCR_A_RAW_TX 0x10
  74. #define IRCC_LCR_A_RAW_RX 0x08
  75. #define IRCC_LCR_A_ABORT 0x04
  76. #define IRCC_LCR_A_DATA_DONE 0x02
  77. /* Line Control Register B */
  78. #define IRCC_LCR_B 0x05
  79. #define IRCC_LCR_B_SCE_DISABLED 0x00
  80. #define IRCC_LCR_B_SCE_TRANSMIT 0x40
  81. #define IRCC_LCR_B_SCE_RECEIVE 0x80
  82. #define IRCC_LCR_B_SCE_UNDEFINED 0xc0
  83. #define IRCC_LCR_B_SIP_ENABLE 0x20
  84. #define IRCC_LCR_B_BRICK_WALL 0x10
  85. /* Bus Status Register */
  86. #define IRCC_BSR 0x06
  87. #define IRCC_BSR_NOT_EMPTY 0x80
  88. #define IRCC_BSR_FIFO_FULL 0x40
  89. #define IRCC_BSR_TIMEOUT 0x20
  90. /* Register block 1 */
  91. #define IRCC_FIFO_THRESHOLD 0x02
  92. #define IRCC_SCE_CFGA 0x00
  93. #define IRCC_CFGA_AUX_IR 0x80
  94. #define IRCC_CFGA_HALF_DUPLEX 0x04
  95. #define IRCC_CFGA_TX_POLARITY 0x02
  96. #define IRCC_CFGA_RX_POLARITY 0x01
  97. #define IRCC_CFGA_COM 0x00
  98. #define IRCC_SCE_CFGA_BLOCK_CTRL_BITS_MASK 0x87
  99. #define IRCC_CFGA_IRDA_SIR_A 0x08
  100. #define IRCC_CFGA_ASK_SIR 0x10
  101. #define IRCC_CFGA_IRDA_SIR_B 0x18
  102. #define IRCC_CFGA_IRDA_HDLC 0x20
  103. #define IRCC_CFGA_IRDA_4PPM 0x28
  104. #define IRCC_CFGA_CONSUMER 0x30
  105. #define IRCC_CFGA_RAW_IR 0x38
  106. #define IRCC_CFGA_OTHER 0x40
  107. #define IRCC_IR_HDLC 0x04
  108. #define IRCC_IR_4PPM 0x01
  109. #define IRCC_IR_CONSUMER 0x02
  110. #define IRCC_SCE_CFGB 0x01
  111. #define IRCC_CFGB_LOOPBACK 0x20
  112. #define IRCC_CFGB_LPBCK_TX_CRC 0x10
  113. #define IRCC_CFGB_NOWAIT 0x08
  114. #define IRCC_CFGB_STRING_MOVE 0x04
  115. #define IRCC_CFGB_DMA_BURST 0x02
  116. #define IRCC_CFGB_DMA_ENABLE 0x01
  117. #define IRCC_CFGB_MUX_COM 0x00
  118. #define IRCC_CFGB_MUX_IR 0x40
  119. #define IRCC_CFGB_MUX_AUX 0x80
  120. #define IRCC_CFGB_MUX_INACTIVE 0xc0
  121. /* Register block 3 - Identification Registers! */
  122. #define IRCC_ID_HIGH 0x00 /* 0x10 */
  123. #define IRCC_ID_LOW 0x01 /* 0xB8 */
  124. #define IRCC_CHIP_ID 0x02 /* 0xF1 */
  125. #define IRCC_VERSION 0x03 /* 0x01 */
  126. #define IRCC_INTERFACE 0x04 /* low 4 = DMA, high 4 = IRQ */
  127. #define IRCC_INTERFACE_DMA_MASK 0x0F /* low 4 = DMA, high 4 = IRQ */
  128. #define IRCC_INTERFACE_IRQ_MASK 0xF0 /* low 4 = DMA, high 4 = IRQ */
  129. /* Register block 4 - IrDA */
  130. #define IRCC_CONTROL 0x00
  131. #define IRCC_BOF_COUNT_LO 0x01 /* Low byte */
  132. #define IRCC_BOF_COUNT_HI 0x00 /* High nibble (bit 0-3) */
  133. #define IRCC_BRICKWALL_CNT_LO 0x02 /* Low byte */
  134. #define IRCC_BRICKWALL_CNT_HI 0x03 /* High nibble (bit 4-7) */
  135. #define IRCC_TX_SIZE_LO 0x04 /* Low byte */
  136. #define IRCC_TX_SIZE_HI 0x03 /* High nibble (bit 0-3) */
  137. #define IRCC_RX_SIZE_HI 0x05 /* High nibble (bit 0-3) */
  138. #define IRCC_RX_SIZE_LO 0x06 /* Low byte */
  139. #define IRCC_1152 0x80
  140. #define IRCC_CRC 0x40
  141. /* Register block 5 - IrDA */
  142. #define IRCC_ATC 0x00
  143. #define IRCC_ATC_nPROGREADY 0x80
  144. #define IRCC_ATC_SPEED 0x40
  145. #define IRCC_ATC_ENABLE 0x20
  146. #define IRCC_ATC_MASK 0xE0
  147. #define IRCC_IRHALFDUPLEX_TIMEOUT 0x01
  148. #define IRCC_SCE_TX_DELAY_TIMER 0x02
  149. /*
  150. * Other definitions
  151. */
  152. #define SMSC_IRCC2_MAX_SIR_SPEED 115200
  153. #define SMSC_IRCC2_FIR_CHIP_IO_EXTENT 8
  154. #define SMSC_IRCC2_SIR_CHIP_IO_EXTENT 8
  155. #define SMSC_IRCC2_FIFO_SIZE 16
  156. #define SMSC_IRCC2_FIFO_THRESHOLD 64
  157. /* Max DMA buffer size needed = (data_size + 6) * (window_size) + 6; */
  158. #define SMSC_IRCC2_RX_BUFF_TRUESIZE 14384
  159. #define SMSC_IRCC2_TX_BUFF_TRUESIZE 14384
  160. #define SMSC_IRCC2_MIN_TURN_TIME 0x07
  161. #define SMSC_IRCC2_WINDOW_SIZE 0x07
  162. /* Maximum wait for hw transmitter to finish */
  163. #define SMSC_IRCC2_HW_TRANSMITTER_TIMEOUT_US 1000 /* 1 ms */
  164. /* Maximum wait for ATC transceiver programming to finish */
  165. #define SMSC_IRCC2_ATC_PROGRAMMING_TIMEOUT_JIFFIES 1
  166. #endif /* SMSC_IRCC2_H */