xxvethernet: Xxvethernet_v1_3

| xxvethernet Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Data Structures | Macros | Typedefs | Functions
Xxvethernet_v1_3

## Data Structures
struct | XXxvEthernet_Config
| This typedef contains configuration information for a Xxv Ethernet device. More...
struct | XXxvEthernet
| struct XXxvEthernet is the type for Xxv Ethernet driver instance data. More...

## Macros
#define | XXxvEthernet_IsStarted(InstancePtr) (((InstancePtr)->IsStarted == XIL_COMPONENT_IS_STARTED) ? TRUE : FALSE)
| XXxvEthernet_IsStarted reports if the device is in the started or stopped state. More...
#define | XXxvEthernet_XxvDevBaseAddress(InstancePtr) ((InstancePtr)->Config.XxvDevBaseAddress)
| XXxvEthernet_XxvDevBaseAddress reports the base address of the core connected to the Xxv Ethernet's Axi4 Stream interface (expected to be MCDMA). More...
#define | XXxvEthernet_IsTxErr(InstancePtr)
| XXxvEthernet_IsTxErr determines if there is any TX error reported by device. More...
#define | XXxvEthernet_IsRxErr(InstancePtr)
| XXxvEthernet_IsRxErr determines if there is any RX error reported by device. More...
#define | XXxvEthernet_GetStatus(InstancePtr) XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XXE_SR_OFFSET)
| XXxvEthernet_GetStatus returns the contents of status register. More...
#define | XXxvEthernet_IsStatsConfigured(InstancePtr) (((InstancePtr)->Config.Stats) ? TRUE : FALSE)
| XXxvEthernet_IsStatsConfigured returns determines if Statistics gathering. More...
#define | XXxvEthernet_UsxgmiiLinkSts(InstancePtr)
| XXxvEthernet_UsxgmiiLinkSts returns the USXGMII link status. More...
#define | XXxvEthernet_SetUsxgmiiAnEnable(InstancePtr)
| XXxvEthernet_SetUsxgmiiAnEnable enables USXGMII autonegotiation. More...
#define | XXxvEthernet_SetUsxgmiiAnBypass(InstancePtr)
| XXxvEthernet_SetUsxgmiiAnBypass bypasses USXGMII autonegotiation. More...
#define | XXxvEthernet_GetUsxgmiiAnSts(InstancePtr)
| XXxvEthernet_GetUsxgmiiAnSts returns the contents of USXGMII autonegotiation status register. More...
#define | XXxvEthernet_IsMcDma(InstancePtr) (((InstancePtr)->Config.XxvDevType == XPAR_MCDMA) ? TRUE: FALSE)
| XXxvEthernet_IsMcDma reports if the device is currently connected to MCDMA. More...
#define | XXxvEthernet_ReadReg(BaseAddress, RegOffset) (Xil_In32(((BaseAddress) + (RegOffset))))
| XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset. More...
#define | XXxvEthernet_WriteReg(BaseAddress, RegOffset, Data) Xil_Out32(((BaseAddress) + (RegOffset)), (Data))
| XXxvEthernet_WriteReg, writes Data to the register specified by RegOffset. More...

## Typedefs
typedef struct XXxvEthernet_Config | XXxvEthernet_Config
| This typedef contains configuration information for a Xxv Ethernet device. More...
typedef struct XXxvEthernet | XXxvEthernet
| struct XXxvEthernet is the type for Xxv Ethernet driver instance data. More...

