mv88e1xxx.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* $Date: 2005/03/07 23:59:05 $ $RCSfile: mv88e1xxx.h,v $ $Revision: 1.13 $ */
  2. #ifndef CHELSIO_MV8E1XXX_H
  3. #define CHELSIO_MV8E1XXX_H
  4. #ifndef BMCR_SPEED1000
  5. # define BMCR_SPEED1000 0x40
  6. #endif
  7. #ifndef ADVERTISE_PAUSE
  8. # define ADVERTISE_PAUSE 0x400
  9. #endif
  10. #ifndef ADVERTISE_PAUSE_ASYM
  11. # define ADVERTISE_PAUSE_ASYM 0x800
  12. #endif
  13. /* Gigabit MII registers */
  14. #define MII_GBCR 9 /* 1000Base-T control register */
  15. #define MII_GBSR 10 /* 1000Base-T status register */
  16. /* 1000Base-T control register fields */
  17. #define GBCR_ADV_1000HALF 0x100
  18. #define GBCR_ADV_1000FULL 0x200
  19. #define GBCR_PREFER_MASTER 0x400
  20. #define GBCR_MANUAL_AS_MASTER 0x800
  21. #define GBCR_MANUAL_CONFIG_ENABLE 0x1000
  22. /* 1000Base-T status register fields */
  23. #define GBSR_LP_1000HALF 0x400
  24. #define GBSR_LP_1000FULL 0x800
  25. #define GBSR_REMOTE_OK 0x1000
  26. #define GBSR_LOCAL_OK 0x2000
  27. #define GBSR_LOCAL_MASTER 0x4000
  28. #define GBSR_MASTER_FAULT 0x8000
  29. /* Marvell PHY interrupt status bits. */
  30. #define MV88E1XXX_INTR_JABBER 0x0001
  31. #define MV88E1XXX_INTR_POLARITY_CHNG 0x0002
  32. #define MV88E1XXX_INTR_ENG_DETECT_CHNG 0x0010
  33. #define MV88E1XXX_INTR_DOWNSHIFT 0x0020
  34. #define MV88E1XXX_INTR_MDI_XOVER_CHNG 0x0040
  35. #define MV88E1XXX_INTR_FIFO_OVER_UNDER 0x0080
  36. #define MV88E1XXX_INTR_FALSE_CARRIER 0x0100
  37. #define MV88E1XXX_INTR_SYMBOL_ERROR 0x0200
  38. #define MV88E1XXX_INTR_LINK_CHNG 0x0400
  39. #define MV88E1XXX_INTR_AUTONEG_DONE 0x0800
  40. #define MV88E1XXX_INTR_PAGE_RECV 0x1000
  41. #define MV88E1XXX_INTR_DUPLEX_CHNG 0x2000
  42. #define MV88E1XXX_INTR_SPEED_CHNG 0x4000
  43. #define MV88E1XXX_INTR_AUTONEG_ERR 0x8000
  44. /* Marvell PHY specific registers. */
  45. #define MV88E1XXX_SPECIFIC_CNTRL_REGISTER 16
  46. #define MV88E1XXX_SPECIFIC_STATUS_REGISTER 17
  47. #define MV88E1XXX_INTERRUPT_ENABLE_REGISTER 18
  48. #define MV88E1XXX_INTERRUPT_STATUS_REGISTER 19
  49. #define MV88E1XXX_EXT_PHY_SPECIFIC_CNTRL_REGISTER 20
  50. #define MV88E1XXX_RECV_ERR_CNTR_REGISTER 21
  51. #define MV88E1XXX_RES_REGISTER 22
  52. #define MV88E1XXX_GLOBAL_STATUS_REGISTER 23
  53. #define MV88E1XXX_LED_CONTROL_REGISTER 24
  54. #define MV88E1XXX_MANUAL_LED_OVERRIDE_REGISTER 25
  55. #define MV88E1XXX_EXT_PHY_SPECIFIC_CNTRL_2_REGISTER 26
  56. #define MV88E1XXX_EXT_PHY_SPECIFIC_STATUS_REGISTER 27
  57. #define MV88E1XXX_VIRTUAL_CABLE_TESTER_REGISTER 28
  58. #define MV88E1XXX_EXTENDED_ADDR_REGISTER 29
  59. #define MV88E1XXX_EXTENDED_REGISTER 30
  60. /* PHY specific control register fields */
  61. #define S_PSCR_MDI_XOVER_MODE 5
  62. #define M_PSCR_MDI_XOVER_MODE 0x3
  63. #define V_PSCR_MDI_XOVER_MODE(x) ((x) << S_PSCR_MDI_XOVER_MODE)
  64. #define G_PSCR_MDI_XOVER_MODE(x) (((x) >> S_PSCR_MDI_XOVER_MODE) & M_PSCR_MDI_XOVER_MODE)
  65. /* Extended PHY specific control register fields */
  66. #define S_DOWNSHIFT_ENABLE 8
  67. #define V_DOWNSHIFT_ENABLE (1 << S_DOWNSHIFT_ENABLE)
  68. #define S_DOWNSHIFT_CNT 9
  69. #define M_DOWNSHIFT_CNT 0x7
  70. #define V_DOWNSHIFT_CNT(x) ((x) << S_DOWNSHIFT_CNT)
  71. #define G_DOWNSHIFT_CNT(x) (((x) >> S_DOWNSHIFT_CNT) & M_DOWNSHIFT_CNT)
  72. /* PHY specific status register fields */
  73. #define S_PSSR_JABBER 0
  74. #define V_PSSR_JABBER (1 << S_PSSR_JABBER)
  75. #define S_PSSR_POLARITY 1
  76. #define V_PSSR_POLARITY (1 << S_PSSR_POLARITY)
  77. #define S_PSSR_RX_PAUSE 2
  78. #define V_PSSR_RX_PAUSE (1 << S_PSSR_RX_PAUSE)
  79. #define S_PSSR_TX_PAUSE 3
  80. #define V_PSSR_TX_PAUSE (1 << S_PSSR_TX_PAUSE)
  81. #define S_PSSR_ENERGY_DETECT 4
  82. #define V_PSSR_ENERGY_DETECT (1 << S_PSSR_ENERGY_DETECT)
  83. #define S_PSSR_DOWNSHIFT_STATUS 5
  84. #define V_PSSR_DOWNSHIFT_STATUS (1 << S_PSSR_DOWNSHIFT_STATUS)
  85. #define S_PSSR_MDI 6
  86. #define V_PSSR_MDI (1 << S_PSSR_MDI)
  87. #define S_PSSR_CABLE_LEN 7
  88. #define M_PSSR_CABLE_LEN 0x7
  89. #define V_PSSR_CABLE_LEN(x) ((x) << S_PSSR_CABLE_LEN)
  90. #define G_PSSR_CABLE_LEN(x) (((x) >> S_PSSR_CABLE_LEN) & M_PSSR_CABLE_LEN)
  91. #define S_PSSR_LINK 10
  92. #define V_PSSR_LINK (1 << S_PSSR_LINK)
  93. #define S_PSSR_STATUS_RESOLVED 11
  94. #define V_PSSR_STATUS_RESOLVED (1 << S_PSSR_STATUS_RESOLVED)
  95. #define S_PSSR_PAGE_RECEIVED 12
  96. #define V_PSSR_PAGE_RECEIVED (1 << S_PSSR_PAGE_RECEIVED)
  97. #define S_PSSR_DUPLEX 13
  98. #define V_PSSR_DUPLEX (1 << S_PSSR_DUPLEX)
  99. #define S_PSSR_SPEED 14
  100. #define M_PSSR_SPEED 0x3
  101. #define V_PSSR_SPEED(x) ((x) << S_PSSR_SPEED)
  102. #define G_PSSR_SPEED(x) (((x) >> S_PSSR_SPEED) & M_PSSR_SPEED)
  103. #endif