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