## Functions
int | XXxvEthernet_CfgInitialize (XXxvEthernet *InstancePtr, XXxvEthernet_Config *CfgPtr, UINTPTR EffectiveAddress)
| XXxvEthernet_CfgInitialize initializes an XXV Ethernet device along with the InstancePtr that references it. More...
int | XXxvEthernet_Initialize (XXxvEthernet *InstancePtr, XXxvEthernet_Config *CfgPtr)
| XXxvEthernet_Initialize initializes an XXV Ethernet device along with the InstancePtr that references it. More...
int | XXxvEthernet_Start (XXxvEthernet *InstancePtr)
| XXxvEthernet_Start starts the Xxv Ethernet device as follows: More...
void | XXxvEthernet_Stop (XXxvEthernet *InstancePtr)
| XXxvEthernet_Stop gracefully stops the Xxv Ethernet device by disabling the receiver. More...
void | XXxvEthernet_Reset (XXxvEthernet *InstancePtr)
| XXxvEthernet_Reset does not perform a soft reset of the XxvEthernet core. More...
int | XXxvEthernet_SetOptions (XXxvEthernet *InstancePtr, u32 Options)
| XXxvEthernet_SetOptions enables the options, Options for the Xxv Ethernet, specified by InstancePtr. More...
int | XXxvEthernet_ClearOptions (XXxvEthernet *InstancePtr, u32 Options)
| XXxvEthernet_ClearOptions clears the options, Options for the Xxv Ethernet, specified by InstancePtr. More...
u32 | XXxvEthernet_GetOptions (XXxvEthernet *InstancePtr)
| XXxvEthernet_GetOptions returns the current option settings. More...
int | XXxvEthernet_SetUsxgmiiRateAndDuplex (XXxvEthernet *InstancePtr, u32 Rate, u32 SetFD)
| XXxvEthernet_SetUsxgmiiRateAndDuplex sets the speed and duplex ability in USXGMII Autonegotiation register. More...
XXxvEthernet_Config * | XXxvEthernet_LookupConfig (u16 DeviceId)
| XXxvEthernet_LookupConfig returns a reference to an XXxvEthernet_Config structure based on an unique device id, DeviceId. More...
XXxvEthernet_Config * | XXxvEthernet_LookupConfigBaseAddr (UINTPTR Baseaddr)
| XXxvEthernet_LookupConfigBaseAddr returns a reference to an XXxvEthernet_Config structure based on base address. More...
u16 | XXxvEthernet_GetAutoNegSpeed (XXxvEthernet *InstancePtr)
| XXxvEthernet_GetAutoNegSpeed reports the speed (only 10G supported) from the Autonegotiation status register. More...
int | XXxvEthernet_SetAutoNegSpeed (XXxvEthernet *InstancePtr)
| XXxvEthernet_SetAutoNegSpeed sets the speed (only 10G supported) in the Autonegotiation control register. More...
void | XXxvEthernet_UsxgmiiAnMainReset (XXxvEthernet *InstancePtr)
| XXxvEthernet_UsxgmiiAnMainReset sets the USXGMII AN Main reset. More...
void | XXxvEthernet_UsxgmiiAnMainRestart (XXxvEthernet *InstancePtr)
| XXxvEthernet_UsxgmiiAnMainRestart sets the USXGMII AN Main restart. More...

## Configuration options
The following are device configuration options. See the XXxvEthernet_SetOptions, XXxvEthernet_ClearOptions and XXxvEthernet_GetOptions routines for information on how to use options. The default state of the options are also noted below.
#define | XXE_FCS_STRIP_OPTION 0x00000010
| < XXE_FCS_STRIP_OPTION specifies the Xxv Ethernet device to strip FCS and PAD from received frames. More...
#define | XXE_FCS_INSERT_OPTION 0x00000020
| XXE_TRANSMITTER_ENABLE_OPTION specifies the Xxv Ethernet device transmitter to be enabled. More...
#define | XXE_TRANSMITTER_ENABLE_OPTION 0x00000080
| XXE_RECEIVER_ENABLE_OPTION specifies the Xxv Ethernet device receiver to be enabled. More...
#define | XXE_RECEIVER_ENABLE_OPTION 0x00000100
#define | XXE_DEFAULT_OPTIONS
| XXE_DEFAULT_OPTIONS specify the options set in XXxvEthernet_Reset() and XXxvEthernet_CfgInitialize() More...

## XXV Ethernet registers offset
#define | XXE_GRR_OFFSET 0x00000000
#define | XXE_RST_OFFSET 0x00000004
#define | XXE_MODE_OFFSET 0x00000008
#define | XXE_TXCFG_OFFSET 0x0000000C
#define | XXE_RXCFG_OFFSET 0x00000014
#define | XXE_RXMTU_OFFSET 0x00000018
#define | XXE_TICK_OFFSET 0x00000020
#define | XXE_REV_OFFSET 0x00000024
#define | XXE_USXGMII_AN_OFFSET 0x000000C8
#define | XXE_RSFEC_OFFSET 0x000000D0
#define | XXE_FEC_OFFSET 0x000000D4
#define | XXE_ANCR1_OFFSET 0x000000E0
#define | XXE_ANCR2_OFFSET 0x000000E4
#define | XXE_ANACR_OFFSET 0x000000F8
#define | XXE_LTCR_OFFSET 0x00000100
#define | XXE_LTTR_OFFSET 0x00000104
#define | XXE_LTPR_OFFSET 0x00000108
#define | XXE_LTIR_OFFSET 0x0000010C
#define | XXE_LTSR_OFFSET 0x00000110
#define | XXE_LTCOR_OFFSET 0x00000130
#define | XXE_USR0_OFFSET 0x00000184
#define | XXE_USR1_OFFSET 0x00000188

