dm9000.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * dm9000 Ethernet
  3. */
  4. #ifndef _DM9000X_H_
  5. #define _DM9000X_H_
  6. #define DM9000_ID 0x90000A46
  7. /* although the registers are 16 bit, they are 32-bit aligned.
  8. */
  9. #define DM9000_NCR 0x00
  10. #define DM9000_NSR 0x01
  11. #define DM9000_TCR 0x02
  12. #define DM9000_TSR1 0x03
  13. #define DM9000_TSR2 0x04
  14. #define DM9000_RCR 0x05
  15. #define DM9000_RSR 0x06
  16. #define DM9000_ROCR 0x07
  17. #define DM9000_BPTR 0x08
  18. #define DM9000_FCTR 0x09
  19. #define DM9000_FCR 0x0A
  20. #define DM9000_EPCR 0x0B
  21. #define DM9000_EPAR 0x0C
  22. #define DM9000_EPDRL 0x0D
  23. #define DM9000_EPDRH 0x0E
  24. #define DM9000_WCR 0x0F
  25. #define DM9000_PAR 0x10
  26. #define DM9000_MAR 0x16
  27. #define DM9000_GPCR 0x1e
  28. #define DM9000_GPR 0x1f
  29. #define DM9000_TRPAL 0x22
  30. #define DM9000_TRPAH 0x23
  31. #define DM9000_RWPAL 0x24
  32. #define DM9000_RWPAH 0x25
  33. #define DM9000_VIDL 0x28
  34. #define DM9000_VIDH 0x29
  35. #define DM9000_PIDL 0x2A
  36. #define DM9000_PIDH 0x2B
  37. #define DM9000_CHIPR 0x2C
  38. #define DM9000_SMCR 0x2F
  39. #define DM9000_ETXCSR 0x30
  40. #define DM9000_TCCR 0x31
  41. #define DM9000_RCSR 0x32
  42. #define CHIPR_DM9000A 0x19
  43. #define CHIPR_DM9000B 0x1A
  44. #define DM9000_MRCMDX 0xF0
  45. #define DM9000_MRCMD 0xF2
  46. #define DM9000_MRRL 0xF4
  47. #define DM9000_MRRH 0xF5
  48. #define DM9000_MWCMDX 0xF6
  49. #define DM9000_MWCMD 0xF8
  50. #define DM9000_MWRL 0xFA
  51. #define DM9000_MWRH 0xFB
  52. #define DM9000_TXPLL 0xFC
  53. #define DM9000_TXPLH 0xFD
  54. #define DM9000_ISR 0xFE
  55. #define DM9000_IMR 0xFF
  56. #define NCR_EXT_PHY (1<<7)
  57. #define NCR_WAKEEN (1<<6)
  58. #define NCR_FCOL (1<<4)
  59. #define NCR_FDX (1<<3)
  60. #define NCR_RESERVED (3<<1)
  61. #define NCR_MAC_LBK (1<<1)
  62. #define NCR_RST (1<<0)
  63. #define NSR_SPEED (1<<7)
  64. #define NSR_LINKST (1<<6)
  65. #define NSR_WAKEST (1<<5)
  66. #define NSR_TX2END (1<<3)
  67. #define NSR_TX1END (1<<2)
  68. #define NSR_RXOV (1<<1)
  69. #define TCR_TJDIS (1<<6)
  70. #define TCR_EXCECM (1<<5)
  71. #define TCR_PAD_DIS2 (1<<4)
  72. #define TCR_CRC_DIS2 (1<<3)
  73. #define TCR_PAD_DIS1 (1<<2)
  74. #define TCR_CRC_DIS1 (1<<1)
  75. #define TCR_TXREQ (1<<0)
  76. #define TSR_TJTO (1<<7)
  77. #define TSR_LC (1<<6)
  78. #define TSR_NC (1<<5)
  79. #define TSR_LCOL (1<<4)
  80. #define TSR_COL (1<<3)
  81. #define TSR_EC (1<<2)
  82. #define RCR_WTDIS (1<<6)
  83. #define RCR_DIS_LONG (1<<5)
  84. #define RCR_DIS_CRC (1<<4)
  85. #define RCR_ALL (1<<3)
  86. #define RCR_RUNT (1<<2)
  87. #define RCR_PRMSC (1<<1)
  88. #define RCR_RXEN (1<<0)
  89. #define RSR_RF (1<<7)
  90. #define RSR_MF (1<<6)
  91. #define RSR_LCS (1<<5)
  92. #define RSR_RWTO (1<<4)
  93. #define RSR_PLE (1<<3)
  94. #define RSR_AE (1<<2)
  95. #define RSR_CE (1<<1)
  96. #define RSR_FOE (1<<0)
  97. #define WCR_LINKEN (1 << 5)
  98. #define WCR_SAMPLEEN (1 << 4)
  99. #define WCR_MAGICEN (1 << 3)
  100. #define WCR_LINKST (1 << 2)
  101. #define WCR_SAMPLEST (1 << 1)
  102. #define WCR_MAGICST (1 << 0)
  103. #define FCTR_HWOT(ot) (( ot & 0xf ) << 4 )
  104. #define FCTR_LWOT(ot) ( ot & 0xf )
  105. #define IMR_PAR (1<<7)
  106. #define IMR_ROOM (1<<3)
  107. #define IMR_ROM (1<<2)
  108. #define IMR_PTM (1<<1)
  109. #define IMR_PRM (1<<0)
  110. #define ISR_ROOS (1<<3)
  111. #define ISR_ROS (1<<2)
  112. #define ISR_PTS (1<<1)
  113. #define ISR_PRS (1<<0)
  114. #define ISR_CLR_STATUS (ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS)
  115. #define EPCR_REEP (1<<5)
  116. #define EPCR_WEP (1<<4)
  117. #define EPCR_EPOS (1<<3)
  118. #define EPCR_ERPRR (1<<2)
  119. #define EPCR_ERPRW (1<<1)
  120. #define EPCR_ERRE (1<<0)
  121. #define GPCR_GEP_CNTL (1<<0)
  122. #define TCCR_IP (1<<0)
  123. #define TCCR_TCP (1<<1)
  124. #define TCCR_UDP (1<<2)
  125. #define RCSR_UDP_BAD (1<<7)
  126. #define RCSR_TCP_BAD (1<<6)
  127. #define RCSR_IP_BAD (1<<5)
  128. #define RCSR_UDP (1<<4)
  129. #define RCSR_TCP (1<<3)
  130. #define RCSR_IP (1<<2)
  131. #define RCSR_CSUM (1<<1)
  132. #define RCSR_DISCARD (1<<0)
  133. #define DM9000_PKT_RDY 0x01 /* Packet ready to receive */
  134. #define DM9000_PKT_ERR 0x02
  135. #define DM9000_PKT_MAX 1536 /* Received packet max size */
  136. /* DM9000A / DM9000B definitions */
  137. #define IMR_LNKCHNG (1<<5)
  138. #define IMR_UNDERRUN (1<<4)
  139. #define ISR_LNKCHNG (1<<5)
  140. #define ISR_UNDERRUN (1<<4)
  141. /* Davicom MII registers.
  142. */
  143. #define MII_DM_DSPCR 0x1b /* DSP Control Register */
  144. #define DSPCR_INIT_PARAM 0xE100 /* DSP init parameter */
  145. #endif /* _DM9000X_H_ */