emac.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * \file emac.h
  3. *
  4. * \brief EMAC APIs and macros.
  5. *
  6. * This file contains the driver API prototypes and macro definitions.
  7. */
  8. /* (c) Texas Instruments 2009-2013, All rights reserved. */
  9. #ifndef __EMAC_H__
  10. #define __EMAC_H__
  11. #include "sys_common.h"
  12. #include "hw_emac.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /*****************************************************************************/
  17. /*
  18. ** Macros which can be used as speed parameter to the API EMACRMIISpeedSet
  19. */
  20. #define EMAC_RMIISPEED_10MBPS (0x00000000U)
  21. #define EMAC_RMIISPEED_100MBPS (0x00008000U)
  22. /*
  23. ** Macros which can be used as duplexMode parameter to the API
  24. ** EMACDuplexSet
  25. */
  26. #define EMAC_DUPLEX_FULL (0x00000001U)
  27. #define EMAC_DUPLEX_HALF (0x00000000U)
  28. /*
  29. ** Macros which can be used as matchFilt parameters to the API
  30. ** EMACMACAddrSet
  31. */
  32. /* Address not used to match/filter incoming packets */
  33. #define EMAC_MACADDR_NO_MATCH_NO_FILTER (0x00000000U)
  34. /* Address will be used to filter incoming packets */
  35. #define EMAC_MACADDR_FILTER (0x00100000U)
  36. /* Address will be used to match incoming packets */
  37. #define EMAC_MACADDR_MATCH (0x00180000U)
  38. /*
  39. ** Macros which can be passed as eoiFlag to EMACRxIntAckToClear API
  40. */
  41. #define EMAC_INT_CORE0_RX (0x1U)
  42. #define EMAC_INT_CORE1_RX (0x5U)
  43. #define EMAC_INT_CORE2_RX (0x9U)
  44. /*
  45. ** Macros which can be passed as eoiFlag to EMACTxIntAckToClear API
  46. */
  47. #define EMAC_INT_CORE0_TX (0x2U)
  48. #define EMAC_INT_CORE1_TX (0x6U)
  49. #define EMAC_INT_CORE2_TX (0xAU)
  50. /*****************************************************************************/
  51. /**
  52. * @defgroup EMACMDIO EMAC/MDIO
  53. * @brief Ethernet Media Access Controller/Management Data Input/Output.
  54. *
  55. * The EMAC controls the flow of packet data from the system to the PHY. The MDIO module controls PHY
  56. * configuration and status monitoring.
  57. *
  58. * Both the EMAC and the MDIO modules interface to the system core through a custom interface that
  59. * allows efficient data transmission and reception. This custom interface is referred to as the EMAC control
  60. * module and is considered integral to the EMAC/MDIO peripheral
  61. *
  62. * Related Files
  63. * - emac.h
  64. * - emac.c
  65. * - hw_emac.h
  66. * - hw_emac_ctrl.h
  67. * - hw_mdio.h
  68. * - hw_reg_access.h
  69. * - mdio.h
  70. * - mdio.c
  71. * @addtogroup EMACMDIO
  72. * @{
  73. */
  74. /*
  75. ** Prototypes for the APIs
  76. */
  77. extern void EMACTxIntPulseEnable(uint32 emacBase, uint32 emacCtrlBase,
  78. uint32 ctrlCore, uint32 channel);
  79. extern void EMACTxIntPulseDisable(uint32 emacBase, uint32 emacCtrlBase,
  80. uint32 ctrlCore, uint32 channel);
  81. extern void EMACRxIntPulseEnable(uint32 emacBase, uint32 emacCtrlBase,
  82. uint32 ctrlCore, uint32 channel);
  83. extern void EMACRxIntPulseDisable(uint32 emacBase, uint32 emacCtrlBase,
  84. uint32 ctrlCore, uint32 channel);
  85. extern void EMACRMIISpeedSet(uint32 emacBase, uint32 speed);
  86. extern void EMACDuplexSet(uint32 emacBase, uint32 duplexMode);
  87. extern void EMACTxEnable(uint32 emacBase);
  88. extern void EMACRxEnable(uint32 emacBase);
  89. extern void EMACTxHdrDescPtrWrite(uint32 emacBase, uint32 descHdr,
  90. uint32 channel);
  91. extern void EMACRxHdrDescPtrWrite(uint32 emacBase, uint32 descHdr,
  92. uint32 channel);
  93. extern void EMACInit(uint32 emacCtrlBase, uint32 emacBase);
  94. extern void EMACMACSrcAddrSet(uint32 emacBase, uint8 * macAddr);
  95. extern void EMACMACAddrSet(uint32 emacBase, uint32 channel,
  96. uint8 * macAddr, uint32 matchFilt);
  97. extern void EMACMIIEnable(uint32 emacBase);
  98. extern void EMACRxUnicastSet(uint32 emacBase, uint32 channel);
  99. extern void EMACCoreIntAck(uint32 emacBase, uint32 eoiFlag);
  100. extern void EMACTxCPWrite(uint32 emacBase, uint32 channel,
  101. uint32 comPtr);
  102. extern void EMACRxCPWrite(uint32 emacBase, uint32 channel,
  103. uint32 comPtr);
  104. extern void EMACRxBroadCastEnable(uint32 emacBase, uint32 channel);
  105. extern void EMACNumFreeBufSet(uint32 emacBase, uint32 channel,
  106. uint32 nBuf);
  107. extern uint32 EMACIntVectorGet(uint32 emacBase);
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. /**@}*/
  112. #endif /* __EMAC_H__ */