## Xxv Ethernet status registers offset
#define | XXE_CORESPEEDSR_OFFSET 0x00000180
#define | XXE_TXSR_OFFSET 0x00000400
#define | XXE_RXSR_OFFSET 0x00000404
#define | XXE_SR_OFFSET 0x00000408
#define | XXE_RXBLSR_OFFSET 0x0000040C
#define | XXE_ANSR_OFFSET 0x00000458
#define | XXE_ANASR_OFFSET 0x0000045C

## MODE register masks
#define | XXE_MODE_LCLLPBK_MASK 0x80000000

## TXCFG register masks
#define | XXE_TXCFG_TX_MASK 0x00000001
#define | XXE_TXCFG_FCS_MASK 0x00000002

## RXCFG register masks
#define | XXE_RXCFG_RX_MASK 0x00000001
#define | XXE_RXCFG_DEL_FCS_MASK 0x00000002
#define | XXE_RXCFG_IGN_FCS_MASK 0x00000004

## USXGMII Auto negotiation register masks
#define | XXE_USXGMII_ANBYPASS_MASK 0x00000001
#define | XXE_USXGMII_ANENABLE_MASK 0x00000020
#define | XXE_USXGMII_ANMAINRESET_MASK 0x00000040
#define | XXE_USXGMII_ANRESTART_MASK 0x00000080
#define | XXE_USXGMII_RATE_MASK 0x00000700
#define | XXE_USXGMII_ANA_MASK 0x00010000
#define | XXE_USXGMII_ANA_SPEED_MASK 0x0E000000
#define | XXE_USXGMII_ANA_FD_MASK 0x10000000
#define | XXE_USXGMII_ANACK_MASK 0x40000000
#define | XXE_USXGMII_LINK_STS_MASK 0x80000000
#define | XXE_USXGMII_RATE_10M_MASK 0x0
#define | XXE_USXGMII_RATE_100M_MASK 0x1
#define | XXE_USXGMII_RATE_1G_MASK 0x2
#define | XXE_USXGMII_RATE_10G_MASK 0x3
#define | XXE_USXGMII_RATE_2G5_MASK 0x4
#define | XXE_USXGMII_RATE_SHIFT 8
#define | XXE_USXGMII_SPEED_SHIFT 25

## RXMTU register masks
#define | XXE_RXMTU_MIN_JUM_MASK 0x000000FF
#define | XXE_RXMTU_MAX_JUM_MASK 0x7FFF0000

## RXBLSR register masks
#define | XXE_RXBLKLCK_MASK 0x00000001

## TICK register masks
#define | XXE_TICK_STATEN_MASK 0x00000001

## AN status register masks
#define | XXE_AN_COMP_MASK 0x00000004
#define | XXE_USXGMII_AN_COMP_MASK 0x00010000

## AN ability register masks
#define | XXE_ANA_10GKR_MASK 0x00000004

## Reset and Address Filter (RAF) Register bit definitions.
These bits are associated with the XAE_RAF_OFFSET register.
#define | XXE_RAF_STATSRST_MASK 0x00002000
| Statistics Counter Reset. More...
#define | XXE_RAF_RXBADFRMEN_MASK 0x00004000
| Receive Bad Frame Enable. More...

## Transmit Inter-Frame Gap Adjustment Register (TFGP) bit definitions
#define | XXE_TFGP_IFGP_MASK 0x0000007F
| Transmit inter-frame gap adjustment value. More...

## Other Constant definitions used in the driver
#define | XXE_SPEED_10_GBPS 10
| Speed of 10 Gbps. More...
#define | XXE_LOOPS_TO_COME_OUT_OF_RST 10000
| Number of loops in the driver API to wait for before returning a failure case. More...
#define | XXE_RST_DELAY_LOOPCNT_VAL 10000
| Timeout in ticks used while checking if the core had come out of reset. More...

