You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lan78xx.h 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef _LAN78XX_H
  2. #define _LAN78XX_H
  3. /** @file
  4. *
  5. * Microchip LAN78xx USB Ethernet driver
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include "smscusb.h"
  10. #include "smsc75xx.h"
  11. /** Hardware configuration register */
  12. #define LAN78XX_HW_CFG 0x0010
  13. #define LAN78XX_HW_CFG_LED1_EN 0x00200000UL /**< LED1 enable */
  14. #define LAN78XX_HW_CFG_LED0_EN 0x00100000UL /**< LED1 enable */
  15. #define LAN78XX_HW_CFG_LRST 0x00000002UL /**< Soft lite reset */
  16. /** Interrupt endpoint control register */
  17. #define LAN78XX_INT_EP_CTL 0x0098
  18. #define LAN78XX_INT_EP_CTL_RDFO_EN 0x00400000UL /**< RX FIFO overflow */
  19. #define LAN78XX_INT_EP_CTL_PHY_EN 0x00020000UL /**< PHY interrupt */
  20. /** Bulk IN delay register */
  21. #define LAN78XX_BULK_IN_DLY 0x0094
  22. #define LAN78XX_BULK_IN_DLY_SET(ticks) ( (ticks) << 0 ) /**< Delay / 16.7ns */
  23. /** EEPROM register base */
  24. #define LAN78XX_E2P_BASE 0x0040
  25. /** USB configuration register 0 */
  26. #define LAN78XX_USB_CFG0 0x0080
  27. #define LAN78XX_USB_CFG0_BIR 0x00000040UL /**< Bulk IN use NAK */
  28. /** Receive filtering engine control register */
  29. #define LAN78XX_RFE_CTL 0x00b0
  30. #define LAN78XX_RFE_CTL_AB 0x00000400UL /**< Accept broadcast */
  31. #define LAN78XX_RFE_CTL_AM 0x00000200UL /**< Accept multicast */
  32. #define LAN78XX_RFE_CTL_AU 0x00000100UL /**< Accept unicast */
  33. /** FIFO controller RX FIFO control register */
  34. #define LAN78XX_FCT_RX_CTL 0x00c0
  35. #define LAN78XX_FCT_RX_CTL_EN 0x80000000UL /**< FCT RX enable */
  36. #define LAN78XX_FCT_RX_CTL_BAD 0x02000000UL /**< Store bad frames */
  37. /** FIFO controller TX FIFO control register */
  38. #define LAN78XX_FCT_TX_CTL 0x00c4
  39. #define LAN78XX_FCT_TX_CTL_EN 0x80000000UL /**< FCT TX enable */
  40. /** MAC receive register */
  41. #define LAN78XX_MAC_RX 0x0104
  42. #define LAN78XX_MAC_RX_MAX_SIZE(mtu) ( (mtu) << 16 ) /**< Max frame size */
  43. #define LAN78XX_MAC_RX_MAX_SIZE_DEFAULT \
  44. LAN78XX_MAC_RX_MAX_SIZE ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ )
  45. #define LAN78XX_MAC_RX_FCS 0x00000010UL /**< FCS stripping */
  46. #define LAN78XX_MAC_RX_EN 0x00000001UL /**< RX enable */
  47. /** MAC transmit register */
  48. #define LAN78XX_MAC_TX 0x0108
  49. #define LAN78XX_MAC_TX_EN 0x00000001UL /**< TX enable */
  50. /** MAC receive address register base */
  51. #define LAN78XX_RX_ADDR_BASE 0x0118
  52. /** MII register base */
  53. #define LAN78XX_MII_BASE 0x0120
  54. /** PHY interrupt mask MII register */
  55. #define LAN78XX_MII_PHY_INTR_MASK 25
  56. /** PHY interrupt source MII register */
  57. #define LAN78XX_MII_PHY_INTR_SOURCE 26
  58. /** PHY interrupt: global enable */
  59. #define LAN78XX_PHY_INTR_ENABLE 0x8000
  60. /** PHY interrupt: link state change */
  61. #define LAN78XX_PHY_INTR_LINK 0x2000
  62. /** PHY interrupt: auto-negotiation failure */
  63. #define LAN78XX_PHY_INTR_ANEG_ERR 0x0800
  64. /** PHY interrupt: auto-negotiation complete */
  65. #define LAN78XX_PHY_INTR_ANEG_DONE 0x0400
  66. /** MAC address perfect filter register base */
  67. #define LAN78XX_ADDR_FILT_BASE 0x0400
  68. /** OTP register base */
  69. #define LAN78XX_OTP_BASE 0x1000
  70. /** Maximum time to wait for reset (in milliseconds) */
  71. #define LAN78XX_RESET_MAX_WAIT_MS 100
  72. #endif /* _LAN78XX_H */