reg_ax88796.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. #ifndef _DEV_REG_AX88796_H_
  2. #define _DEV_REG_AX88796_H_
  3. /*!
  4. * \brief Asix Ax88796L register definitions.
  5. */
  6. /*@{*/
  7. /*
  8. * Register offset applicable to all register pages.
  9. */
  10. #define CR 0x00 /*!< \brief Command register */
  11. #define DATAPORT 0x10 /*!< \brief Data Port */
  12. #define IFGS1 0x12 /*!< \brief Inter-frame Gap Segment 1 */
  13. #define IFGS2 0x13 /*!< \brief Inter-frame Gap Segment 2 */
  14. #define MII_EEP 0x14 /*!< \brief MII/EEPROM Access */
  15. #define TR 0x15 /*!< \brief Test Register */
  16. #define IFG 0x16 /*!< \brief Inter-frame Gap */
  17. #define GPI 0x17 /*!< \brief GPI */
  18. #define GPOC 0x17 /*!< \brief GPOC */
  19. #define SPP1 0x18 /*!< \brief Standard Printer Port 1 */
  20. #define SPP2 0x19 /*!< \brief Standard Printer Port 2 */
  21. #define SPP3 0x1a /*!< \brief Standard Printer Port 3 */
  22. #define RESET 0x1f /*!< \brief Reset port */
  23. /*
  24. * Page 0 register offsets.
  25. */
  26. #define PG0_PSTART 0x01 /*!< \brief Page start register */
  27. #define PG0_PSTOP 0x02 /*!< \brief Page stop register */
  28. #define PG0_BNRY 0x03 /*!< \brief Boundary pointer */
  29. #define PG0_TSR 0x04 /*!< \brief Transmit status register */
  30. #define PG0_TPSR 0x04 /*!< \brief Transmit page start address */
  31. #define PG0_NCR 0x05 /*!< \brief Number of collisions register */
  32. #define PG0_TBCR0 0x05 /*!< \brief Transmit byte count register 0 */
  33. #define PG0_CPR 0x06 /*!< \brief Current Page Register */
  34. #define PG0_TBCR1 0x06 /*!< \brief Transmit Byte Count Register 1 */
  35. #define PG0_ISR 0x07 /*!< \brief Interrupt status register */
  36. #define PG0_CRDA0 0x08 /*!< \brief Current remote DMA address 0 */
  37. #define PG0_RSAR0 0x08 /*!< \brief Remote start address register 0
  38. Low byte address to read from the buffer. */
  39. #define PG0_CRDA1 0x09 /*!< \brief Current remote DMA address 1 */
  40. #define PG0_RSAR1 0x09 /*!< \brief Remote start address register 1
  41. High byte address to read from the buffer. */
  42. #define PG0_RBCR0 0x0a /*!< \brief Remote byte count register 0
  43. Low byte of the number of bytes to read
  44. from the buffer. */
  45. #define PG0_RBCR1 0x0b /*!< \brief Remote byte count register 1
  46. High byte of the number of bytes to read
  47. from the buffer. */
  48. #define PG0_RSR 0x0c /*!< \brief Receive status register */
  49. #define PG0_RCR 0x0c /*!< \brief Receive configuration register */
  50. #define PG0_CNTR0 0x0d /*!< \brief Tally counter 0 (frame alignment errors) */
  51. #define PG0_TCR 0x0d /*!< \brief Transmit configuration register */
  52. #define PG0_DCR 0x0e /*!< \brief Data configuration register */
  53. #define PG0_IMR 0x0f /*!< \brief Interrupt mask register */
  54. /*
  55. * Page 1 register offsets.
  56. */
  57. #define PG1_PAR0 0x01 /*!< \brief Physical Address Register 0 */
  58. #define PG1_PAR1 0x02 /*!< \brief Physical Address Register 1 */
  59. #define PG1_PAR2 0x03 /*!< \brief Physical Address Register 2 */
  60. #define PG1_PAR3 0x04 /*!< \brief Physical Address Register 3 */
  61. #define PG1_PAR4 0x05 /*!< \brief Physical Address Register 4 */
  62. #define PG1_PAR5 0x06 /*!< \brief Physical Address Register 5 */
  63. #define PG1_CPR 0x07 /*!< \brief Current Page Register */
  64. #define PG1_MAR0 0x08 /*!< \brief Multicast Address Register 0 */
  65. #define PG1_MAR1 0x09 /*!< \brief Multicast Address Register 1 */
  66. #define PG1_MAR2 0x0a /*!< \brief Multicast Address Register 2 */
  67. #define PG1_MAR3 0x0b /*!< \brief Multicast Address Register 3 */
  68. #define PG1_MAR4 0x0c /*!< \brief Multicast Address Register 4 */
  69. #define PG1_MAR5 0x0d /*!< \brief Multicast Address Register 5 */
  70. #define PG1_MAR6 0x0e /*!< \brief Multicast Address Register 6 */
  71. #define PG1_MAR7 0x0f /*!< \brief Multicast Address Register 7 */
  72. /*
  73. * Command register bits. (0x00, Read/Write)
  74. */
  75. #define CR_STOP 0x01 /*!< \brief Stop */
  76. #define CR_START 0x02 /*!< \brief Start */
  77. #define CR_TXP 0x04 /*!< \brief Transmit packet */
  78. #define CR_RD0 0x08 /*!< \brief Remote DMA command bit 0 */
  79. #define CR_RD1 0x10 /*!< \brief Remote DMA command bit 1 */
  80. #define CR_RD2 0x20 /*!< \brief Remote DMA command bit 2 */
  81. #define CR_PS0 0x40 /*!< \brief Page select bit 0 */
  82. #define CR_PS1 0x80 /*!< \brief Page select bit 1 */
  83. /*
  84. * Interrupt status register bits. (0x07, Read/Write)
  85. */
  86. #define ISR_PRX 0x01 /*!< \brief Packet received */
  87. #define ISR_PTX 0x02 /*!< \brief Packet transmitted */
  88. #define ISR_RXE 0x04 /*!< \brief Receive error */
  89. #define ISR_TXE 0x08 /*!< \brief Transmit error */
  90. #define ISR_OVW 0x10 /*!< \brief Overwrite warning */
  91. #define ISR_CNT 0x20 /*!< \brief Counter overflow */
  92. #define ISR_RDC 0x40 /*!< \brief Remote DMA complete */
  93. #define ISR_RST 0x80 /*!< \brief Reset status */
  94. /*
  95. * Interrupt mask register bits. (0x0F, Write)
  96. */
  97. #define IMR_PRXE 0x01 /*!< \brief Packet received interrupt enable */
  98. #define IMR_PTXE 0x02 /*!< \brief Packet transmitted interrupt enable */
  99. #define IMR_RXEE 0x04 /*!< \brief Receive error interrupt enable */
  100. #define IMR_TXEE 0x08 /*!< \brief Transmit error interrupt enable */
  101. #define IMR_OVWE 0x10 /*!< \brief Overwrite warning interrupt enable */
  102. #define IMR_CNTE 0x20 /*!< \brief Counter overflow interrupt enable */
  103. #define IMR_RCDE 0x40 /*!< \brief Remote DMA complete interrupt enable */
  104. /*
  105. * Data configuration register bits. (0x0E, Write)
  106. */
  107. #define DCR_WTS 0x01 /*!< \brief Word transfer select */
  108. #define DCR_RDCR 0x80 /*!< \brief Remote DMA always completed */
  109. /*
  110. * Transmit configuration register bits. (0x0D, Write)
  111. */
  112. #define TCR_CRC 0x01 /*!< \brief Inhibit CRC */
  113. #define TCR_LB0 0x02 /*!< \brief Encoded loopback control bit 0 */
  114. #define TCR_LB1 0x04 /*!< \brief Encoded loopback control bit 1 */
  115. #define TCR_RLO 0x20 /*!< \brief Full Duplex */
  116. #define TCR_PD 0x40 /*!< \brief Pad Disable */
  117. #define TCR_FDU 0x80 /*!< \brief Retry of late collision */
  118. /*
  119. * Transmit status register bits. (0x04, Read)
  120. */
  121. #define TSR_PTX 0x01 /*!< \brief Packet transmitted */
  122. #define TSR_COL 0x04 /*!< \brief Transmit collided */
  123. #define TSR_ABT 0x08 /*!< \brief Transmit aborted */
  124. #define TSR_OWC 0x80 /*!< \brief Out of window collision */
  125. /*
  126. * Receive configuration register bits. (0x0C, Write)
  127. */
  128. #define RCR_SEP 0x01 /*!< \brief Save errored packets */
  129. #define RCR_AR 0x02 /*!< \brief Accept runt packets */
  130. #define RCR_AB 0x04 /*!< \brief Accept broadcast */
  131. #define RCR_AM 0x08 /*!< \brief Accept multicast */
  132. #define RCR_PRO 0x10 /*!< \brief Promiscuous physical */
  133. #define RCR_MON 0x20 /*!< \brief Monitor mode */
  134. #define RCR_INTT 0x40 /*!< \brief Interrupt Trigger Mode */
  135. /*
  136. * Receive status register bits. (0x0C, Read)
  137. */
  138. #define RSR_PRX 0x01 /*!< \brief Packet received intact */
  139. #define RSR_CR 0x02 /*!< \brief CRC error */
  140. #define RSR_FAE 0x04 /*!< \brief Frame alignment error */
  141. #define RSR_FO 0x08 /*!< \brief FIFO overrun */
  142. #define RSR_MPA 0x10 /*!< \brief Missed packet */
  143. #define RSR_PHY 0x20 /*!< \brief Physical/multicast address */
  144. #define RSR_DIS 0x40 /*!< \brief Receiver disabled */
  145. /*
  146. * MII/EEPROM access regiser bits. (0x14, Read/Write)
  147. */
  148. #define MII_EEP_MDC 0x01 /*!< \brief MII clock */
  149. #define MII_EEP_MDIR 0x02 /*!< \brief MII MDIO directions */
  150. #define MII_EEP_MDI 0x04 /*!< \brief MII data In */
  151. #define MII_EEP_MDO 0x08 /*!< \brief MII data Out */
  152. #define MII_EEP_EECS 0x10 /*!< \brief EEPROM Chip select */
  153. #define MII_EEP_EEI 0x20 /*!< \brief EEPROM data in */
  154. #define MII_EEP_EEO 0x40 /*!< \brief EEPROM data out */
  155. #define MII_EEP_EECLK 0x80 /*!< \brief EEPROM clock*/
  156. /*
  157. * TR access regiser bits. (0x15, Read/Write)
  158. */
  159. #define TR_RST_B 0x02 /*!< \brief Reset busy */
  160. /*
  161. * The Asix Embedded PHY Registers
  162. */
  163. #define PHY_MR0 0x00 /*!< \brief Control*/
  164. #define PHY_MR1 0x01 /*!< \brief Status*/
  165. #define PHY_MR2 0x02 /*!< \brief PHY Identifier 1*/
  166. #define PHY_MR3 0x03 /*!< \brief PHY Identifier 2*/
  167. #define PHY_MR4 0x04 /*!< \brief Autonegotiation Advertisement*/
  168. #define PHY_MR5 0x05 /*!< \brief Autonegotiation Link Partner Ability*/
  169. #define PHY_MR6 0x06 /*!< \brief Autonegotiation Expansion*/
  170. #define PHY_MR7 0x07 /*!< \brief Next Page Transmit*/
  171. #define PHY_MR16 0x10 /*!< \brief PCS Control Register*/
  172. #define PHY_MR17 0x11 /*!< \brief Autonegotiation (read register A)*/
  173. #define PHY_MR18 0x12 /*!< \brief Autonegotiation (read register B)*/
  174. #define PHY_MR19 0x13 /*!< \brief Analog Test Register*/
  175. #define PHY_MR20 0x14 /*!< \brief User-defined Register*/
  176. #define PHY_MR21 0x15 /*!< \brief RXER Counter*/
  177. #define PHY_MR22 0x16 /*!< \brief Analog Test Registers*/
  178. #define PHY_MR23 0x17 /*!< \brief Analog Test Registers*/
  179. #define PHY_MR24 0x18 /*!< \brief Analog Test Registers*/
  180. #define PHY_MR25 0x19 /*!< \brief Analog Test (tuner) Registers*/
  181. #define PHY_MR26 0x1a /*!< \brief Analog Test (tuner) Registers*/
  182. #define PHY_MR27 0x1b /*!< \brief Analog Test (tuner) Registers*/
  183. #define PHY_MR28 0x1c /*!< \brief Device Specific 1*/
  184. #define PHY_MR29 0x1d /*!< \brief Device Specific 2*/
  185. #define PHY_MR30 0x1e /*!< \brief Device Specific 3*/
  186. #define PHY_MR31 0x1f /*!< \brief Quick Status Register*/
  187. /*
  188. * PHY MR0 (Control) access regiser bits.
  189. */
  190. #define MR0_SW_RESET 0x8000 /* R/W Reset, all PHY registers will be set to default */
  191. #define MR0_LOOPBACK 0x4000 /* R/W Loopback */
  192. #define MR0_SPEED100 0x2000 /* R/W Speed selection, 1 = 100Mbits/s, 0 = 10Mbits/s */
  193. #define MR0_NWAY_ENA 0x1000 /* R/W Autonegotiation Enable */
  194. #define MR0_PWRDN 0x0800 /* R/W Powerdown */
  195. #define MR0_ISOLATE 0x0400 /* R/W Isolate */
  196. #define MR0_REDONWAY 0x0200 /* R/W Restart autonegotiation */
  197. #define MR0_FULL_DUP 0x0100 /* R/W Duplex mode selection, 1 = FULL, 0 = HALF */
  198. #define MR0_COLTST 0x0080 /* R/W Collision Test */
  199. /*
  200. * PHY MR1 (Status) access regiser bits.
  201. */
  202. #define MR1_T4ABLE 0x8000 /* R 100Base-T4 Ability. This bit will always be a 0 */
  203. #define MR1_TXFULDUP 0x4000 /* R 100Base-TX Full-Duplex Ability. This bit will always be a 1 */
  204. #define MR1_TXHAFDUP 0x2000 /* R 100Base-TX Half-Duplex Ability. This bit will always be a 1 */
  205. #define MR1_ENFULDUP 0x1000 /* R 10Base-T Full-Duplex Ability. This bit will always be a 1 */
  206. #define MR1_ENHAFDUP 0x0800 /* R 10Base-T Half-Duplex Ability. This bit will always be a 1 */
  207. #define MR1_NO_PA_OK 0x0040 /* R Suppress preamble */
  208. #define MR1_NWAYDONE 0x0020 /* R Autonegotiation complete */
  209. #define MR1_REM_FLT 0x0010 /* R Remote fault */
  210. #define MR1_NWAYABLE 0x0008 /* R Autonegotiation ability */
  211. #define MR1_LSTAT_OK 0x0004 /* R Link status */
  212. #define MR1_JABBER 0x0002 /* R Jabber detect */
  213. #define MR1_EXT_ABLE 0x0001 /* R Extended capability */
  214. /*
  215. * PHY MR31 (Quick Status) access regiser bits.
  216. */
  217. #define MR31_LSTAT_OK 0x0800 /* R Link status */
  218. #define MR31_SPEED100 0x0200 /* R Link Speed, 0=10Mbits/s, 1=100Mbits/s */
  219. #define MR31_FULL_DUP 0x0100 /* R Duplex Mode, 0=Half, 1=Full */
  220. /*
  221. 0x8000 15
  222. 0x4000 14
  223. 0x2000 13
  224. 0x1000 12
  225. 0x0800 11
  226. 0x0400 10
  227. 0x0200 9
  228. 0x0100 8
  229. 0x0080 7
  230. 0x0040 6
  231. 0x0020 5
  232. 0x0010 4
  233. 0x0008 3
  234. 0x0004 2
  235. 0x0002 1
  236. 0x0001 0
  237. */
  238. /*@}*/
  239. #endif