This file implements the utility functions for the Axi Ethernet example code.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a asa 6/30/10 First release based on the ll temac driver
3.01a srt 02/03/13 Added support for SGMII mode (CR 676793).
02/14/13 Added support for Zynq (CR 681136).
3.02a srt 04/24/13 Modified parameter *_SGMII_PHYADDR to *_PHYADDR, the
config parameter C_PHYADDR applies to SGMII/1000BaseX
modes of operation and added support for 1000BaseX mode
(CR 704195). Added function *_ConfigureInternalPhy()
for this purpose.
04/24/13 Added support for RGMII mode.
3.02a srt 08/06/13 Fixed CR 717949:
Configures external Marvel 88E1111 PHY based on the
axi ethernet physical interface type and allows to
operate in specific interface mode without changing
jumpers on the Microblaze board.
5.4 adk 07/12/16 Added Support for TI PHY DP83867.
ms 04/05/17 Added tabspace for return statements in functions
for proper documentation while generating doxygen.
|
void | AxiEthernetUtilFrameHdrFormatMAC (EthernetFrame *FramePtr, char *DestAddr) |
| Set the MAC addresses in the frame. More...
|
|
void | AxiEthernetUtilFrameHdrFormatType (EthernetFrame *FramePtr, u16 FrameType) |
| Set the frame type for the specified frame. More...
|
|
void | AxiEthernetUtilFrameSetPayloadData (EthernetFrame *FramePtr, int PayloadSize) |
| This function places a pattern in the payload section of a frame. More...
|
|
void | AxiEthernetUtilFrameHdrVlanFormatVid (EthernetFrame *FramePtr, u32 VlanNumber, u32 Vid) |
| Set the frame VLAN info for the specified frame. More...
|
|
void | AxiEthernetUtilFrameHdrVlanFormatType (EthernetFrame *FramePtr, u16 FrameType, u32 VlanNumber) |
| Set the frame type for the specified frame. More...
|
|
void | AxiEthernetUtilFrameSetVlanPayloadData (EthernetFrame *FramePtr, int PayloadSize, u32 VlanNumber) |
| This function places a pattern in the payload section of a frame. More...
|
|
int | AxiEthernetUtilFrameVerify (EthernetFrame *CheckFrame, EthernetFrame *ActualFrame) |
| This function verifies the frame data against a CheckFrame. More...
|
|
void | AxiEthernetUtilFrameMemClear (EthernetFrame *FramePtr) |
| This function sets all bytes of a frame to 0. More...
|
|
int | AxiEthernetUtilEnterLoopback (XAxiEthernet *AxiEthernetInstancePtr, int Speed) |
| This function sets the PHY to loopback mode. More...
|
|
void | AxiEthernetUtilErrorTrap (char *Message) |
| This function is called by example code when an error is detected. More...
|
|
void | AxiEthernetUtilPhyDelay (unsigned int Seconds) |
| For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary. More...
|
|
int | AxiEthernetUtilConfigureInternalPhy (XAxiEthernet *AxiEthernetInstancePtr, int Speed) |
| This function configures the internal phy for SGMII and 1000baseX modes. More...
|
|
This function detects the PHY address by looking for successful MII status register contents (PHY register 1).
It looks for a PHY that supports auto-negotiation and 10Mbps full-duplex and half-duplex. So, this code won't work for PHYs that don't support those features, but it's a bit more general purpose than matching a specific PHY manufacturer ID.
Note also that on some (older) Xilinx ML4xx boards, PHY address 0 does not properly respond to this query. But, since the default is 0 and asssuming no other address responds, then it seems to work OK.
- Parameters
-
The | Axi Ethernet driver instance |
- Returns
- The address of the PHY (defaults to 0 if none detected)
- Note
- None.
void AxiEthernetUtilFrameSetPayloadData |
( |
EthernetFrame * |
FramePtr, |
|
|
int |
PayloadSize |
|
) |
| |
This function places a pattern in the payload section of a frame.
The pattern is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern:
0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...
- Parameters
-
FramePtr | is a pointer to the frame to change. |
PayloadSize | is the number of bytes in the payload that will be set. |
- Returns
- None.
- Note
- None.
void AxiEthernetUtilFrameSetVlanPayloadData |
( |
EthernetFrame * |
FramePtr, |
|
|
int |
PayloadSize, |
|
|
u32 |
VlanNumber |
|
) |
| |
This function places a pattern in the payload section of a frame.
The pattern is a 8 bit incrementing series of numbers starting with 0. Once the pattern reaches 256, then the pattern changes to a 16 bit incrementing pattern:
0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...
- Parameters
-
FramePtr | is a pointer to the frame to change. |
PayloadSize | is the number of bytes in the payload that will be set. |
VlanNumber | is the VLAN friendly adjusted insertion position to set in frame. |
- Returns
- None.
- Note
- None.