## Macro Definition Documentation

#define XXE_DEFAULT_OPTIONS

Value:
(XXE_FCS_INSERT_OPTION | \
XXE_FCS_STRIP_OPTION | \
XXE_TRANSMITTER_ENABLE_OPTION | \
XXE_RECEIVER_ENABLE_OPTION)
XXE_FCS_STRIP_OPTION
#define XXE_FCS_STRIP_OPTION
&lt; XXE_FCS_STRIP_OPTION specifies the Xxv Ethernet device to strip FCS and PAD from received frames...
Definition: xxxvethernet.h:170
XXE_FCS_INSERT_OPTION
#define XXE_FCS_INSERT_OPTION
XXE_TRANSMITTER_ENABLE_OPTION specifies the Xxv Ethernet device transmitter to be enabled...
Definition: xxxvethernet.h:176
XXE_TRANSMITTER_ENABLE_OPTION
#define XXE_TRANSMITTER_ENABLE_OPTION
XXE_RECEIVER_ENABLE_OPTION specifies the Xxv Ethernet device receiver to be enabled.
Definition: xxxvethernet.h:182

XXE_DEFAULT_OPTIONS specify the options set in XXxvEthernet_Reset() and XXxvEthernet_CfgInitialize()

Referenced by XXxvEthernet_Reset(), and XXxvEthernet_SetOptions().

#define XXE_FCS_INSERT_OPTION 0x00000020

XXE_TRANSMITTER_ENABLE_OPTION specifies the Xxv Ethernet device transmitter to be enabled.

This driver sets this option to enabled (set) by default.

Referenced by XXxvEthernet_ClearOptions(), and XXxvEthernet_SetOptions().

#define XXE_FCS_STRIP_OPTION 0x00000010

< XXE_FCS_STRIP_OPTION specifies the Xxv Ethernet device to strip FCS and PAD from received frames.

This driver sets this option to enabled (set) by default.XXE_FCS_INSERT_OPTION specifies the Xxv Ethernet device to generate the FCS field and add PAD automatically for outgoing frames. This driver sets this option to enabled (set) by default.

Referenced by XXxvEthernet_ClearOptions(), and XXxvEthernet_SetOptions().

#define XXE_LOOPS_TO_COME_OUT_OF_RST 10000

Number of loops in the driver API to wait for before returning a failure case.

Referenced by XXxvEthernet_Reset().

#define XXE_RAF_RXBADFRMEN_MASK 0x00004000

Receive Bad Frame Enable.

#define XXE_RAF_STATSRST_MASK 0x00002000

Statistics Counter Reset.

#define XXE_RST_DELAY_LOOPCNT_VAL 10000

Timeout in ticks used while checking if the core had come out of reset.

The exact tick time is defined in each case/loop where it will be used

#define XXE_SPEED_10_GBPS 10

Speed of 10 Gbps.

Referenced by XXxvEthernet_GetAutoNegSpeed().

#define XXE_TFGP_IFGP_MASK 0x0000007F

Transmit inter-frame gap adjustment value.

#define XXE_TRANSMITTER_ENABLE_OPTION 0x00000080

XXE_RECEIVER_ENABLE_OPTION specifies the Xxv Ethernet device receiver to be enabled.

This driver sets this option to enabled (set) by default.

Referenced by XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), and XXxvEthernet_Start().

#define XXxvEthernet_GetStatus | ( |  | InstancePtr | ) | XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XXE_SR_OFFSET)

XXxvEthernet_GetStatus returns the contents of status register.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  Returns the status register.

Note
  C-style signature: u32 XXxvEthernet_GetStatus(XXxvEthernet *InstancePtr)

#define XXxvEthernet_GetUsxgmiiAnSts | ( |  | InstancePtr | ) |

Value:
XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
XXE_ANSR_OFFSET);
XXxvEthernet_ReadReg
#define XXxvEthernet_ReadReg(BaseAddress, RegOffset)
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
Definition: xxxvethernet_hw.h:300

XXxvEthernet_GetUsxgmiiAnSts returns the contents of USXGMII autonegotiation status register.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Note
  C-style signature: u32 XXxvEthernet_GetUsxgmiiAnSts(XXxvEthernet *InstancePtr)

Referenced by XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().

#define XXxvEthernet_IsMcDma | ( |  | InstancePtr | ) | (((InstancePtr)->Config.XxvDevType == XPAR_MCDMA) ? TRUE: FALSE)

