tdkphy.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:16k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/drivers/tdkphy.h
  3.  *
  4.  *  Copyright (C) 2001 Altera Corporation
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  */
  20. #ifndef __TDKPHY_H
  21. #define __TDKPHY_H
  22. /*
  23.  * Register definitions for the TDK 78Q2120 PHY 
  24.  * which is on the Camelot board
  25.  */
  26. /*
  27.  * Copyright (c) Altera Corporation 2000.
  28.  * All rights reserved.
  29.  */
  30. #define PHY_CONTROL                                                                                     (0)
  31. #define PHY_CONTROL_COLT_MSK                                                            (0x80)
  32. #define PHY_CONTROL_COLT_OFST                                                           (7)
  33. #define PHY_CONTROL_DUPLEX_MSK                                                          (0x100)
  34. #define PHY_CONTROL_DUPLEX_OFST                                                         (8)
  35. #define PHY_CONTROL_RANEG_MSK                                                           (0x200)
  36. #define PHY_CONTROL_RANEG_OFST                                                          (9)
  37. #define PHY_CONTROL_ISO_MSK                                                                     (0x400)
  38. #define PHY_CONTROL_ISO_OFST                                                            (10)
  39. #define PHY_CONTROL_PWRDN_MSK                                                           (0x800)
  40. #define PHY_CONTROL_PWRDN_OFST                                                          (11)
  41. #define PHY_CONTROL_ANEGEN_MSK                                                          (0x1000)
  42. #define PHY_CONTROL_ANEGEN_OFST                                                         (12)
  43. #define PHY_CONTROL_SPEEDSL_MSK                                                         (0x2000)
  44. #define PHY_CONTROL_SPEEDSL_OFST                                                        (13)
  45. #define PHY_CONTROL_LOOPBK_MSK                                                          (0x4000)
  46. #define PHY_CONTROL_LOOPBK_OFST                                                         (14)
  47. #define PHY_CONTROL_RESET_MSK                                                           (0x8000)
  48. #define PHY_CONTROL_RESET_OFST                                                          (15)
  49. #define PHY_STATUS                                                                                      (1)
  50. #define PHY_STATUS_ETXD_MSK                                                                     (0x1)
  51. #define PHY_STATUS_EXTD_OFST                                                            (0)
  52. #define PHY_STATUS_JAB_MSK                                                                      (0x2)
  53. #define PHY_STATUS_JAB_OFST                                                                     (1)
  54. #define PHY_STATUS_LINK_MSK                                                                     (0x4)
  55. #define PHY_STATUS_LINK_OFST                                                            (2)
  56. #define PHY_STATUS_ANEGA_MSK                                                            (0x8)
  57. #define PHY_STATUS_ANEGA_OFST                                                           (3)
  58. #define PHY_STATUS_RFAULT_MSK                                                           (0x10)
  59. #define PHY_STATUS_RFAULT_OFST                                                          (4)
  60. #define PHY_STATUS_ANEGC_MSK                                                            (0x20)
  61. #define PHY_STATUS_ANEGC_OFST                                                           (5)
  62. #define PHY_STATUS_10T_H_MSK                                                            (0x800)
  63. #define PHY_STATUS_10T_H_OFST                                                           (11)
  64. #define PHY_STATUS_10T_F_MSK                                                            (0x1000)
  65. #define PHY_STATUS_10T_F_OFST                                                           (12)
  66. #define PHY_STATUS_100_X_H_MSK                                                          (0x2000)
  67. #define PHY_STATUS_100_X_H_OFST                                                         (13)
  68. #define PHY_STATUS_100_X_F_MSK                                                          (0x4000)
  69. #define PHY_STATUS_100_X_F_OFST                                                         (14)
  70. #define PHY_STATUS_100T4_MSK                                                            (0x8000)
  71. #define PHY_STATUS_100T4_OFST                                                           (15)
  72. #define PHY_ID1                                                                                         (2)
  73. #define PHY_ID1_OUI_MSK                                                                         (0xFFFF)
  74. #define PHY_ID1_OUI_OFST                                                                        (0)
  75. #define PHY_ID2                                                                                         (3)
  76. #define PHY_ID2_RN_MSK                                                                          (0xF)
  77. #define PHY_ID2_RN_OFST                                                                         (0)
  78. #define PHY_ID2_MN_MSK                                                                          (0x3F0)
  79. #define PHY_ID2_MN_OFST                                                                         (4)
  80. #define PHY_ID2_OUI_MSK                                                                         (0xFC00)
  81. #define PHY_ID2_OUI_OFST                                                                        (10)
  82. #define PHY_AUTO_NEG_ADVERTISEMENT                                                      (4)
  83. #define PHY_AUTO_NEG_ADVERTISEMENT_SELECTOR_MSK                         (0x1F)
  84. #define PHY_AUTO_NEG_ADVERTISEMENT_SELECTOR_OFST                        (0)
  85. #define PHY_AUTO_NEG_ADVERTISEMENT_A0_MSK                                       (0x20)
  86. #define PHY_AUTO_NEG_ADVERTISEMENT_A0_OFST                                      (5)
  87. #define PHY_AUTO_NEG_ADVERTISEMENT_A1_MSK                                       (0x40)
  88. #define PHY_AUTO_NEG_ADVERTISEMENT_A1_OFST                                      (6)
  89. #define PHY_AUTO_NEG_ADVERTISEMENT_A2_MSK                                       (0x80)
  90. #define PHY_AUTO_NEG_ADVERTISEMENT_A2_OFST                                      (7)
  91. #define PHY_AUTO_NEG_ADVERTISEMENT_A3_MSK                                       (0x100)
  92. #define PHY_AUTO_NEG_ADVERTISEMENT_A3_OFST                                      (8)
  93. #define PHY_AUTO_NEG_ADVERTISEMENT_A4_MSK                                       (0x200)
  94. #define PHY_AUTO_NEG_ADVERTISEMENT_A4_OFST                                      (9)
  95. #define PHY_AUTO_NEG_ADVERTISEMENT_TAF_MSK                                      (0x1FE0)
  96. #define PHY_AUTO_NEG_ADVERTISEMENT_TAF_OFST                                     (5)
  97. #define PHY_AUTO_NEG_ADVERTISEMENT_RF_MSK                                       (0x2000)
  98. #define PHY_AUTO_NEG_ADVERTISEMENT_RF_OFST                                      (13)
  99. #define PHY_AUTO_NEG_ADVERTISEMENT_RSVD_MSK                                     (0x4000)
  100. #define PHY_AUTO_NEG_ADVERTISEMENT_RVSD_OFST                            (14)
  101. #define PHY_AUTO_NEG_ADVERTISEMENT_NP_MSK                                       (0x8000)
  102. #define PHY_AUTO_NEG_ADVERTISEMENT_NP_OFST                                      (15)
  103. #define PHY_AUTO_NEG_LINK_PARTNER                                                       (5)
  104. #define PHY_AUTO_NEG_LINK_PARTNER_S4_MSK                                        (0x1F)
  105. #define PHY_AUTO_NEG_LINK_PARTNER_S4_OFST                                       (0)
  106. #define PHY_AUTO_NEG_LINK_PARTNER_A7_MSK                                        (0x1FE0)
  107. #define PHY_AUTO_NEG_LINK_PARTNER_A7_OFST                                       (5)
  108. #define PHY_AUTO_NEG_LINK_PARTNER_RF_MSK                                        (0x2000)
  109. #define PHY_AUTO_NEG_LINK_PARTNER_RF_OFST                                       (13)
  110. #define PHY_AUTO_NEG_LINK_PARTNER_ACK_MSK                                       (0x4000)
  111. #define PHY_AUTO_NEG_LINK_PARTNER_ACK_OFST                                      (14)
  112. #define PHY_AUTO_NEG_LINK_PARTNER_NP_MSK                                        (0x8000)
  113. #define PHY_AUTO_NEG_LINK_PARTNER_NP_OFST                                       (15)
  114. #define PHY_AUTO_NEG_EXPANSION                                                          (6)
  115. #define PHY_AUTO_NEG_EXPANSION_LPANEGA_MSK                                      (0x1)
  116. #define PHY_AUTO_NEG_EXPANSION_LPANEGA_OFST                                     (0)
  117. #define PHY_AUTO_NEG_EXPANSION_PRX_MSK                                          (0x2)
  118. #define PHY_AUTO_NEG_EXPANSION_PRX_OFST                                         (1)
  119. #define PHY_AUTO_NEG_EXPANSION_NPA_MSK                                          (0x4)
  120. #define PHY_AUTO_NEG_EXPANSION_NPA_OFST                                         (2)
  121. #define PHY_AUTO_NEG_EXPANSION_LPNPA_MSK                                        (0x8)
  122. #define PHY_AUTO_NEG_EXPANSION_LPNPA_OFST                                       (3)
  123. #define PHY_AUTO_NEG_EXPANSION_PDF_MSK                                          (0x10)
  124. #define PHY_AUTO_NEG_EXPANSION_PDF_OFST                                         (4)
  125. #define PHY_VENDOR_SPECIFIC                                                                     (16)
  126. #define PHY_VENDOR_SPECIFIC_RXCC_MSK                                            (0x1)
  127. #define PHY_VENDOR_SPECIFIC_RXCC_OFST                                           (0)
  128. #define PHY_VENDOR_SPECIFIC_PCSBP_MSK                                           (0x2)
  129. #define PHY_VENDOR_SPECIFIC_PCSBP_OFST                                          (1)
  130. #define PHY_VENDOR_SPECIFIC_RVSPOL_MSK                                          (0x10)
  131. #define PHY_VENDOR_SPECIFIC_RVSPOL_OFST                                         (4)
  132. #define PHY_VENDOR_SPECIFIC_APOL_MSK                                            (0x20)  
  133. #define PHY_VENDOR_SPECIFIC_APOL_OFST                                           (5)
  134. #define PHY_VENDOR_SPECIFIC_GPIO0_DIR_MSK                                       (0x40)
  135. #define PHY_VENDOR_SPECIFIC_GPIO0_DIR_OFST                                      (6)
  136. #define PHY_VENDOR_SPECIFIC_GPIO0_DAT_MSK                                       (0x80)
  137. #define PHY_VENDOR_SPECIFIC_GPIO0_DAT_OFST                                      (7)
  138. #define PHY_VENDOR_SPECIFIC_GPIO1_DIR_MSK                                       (0x100)
  139. #define PHY_VENDOR_SPECIFIC_GPIO1_DIR_OFST                                      (8)
  140. #define PHY_VENDOR_SPECIFIC_GPIO1_DAT_MSK                                       (0x200)
  141. #define PHY_VENDOR_SPECIFIC_GPIO1_DAT_OFST                                      (9)
  142. #define PHY_VENDOR_SPECIFIC_10BT_NATURAL_LOOPBACK_DAT_MSK       (0x400)
  143. #define PHY_VENDOR_SPECIFIC_10BT_NATURAL_LOOPBACK_DAT_OFST      (10)
  144. #define PHY_VENDOR_SPECIFIC_10BT_SQE_TEST_INHIBIT_MSK           (0x800)
  145. #define PHY_VENDOR_SPECIFIC_10BT_SQE_TEST_INHIBIT_OFST          (11)
  146. #define PHY_VENDOR_SPECIFIC_TXHIM_MSK                                           (0x1000)
  147. #define PHY_VENDOR_SPECIFIC_TXHIM_OFST                                          (12)
  148. #define PHY_VENDOR_SPECIFIC_INT_LEVEL_MSK                                       (0x4000)
  149. #define PHY_VENDOR_SPECIFIC_INT_LEVEL_OFST                                      (14)
  150. #define PHY_VENDOR_SPECIFIC_RPTR_MSK                                            (0x8000)
  151. #define PHY_VENDOR_SPECIFIC_RPTR_OFST                                           (15)
  152. #define PHY_IRQ_CONTROL                                                                         (17)
  153. #define PHY_IRQ_CONTROL_ANEG_COMP_INT_MSK                                       (0x1)
  154. #define PHY_IRQ_CONTROL_ANEG_COMP_INT_OFST                                      (0)
  155. #define PHY_IRQ_CONTROL_RFAULT_INT_MSK                                          (0x2)
  156. #define PHY_IRQ_CONTROL_RFAULT_INT_OFST                                         (1)
  157. #define PHY_IRQ_CONTROL_LS_CHG_INT_MSK                                          (0x4)
  158. #define PHY_IRQ_CONTROL_LS_CHG_INT_OFST                                         (2)
  159. #define PHY_IRQ_CONTROL_LP_ACK_INT_MSK                                          (0x8)
  160. #define PHY_IRQ_CONTROL_LP_ACK_INT_OFST                                         (3)
  161. #define PHY_IRQ_CONTROL_PDF_INT_MSK                                                     (0x10)
  162. #define PHY_IRQ_CONTROL_PDF_INT_OFST                                            (4)
  163. #define PHY_IRQ_CONTROL_PRX_INT_MSK                                                     (0x20)
  164. #define PHY_IRQ_CONTROL_PRX_INT_OFST                                            (5)
  165. #define PHY_IRQ_CONTROL_RXER_INT_MSK                                            (0x40)
  166. #define PHY_IRQ_CONTROL_RXER_INT_OFST                                           (6)
  167. #define PHY_IRQ_CONTROL_JABBER_INT_MSK                                          (0x80)
  168. #define PHY_IRQ_CONTROL_JABBER_INT_OFST                                         (7)
  169. #define PHY_IRQ_CONTROL_ANEG_COMP_IE_MSK                                        (0x100)
  170. #define PHY_IRQ_CONTROL_ANEG_COMP_IE_OFST                                       (8)
  171. #define PHY_IRQ_CONTROL_RFAULT_IE_MSK                                           (0x200)
  172. #define PHY_IRQ_CONTROL_RFAULT_IE_OFST                                          (9)
  173. #define PHY_IRQ_CONTROL_LS_CHG_IE_MSK                                           (0x400)
  174. #define PHY_IRQ_CONTROL_LS_CHG_IE_OFST                                          (10)
  175. #define PHY_IRQ_CONTROL_LP_ACK_IE_MSK                                           (0x800)
  176. #define PHY_IRQ_CONTROL_LP_ACK_IE_OFST                                          (11)
  177. #define PHY_IRQ_CONTROL_PDF_IE_MSK                                                      (0x1000)
  178. #define PHY_IRQ_CONTROL_PDF_IE_OFST                                                     (12)
  179. #define PHY_IRQ_CONTROL_PRX_IE_MSK                                                      (0x2000)
  180. #define PHY_IRQ_CONTROL_PRX_IE_OFST                                                     (13)
  181. #define PHY_IRQ_CONTROL_RXER_IE_MSK                                                     (0x4000)
  182. #define PHY_IRQ_CONTROL_RXER_IE_OFST                                            (14)
  183. #define PHY_IRQ_CONTROL_JABBER_IE_MSK                                           (0x8000)
  184. #define PHY_IRQ_CONTROL_JABBER_IE_OFST                                          (15)
  185. #define PHY_DIAGNOSTIC                                                                          (18)
  186. #define PHY_DIAGNOSTIC_RX_LOCK_MSK                                                      (0x100)
  187. #define PHY_DIAGNOSTIC_RX_LOCK_OFST                                                     (8)
  188. #define PHY_DIAGNOSTIC_RX_PASS_MSK                                                      (0x200)
  189. #define PHY_DIAGNOSTIC_RX_PASS_OFST                                                     (9)
  190. #define PHY_DIAGNOSTIC_RATE_MSK                                                         (0x400)
  191. #define PHY_DIAGNOSTIC_RATE_OFST                                                        (10)
  192. #define PHY_DIAGNOSTIC_DPLX_MSK                                                         (0x800)
  193. #define PHY_DIAGNOSTIC_DPLX_OFST                                                        (11)
  194. #define PHY_DIAGNOSTIC_ANEGF_MSK                                                        (0x1000)
  195. #define PHY_DIAGNOSTIC_ANEGF_OFST                                                       (12)
  196. #endif /* __TDKPHY_H */