MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- ------------------------------------------------------- 1.00a asa 6/30/10 First release based on the ll temac driver 1.02a asa 2/16/11 Made changes in XAxiEthernet_Reset to insert delays. 3.02a srt 4/13/13 Removed Warnings (CR 704998).
#include "xaxiethernet.h"
int XAxiEthernet_CfgInitialize | ( | XAxiEthernet * | InstancePtr, | |
XAxiEthernet_Config * | CfgPtr, | |||
u32 | EffectiveAddress | |||
) |
XAxiEthernet_CfgInitialize initializes an AXI Ethernet device along with the InstancePtr that references it.
The PHY is setup independently from the Ethernet core. Use the MII or whatever other interface may be present for setup.
InstancePtr | references the memory instance to be associated with the AXI Ethernet core instance upon initialization. | |
CfgPtr | references the structure holding the hardware configuration for the Axi Ethernet core to initialize. | |
EffectiveAddress | is the processor address used to access the base address of the AXI Ethernet instance. In systems with an MMU and virtual memory, EffectiveAddress is the virtual address mapped to the physical in ConfigPtr->Config.BaseAddress . In systems without an active MMU, EffectiveAddress should be set to the same value as ConfigPtr->Config.BaseAddress . |
void XAxiEthernet_ClearBadFrmRcvOption | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_ClearBadFrmRcvOption is used to disable the bad frame receive option.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
int XAxiEthernet_ClearOptions | ( | XAxiEthernet * | InstancePtr, | |
u32 | Options | |||
) |
XAxiEthernet_ClearOptions clears the options, Options for the Axi Ethernet, specified by InstancePtr. Axi Ethernet should be stopped with XAxiEthernet_Stop() before changing options.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. | |
Options | is a bitmask of OR'd XAE_*_OPTION values for options to clear. Options not specified are not affected. |
void XAxiEthernet_DisableControlFrameLenCheck | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_DisableControlFrameLenCheck is used to disable the length check for control frames (pause frames). This means once the API is called, control frames larger than the minimum frame length are accepted.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
void XAxiEthernet_EnableControlFrameLenCheck | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_EnableControlFrameLenCheck is used to enable the length check for control frames (pause frames). After calling the API, all control frames received will be checked for proper length (less than minimum frame length). By default, upon normal start up, control frame length check is enabled. Hence this API needs to be called only if previously the control frame length check has been disabled by calling the API XAxiEthernet_DisableControlFrameLenCheck.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
void XAxiEthernet_GetMacAddress | ( | XAxiEthernet * | InstancePtr, | |
void * | AddressPtr | |||
) |
XAxiEthernet_GetMacAddress gets the MAC address for the Axi Ethernet, specified by InstancePtr into the memory buffer specified by AddressPtr.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. | |
AddressPtr | references the memory buffer to store the retrieved MAC address. This memory buffer must be at least 6 bytes in length. |
u16 XAxiEthernet_GetOperatingSpeed | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_GetOperatingSpeed gets the current operating link speed. This may be the value set by XAxiEthernet_SetOperatingSpeed() or a hardware default.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
u32 XAxiEthernet_GetOptions | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_GetOptions returns the current option settings.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
void XAxiEthernet_PhyRead | ( | XAxiEthernet * | InstancePtr, | |
u32 | PhyAddress, | |||
u32 | RegisterNum, | |||
u16 * | PhyDataPtr | |||
) |
void XAxiEthernet_PhySetMdioDivisor | ( | XAxiEthernet * | InstancePtr, | |
u8 | Divisor | |||
) |
XAxiEthernet_PhySetMdioDivisor sets the MDIO clock divisor in the Axi Ethernet,specified by InstancePtr to the value, Divisor. This function must be called once after each reset prior to accessing MII PHY registers.
From the Virtex-6(TM) and Spartan-6 (TM) Embedded Tri-Mode Ethernet MAC User's Guide, the following equation governs the MDIO clock to the PHY:
f[HOSTCLK] f[MDC] = ----------------------- (1 + Divisor) * 2
where f[HOSTCLK] is the bus clock frequency in MHz, and f[MDC] is the MDIO clock frequency in MHz to the PHY. Typically, f[MDC] should not exceed 2.5 MHz. Some PHYs can tolerate faster speeds which means faster access.
InstancePtr | references the Axi Ethernet instance on which to operate. | |
Divisor | is the divisor value to set within the range of 0 to XAE_MDIO_MC_CLK_DVD_MAX. |
void XAxiEthernet_PhyWrite | ( | XAxiEthernet * | InstancePtr, | |
u32 | PhyAddress, | |||
u32 | RegisterNum, | |||
u16 | PhyData | |||
) |
void XAxiEthernet_Reset | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_Reset does not perform a soft reset of the AxiEthernet core. AxiEthernet hardware is reset by the device connected to the AXI4-Stream interface. This function inserts some delay before proceeding to check for MgtRdy bit. The delay is necessary to be at a safe side. It takes a while for the reset process to complete and for any of the AxiEthernet registers to be accessed. It then checks for MgtRdy bit in IS register to know if AxiEthernet reset is completed or not. Subsequently it calls one more driver function to complete the AxiEthernet hardware initialization.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
void XAxiEthernet_SetBadFrmRcvOption | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_SetBadFrmRcvOption is used to enable the bad frame receive option. If enabled, this option ensures that bad receive frames are allowed and passed to the AXI4-Stream interface as if they are good frames.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
int XAxiEthernet_SetMacAddress | ( | XAxiEthernet * | InstancePtr, | |
void * | AddressPtr | |||
) |
XAxiEthernet_SetMacAddress sets the MAC address for the Axi Ethernet device, specified by InstancePtr to the MAC address specified by AddressPtr. The Axi Ethernet device must be stopped before calling this function.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. | |
AddressPtr | is a reference to the 6-byte MAC address to set. |
int XAxiEthernet_SetOperatingSpeed | ( | XAxiEthernet * | InstancePtr, | |
u16 | Speed | |||
) |
XAxiEthernet_SetOperatingSpeed sets the current operating link speed. For any traffic to be passed, this speed must match the current MII/GMII/SGMII/RGMII link speed.
InstancePtr | references the Axi Ethernet on which to operate. | |
Speed | is the speed to set in units of Mbps. Valid values are 10, 100, or 1000. |
int XAxiEthernet_SetOptions | ( | XAxiEthernet * | InstancePtr, | |
u32 | Options | |||
) |
XAxiEthernet_SetOptions enables the options, Options for the Axi Ethernet, specified by InstancePtr. Axi Ethernet should be stopped with XAxiEthernet_Stop() before changing options.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. | |
Options | is a bitmask of OR'd XAE_*_OPTION values for options to set. Options not specified are not affected. |
void XAxiEthernet_Start | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_Start starts the Axi Ethernet device as follows:
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
void XAxiEthernet_Stop | ( | XAxiEthernet * | InstancePtr | ) |
XAxiEthernet_Stop gracefully stops the Axi Ethernet device as follows:
XAxiEthernet_Stop does not modify any of the current device options.
Since the transmitter is not disabled, frames currently in internal buffers or in process by a DMA engine are allowed to be transmitted.
InstancePtr | is a pointer to the Axi Ethernet instance to be worked on. |
xdbg_stmnt | ( | int | indent_on = 0; |
) |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.