XXxvEthernet_IsMcDma reports if the device is currently connected to MCDMA.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  - TRUE if the Xxv Ethernet device is connected MCDMA.
  - FALSE.if the Xxv Ethernet device is NOT connected to MCDMA

Note
  C-style signature: u32 XXxvEthernet_IsMcDma(XXxvEthernet *InstancePtr)

#define XXxvEthernet_IsRxErr | ( |  | InstancePtr | ) |

Value:
((XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
XXE_RXSR_OFFSET) & XXE_STS_RX_ERROR_MASK) ? TRUE : FALSE
XXxvEthernet_ReadReg
#define XXxvEthernet_ReadReg(BaseAddress, RegOffset)
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
Definition: xxxvethernet_hw.h:300

XXxvEthernet_IsRxErr determines if there is any RX error reported by device.

The RX status register is read for this to be determined.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  - TRUE if error bit mask is set
  - FALSE if error bit mask is not set

Note
  C-style signature: u32 XXxvEthernet_IsRxErr(XXxvEthernet *InstancePtr)

#define XXxvEthernet_IsStarted | ( |  | InstancePtr | ) | (((InstancePtr)->IsStarted == XIL_COMPONENT_IS_STARTED) ? TRUE : FALSE)

XXxvEthernet_IsStarted reports if the device is in the started or stopped state.

To be in the started state, the calling code must have made a successful call to XXxvEthernet_Start. To be in the stopped state, XXxvEthernet_Stop or XXxvEthernet_CfgInitialize function must have been called.

Parameters

  InstancePtr | is a pointer to the of Xxv Ethernet instance to be worked on.

Returns
  - TRUE if the device has been started.
  - FALSE.if the device has not been started

Note
  C-style signature: u32 XXxvEthernet_IsStarted(XXxvEthernet *InstancePtr)

#define XXxvEthernet_IsStatsConfigured | ( |  | InstancePtr | ) | (((InstancePtr)->Config.Stats) ? TRUE : FALSE)

XXxvEthernet_IsStatsConfigured returns determines if Statistics gathering.

is configured in the harwdare or not.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  - TRUE if the device is configured with statistics gathering.
  - FALSE if the device is NOT configured with statistics gathering.

Note
  C-style signature: u32 XXxvEthernet_IsStatsConfigured(XXxvEthernet *InstancePtr)

#define XXxvEthernet_IsTxErr | ( |  | InstancePtr | ) |

Value:
((XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
XXE_TXSR_OFFSET) & XXE_STS_TX_ERROR_MASK) ? TRUE : FALSE)
XXxvEthernet_ReadReg
#define XXxvEthernet_ReadReg(BaseAddress, RegOffset)
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
Definition: xxxvethernet_hw.h:300

XXxvEthernet_IsTxErr determines if there is any TX error reported by device.

The TX status register is read for this to be determined.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  - TRUE if error bit mask is set
  - FALSE if error bit mask is not set

Note
  C-style signature: u32 XXxvEthernet_IsTxErr(XXxvEthernet *InstancePtr)

#define XXxvEthernet_ReadReg | ( |  | BaseAddress,
|  |  | RegOffset
| ) |  | (Xil_In32(((BaseAddress) + (RegOffset))))

XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.

Parameters

  BaseAddress | is the base address of the Xxv Ethernet device.
  RegOffset | is the offset of the register to be read.

Returns
  Returns the 32-bit value of the register.

Note
  C-style signature: u32 XXxvEthernet_ReadReg(u32 BaseAddress, u32 RegOffset)

Referenced by XxvEthernetUtilEnterLocalLoopback(), XXxvEthernet_ClearOptions(), XXxvEthernet_GetAutoNegSpeed(), XXxvEthernet_SetOptions(), XXxvEthernet_SetUsxgmiiRateAndDuplex(), XXxvEthernet_Start(), XXxvEthernet_Stop(), XXxvEthernet_UsxgmiiAnMainReset(), and XXxvEthernet_UsxgmiiAnMainRestart().

#define XXxvEthernet_SetUsxgmiiAnBypass | ( |  | InstancePtr | ) |

