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.

intelx.h 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef _INTELX_H
  2. #define _INTELX_H
  3. /** @file
  4. *
  5. * Intel 10 Gigabit Ethernet network card driver
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. #include <ipxe/if_ether.h>
  11. #include "intel.h"
  12. /** Device Control Register */
  13. #define INTELX_CTRL 0x00000UL
  14. #define INTELX_CTRL_LRST 0x00000008UL /**< Link reset */
  15. #define INTELX_CTRL_RST 0x04000000UL /**< Device reset */
  16. /** Time to delay for device reset, in milliseconds */
  17. #define INTELX_RESET_DELAY_MS 20
  18. /** Extended Interrupt Cause Read Register */
  19. #define INTELX_EICR 0x00800UL
  20. #define INTELX_EIRQ_RX0 0x00000001UL /**< RX0 (via IVAR) */
  21. #define INTELX_EIRQ_TX0 0x00000002UL /**< RX0 (via IVAR) */
  22. #define INTELX_EIRQ_RXO 0x00020000UL /**< Receive overrun */
  23. #define INTELX_EIRQ_LSC 0x00100000UL /**< Link status change */
  24. /** Interrupt Mask Set/Read Register */
  25. #define INTELX_EIMS 0x00880UL
  26. /** Interrupt Mask Clear Register */
  27. #define INTELX_EIMC 0x00888UL
  28. /** Interrupt Vector Allocation Register */
  29. #define INTELX_IVAR 0x00900UL
  30. #define INTELX_IVAR_RX0(bit) ( (bit) << 0 ) /**< RX queue 0 allocation */
  31. #define INTELX_IVAR_RX0_DEFAULT INTELX_IVAR_RX0 ( 0x00 )
  32. #define INTELX_IVAR_RX0_MASK INTELX_IVAR_RX0 ( 0x3f )
  33. #define INTELX_IVAR_RX0_VALID 0x00000080UL /**< RX queue 0 valid */
  34. #define INTELX_IVAR_TX0(bit) ( (bit) << 8 ) /**< TX queue 0 allocation */
  35. #define INTELX_IVAR_TX0_DEFAULT INTELX_IVAR_TX0 ( 0x01 )
  36. #define INTELX_IVAR_TX0_MASK INTELX_IVAR_TX0 ( 0x3f )
  37. #define INTELX_IVAR_TX0_VALID 0x00008000UL /**< TX queue 0 valid */
  38. /** Receive Filter Control Register */
  39. #define INTELX_FCTRL 0x05080UL
  40. #define INTELX_FCTRL_MPE 0x00000100UL /**< Multicast promiscuous */
  41. #define INTELX_FCTRL_UPE 0x00000200UL /**< Unicast promiscuous mode */
  42. #define INTELX_FCTRL_BAM 0x00000400UL /**< Broadcast accept mode */
  43. /** Receive Address Low
  44. *
  45. * The MAC address registers RAL0/RAH0 exist at address 0x05400 for
  46. * the 82598 and 0x0a200 for the 82599, according to the datasheet.
  47. * In practice, the 82599 seems to also provide a copy of these
  48. * registers at 0x05400. To aim for maximum compatibility, we try
  49. * both addresses when reading the initial MAC address, and set both
  50. * addresses when setting the MAC address.
  51. */
  52. #define INTELX_RAL0 0x05400UL
  53. #define INTELX_RAL0_ALT 0x0a200UL
  54. /** Receive Address High */
  55. #define INTELX_RAH0 0x05404UL
  56. #define INTELX_RAH0_ALT 0x0a204UL
  57. #define INTELX_RAH0_AV 0x80000000UL /**< Address valid */
  58. /** Receive Descriptor register block */
  59. #define INTELX_RD 0x01000UL
  60. /** Receive Descriptor Control Register */
  61. #define INTELX_RXDCTL_VME 0x40000000UL /**< Strip VLAN tag */
  62. /** Split Receive Control Register */
  63. #define INTELX_SRRCTL 0x02100UL
  64. #define INTELX_SRRCTL_BSIZE(kb) ( (kb) << 0 ) /**< Receive buffer size */
  65. #define INTELX_SRRCTL_BSIZE_DEFAULT INTELX_SRRCTL_BSIZE ( 0x02 )
  66. #define INTELX_SRRCTL_BSIZE_MASK INTELX_SRRCTL_BSIZE ( 0x1f )
  67. /** Receive DMA Control Register */
  68. #define INTELX_RDRXCTL 0x02f00UL
  69. #define INTELX_RDRXCTL_SECRC 0x00000001UL /**< Strip CRC */
  70. /** Receive Control Register */
  71. #define INTELX_RXCTRL 0x03000UL
  72. #define INTELX_RXCTRL_RXEN 0x00000001UL /**< Receive enable */
  73. /** Transmit DMA Control Register */
  74. #define INTELX_DMATXCTL 0x04a80UL
  75. #define INTELX_DMATXCTL_TE 0x00000001UL /**< Transmit enable */
  76. /** Transmit Descriptor register block */
  77. #define INTELX_TD 0x06000UL
  78. /** RX DCA Control Register */
  79. #define INTELX_DCA_RXCTRL 0x02200UL
  80. #define INTELX_DCA_RXCTRL_MUST_BE_ZERO 0x00001000UL /**< Must be zero */
  81. /** MAC Core Control 0 Register */
  82. #define INTELX_HLREG0 0x04240UL
  83. #define INTELX_HLREG0_JUMBOEN 0x00000004UL /**< Jumbo frame enable */
  84. /** Maximum Frame Size Register */
  85. #define INTELX_MAXFRS 0x04268UL
  86. #define INTELX_MAXFRS_MFS(len) ( (len) << 16 ) /**< Maximum frame size */
  87. #define INTELX_MAXFRS_MFS_DEFAULT \
  88. INTELX_MAXFRS_MFS ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ )
  89. #define INTELX_MAXFRS_MFS_MASK INTELX_MAXFRS_MFS ( 0xffff )
  90. /** Link Status Register */
  91. #define INTELX_LINKS 0x042a4UL
  92. #define INTELX_LINKS_UP 0x40000000UL /**< Link up */
  93. #endif /* _INTELX_H */