4 * \brief EMAC APIs and macros.
6 * This file contains the driver API prototypes and macro definitions.
9 /* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
15 #include "sys/hw_emac.h"
22 /*****************************************************************************/
24 ** Macros which can be used as speed parameter to the API EMACRMIISpeedSet
26 #define EMAC_RMIISPEED_10MBPS (0x00000000u)
27 #define EMAC_RMIISPEED_100MBPS (0x00008000u)
30 ** Macros which can be used as duplexMode parameter to the API
33 #define EMAC_DUPLEX_FULL (0x00000001u)
34 #define EMAC_DUPLEX_HALF (0x00000000u)
37 ** Macros which can be used as matchFilt parameters to the API
40 /* Address not used to match/filter incoming packets */
41 #define EMAC_MACADDR_NO_MATCH_NO_FILTER (0x00000000u)
43 /* Address will be used to filter incoming packets */
44 #define EMAC_MACADDR_FILTER (0x00100000u)
46 /* Address will be used to match incoming packets */
47 #define EMAC_MACADDR_MATCH (0x00180000u)
50 ** Macros which can be passed as eoiFlag to EMACRxIntAckToClear API
52 #define EMAC_INT_CORE0_RX (0x1u)
53 #define EMAC_INT_CORE1_RX (0x5u)
54 #define EMAC_INT_CORE2_RX (0x9u)
57 ** Macros which can be passed as eoiFlag to EMACTxIntAckToClear API
59 #define EMAC_INT_CORE0_TX (0x2u)
60 #define EMAC_INT_CORE1_TX (0x6u)
61 #define EMAC_INT_CORE2_TX (0xAu)
63 /*****************************************************************************/
65 ** Prototypes for the APIs
67 extern void EMACTxIntPulseEnable(unsigned int emacBase, unsigned int emacCtrlBase,
68 unsigned int ctrlCore, unsigned int channel);
69 extern void EMACTxIntPulseDisable(unsigned int emacBase, unsigned int emacCtrlBase,
70 unsigned int ctrlCore, unsigned int channel);
71 extern void EMACRxIntPulseEnable(unsigned int emacBase, unsigned int emacCtrlBase,
72 unsigned int ctrlCore, unsigned int channel);
73 extern void EMACRxIntPulseDisable(unsigned int emacBase, unsigned int emacCtrlBase,
74 unsigned int ctrlCore, unsigned int channel);
75 extern void EMACRMIISpeedSet(unsigned int emacBase, unsigned int speed);
76 extern void EMACDuplexSet(unsigned int emacBase, unsigned int duplexMode);
77 extern void EMACTxEnable(unsigned int emacBase);
78 extern void EMACRxEnable(unsigned int emacBase);
79 extern void EMACTxHdrDescPtrWrite(unsigned int emacBase, unsigned int descHdr,
80 unsigned int channel);
81 extern void EMACRxHdrDescPtrWrite(unsigned int emacBase, unsigned int descHdr,
82 unsigned int channel);
83 extern void EMACInit(unsigned int emacCtrlBase, unsigned int emacBase);
84 extern void EMACMACSrcAddrSet(unsigned int emacBase, unsigned char *macAddr);
85 extern void EMACMACAddrSet(unsigned int emacBase, unsigned int channel,
86 unsigned char *macAddr, unsigned int matchFilt);
87 extern void EMACMIIEnable(unsigned int emacBase);
88 extern void EMACRxUnicastSet(unsigned int emacBase, unsigned int channel);
89 extern void EMACCoreIntAck(unsigned int emacBase, unsigned int eoiFlag);
90 extern void EMACTxCPWrite(unsigned int emacBase, unsigned int channel,
92 extern uint32_t EMACTxCPRead(unsigned int emacBase, unsigned int channel);
94 extern void EMACRxCPWrite(unsigned int emacBase, unsigned int channel,
96 extern void EMACRxBroadCastEnable(unsigned int emacBase, unsigned int channel);
97 extern void EMACRxPromiscEnable(unsigned int emacBase, unsigned int channel);
98 extern void EMACNumFreeBufSet(unsigned int emacBase, unsigned int channel,
100 extern unsigned int EMACIntVectorGet(unsigned int emacBase);
101 unsigned int EMACIntVectorRawGet(unsigned int emacBase);
107 #endif /* __EMAC_H__ */