Value:
(XXxvEthernet_WriteReg((InstancePtr)->Config.BaseAddress, \
XXE_USXGMII_AN_OFFSET, \
XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
XXE_USXGMII_AN_OFFSET) | XXE_USXGMII_ANBYPASS_MASK));
XXxvEthernet_WriteReg
#define XXxvEthernet_WriteReg(BaseAddress, RegOffset, Data)
XXxvEthernet_WriteReg, writes Data to the register specified by RegOffset.
Definition: xxxvethernet_hw.h:328
XXxvEthernet_ReadReg
#define XXxvEthernet_ReadReg(BaseAddress, RegOffset)
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
Definition: xxxvethernet_hw.h:300

XXxvEthernet_SetUsxgmiiAnBypass bypasses USXGMII autonegotiation.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Note
  C-style signature: u32 XXxvEthernet_SetUsxgmiiAnBypass(XXxvEthernet *InstancePtr)

Referenced by XxvEthernetUtilUsxgmiiSetupBypassAN().

#define XXxvEthernet_SetUsxgmiiAnEnable | ( |  | InstancePtr | ) |

Value:
(XXxvEthernet_WriteReg((InstancePtr)->Config.BaseAddress, \
XXE_USXGMII_AN_OFFSET, \
XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
XXE_USXGMII_AN_OFFSET) | XXE_USXGMII_ANENABLE_MASK));
XXxvEthernet_WriteReg
#define XXxvEthernet_WriteReg(BaseAddress, RegOffset, Data)
XXxvEthernet_WriteReg, writes Data to the register specified by RegOffset.
Definition: xxxvethernet_hw.h:328
XXxvEthernet_ReadReg
#define XXxvEthernet_ReadReg(BaseAddress, RegOffset)
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
Definition: xxxvethernet_hw.h:300

XXxvEthernet_SetUsxgmiiAnEnable enables USXGMII autonegotiation.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Note
  C-style signature: u32 XXxvEthernet_SetUsxgmiiAnEnable(XXxvEthernet *InstancePtr)

Referenced by XxvEthernetUtilUsxgmiiSetup().

#define XXxvEthernet_UsxgmiiLinkSts | ( |  | InstancePtr | ) |

Value:
((XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, \
XXE_USXGMII_AN_OFFSET) & XXE_USXGMII_LINK_STS_MASK) ? TRUE : FALSE)
XXxvEthernet_ReadReg
#define XXxvEthernet_ReadReg(BaseAddress, RegOffset)
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
Definition: xxxvethernet_hw.h:300

XXxvEthernet_UsxgmiiLinkSts returns the USXGMII link status.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  - TRUE if link is up
  - FALSE if link is down

Note
  C-style signature: u32 XXxvEthernet_UsxgmiiLinkSts(XXxvEthernet *InstancePtr)

#define XXxvEthernet_WriteReg | ( |  | BaseAddress,
|  |  | RegOffset,
|  |  | Data
| ) |  | Xil_Out32(((BaseAddress) + (RegOffset)), (Data))

XXxvEthernet_WriteReg, writes Data to the register specified by RegOffset.

Parameters

  BaseAddress | is the base address of the Xxv Ethernet device.
  RegOffset | is the offset of the register to be written.
  Data | is the 32-bit value to write to the register.

Returns
  None.

Note
  C-style signature: void XXxvEthernet_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)

Referenced by XxvEthernetUtilEnterLocalLoopback(), XxvEthernetUtilUsxgmiiSetup(), XxvEthernetUtilUsxgmiiSetupBypassAN(), XXxvEthernet_ClearOptions(), XXxvEthernet_SetAutoNegSpeed(), XXxvEthernet_SetOptions(), XXxvEthernet_SetUsxgmiiRateAndDuplex(), XXxvEthernet_Start(), XXxvEthernet_Stop(), XXxvEthernet_UsxgmiiAnMainReset(), and XXxvEthernet_UsxgmiiAnMainRestart().

#define XXxvEthernet_XxvDevBaseAddress | ( |  | InstancePtr | ) | ((InstancePtr)->Config.XxvDevBaseAddress)

XXxvEthernet_XxvDevBaseAddress reports the base address of the core connected to the Xxv Ethernet's Axi4 Stream interface (expected to be MCDMA).

This function is currently not in use because of limitation in exporting target MCDMA information.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  The base address of the core connected to the Xxv Ethernet's streaming interface.

Note
  C-style signature: u32 XXxvEthernet_XxvDevBaseAddress(XXxvEthernet *InstancePtr)

## Typedef Documentation

