emaclite
Vitis Drivers API Documentation
|
This file implements the utility functions for the EmacLite example code.
MODIFICATION HISTORY:
Ver Who Date Changes
2.00a ktn 04/13/09 First release 2.00a ktn 06/13/09 Changed the EmacLitePhyDetect function so that the function is not in an infinite loop in case of a faulty Phy device. 3.03a bss 09/01/12 Moved the declarations of RecvFrameLength, TransmitComplete, EmacLiteInstance TxFrame[XEL_MAX_FRAME_SIZE], RxFrame[XEL_MAX_FRAME_SIZE] from the xemaclite_example.h to this file for fixing C++ compilation errors
Functions | |
u32 | EmacLitePhyDetect (XEmacLite *InstancePtr) |
This function detects the PHY address by looking for successful MII status register contents (PHY register 1). More... | |
int | EmacLiteEnablePhyLoopBack (XEmacLite *InstancePtr, u32 PhyAddress) |
This function enables the MAC loopback on the PHY. More... | |
int | EmacLiteDisablePhyLoopBack (XEmacLite *InstancePtr, u32 PhyAddress) |
This function disables the MAC loopback on the PHY. More... | |
void | EmacLitePhyDelay (unsigned int Seconds) |
For PPC we use a usleep call, 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 EmacLiteDisablePhyLoopBack | ( | XEmacLite * | InstancePtr, |
u32 | PhyAddress | ||
) |
This function disables the MAC loopback on the PHY.
InstancePtr | is the pointer to the instance of EmacLite driver. |
PhyAddress | is the address of the Phy device. |
References XEmacLite_PhyRead(), and XEmacLite_PhyWrite().
Referenced by EmacLiteIntrExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().
int EmacLiteEnablePhyLoopBack | ( | XEmacLite * | InstancePtr, |
u32 | PhyAddress | ||
) |
This function enables the MAC loopback on the PHY.
InstancePtr | is the pointer to the instance of EmacLite driver. |
PhyAddress | is the address of the Phy device. |
References EmacLitePhyDelay(), and XEmacLite_PhyWrite().
Referenced by EmacLiteIntrExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().
void EmacLitePhyDelay | ( | unsigned int | Seconds | ) |
For PPC we use a usleep call, 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.
Just keep in mind that after resetting or updating the PHY modes, the PHY typically needs time to recover.
Referenced by EmacLiteEnablePhyLoopBack().
u32 EmacLitePhyDetect | ( | XEmacLite * | InstancePtr | ) |
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 assuming no other address responds, then it seems to work OK.
InstancePtr | is the pointer to the instance of EmacLite driver. |
References XEmacLite_PhyRead().
Referenced by EmacLiteIntrExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().