![]() |
xxvethernet
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XXxvEthernet_Config |
| Holds configuration information for an Xxv Ethernet device. More... | |
| struct | XXxvEthernet |
| Holds Xxv Ethernet driver instance data. More... | |
Macros | |
| #define | XXE_MAC_ADDR_SIZE 6 |
| MAC address size in bytes. More... | |
| #define | XXE_MTU 1500 |
| Maximum MTU size of an Ethernet frame. More... | |
| #define | XXE_JUMBO_MTU 8982 |
| Maximum MTU size of a jumbo Ethernet frame. More... | |
| #define | XXE_HDR_SIZE 14 |
| Size of an Ethernet header in bytes. More... | |
| #define | XXE_TRL_SIZE 4 |
| Size of an Ethernet trailer (FCS) in bytes. More... | |
| #define | XXE_MAX_FRAME_SIZE (XXE_MTU + XXE_HDR_SIZE + XXE_TRL_SIZE) |
| Maximum standard Ethernet frame size. More... | |
| #define | XXE_MAX_JUMBO_FRAME_SIZE (XXE_JUMBO_MTU + XXE_HDR_SIZE + XXE_TRL_SIZE) |
| Maximum jumbo Ethernet frame size. More... | |
| #define | XXE_RX 1 |
| Receive direction. More... | |
| #define | XXE_TX 2 |
| Transmit direction. More... | |
| #define | RATE_10M 10 |
| 10 Mbps line rate. More... | |
| #define | RATE_100M 100 |
| 100 Mbps line rate. More... | |
| #define | RATE_1G 1000 |
| 1 Gbps line rate. More... | |
| #define | RATE_2G5 2500 |
| 2.5 Gbps line rate. More... | |
| #define | RATE_10G 10000 |
| 10 Gbps line rate. More... | |
| #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 | XXE_STS_TX_ERROR_MASK 0x1 |
| Transmit error status mask. More... | |
| #define | XXE_STS_RX_ERROR_MASK 0xFF0 |
| Receive error status mask. 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... | |
| #define | XXV_AXIDEVTYPE_MASK 0xF |
| Mask for AXI device type bits in the base address. More... | |
| #define | XXV_AXIDMA 0x2 |
| AXI DMA device type identifier. More... | |
| #define | XXV_MCDMA 0x3 |
| AXI MCDMA device type identifier. More... | |
| #define | XXVETHERNET_BASEADDR XPAR_XXXVETHERNET_0_BASEADDR |
| Base address of the Xxv Ethernet device. More... | |
| #define | RXBD_CNT 1024 |
| Number of RxBDs to use. More... | |
| #define | TXBD_CNT 1024 |
| Number of TxBDs to use. More... | |
| #define | BD_ALIGNMENT 64 |
| Byte alignment of buffer descriptors. More... | |
| #define | PAYLOAD_SIZE 8900 |
| Payload size used in examples. More... | |
| #define | IP_VERSION_4 0x800 |
| Ethernet type/length value for IPv4 frames. More... | |
| #define | IP_HEADER_VERSION 0x04 |
| IPv4 version field value in the IP header. More... | |
| #define | IP_HEADER_LEN_IN_WORDS 0x05 |
| IP header length in 32-bit words. More... | |
| #define | IP_HEADER_LENGTH 20 |
| IP header length in bytes. More... | |
| #define | IP_HEADER_PROTOCOL_TCP 0x6 |
| IP protocol value for TCP packets. More... | |
| #define | IP_HEADER_PROTOCOL_UDP 0x17 |
| IP protocol value for UDP packets. More... | |
| #define | TCP_HEADER_LEN_IN_WORDS 0x5 |
| TCP header length in 32-bit words. More... | |
| #define | TCP_HEADER_LENGTH 20 |
| TCP header length in bytes. More... | |
| #define | RXBD_SPACE_BYTES (RXBD_CNT * 64 * 16) |
| Bytes reserved for receive BD space. More... | |
| #define | TXBD_SPACE_BYTES (TXBD_CNT * 64 * 16) |
| Bytes reserved for transmit BD space. More... | |
| #define | BLOCK_SIZE_2MB 0x200000U |
| Two-megabyte block size for TLB attributes. More... | |
| #define | INTC XScuGic |
| Interrupt controller driver type for SCU GIC. More... | |
| #define | INTC_HANDLER XScuGic_InterruptHandler |
| Interrupt handler for SCU GIC. More... | |
| #define | XXVETHERNET_BASEADDR XPAR_XXXVETHERNET_0_BASEADDR |
| Base address of the Xxv Ethernet device. More... | |
| #define | RXBD_CNT 1024 |
| Number of RxBDs to use. More... | |
| #define | TXBD_CNT 1024 |
| Number of TxBDs to use. More... | |
| #define | BD_ALIGNMENT 64 |
| Byte alignment of buffer descriptors. More... | |
| #define | PAYLOAD_SIZE 1500 |
| Payload size used in examples. More... | |
| #define | IP_VERSION_4 0x800 |
| Ethernet type/length value for IPv4 frames. More... | |
| #define | IP_HEADER_VERSION 0x04 |
| IPv4 version field value in the IP header. More... | |
| #define | IP_HEADER_LEN_IN_WORDS 0x05 |
| IP header length in 32-bit words. More... | |
| #define | IP_HEADER_LENGTH 20 |
| IP header length in bytes. More... | |
| #define | IP_HEADER_PROTOCOL_TCP 0x6 |
| IP protocol value for TCP packets. More... | |
| #define | IP_HEADER_PROTOCOL_UDP 0x17 |
| IP protocol value for UDP packets. More... | |
| #define | TCP_HEADER_LEN_IN_WORDS 0x5 |
| TCP header length in 32-bit words. More... | |
| #define | TCP_HEADER_LENGTH 20 |
| TCP header length in bytes. More... | |
| #define | RXBD_SPACE_BYTES (RXBD_CNT * 64 * 16) |
| Bytes reserved for receive BD space. More... | |
| #define | TXBD_SPACE_BYTES (TXBD_CNT * 64 * 16) |
| Bytes reserved for transmit BD space. More... | |
| #define | BLOCK_SIZE_2MB 0x200000U |
| Two-megabyte block size for TLB attributes. More... | |
| #define | INTC XScuGic |
| Interrupt controller driver type for SCU GIC. More... | |
| #define | INTC_HANDLER XScuGic_InterruptHandler |
| Interrupt handler for SCU GIC. More... | |
Typedefs | |
| typedef struct XXxvEthernet_Config | XXxvEthernet_Config |
| Holds configuration information for an Xxv Ethernet device. More... | |
| typedef struct XXxvEthernet | XXxvEthernet |
| Holds 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... | |
| 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... | |
| 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... | |
| XXxvEthernet_Config * | XXxvEthernet_LookupConfig (UINTPTR BaseAddress) |
| Looks up device configuration by base address. More... | |
| XXxvEthernet_Config * | XXxvEthernet_LookupConfigBaseAddr (UINTPTR BaseAddress) |
| Looks up device configuration by base address. More... | |
| void | XxvEthernetUtilFrameHdrFormatMAC (EthernetFrame *FramePtr, char *DestAddr, char *SrcAddr) |
| Sets the MAC addresses in the frame. More... | |
| void | XxvEthernetUtilFrameHdrFormatType (EthernetFrame *FramePtr, u16 FrameType) |
| Sets the frame type for the specified frame. More... | |
| void | XxvEthernetUtilFrameSetPayloadData (EthernetFrame *FramePtr, int PayloadSize) |
| Places an incrementing pattern in the payload section of a frame. More... | |
| int | XxvEthernetUtilFrameVerify (EthernetFrame *CheckFrame, EthernetFrame *ActualFrame) |
| Verifies frame data against a CheckFrame. More... | |
| void | XxvEthernetUtilFrameMemClear (EthernetFrame *FramePtr) |
| Sets all bytes of a frame to 0. More... | |
| int | XxvEthernetUtilEnterLocalLoopback (XXxvEthernet *XxvEthernetInstancePtr) |
| Sets 10G Ethernet in local loopback mode. More... | |
| void | XxvEthernetUtilErrorTrap (const char *Message) |
| Reports an error detected by example code. More... | |
| int | XxvEthernetUtilUsxgmiiSetup (XXxvEthernet *XxvEthernetInstancePtr, u32 Rate, u32 Duplex) |
| Sets up USXGMII at the specified speed with autonegotiation enabled. More... | |
| int | XxvEthernetUtilUsxgmiiSetupBypassAN (XXxvEthernet *XxvEthernetInstancePtr, u32 Rate, u32 Duplex) |
| Sets up USXGMII at the specified speed with autonegotiation bypassed. More... | |
| int | XxvEthernetSgDmaIntrExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, UINTPTR XxvBaseAddress) |
| Demonstrates Xxv Ethernet send and receive in interrupt-driven MCDMA mode. More... | |
| int | XxvEthernetSgDmaIntrSingleFrameExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
| Sends and receives a single Xxv Ethernet frame in interrupt-driven MCDMA mode. More... | |
| int | main (void) |
| Runs the main entry point of the Xxv Ethernet example. More... | |
| void | AxiEthernetSetMAC (char *MacAddr, u8 ChanTdest) |
| Programs a channel-specific destination MAC address. More... | |
| int | UsxgmiiSgDmaIntrExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, UINTPTR XxvBaseAddress) |
| Demonstrates USXGMII send and receive in interrupt-driven MCDMA mode. More... | |
| int | UsxgmiiSgDmaIntrSingleFrameExample (XXxvEthernet *XxvEthernetInstancePtr, XMcdma *DmaInstancePtr, u8 ChanId) |
| Sends and receives a single USXGMII frame in interrupt-driven MCDMA mode. More... | |
Variables | |
| XXxvEthernet_Config | XXxvEthernet_ConfigTable [] |
| Configuration table for each XXV Ethernet instance in the system. 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 |
| Strips FCS and PAD from received frames. More... | |
| #define | XXE_FCS_INSERT_OPTION 0x00000020 |
| Generates FCS and adds PAD for outgoing frames. More... | |
| #define | XXE_TRANSMITTER_ENABLE_OPTION 0x00000080 |
| Enables the Xxv Ethernet device transmitter. More... | |
| #define | XXE_RECEIVER_ENABLE_OPTION 0x00000100 |
| Enables the Xxv Ethernet device receiver. More... | |
| #define | XXE_DEFAULT_OPTIONS |
| Default options applied in XXxvEthernet_Reset() and XXxvEthernet_CfgInitialize(). More... | |
XXV Ethernet registers offset | |
| #define | XXE_GRR_OFFSET 0x00000000 |
| General register reset offset. More... | |
| #define | XXE_RST_OFFSET 0x00000004 |
| Reset register offset. More... | |
| #define | XXE_MODE_OFFSET 0x00000008 |
| Mode register offset. More... | |
| #define | XXE_TXCFG_OFFSET 0x0000000C |
| Transmit configuration offset. More... | |
| #define | XXE_RXCFG_OFFSET 0x00000014 |
| Receive configuration offset. More... | |
| #define | XXE_RXMTU_OFFSET 0x00000018 |
| Receive MTU register offset. More... | |
| #define | XXE_TICK_OFFSET 0x00000020 |
| Tick register offset. More... | |
| #define | XXE_REV_OFFSET 0x00000024 |
| Revision register offset. More... | |
| #define | XXE_USXGMII_AN_OFFSET 0x000000C8 |
| USXGMII autonegotiation offset. More... | |
| #define | XXE_RSFEC_OFFSET 0x000000D0 |
| RS-FEC register offset. More... | |
| #define | XXE_FEC_OFFSET 0x000000D4 |
| FEC register offset. More... | |
| #define | XXE_ANCR1_OFFSET 0x000000E0 |
| Autonegotiation control 1 offset. More... | |
| #define | XXE_ANCR2_OFFSET 0x000000E4 |
| Autonegotiation control 2 offset. More... | |
| #define | XXE_ANACR_OFFSET 0x000000F8 |
| Autonegotiation ability offset. More... | |
| #define | XXE_LTCR_OFFSET 0x00000100 |
| Link training control offset. More... | |
| #define | XXE_LTTR_OFFSET 0x00000104 |
| Link training timer offset. More... | |
| #define | XXE_LTPR_OFFSET 0x00000108 |
| Link training preset offset. More... | |
| #define | XXE_LTIR_OFFSET 0x0000010C |
| Link training interval offset. More... | |
| #define | XXE_LTSR_OFFSET 0x00000110 |
| Link training status offset. More... | |
| #define | XXE_LTCOR_OFFSET 0x00000130 |
| Link training control offset. More... | |
| #define | XXE_USR0_OFFSET 0x00000184 |
| User register 0 offset. More... | |
| #define | XXE_USR1_OFFSET 0x00000188 |
| User register 1 offset. More... | |
Xxv Ethernet status registers offset | |
| #define | XXE_CORESPEEDSR_OFFSET 0x00000180 |
| Core speed status offset. More... | |
| #define | XXE_TXSR_OFFSET 0x00000400 |
| Transmit status register offset. More... | |
| #define | XXE_RXSR_OFFSET 0x00000404 |
| Receive status register offset. More... | |
| #define | XXE_SR_OFFSET 0x00000408 |
| Status register offset. More... | |
| #define | XXE_RXBLSR_OFFSET 0x0000040C |
| Receive block lock status offset. More... | |
| #define | XXE_ANSR_OFFSET 0x00000458 |
| Autonegotiation status offset. More... | |
| #define | XXE_ANASR_OFFSET 0x0000045C |
| Autonegotiation ability status offset. More... | |
MODE register masks | |
| #define | XXE_MODE_LCLLPBK_MASK 0x80000000 |
| Local loopback mode mask. More... | |
TXCFG register masks | |
| #define | XXE_TXCFG_TX_MASK 0x00000001 |
| Transmit enable mask. More... | |
| #define | XXE_TXCFG_FCS_MASK 0x00000002 |
| FCS insertion mask. More... | |
RXCFG register masks | |
| #define | XXE_RXCFG_RX_MASK 0x00000001 |
| Receive enable mask. More... | |
| #define | XXE_RXCFG_DEL_FCS_MASK 0x00000002 |
| FCS strip mask. More... | |
| #define | XXE_RXCFG_IGN_FCS_MASK 0x00000004 |
| FCS ignore mask. More... | |
USXGMII Auto negotiation register masks | |
| #define | XXE_USXGMII_ANBYPASS_MASK 0x00000001 |
| Autonegotiation bypass mask. More... | |
| #define | XXE_USXGMII_ANENABLE_MASK 0x00000020 |
| Autonegotiation enable mask. More... | |
| #define | XXE_USXGMII_ANMAINRESET_MASK 0x00000040 |
| Autonegotiation main reset mask. More... | |
| #define | XXE_USXGMII_ANRESTART_MASK 0x00000080 |
| Autonegotiation restart mask. More... | |
| #define | XXE_USXGMII_RATE_MASK 0x00000700 |
| Rate field mask. More... | |
| #define | XXE_USXGMII_ANA_MASK 0x00010000 |
| Autonegotiation ability mask. More... | |
| #define | XXE_USXGMII_ANA_SPEED_MASK 0x0E000000 |
| Autonegotiation speed mask. More... | |
| #define | XXE_USXGMII_ANA_FD_MASK 0x10000000 |
| Full duplex ability mask. More... | |
| #define | XXE_USXGMII_ANACK_MASK 0x40000000 |
| Autonegotiation acknowledge mask. More... | |
| #define | XXE_USXGMII_LINK_STS_MASK 0x80000000 |
| Link status mask. More... | |
| #define | XXE_USXGMII_RATE_10M_MASK 0x0 |
| 10M rate value. More... | |
| #define | XXE_USXGMII_RATE_100M_MASK 0x1 |
| 100M rate value. More... | |
| #define | XXE_USXGMII_RATE_1G_MASK 0x2 |
| 1G rate value. More... | |
| #define | XXE_USXGMII_RATE_10G_MASK 0x3 |
| 10G rate value. More... | |
| #define | XXE_USXGMII_RATE_2G5_MASK 0x4 |
| 2.5G rate value. More... | |
| #define | XXE_USXGMII_RATE_SHIFT 8 |
| Rate field shift. More... | |
| #define | XXE_USXGMII_SPEED_SHIFT 25 |
| Speed field shift. More... | |
RXMTU register masks | |
| #define | XXE_RXMTU_MIN_JUM_MASK 0x000000FF |
| Minimum jumbo frame size mask. More... | |
| #define | XXE_RXMTU_MAX_JUM_MASK 0x7FFF0000 |
| Maximum jumbo frame size mask. More... | |
RXBLSR register masks | |
| #define | XXE_RXBLKLCK_MASK 0x00000001 |
| Receive block lock mask. More... | |
TICK register masks | |
| #define | XXE_TICK_STATEN_MASK 0x00000001 |
| Statistics enable mask. More... | |
AN status register masks | |
| #define | XXE_AN_COMP_MASK 0x00000004 |
| Autonegotiation complete mask. More... | |
| #define | XXE_USXGMII_AN_COMP_MASK 0x00010000 |
| USXGMII autonegotiation complete mask. More... | |
AN ability register masks | |
| #define | XXE_ANA_10GKR_MASK 0x00000004 |
| 10G KR ability mask. More... | |
Reset and Address Filter (RAF) Register bit definitions. | |
| #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... | |
| #define BD_ALIGNMENT 64 |
Byte alignment of buffer descriptors.
| #define BD_ALIGNMENT 64 |
Byte alignment of buffer descriptors.
| #define BLOCK_SIZE_2MB 0x200000U |
Two-megabyte block size for TLB attributes.
Referenced by XxvEthernetSgDmaIntrExample().
| #define BLOCK_SIZE_2MB 0x200000U |
Two-megabyte block size for TLB attributes.
Referenced by UsxgmiiSgDmaIntrExample().
| #define INTC XScuGic |
Interrupt controller driver type for SCU GIC.
| #define INTC XScuGic |
Interrupt controller driver type for SCU GIC.
| #define INTC_HANDLER XScuGic_InterruptHandler |
Interrupt handler for SCU GIC.
| #define INTC_HANDLER XScuGic_InterruptHandler |
Interrupt handler for SCU GIC.
| #define IP_HEADER_LEN_IN_WORDS 0x05 |
IP header length in 32-bit words.
| #define IP_HEADER_LEN_IN_WORDS 0x05 |
IP header length in 32-bit words.
| #define IP_HEADER_LENGTH 20 |
IP header length in bytes.
| #define IP_HEADER_LENGTH 20 |
IP header length in bytes.
| #define IP_HEADER_PROTOCOL_TCP 0x6 |
IP protocol value for TCP packets.
| #define IP_HEADER_PROTOCOL_TCP 0x6 |
IP protocol value for TCP packets.
| #define IP_HEADER_PROTOCOL_UDP 0x17 |
IP protocol value for UDP packets.
| #define IP_HEADER_PROTOCOL_UDP 0x17 |
IP protocol value for UDP packets.
| #define IP_HEADER_VERSION 0x04 |
IPv4 version field value in the IP header.
| #define IP_HEADER_VERSION 0x04 |
IPv4 version field value in the IP header.
| #define IP_VERSION_4 0x800 |
Ethernet type/length value for IPv4 frames.
| #define IP_VERSION_4 0x800 |
Ethernet type/length value for IPv4 frames.
| #define PAYLOAD_SIZE 8900 |
Payload size used in examples.
Referenced by XxvEthernetSgDmaIntrSingleFrameExample().
| #define PAYLOAD_SIZE 1500 |
Payload size used in examples.
Referenced by UsxgmiiSgDmaIntrSingleFrameExample().
| #define RATE_100M 100 |
100 Mbps line rate.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define RATE_10G 10000 |
10 Gbps line rate.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define RATE_10M 10 |
10 Mbps line rate.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define RATE_1G 1000 |
1 Gbps line rate.
Referenced by UsxgmiiSgDmaIntrExample(), and XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define RATE_2G5 2500 |
2.5 Gbps line rate.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define RXBD_CNT 1024 |
Number of RxBDs to use.
| #define RXBD_CNT 1024 |
Number of RxBDs to use.
| #define RXBD_SPACE_BYTES (RXBD_CNT * 64 * 16) |
Bytes reserved for receive BD space.
| #define RXBD_SPACE_BYTES (RXBD_CNT * 64 * 16) |
Bytes reserved for receive BD space.
| #define TCP_HEADER_LEN_IN_WORDS 0x5 |
TCP header length in 32-bit words.
| #define TCP_HEADER_LEN_IN_WORDS 0x5 |
TCP header length in 32-bit words.
| #define TCP_HEADER_LENGTH 20 |
TCP header length in bytes.
| #define TCP_HEADER_LENGTH 20 |
TCP header length in bytes.
| #define TXBD_CNT 1024 |
Number of TxBDs to use.
| #define TXBD_CNT 1024 |
Number of TxBDs to use.
| #define TXBD_SPACE_BYTES (TXBD_CNT * 64 * 16) |
Bytes reserved for transmit BD space.
| #define TXBD_SPACE_BYTES (TXBD_CNT * 64 * 16) |
Bytes reserved for transmit BD space.
| #define XXE_AN_COMP_MASK 0x00000004 |
Autonegotiation complete mask.
| #define XXE_ANA_10GKR_MASK 0x00000004 |
10G KR ability mask.
Referenced by XXxvEthernet_GetAutoNegSpeed(), and XXxvEthernet_SetAutoNegSpeed().
| #define XXE_ANACR_OFFSET 0x000000F8 |
Autonegotiation ability offset.
Referenced by XXxvEthernet_SetAutoNegSpeed().
| #define XXE_ANASR_OFFSET 0x0000045C |
Autonegotiation ability status offset.
Referenced by XXxvEthernet_GetAutoNegSpeed().
| #define XXE_ANCR1_OFFSET 0x000000E0 |
Autonegotiation control 1 offset.
| #define XXE_ANCR2_OFFSET 0x000000E4 |
Autonegotiation control 2 offset.
| #define XXE_ANSR_OFFSET 0x00000458 |
Autonegotiation status offset.
| #define XXE_CORESPEEDSR_OFFSET 0x00000180 |
Core speed status offset.
| #define XXE_DEFAULT_OPTIONS |
Default options applied in XXxvEthernet_Reset() and XXxvEthernet_CfgInitialize().
Referenced by XXxvEthernet_Reset(), and XXxvEthernet_SetOptions().
| #define XXE_FCS_INSERT_OPTION 0x00000020 |
Generates FCS and adds PAD for outgoing frames.
This driver sets this option to enabled (set) by default.
Referenced by XXxvEthernet_ClearOptions(), and XXxvEthernet_SetOptions().
| #define XXE_FCS_STRIP_OPTION 0x00000010 |
Strips FCS and PAD from received frames.
This driver sets this option to enabled (set) by default.
Referenced by XXxvEthernet_ClearOptions(), and XXxvEthernet_SetOptions().
| #define XXE_FEC_OFFSET 0x000000D4 |
FEC register offset.
| #define XXE_GRR_OFFSET 0x00000000 |
General register reset offset.
Referenced by XxvEthernetUtilEnterLocalLoopback(), XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().
| #define XXE_HDR_SIZE 14 |
Size of an Ethernet header in bytes.
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), XxvEthernetSgDmaIntrSingleFrameExample(), XxvEthernetUtilFrameSetPayloadData(), and XxvEthernetUtilFrameVerify().
| #define XXE_JUMBO_MTU 8982 |
Maximum MTU size of a jumbo Ethernet frame.
| #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_LTCOR_OFFSET 0x00000130 |
Link training control offset.
| #define XXE_LTCR_OFFSET 0x00000100 |
Link training control offset.
| #define XXE_LTIR_OFFSET 0x0000010C |
Link training interval offset.
| #define XXE_LTPR_OFFSET 0x00000108 |
Link training preset offset.
| #define XXE_LTSR_OFFSET 0x00000110 |
Link training status offset.
| #define XXE_LTTR_OFFSET 0x00000104 |
Link training timer offset.
| #define XXE_MAC_ADDR_SIZE 6 |
MAC address size in bytes.
Referenced by AxiEthernetSetMAC(), and XxvEthernetUtilFrameHdrFormatMAC().
| #define XXE_MAX_FRAME_SIZE (XXE_MTU + XXE_HDR_SIZE + XXE_TRL_SIZE) |
Maximum standard Ethernet frame size.
| #define XXE_MAX_JUMBO_FRAME_SIZE (XXE_JUMBO_MTU + XXE_HDR_SIZE + XXE_TRL_SIZE) |
Maximum jumbo Ethernet frame size.
| #define XXE_MODE_LCLLPBK_MASK 0x80000000 |
Local loopback mode mask.
Referenced by XxvEthernetUtilEnterLocalLoopback().
| #define XXE_MODE_OFFSET 0x00000008 |
Mode register offset.
Referenced by XxvEthernetUtilEnterLocalLoopback().
| #define XXE_MTU 1500 |
Maximum MTU size of an Ethernet frame.
| #define XXE_RAF_RXBADFRMEN_MASK 0x00004000 |
Receive Bad Frame Enable.
| #define XXE_RAF_STATSRST_MASK 0x00002000 |
Statistics Counter Reset.
| #define XXE_RECEIVER_ENABLE_OPTION 0x00000100 |
Enables the Xxv Ethernet device receiver.
This driver sets this option to enabled (set) by default.
Referenced by XxvEthernetUtilUsxgmiiSetup(), XxvEthernetUtilUsxgmiiSetupBypassAN(), XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), and XXxvEthernet_Start().
| #define XXE_REV_OFFSET 0x00000024 |
Revision register offset.
| #define XXE_RSFEC_OFFSET 0x000000D0 |
RS-FEC register offset.
| #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_RST_OFFSET 0x00000004 |
Reset register offset.
| #define XXE_RX 1 |
Receive direction.
| #define XXE_RXBLKLCK_MASK 0x00000001 |
Receive block lock mask.
Referenced by XXxvEthernet_Start().
| #define XXE_RXBLSR_OFFSET 0x0000040C |
Receive block lock status offset.
Referenced by XXxvEthernet_Start().
| #define XXE_RXCFG_DEL_FCS_MASK 0x00000002 |
FCS strip mask.
Referenced by XXxvEthernet_ClearOptions(), and XXxvEthernet_SetOptions().
| #define XXE_RXCFG_IGN_FCS_MASK 0x00000004 |
FCS ignore mask.
| #define XXE_RXCFG_OFFSET 0x00000014 |
Receive configuration offset.
Referenced by XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), XXxvEthernet_Start(), and XXxvEthernet_Stop().
| #define XXE_RXCFG_RX_MASK 0x00000001 |
Receive enable mask.
Referenced by XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), XXxvEthernet_Start(), and XXxvEthernet_Stop().
| #define XXE_RXMTU_MAX_JUM_MASK 0x7FFF0000 |
Maximum jumbo frame size mask.
| #define XXE_RXMTU_MIN_JUM_MASK 0x000000FF |
Minimum jumbo frame size mask.
| #define XXE_RXMTU_OFFSET 0x00000018 |
Receive MTU register offset.
| #define XXE_RXSR_OFFSET 0x00000404 |
Receive status register offset.
| #define XXE_SPEED_10_GBPS 10 |
Speed of 10 Gbps.
Referenced by XXxvEthernet_GetAutoNegSpeed().
| #define XXE_SR_OFFSET 0x00000408 |
Status register offset.
| #define XXE_STS_RX_ERROR_MASK 0xFF0 |
Receive error status mask.
| #define XXE_STS_TX_ERROR_MASK 0x1 |
Transmit error status mask.
| #define XXE_TFGP_IFGP_MASK 0x0000007F |
Transmit inter-frame gap adjustment value.
| #define XXE_TICK_OFFSET 0x00000020 |
Tick register offset.
| #define XXE_TICK_STATEN_MASK 0x00000001 |
Statistics enable mask.
| #define XXE_TRANSMITTER_ENABLE_OPTION 0x00000080 |
Enables the Xxv Ethernet device transmitter.
This driver sets this option to enabled (set) by default.
Referenced by XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), and XXxvEthernet_Start().
| #define XXE_TRL_SIZE 4 |
Size of an Ethernet trailer (FCS) in bytes.
| #define XXE_TX 2 |
Transmit direction.
| #define XXE_TXCFG_FCS_MASK 0x00000002 |
FCS insertion mask.
Referenced by XXxvEthernet_ClearOptions(), and XXxvEthernet_SetOptions().
| #define XXE_TXCFG_OFFSET 0x0000000C |
Transmit configuration offset.
Referenced by XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), and XXxvEthernet_Start().
| #define XXE_TXCFG_TX_MASK 0x00000001 |
Transmit enable mask.
Referenced by XXxvEthernet_ClearOptions(), XXxvEthernet_SetOptions(), and XXxvEthernet_Start().
| #define XXE_TXSR_OFFSET 0x00000400 |
Transmit status register offset.
| #define XXE_USR0_OFFSET 0x00000184 |
User register 0 offset.
| #define XXE_USR1_OFFSET 0x00000188 |
User register 1 offset.
| #define XXE_USXGMII_AN_COMP_MASK 0x00010000 |
USXGMII autonegotiation complete mask.
Referenced by XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().
| #define XXE_USXGMII_AN_OFFSET 0x000000C8 |
USXGMII autonegotiation offset.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex(), XXxvEthernet_UsxgmiiAnMainReset(), and XXxvEthernet_UsxgmiiAnMainRestart().
| #define XXE_USXGMII_ANA_FD_MASK 0x10000000 |
Full duplex ability mask.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_ANA_MASK 0x00010000 |
Autonegotiation ability mask.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_ANA_SPEED_MASK 0x0E000000 |
Autonegotiation speed mask.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_ANACK_MASK 0x40000000 |
Autonegotiation acknowledge mask.
| #define XXE_USXGMII_ANBYPASS_MASK 0x00000001 |
Autonegotiation bypass mask.
| #define XXE_USXGMII_ANENABLE_MASK 0x00000020 |
Autonegotiation enable mask.
| #define XXE_USXGMII_ANMAINRESET_MASK 0x00000040 |
Autonegotiation main reset mask.
Referenced by XXxvEthernet_UsxgmiiAnMainReset().
| #define XXE_USXGMII_ANRESTART_MASK 0x00000080 |
Autonegotiation restart mask.
Referenced by XXxvEthernet_UsxgmiiAnMainRestart().
| #define XXE_USXGMII_LINK_STS_MASK 0x80000000 |
Link status mask.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_100M_MASK 0x1 |
100M rate value.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_10G_MASK 0x3 |
10G rate value.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_10M_MASK 0x0 |
10M rate value.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_1G_MASK 0x2 |
1G rate value.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_2G5_MASK 0x4 |
2.5G rate value.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_MASK 0x00000700 |
Rate field mask.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_RATE_SHIFT 8 |
Rate field shift.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXE_USXGMII_SPEED_SHIFT 25 |
Speed field shift.
Referenced by XXxvEthernet_SetUsxgmiiRateAndDuplex().
| #define XXV_AXIDEVTYPE_MASK 0xF |
Mask for AXI device type bits in the base address.
Referenced by UsxgmiiSgDmaIntrExample(), and XxvEthernetSgDmaIntrExample().
| #define XXV_AXIDMA 0x2 |
AXI DMA device type identifier.
| #define XXV_MCDMA 0x3 |
AXI MCDMA device type identifier.
Referenced by UsxgmiiSgDmaIntrExample(), and XxvEthernetSgDmaIntrExample().
| #define XXVETHERNET_BASEADDR XPAR_XXXVETHERNET_0_BASEADDR |
Base address of the Xxv Ethernet device.
Referenced by main().
| #define XXVETHERNET_BASEADDR XPAR_XXXVETHERNET_0_BASEADDR |
Base address of the Xxv Ethernet device.
| #define XXxvEthernet_GetStatus | ( | InstancePtr | ) | XXxvEthernet_ReadReg((InstancePtr)->Config.BaseAddress, XXE_SR_OFFSET) |
XXxvEthernet_GetStatus returns the contents of status register.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| #define XXxvEthernet_GetUsxgmiiAnSts | ( | InstancePtr | ) |
XXxvEthernet_GetUsxgmiiAnSts returns the contents of USXGMII autonegotiation status register.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| #define XXxvEthernet_IsRxErr | ( | InstancePtr | ) |
XXxvEthernet_IsRxErr determines if there is any RX error reported by device.
The RX status register is read for this to be determined.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| #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.
| [in] | InstancePtr | is a pointer to the of Xxv Ethernet instance to be worked on. |
| #define XXxvEthernet_IsStatsConfigured | ( | InstancePtr | ) | (((InstancePtr)->Config.Stats) ? TRUE : FALSE) |
XXxvEthernet_IsStatsConfigured returns determines if Statistics gathering.
is configured in the hardware or not.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| #define XXxvEthernet_IsTxErr | ( | InstancePtr | ) |
XXxvEthernet_IsTxErr determines if there is any TX error reported by device.
The TX status register is read for this to be determined.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| #define XXxvEthernet_ReadReg | ( | BaseAddress, | |
| RegOffset | |||
| ) | (Xil_In32(((BaseAddress) + (RegOffset)))) |
XXxvEthernet_ReadReg returns the value read from the register specified by RegOffset.
| [in] | BaseAddress | is the base address of the Xxv Ethernet device. |
| [in] | RegOffset | is the offset of the register to be read. |
Referenced by XxvEthernetUtilEnterLocalLoopback(), XXxvEthernet_ClearOptions(), XXxvEthernet_GetAutoNegSpeed(), XXxvEthernet_SetOptions(), XXxvEthernet_SetUsxgmiiRateAndDuplex(), XXxvEthernet_Start(), XXxvEthernet_Stop(), XXxvEthernet_UsxgmiiAnMainReset(), and XXxvEthernet_UsxgmiiAnMainRestart().
| #define XXxvEthernet_SetUsxgmiiAnBypass | ( | InstancePtr | ) |
XXxvEthernet_SetUsxgmiiAnBypass bypasses USXGMII autonegotiation.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
Referenced by XxvEthernetUtilUsxgmiiSetupBypassAN().
| #define XXxvEthernet_SetUsxgmiiAnEnable | ( | InstancePtr | ) |
XXxvEthernet_SetUsxgmiiAnEnable enables USXGMII autonegotiation.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
Referenced by XxvEthernetUtilUsxgmiiSetup().
| #define XXxvEthernet_UsxgmiiLinkSts | ( | InstancePtr | ) |
XXxvEthernet_UsxgmiiLinkSts returns the USXGMII link status.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| #define XXxvEthernet_WriteReg | ( | BaseAddress, | |
| RegOffset, | |||
| Data | |||
| ) | Xil_Out32(((BaseAddress) + (RegOffset)), (Data)) |
XXxvEthernet_WriteReg, writes Data to the register specified by RegOffset.
| [in] | BaseAddress | is the base address of the Xxv Ethernet device. |
| [in] | RegOffset | is the offset of the register to be written. |
| [in] | Data | is the 32-bit value to write to the register. |
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).
Reserved for future use because of a limitation in exporting target MCDMA information.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| typedef struct XXxvEthernet XXxvEthernet |
Holds Xxv Ethernet driver instance data.
The calling code must 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 |
Holds configuration information for an Xxv Ethernet device.
| void AxiEthernetSetMAC | ( | char * | MacAddr, |
| u8 | ChanTdest | ||
| ) |
Programs a channel-specific destination MAC address.
| [out] | MacAddr | is the MAC address buffer to update. |
| [in] | ChanTdest | is the channel TDEST value placed in MAC byte 1. |
References XXE_MAC_ADDR_SIZE.
| int main | ( | void | ) |
Runs the main entry point of the Xxv Ethernet example.
Runs the main entry point of the USXGMII example.
Excluded when the example is generated from TestAppGen.
References XXVETHERNET_BASEADDR, XxvEthernetSgDmaIntrExample(), and XxvEthernetUtilErrorTrap().
| int UsxgmiiSgDmaIntrExample | ( | XXxvEthernet * | XxvEthernetInstancePtr, |
| XMcdma * | DmaInstancePtr, | ||
| UINTPTR | XxvBaseAddress | ||
| ) |
Demonstrates USXGMII send and receive in interrupt-driven MCDMA mode.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. XxvEthernet component. |
| [in] | DmaInstancePtr | is a pointer to the instance of the AXI MCDMA. component. |
| [in] | XxvBaseAddress | contains the base address of the XxvEthernet device. |
References XXxvEthernet_Config::BaseAddress, BLOCK_SIZE_2MB, RATE_1G, UsxgmiiSgDmaIntrSingleFrameExample(), XXV_AXIDEVTYPE_MASK, XXV_MCDMA, XXxvEthernet_Config::XxvDevBaseAddress, XxvEthernetUtilErrorTrap(), XxvEthernetUtilUsxgmiiSetup(), XXxvEthernet_CfgInitialize(), XXxvEthernet_LookupConfig(), and XXxvEthernet_Stop().
| int UsxgmiiSgDmaIntrSingleFrameExample | ( | XXxvEthernet * | XxvEthernetInstancePtr, |
| XMcdma * | DmaInstancePtr, | ||
| u8 | ChanId | ||
| ) |
Sends and receives a single USXGMII frame in interrupt-driven MCDMA mode.
The source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. Xxv Ethernet component. |
| [in] | DmaInstancePtr | is a pointer to the instance of the Dma. component. |
| [in] | ChanId | is the MCDMA channel ID to use for the transfer. |
References PAYLOAD_SIZE, XXE_HDR_SIZE, XxvEthernetUtilErrorTrap(), XxvEthernetUtilFrameHdrFormatMAC(), XxvEthernetUtilFrameHdrFormatType(), XxvEthernetUtilFrameMemClear(), XxvEthernetUtilFrameSetPayloadData(), XxvEthernetUtilFrameVerify(), XXxvEthernet_Start(), and XXxvEthernet_Stop().
Referenced by UsxgmiiSgDmaIntrExample().
| int XxvEthernetSgDmaIntrExample | ( | XXxvEthernet * | XxvEthernetInstancePtr, |
| XMcdma * | DmaInstancePtr, | ||
| UINTPTR | XxvBaseAddress | ||
| ) |
Demonstrates Xxv Ethernet send and receive in interrupt-driven MCDMA mode.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. XxvEthernet component. |
| [in] | DmaInstancePtr | is a pointer to the instance of the AXI MCDMA. component. |
| [in] | XxvBaseAddress | contains the base address of the XxvEthernet device. |
References XXxvEthernet_Config::BaseAddress, BLOCK_SIZE_2MB, XXV_AXIDEVTYPE_MASK, XXV_MCDMA, XXxvEthernet_Config::XxvDevBaseAddress, XxvEthernetSgDmaIntrSingleFrameExample(), XxvEthernetUtilEnterLocalLoopback(), XxvEthernetUtilErrorTrap(), XXxvEthernet_CfgInitialize(), XXxvEthernet_LookupConfig(), and XXxvEthernet_Stop().
Referenced by main().
| int XxvEthernetSgDmaIntrSingleFrameExample | ( | XXxvEthernet * | XxvEthernetInstancePtr, |
| XMcdma * | DmaInstancePtr, | ||
| u8 | ChanId | ||
| ) |
Sends and receives a single Xxv Ethernet frame in interrupt-driven MCDMA mode.
The source packet will be described by two descriptors. It will be received into a buffer described by a single descriptor.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. Xxv Ethernet component. |
| [in] | DmaInstancePtr | is a pointer to the instance of the Dma. component. |
| [in] | ChanId | is the MCDMA channel ID to use for the transfer. |
References PAYLOAD_SIZE, XXE_HDR_SIZE, XxvEthernetUtilErrorTrap(), XxvEthernetUtilFrameHdrFormatMAC(), XxvEthernetUtilFrameHdrFormatType(), XxvEthernetUtilFrameMemClear(), XxvEthernetUtilFrameSetPayloadData(), XxvEthernetUtilFrameVerify(), XXxvEthernet_Start(), and XXxvEthernet_Stop().
Referenced by XxvEthernetSgDmaIntrExample().
| int XxvEthernetUtilEnterLocalLoopback | ( | XXxvEthernet * | XxvEthernetInstancePtr | ) |
Sets 10G Ethernet in local loopback mode.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. XxvEthernet component. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXE_GRR_OFFSET, XXE_MODE_LCLLPBK_MASK, XXE_MODE_OFFSET, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.
Referenced by XxvEthernetSgDmaIntrExample().
| void XxvEthernetUtilErrorTrap | ( | const char * | Message | ) |
Reports an error detected by example code.
It can be set as a breakpoint with a debugger or used to print the given message if a UART or STDIO device is present.
| [in] | Message | is the text explaining the error. |
Referenced by main(), UsxgmiiSgDmaIntrExample(), UsxgmiiSgDmaIntrSingleFrameExample(), XxvEthernetSgDmaIntrExample(), and XxvEthernetSgDmaIntrSingleFrameExample().
| void XxvEthernetUtilFrameHdrFormatMAC | ( | EthernetFrame * | FramePtr, |
| char * | DestAddr, | ||
| char * | SrcAddr | ||
| ) |
Sets the MAC addresses in the frame.
| [in] | FramePtr | is the pointer to the frame. |
| [in] | DestAddr | is the Destination MAC address. |
| [in] | SrcAddr | is the source MAC address. |
References XXE_MAC_ADDR_SIZE.
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), and XxvEthernetSgDmaIntrSingleFrameExample().
| void XxvEthernetUtilFrameHdrFormatType | ( | EthernetFrame * | FramePtr, |
| u16 | FrameType | ||
| ) |
Sets the frame type for the specified frame.
| [in] | FramePtr | is the pointer to the frame. |
| [in] | FrameType | is the Type to set in frame. |
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), and XxvEthernetSgDmaIntrSingleFrameExample().
| void XxvEthernetUtilFrameMemClear | ( | EthernetFrame * | FramePtr | ) |
Sets all bytes of a frame to 0.
| [in] | FramePtr | is a pointer to the frame itself. |
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), and XxvEthernetSgDmaIntrSingleFrameExample().
| void XxvEthernetUtilFrameSetPayloadData | ( | EthernetFrame * | FramePtr, |
| int | PayloadSize | ||
| ) |
Places an incrementing pattern in the payload section of a frame.
The pattern is an 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, ..
| [in] | FramePtr | is a pointer to the frame to change. |
| [in] | PayloadSize | is the number of bytes in the payload that will be. set. |
References XXE_HDR_SIZE.
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), and XxvEthernetSgDmaIntrSingleFrameExample().
| int XxvEthernetUtilFrameVerify | ( | EthernetFrame * | CheckFrame, |
| EthernetFrame * | ActualFrame | ||
| ) |
Verifies frame data against a CheckFrame.
Validation occurs by comparing the ActualFrame to the header of the CheckFrame. If the headers match, then the payload of ActualFrame is verified for the same pattern Util_FrameSetPayloadData() generates.
| [in] | CheckFrame | is a pointer to a frame containing the 14 byte header. that should be present in the ActualFrame parameter. |
| [in] | ActualFrame | is a pointer to a frame to validate. |
References XXE_HDR_SIZE.
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), and XxvEthernetSgDmaIntrSingleFrameExample().
| int XxvEthernetUtilUsxgmiiSetup | ( | XXxvEthernet * | XxvEthernetInstancePtr, |
| u32 | Rate, | ||
| u32 | Duplex | ||
| ) |
Sets up USXGMII at the specified speed with autonegotiation enabled.
Autonegotiation is enabled with the selected settings. If autonegotiation fails, it is restarted after a timeout. The function returns success after autonegotiation is completed. Enables RX and performs a GT reset first because USXGMII requires the same.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. XxvEthernet component. |
| [in] | Rate | Line rate to set. Use RATE_1G or RATE_2G5. |
| [in] | Duplex | Set to 1 for full duplex, or 0 for half duplex. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXE_GRR_OFFSET, XXE_RECEIVER_ENABLE_OPTION, XXE_USXGMII_AN_COMP_MASK, XXxvEthernet_GetUsxgmiiAnSts, XXxvEthernet_SetOptions(), XXxvEthernet_SetUsxgmiiAnEnable, XXxvEthernet_SetUsxgmiiRateAndDuplex(), XXxvEthernet_UsxgmiiAnMainRestart(), and XXxvEthernet_WriteReg.
Referenced by UsxgmiiSgDmaIntrExample().
| int XxvEthernetUtilUsxgmiiSetupBypassAN | ( | XXxvEthernet * | XxvEthernetInstancePtr, |
| u32 | Rate, | ||
| u32 | Duplex | ||
| ) |
Sets up USXGMII at the specified speed with autonegotiation bypassed.
Autonegotiation is bypassed and the status is checked for completion before returning successfully. Enables RX and performs a GT reset first because USXGMII requires the same.
| [in] | XxvEthernetInstancePtr | is a pointer to the instance of the. XxvEthernet component. |
| [in] | Rate | Line rate to set. Use RATE_1G or RATE_2G5. |
| [in] | Duplex | Set to 1 for full duplex, or 0 for half duplex. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXE_GRR_OFFSET, XXE_RECEIVER_ENABLE_OPTION, XXE_USXGMII_AN_COMP_MASK, XXxvEthernet_GetUsxgmiiAnSts, XXxvEthernet_SetOptions(), XXxvEthernet_SetUsxgmiiAnBypass, XXxvEthernet_SetUsxgmiiRateAndDuplex(), XXxvEthernet_UsxgmiiAnMainRestart(), and XXxvEthernet_WriteReg.
| int XXxvEthernet_CfgInitialize | ( | XXxvEthernet * | InstancePtr, |
| XXxvEthernet_Config * | CfgPtr, | ||
| UINTPTR | EffectiveAddress | ||
| ) |
XXxvEthernet_CfgInitialize initializes an XXV Ethernet device along with the InstancePtr that references it.
| [in] | InstancePtr | references the memory instance to be associated with the XXV Ethernet core instance upon initialization. |
| [in] | CfgPtr | references the structure holding the hardware configuration for the Xxv Ethernet core to initialize. |
| [in] | 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. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, and XXxvEthernet_Reset().
Referenced by UsxgmiiSgDmaIntrExample(), and 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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| [in] | Options | is a bitmask of OR'd XXE_*_OPTION values for options to clear. Options not specified are not affected. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet::Options, XXE_FCS_INSERT_OPTION, XXE_FCS_STRIP_OPTION, XXE_RECEIVER_ENABLE_OPTION, XXE_RXCFG_DEL_FCS_MASK, XXE_RXCFG_OFFSET, XXE_RXCFG_RX_MASK, XXE_TRANSMITTER_ENABLE_OPTION, XXE_TXCFG_FCS_MASK, XXE_TXCFG_OFFSET, XXE_TXCFG_TX_MASK, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.
| u16 XXxvEthernet_GetAutoNegSpeed | ( | XXxvEthernet * | InstancePtr | ) |
XXxvEthernet_GetAutoNegSpeed reports the speed (only 10G supported) from the Autonegotiation status register.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXE_ANA_10GKR_MASK, XXE_ANASR_OFFSET, XXE_SPEED_10_GBPS, and XXxvEthernet_ReadReg.
| u32 XXxvEthernet_GetOptions | ( | XXxvEthernet * | InstancePtr | ) |
XXxvEthernet_GetOptions returns the current option settings.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
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.
| [in] | InstancePtr | references the memory instance to be associated with the AXI Ethernet core instance upon initialization. |
| [in] | CfgPtr | references the structure holding the hardware configuration for the Axi Ethernet core to initialize. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, and XXxvEthernet::IsReady.
| XXxvEthernet_Config * XXxvEthernet_LookupConfig | ( | UINTPTR | BaseAddress | ) |
Looks up device configuration by base address.
| [in] | BaseAddress | contains the base address of the device. |
References XXxvEthernet_Config::Name, and XXxvEthernet_ConfigTable.
Referenced by UsxgmiiSgDmaIntrExample(), and XxvEthernetSgDmaIntrExample().
| XXxvEthernet_Config* XXxvEthernet_LookupConfigBaseAddr | ( | UINTPTR | BaseAddress | ) |
Looks up device configuration by base address.
| [in] | BaseAddress | is the base address of the device to look up. |
References XXxvEthernet_Config::Name.
| 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 (MCDMA). Disables TX and RX only. Inserts a delay before stopping the device.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
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.
| [in] | InstancePtr | references the Xxv Ethernet on which to operate. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXE_ANA_10GKR_MASK, XXE_ANACR_OFFSET, 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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
| [in] | Options | is a bitmask of OR'd XXE_*_OPTION values for options to set. Options not specified are not affected. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet::Options, XXE_DEFAULT_OPTIONS, XXE_FCS_INSERT_OPTION, XXE_FCS_STRIP_OPTION, XXE_RECEIVER_ENABLE_OPTION, XXE_RXCFG_DEL_FCS_MASK, XXE_RXCFG_OFFSET, XXE_RXCFG_RX_MASK, XXE_TRANSMITTER_ENABLE_OPTION, XXE_TXCFG_FCS_MASK, XXE_TXCFG_OFFSET, XXE_TXCFG_TX_MASK, 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.
| [in] | InstancePtr | references the Xxv Ethernet on which to operate. |
| [in] | Rate | Line rate to set. Pass RATE_1G or RATE_2G5. |
| [in] | SetFD | Set to 0 for half duplex, or non-zero for full duplex. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, RATE_100M, RATE_10G, RATE_10M, RATE_1G, RATE_2G5, XXE_USXGMII_AN_OFFSET, XXE_USXGMII_ANA_FD_MASK, XXE_USXGMII_ANA_MASK, XXE_USXGMII_ANA_SPEED_MASK, XXE_USXGMII_LINK_STS_MASK, XXE_USXGMII_RATE_100M_MASK, XXE_USXGMII_RATE_10G_MASK, XXE_USXGMII_RATE_10M_MASK, XXE_USXGMII_RATE_1G_MASK, XXE_USXGMII_RATE_2G5_MASK, XXE_USXGMII_RATE_MASK, XXE_USXGMII_RATE_SHIFT, XXE_USXGMII_SPEED_SHIFT, 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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXxvEthernet::Options, XXE_RECEIVER_ENABLE_OPTION, XXE_RXBLKLCK_MASK, XXE_RXBLSR_OFFSET, XXE_RXCFG_OFFSET, XXE_RXCFG_RX_MASK, XXE_TRANSMITTER_ENABLE_OPTION, XXE_TXCFG_OFFSET, XXE_TXCFG_TX_MASK, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.
Referenced by UsxgmiiSgDmaIntrSingleFrameExample(), and 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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXxvEthernet::IsStarted, XXE_RXCFG_OFFSET, XXE_RXCFG_RX_MASK, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.
Referenced by UsxgmiiSgDmaIntrExample(), UsxgmiiSgDmaIntrSingleFrameExample(), 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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXE_USXGMII_AN_OFFSET, XXE_USXGMII_ANMAINRESET_MASK, 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.
| [in] | InstancePtr | is a pointer to the Xxv Ethernet instance to be worked on. |
References XXxvEthernet_Config::BaseAddress, XXxvEthernet::Config, XXxvEthernet::IsReady, XXE_USXGMII_AN_OFFSET, XXE_USXGMII_ANRESTART_MASK, XXxvEthernet_ReadReg, and XXxvEthernet_WriteReg.
Referenced by XxvEthernetUtilUsxgmiiSetup(), and XxvEthernetUtilUsxgmiiSetupBypassAN().
| XXxvEthernet_Config XXxvEthernet_ConfigTable[] |
Configuration table for each XXV Ethernet instance in the system.
Referenced by XXxvEthernet_LookupConfig().