typedef struct XXxvEthernet XXxvEthernet

struct XXxvEthernet is the type for Xxv Ethernet driver instance data.

The calling code is required to use a unique instance of this structure for every Xxv Ethernet device used in the system. A reference to a structure of this type is then passed to the driver API functions.

typedef struct XXxvEthernet_Config XXxvEthernet_Config

This typedef contains configuration information for a Xxv Ethernet device.

## Function Documentation

int XXxvEthernet_CfgInitialize | ( | XXxvEthernet * | InstancePtr,
|  | XXxvEthernet_Config * | CfgPtr,
|  | UINTPTR | EffectiveAddress
| ) |  |

XXxvEthernet_CfgInitialize initializes an XXV Ethernet device along with the InstancePtr that references it.

Parameters

  InstancePtr | references the memory instance to be associated with the XXV Ethernet core instance upon initialization.
  CfgPtr | references the structure holding the hardware configuration for the Xxv Ethernet core to initialize.
  EffectiveAddress | is the processor address used to access the base address of the XXV 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`.

Returns
  XST_SUCCESS

Note
  None.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, and XXxvEthernet_Reset().

Referenced by XxvEthernetSgDmaIntrExample().

int XXxvEthernet_ClearOptions | ( | XXxvEthernet * | InstancePtr,
|  | u32 | Options
| ) |  |

XXxvEthernet_ClearOptions clears the options, Options for the Xxv Ethernet, specified by InstancePtr.

Xxv Ethernet should be stopped with XXxvEthernet_Stop() before changing options.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.
  Options | is a bitmask of OR'd XXE_*_OPTION values for options to clear. Options not specified are not affected.

Returns
  - XST_SUCCESS on successful completion.
  - XST_DEVICE_IS_STARTED if the device has not been stopped.

Note
  See xxxvethernet.h for a description of the available options.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet::Options, XXE_FCS_INSERT_OPTION, XXE_FCS_STRIP_OPTION, XXE_TRANSMITTER_ENABLE_OPTION, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

u16 XXxvEthernet_GetAutoNegSpeed | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_GetAutoNegSpeed reports the speed (only 10G supported) from the Autonegotiation status register.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  Returns the link speed in units of gigabits per second (10) Can return a value of 0, in case 10Gbps is not set.

Note
  This function is only supported for XXV Ethernet MAC

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXE_SPEED_10_GBPS, and XXxvEthernet_ReadReg.

u32 XXxvEthernet_GetOptions | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_GetOptions returns the current option settings.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  Returns a bitmask of XXE_*_OPTION constants, each bit specifying an option that is currently active.

Note
  See xxxvethernet.h for a description of the available options.

References XXxvEthernet::IsReady, and XXxvEthernet::Options.

int XXxvEthernet_Initialize | ( | XXxvEthernet * | InstancePtr,
|  | XXxvEthernet_Config * | CfgPtr
| ) |  |

XXxvEthernet_Initialize initializes an XXV 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.

Parameters

  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.

Returns
  XST_SUCCESS.

Note
  When user calls this function he should ensure the hardware is in a quiescent state by resetting all the hardware Configurations.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, and XXxvEthernet::IsReady.

XXxvEthernet_Config * XXxvEthernet_LookupConfig | ( | u16 | DeviceId | ) |

XXxvEthernet_LookupConfig returns a reference to an XXxvEthernet_Config structure based on an unique device id, DeviceId.

The return value will refer to an entry in the device configuration table defined in the xxxvethernet_g.c file.

Parameters

  DeviceId | is the unique ID for the lookup operation.

Returns
  - Returns a reference to a config record in the configuration table (in xxxvethernet_g.c) corresponding to DeviceId, or NULL
  - NULL if no match is found.

Referenced by XxvEthernetSgDmaIntrExample().

XXxvEthernet_Config * XXxvEthernet_LookupConfigBaseAddr | ( | UINTPTR | Baseaddr | ) |

XXxvEthernet_LookupConfigBaseAddr returns a reference to an XXxvEthernet_Config structure based on base address.

The return value will refer to an entry in the device configuration table defined in the xxxvethernet_g.c file.

Parameters

  Baseaddr | is the base address of the device to lookup for.

Returns
  - Returns a reference to a config record in the configuration table (in xxxvethernet_g.c) corresponding to Baseaddr, or NULL
  - NULL if no match is found.

void XXxvEthernet_Reset | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_Reset does not perform a soft reset of the XxvEthernet core.

XxvEthernet hardware is reset by the device connected to the AXI4-Stream interface i.e. MCDMA. This function simply disabled TX and RX. This function inserts some delay before proceeding to stop the device.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Note
  None

References XXxvEthernet::IsReady, XXxvEthernet::Options, XXE_DEFAULT_OPTIONS, XXE_LOOPS_TO_COME_OUT_OF_RST, and XXxvEthernet_Stop().

Referenced by XXxvEthernet_CfgInitialize().

int XXxvEthernet_SetAutoNegSpeed | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_SetAutoNegSpeed sets the speed (only 10G supported) in the Autonegotiation control register.

Parameters

  InstancePtr | references the Xxv Ethernet on which to operate.

Returns
  - XST_SUCCESS on successful setting of speed.
  - XST_FAILURE, if the speed cannot be set for the present harwdare configuration.

Note
  This function is only supported for XXV Ethernet MAC

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, and XXxvEthernet_WriteReg.

int XXxvEthernet_SetOptions | ( | XXxvEthernet * | InstancePtr,
|  | u32 | Options
| ) |  |

XXxvEthernet_SetOptions enables the options, Options for the Xxv Ethernet, specified by InstancePtr.

Xxv Ethernet should be stopped with XXxvEthernet_Stop() before changing options.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.
  Options | is a bitmask of OR'd XXE_*_OPTION values for options to set. Options not specified are not affected.

Returns
  - XST_SUCCESS on successful completion.
  - XST_DEVICE_IS_STARTED if the device has not been stopped.

Note
  See xxxvethernet.h for a description of the available options.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet::Options, XXE_DEFAULT_OPTIONS, XXE_FCS_INSERT_OPTION, XXE_FCS_STRIP_OPTION, XXE_TRANSMITTER_ENABLE_OPTION, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

Referenced by XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().

int XXxvEthernet_SetUsxgmiiRateAndDuplex | ( | XXxvEthernet * | InstancePtr,
|  | u32 | Rate,
|  | u32 | SetFD
| ) |  |

XXxvEthernet_SetUsxgmiiRateAndDuplex sets the speed and duplex ability in USXGMII Autonegotiation register.

Parameters

  InstancePtr | references the Xxv Ethernet on which to operate.
  Rate | to be set - currently only 1G and 2.5G are tested. Pass RATE_1G or RATE_2G5 to the function.
  Set | FD or HD - if 0 Half duplex is set, else Full duplex.

Returns
  - XST_SUCCESS on successful setting of speed.
  - XST_FAILURE, if the speed cannot be set for the present harwdare configuration.

Note
  None.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

Referenced by XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().

int XXxvEthernet_Start | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_Start starts the Xxv Ethernet device as follows:

      - Enable transmitter if XXE_TRANSMIT_ENABLE_OPTION is set
      - Enable receiver if XXE_RECEIVER_ENABLE_OPTION is set
      - Upon enabling RX, check for RX BLOCK LOCK bit to make sure
        RX channel is ready.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  XST_FAILURE if RX is enabled and BLOCK LOCK is not set.

Note
  None

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet::Options, XXE_TRANSMITTER_ENABLE_OPTION, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

Referenced by XxvEthernetSgDmaIntrSingleFrameExample().

void XXxvEthernet_Stop | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_Stop gracefully stops the Xxv Ethernet device by disabling the receiver.

XXxvEthernet_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.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  None

Note
  None.

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

Referenced by XxvEthernetSgDmaIntrExample(), XxvEthernetSgDmaIntrSingleFrameExample(), and XXxvEthernet_Reset().

void XXxvEthernet_UsxgmiiAnMainReset | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_UsxgmiiAnMainReset sets the USXGMII AN Main reset.

A delay is provided in between setting and clearing the main reset bit.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  None

Note
  This function is only supported for USXGMII Ethernet MAC

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

void XXxvEthernet_UsxgmiiAnMainRestart | ( | XXxvEthernet * | InstancePtr | ) |

XXxvEthernet_UsxgmiiAnMainRestart sets the USXGMII AN Main restart.

A delay is provided in between setting and clearing this bit as it is not self clearing.

Parameters

  InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on.

Returns
  None

Note
  This function is only supported for USXGMII Ethernet MAC

References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.

Referenced by XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().