#include <string.h>
#include "xstatus.h"
#include "xil_assert.h"
#include "xsrio_hw.h"
Classes | |
struct | XSrio_Config |
struct | XSrio |
Defines | |
#define | XSRIO_H |
#define | XSRIO_IS_MEMORY 1 |
#define | XSRIO_IS_PROCESSOR 2 |
#define | XSRIO_IS_BRIDGE 3 |
#define | XSRIO_OP_MODE_NREAD 0 |
#define | XSRIO_OP_MODE_NWRITE 1 |
#define | XSRIO_OP_MODE_SWRITE 2 |
#define | XSRIO_OP_MODE_NWRITE_R 3 |
#define | XSRIO_OP_MODE_DATA_MESSAGE 4 |
#define | XSRIO_OP_MODE_DOORBELL 5 |
#define | XSRIO_OP_MODE_ATOMIC 6 |
#define | XSRIO_PORT_OK 0 |
#define | XSRIO_PORT_UNINITIALIZED 1 |
#define | XSRIO_PORT_HAS_ERRORS 2 |
#define | XSRIO_DIR_TX 1 |
#define | XSRIO_DIR_RX 2 |
#define | XSrio_ReadDeviceVendorID(InstancePtr) |
#define | XSrio_ReadDeviceID(InstancePtr) |
#define | XSrio_ReadAsmVendorID(InstancePtr) |
#define | XSrio_ReadAsmID(InstancePtr) |
#define | XSrio_GetExFeaturesPointer(InstancePtr) |
#define | XSrio_ReadAsmRevision(InstancePtr) |
#define | XSrio_IsLargeSystem(InstancePtr) |
#define | XSrio_IsCRFSupported(InstancePtr) |
#define | XSrio_ReadSrcOps(InstancePtr) |
#define | XSrio_ReadDstOps(InstancePtr) |
#define | XSrio_GetLCSBA(InstancePtr) |
#define | XSrio_SetLCSBA(InstancePtr, Value) |
#define | XSrio_GetLargeBaseDeviceID(InstancePtr) |
#define | XSrio_SetLargeBaseDeviceID(InstancePtr, DeviceId) |
#define | XSrio_GetBaseDeviceID(InstancePtr) |
#define | XSrio_SetBaseDeviceID(InstancePtr, DeviceId) |
#define | XSrio_GetHostBaseDevID_LockCSR(InstancePtr) |
#define | XSrio_SetHostBaseDevID_LockCSR(InstancePtr, DeviceId) |
#define | XSrio_GetComponentTagCSR(InstancePtr) |
#define | XSrio_SetComponentTagCSR(InstancePtr, Value) |
#define | XSrio_GetExtFeaturesID(InstancePtr) |
#define | XSrio_GetSerialExtFeaturesPointer(InstancePtr) |
#define | XSrio_GetPortLinkTimeOutValue(InstancePtr) |
#define | XSrio_SetPortLinkTimeOutValue(InstancePtr, Value) |
#define | XSrio_GetPortRespTimeOutValue(InstancePtr) |
#define | XSrio_SetPortRespTimeOutValue(InstancePtr, Value) |
#define | XSrio_IsPEDiscovered(InstancePtr) |
#define | XSrio_SetDiscovered(InstancePtr) |
#define | XSrio_IsMasterEnabled(InstancePtr) |
#define | XSrio_SetMasterEnabled(InstancePtr) |
#define | XSrio_IsHost(InstancePtr) |
#define | XSrio_SetHostEnabled(InstancePtr) |
#define | XSrio_GetCommand(InstancePtr) |
#define | XSrio_SendCommand(InstancePtr, Value) |
#define | XSrio_IsResponseValid(InstancePtr) |
#define | XSrio_GetOutboundAckID(InstancePtr) |
#define | XSrio_SetOutboundAckID(InstancePtr, Value) |
#define | XSrio_GetInboundAckID(InstancePtr) |
#define | XSrio_SetInboundAckID(InstancePtr, Value) |
#define | XSrio_ClrOutStandingAckIDs(InstancePtr) |
#define | XSrio_IsEnumerationBoundary(InstancePtr) |
#define | XSrio_ClrEnumerationBoundary(InstancePtr) |
#define | XSrio_GetPortwidthOverride(InstancePtr) |
#define | XSrio_SetPortwidthOverride(InstancePtr, Value) |
#define | XSrio_GetSerialLaneExtFeaturesPointer(InstancePtr) |
#define | XSrio_ClrDecodingErrors(InstancePtr, Lanenum) |
#define | XSrio_GetRxSize(InstancePtr) |
#define | XSrio_ForceRxFlowControl(InstancePtr) |
#define | XSrio_GetTxSize(InstancePtr) |
#define | XSrio_CheckforTxReqreorder(InstancePtr) |
#define | XSrio_IsTxFlowControl(InstancePtr) |
#define | XSrio_GetDestinationID(InstancePtr) |
#define | XSrio_SetDestinationID(InstancePtr, Value) |
#define | XSrio_GetCRF(InstancePtr) |
#define | XSrio_SetCRF(InstancePtr) |
#define | XSrio_GetPriority(InstancePtr) |
#define | XSrio_SetPriority(InstancePtr, Value) |
#define | XSrio_RequestTID(InstancePtr) |
#define | XSrio_SetTID(InstancePtr, Value) |
#define | XSrio_ClrPortError(InstancePtr, Mask) |
#define | XSrio_GetPortErrorStatus(InstancePtr) |
#define | XSrio_SetPortControlStatus(InstancePtr, Mask) |
#define | XSrio_GetPortControlStatus(InstancePtr) |
Functions | |
int | XSrio_CfgInitialize (XSrio *InstancePtr, XSrio_Config *Config, u32 EffectiveAddress) |
XSrio_Config * | XSrio_LookupConfig (u32 DeviceId) |
int | XSrio_GetPortStatus (XSrio *InstancePtr) |
int | XSrio_GetPEType (XSrio *InstancePtr) |
int | XSrio_IsOperationSupported (XSrio *InstancePtr, u8 Operation, u8 Direction) |
void | XSrio_SetWaterMark (XSrio *InstancePtr, u8 WaterMark0, u8 WaterMark1, u8 WaterMark2) |
void | XSrio_GetWaterMark (XSrio *InstancePtr, u8 *WaterMark0, u8 *WaterMark1, u8 *WaterMark2) |
#define XSrio_CheckforTxReqreorder | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_BCSR_OFFSET) & \ XSRIO_IMP_BCSR_TXREQ_REORDER_MASK) ? TRUE : FALSE)
XSrio_CheckforTxReqreorder checks whether the transmit buffer has been configured to allow reordering of requests.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ClrDecodingErrors | ( | InstancePtr, | |||
Lanenum | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_EFB_LPSL_OFFSET + XSRIO_SLS0_CSR_OFFSET(Lanenum)) & \ XSRIO_SLS0_CSR_DECODING_ERRORS_MASK) \ >> XSRIO_SLS0_CSR_DECODING_ERRORS_SHIFT)
XSrio_ClrDecodingErrors clears the 8B/10B decoding errors and return Result.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Lanenum | is the Serial Lane-number(0,1,2,3). |
#define XSrio_ClrEnumerationBoundary | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET) \ | XSRIO_PORT_N_CTL_CSR_ENUMB_MASK)))
XSrio_ClrEnumerationBoundary clears the enumeration boundary of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ClrOutStandingAckIDs | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET) \ | XSRIO_PORT_N_ACKID_CSR_CLSACKID_MASK)))
XSrio_ClrOutStandingAckIDs clears all outstanding unacknowledged received packets of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ClrPortError | ( | InstancePtr, | |||
Mask | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ERR_STS_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ERR_STS_CSR_OFFSET) | \ (Mask & XSRIO_PORT_N_ERR_STS_CSR_ERR_ALL_MASK))))
XSrio_ClrPortError clears the Port Error specified by the Mask.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Mask | is the mask for the Port Error to be cleared. |
#define XSRIO_DIR_RX 2 |
Receive Direction Flag
#define XSRIO_DIR_TX 1 |
Transmit Direction Flag
#define XSrio_ForceRxFlowControl | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_BCSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_BCSR_OFFSET) | \ XSRIO_IMP_BCSR_FRX_FLOW_CNTL_MASK)))
XSrio_ForceRxFlowControl forces the Tx flow control enabled core to use Rx flow control.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetBaseDeviceID | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_BASE_DID_CSR_OFFSET) & \ XSRIO_BASE_DID_CSR_BDID_MASK) >> XSRIO_BASE_DID_CSR_BDID_SHIFT)
XSrio_GetBaseDeviceID returns the 8-bit Device Id for an endpoint in a small Transport system.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetCommand | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_MNT_REQ_CSR_OFFSET) & \ XSRIO_PORT_N_MNT_REQ_CSR_CMD_MASK)
XSrio_GetCommand returns the command value that is sent on the Link-request Control symbol of the SRIO Gen2 core. This api is available only if the software assisted error recovery option is enabled in the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetComponentTagCSR | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_COMPONENT_TAG_CSR_OFFSET))
XSrio_GetComponentTagCSR returns the Component Tag Value set by the software during initialization.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetCRF | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET) & \ XSRIO_IMP_MRIR_REQ_CRF_MASK) >> XSRIO_IMP_MRIR_REQ_CRF_SHIFT)
XSrio_GetCRF checks whether the CRF is enabled in the core or not which will be used for outgoing maintenance requests.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetDestinationID | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET ) & \ XSRIO_IMP_MRIR_REQ_DESTID_MASK)
XSrio_GetDestinationID gets the destination id value which will be used for outgoing maintenance requests.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetExFeaturesPointer | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_ASM_INFO_CAR_OFFSET) & XSRIO_ASM_INFO_CAR_EFP_MASK)
XSrio_GetExFeaturesPointer gives the pointer to the Phy Register space of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetExtFeaturesID | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_EFB_HEADER_OFFSET) & \ XSRIO_EFB_HEADER_EFID_MASK)
XSrio_GetExtFeaturesID returns the Extended Features Id value.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetHostBaseDevID_LockCSR | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_HOST_DID_LOCK_CSR_OFFSET) & \ XSRIO_HOST_DID_LOCK_CSR_HBDID_MASK)
XSrio_GetHostBaseDevID_LockCSR returns the Device Id of the system host.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetInboundAckID | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET) & \ XSRIO_PORT_N_ACKID_CSR_IBACKID_MASK) >> \ XSRIO_PORT_N_ACKID_CSR_IBACKID_SHIFT)
XSrio_GetInboundAckID returns the expected Ackid of the next received packet of the SRIO Gen2 core. This api is available only if the software assisted error recovery option is selected in the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetLargeBaseDeviceID | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_BASE_DID_CSR_OFFSET) & \ XSRIO_BASE_DID_CSR_LBDID_MASK)
XSrio_GetLargeBaseDeviceID returns the 16-bit Device Id for an endpoint in a Large transport system.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetLCSBA | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_LCS1_BASEADDR_CSR_OFFSET) & \ XSRIO_LCS1_BASEADDR_LCSBA_CSR_MASK) >> \ XSRIO_LCS1_BASEADDR_LCSBA_CSR_SHIFT)
XSrio_GetLCSBA returns the Local Configuration Space Base Address(LCSBA) of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetOutboundAckID | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET) & \ XSRIO_PORT_N_ACKID_CSR_OBACKID_MASK)
XSrio_GetOutboundAckID returns the value of the next transmitted Ackid of the SRIO Gen2 Core. This api is available only if the software assisted error recovery option is selected core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetPortControlStatus | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET) & \ XSRIO_PORT_N_CTL_CSR_STATUS_ALL_MASK)
XSrio_GetPortControlStatus returns the status of the port that is currently enabled in the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetPortErrorStatus | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ERR_STS_CSR_OFFSET) & \ XSRIO_PORT_N_ERR_STS_CSR_ERR_ALL_MASK)
XSrio_GetPortErrorStatus returns the mask for the port errors currently enabled in the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetPortLinkTimeOutValue | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_LINK_TOUT_CSR_OFFSET ) & \ XSRIO_PORT_LINK_TOUT_CSR_TOUTVAL_MASK) >> \ XSRIO_PORT_LINK_TOUT_CSR_TOUTVAL_SHIFT)
XSrio_GetPortLinkTimeOutValue returns the Port Link Timeout value for the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetPortRespTimeOutValue | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_RESP_TOUT_CSR_OFFSET) & \ XSRIO_PORT_RESP_TOUT_CSR_TOUTVAL_MASK) >> \ XSRIO_PORT_RESP_TOUT_CSR_TOUTVAL_SHIFT)
XSrio_GetPortRespTimeOutValue returns the Port Response Timeout value for the the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetPortwidthOverride | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET) & \ XSRIO_PORT_N_CTL_CSR_PWO_MASK) >> XSRIO_PORT_N_CTL_CSR_PWO_SHIFT)
XSrio_GetPortwidthOverride returns the port width override value of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetPriority | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET ) & \ XSRIO_IMP_MRIR_REQ_PRIO_MASK) >> XSRIO_IMP_MRIR_REQ_PRIO_SHIFT)
XSrio_GetPriority priority used for outgoing maintenance requests.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetRxSize | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_BCSR_OFFSET ) & \ XSRIO_IMP_BCSR_RXSIZE_MASK)
XSrio_GetRxSize returns the number of maximum-size packets the rx buffer holded.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetSerialExtFeaturesPointer | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_EFB_HEADER_OFFSET) & \ XSRIO_EFB_HEADER_EFP_MASK) >> XSRIO_EFB_HEADER_EFP_SHIFT)
XSrio_GetSerialExtFeaturesPointer returns the Extended Features Pointer which will point to the next extended features block if one exists.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetSerialLaneExtFeaturesPointer | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_EFB_LPSL_OFFSET + XSRIO_SL_HEADER_OFFSET) & \ XSRIO_SL_HEADER_EFP_MASK) >> XSRIO_SL_HEADER_EFP_SHIFT)
XSrio_GetSerialLaneExtFeaturesPointer returns the extended features pointer For the serial lane which will point to the next extended features block If one exists.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_GetTxSize | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_BCSR_OFFSET ) & \ XSRIO_IMP_BCSR_TXSIZE_MASK) >> XSRIO_IMP_BCSR_TXSIZE_SHIFT)
XSrio_GetTxSize returns the number of maximum-size packets the tx buffer holds.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSRIO_H |
#define XSRIO_IS_BRIDGE 3 |
Core can be used as a bridge to another interface
#define XSRIO_IS_MEMORY 1 |
Core has physically addressable storage space
#define XSRIO_IS_PROCESSOR 2 |
Core has a local processor that runs code
#define XSrio_IsCRFSupported | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PEF_CAR_OFFSET) & XSRIO_PEF_CAR_CRF_MASK) ? \ TRUE : FALSE)
XSrio_IsCRFSupported checks whether the PE(Processing Element) supports CRF(Critical Request Flow indicator).
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsEnumerationBoundary | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET) & \ XSRIO_PORT_N_CTL_CSR_ENUMB_MASK) ? TRUE : FALSE)
XSrio_IsEnumerationBoundary checks whether the enumeration boundary is available or not for the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsHost | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET) \ & XSRIO_PORT_GEN_CTL_CSR_HOST_MASK) ? TRUE : FALSE)
XSrio_IsHost checks whether PE(Processing Element) is responsible for system exploration.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsLargeSystem | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PEF_CAR_OFFSET) & XSRIO_PEF_CAR_CTS_MASK) ? \ TRUE : FALSE)
XSrio_IsLargeSystem checks whether PE(Processing Element) supports a large system (16-bit Device ids)
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsMasterEnabled | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET) \ & XSRIO_PORT_GEN_CTL_CSR_MENABLE_MASK) ? TRUE : FALSE)
XSrio_IsMasterEnabled checks whether PE(Processing Element) is allowed to issue request into the system.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsPEDiscovered | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET) & \ XSRIO_PORT_GEN_CTL_CSR_DISCOVERED_MASK) ? TRUE : FALSE)
XSrio_IsPEDiscovered checks whether the PE(Processing Element) is discovered or not.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsResponseValid | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_MNT_RES_CSR_OFFSET) & \ XSRIO_PORT_N_MNT_RES_CSR_RVALID_MASK) ? TRUE : FALSE)
XSrio_IsResponseValid checks whether the link response is valid or not in the SRIO Gen2 Core. This api is available only if the software assisted error recovery option is enabled in the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_IsTxFlowControl | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_BCSR_OFFSET) & \ XSRIO_IMP_BCSR_TX_FLOW_CNTL_MASK) ? TRUE : FALSE)
XSrio_IsTxFlowControl checks whether the BUF is currently operating in Tx flow control mode or not.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSRIO_OP_MODE_ATOMIC 6 |
Core supports atomic Operation
#define XSRIO_OP_MODE_DATA_MESSAGE 4 |
Core supports data message Operation
#define XSRIO_OP_MODE_DOORBELL 5 |
Core supports doorbell Operation
#define XSRIO_OP_MODE_NREAD 0 |
Core supports read Operation
#define XSRIO_OP_MODE_NWRITE 1 |
Core supports write Operation
#define XSRIO_OP_MODE_NWRITE_R 3 |
Core supports write with Response operation
#define XSRIO_OP_MODE_SWRITE 2 |
Core supports streaming-write Operation
#define XSRIO_PORT_HAS_ERRORS 2 |
Port has errors
#define XSRIO_PORT_OK 0 |
Port is initialized
#define XSRIO_PORT_UNINITIALIZED 1 |
Port is uninitialized
#define XSrio_ReadAsmID | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_ASM_ID_CAR_OFFSET) & XSRIO_ASM_ID_CAR_ASMID_MASK) >> \ XSRIO_ASM_ID_CAR_ASMID_SHIFT)
XSrio_ReadAsmID returns the Assembly Id of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ReadAsmRevision | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_ASM_INFO_CAR_OFFSET) & XSRIO_ASM_INFO_CAR_ASMREV_MASK) >> \ XSRIO_ASM_INFO_CAR_ASMREV_SHIFT)
XSrio_ReadAsmRevision returns the Assembly Revision value of the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ReadAsmVendorID | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_ASM_ID_CAR_OFFSET) & XSRIO_ASM_ID_CAR_ASMVID_MASK)
XSrio_ReadAsmVendorID returns the Assembly Vendor Id of the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ReadDeviceID | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_DEV_ID_CAR_OFFSET) & XSRIO_DEV_ID_DEVID_CAR_MASK) >> \ XSRIO_DEV_ID_DEVID_CAR_SHIFT)
XSrio_ReadDeviceID returns the Device Id of the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ReadDeviceVendorID | ( | InstancePtr | ) |
(XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_DEV_ID_CAR_OFFSET) & XSRIO_DEV_ID_VDRID_CAR_MASK)
XSrio_ReadDeviceVendorID returns the Device Vendor Id of the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ReadDstOps | ( | InstancePtr | ) |
XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_DST_OPS_CAR_OFFSET)
XSrio_ReadDstOps returns the Destination Operations CAR Register contents.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_ReadSrcOps | ( | InstancePtr | ) |
XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_SRC_OPS_CAR_OFFSET)
XSrio_ReadSrcOps returns the Source Operations CAR Register contents.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_RequestTID | ( | InstancePtr | ) |
((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET ) & \ XSRIO_IMP_MRIR_REQ_TID_MASK) >> XSRIO_IMP_MRIR_REQ_TID_SHIFT)
XSrio_RequestTID gives the transfer id value which will be used for the next outgoing maintenance request. This value will increment after each request is sent.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_SendCommand | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_MNT_REQ_CSR_OFFSET, \ Value & XSRIO_PORT_N_MNT_REQ_CSR_CMD_MASK))
XSrio_SendCommand sends the given command in the link-request control symbol of the SRIO Gen2 core. This api is available only if the software assisted error recovery option is selected in the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Command to be send. |
#define XSrio_SetBaseDeviceID | ( | InstancePtr, | |||
DeviceId | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_BASE_DID_CSR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_BASE_DID_CSR_OFFSET) & XSRIO_BASE_DID_CSR_LBDID_MASK) \ |((DeviceId << XSRIO_BASE_DID_CSR_BDID_SHIFT) \ & XSRIO_BASE_DID_CSR_BDID_MASK))))
XSrio_SetBaseDeviceID configures the 8-bit Device Id for an endpoint in a small transport system.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
DeviceId | is the Device ID that needs to be configured. |
#define XSrio_SetComponentTagCSR | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_COMPONENT_TAG_CSR_OFFSET, \ Value))
XSrio_SetComponentTagCSR sets the Component Tag Value for SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Component Tag Value to be set. |
#define XSrio_SetCRF | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET) | \ XSRIO_IMP_MRIR_REQ_CRF_MASK)))
XSrio_SetCRF sets CRF value that is used for outgoing maintenance requests. This api will work only when the CRF support is enabled in the core
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_SetDestinationID | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET) & ~XSRIO_IMP_MRIR_REQ_DESTID_MASK) | \ (Value & XSRIO_IMP_MRIR_REQ_DESTID_MASK))))
XSrio_SetDestinationID sets Device Id which will be used for Outgoing maintenance requests.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Device Id value. |
#define XSrio_SetDiscovered | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET) \ | XSRIO_PORT_GEN_CTL_CSR_DISCOVERED_MASK)))
XSrio_SetDiscovered configures the device as Discovered so that it is responsible for system exploration.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_SetHostBaseDevID_LockCSR | ( | InstancePtr, | |||
DeviceId | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_HOST_DID_LOCK_CSR_OFFSET, \ (DeviceId & XSRIO_HOST_DID_LOCK_CSR_HBDID_MASK)))
XSrio_SetHostBaseDevID_LockCSR configures the Host Base Device Id of the SRIO gen2 Core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
DeviceId | is the Device ID that needs to be configured. |
#define XSrio_SetHostEnabled | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET) \ | XSRIO_PORT_GEN_CTL_CSR_HOST_MASK)))
XSrio_SetHostEnabled configures the device to be responsible for system exploration.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_SetInboundAckID | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET) & \ XSRIO_PORT_N_ACKID_CSR_RESET_IBACKID_MASK) \ | ((Value << XSRIO_PORT_N_ACKID_CSR_IBACKID_SHIFT) & \ XSRIO_PORT_N_ACKID_CSR_IBACKID_MASK))))
XSrio_SetInboundAckID sets the value of the next transmitted Ackid of the SRIO Gen2 core. This api is available only if the software assisted error recovery option is selected in the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the InBound Ack Id to be set. |
#define XSrio_SetLargeBaseDeviceID | ( | InstancePtr, | |||
DeviceId | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_BASE_DID_CSR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_BASE_DID_CSR_OFFSET) & XSRIO_BASE_DID_CSR_BDID_MASK) | \ (DeviceId & XSRIO_BASE_DID_CSR_LBDID_MASK))))
XSrio_SetLargeBaseDeviceID configures the 16-bit Device Id for an endpoint in a Large transport system.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
DeviceId | is the Device ID that needs to be configured. |
#define XSrio_SetLCSBA | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_LCS1_BASEADDR_CSR_OFFSET, \ ((Value << XSRIO_LCS1_BASEADDR_LCSBA_CSR_SHIFT) \ & XSRIO_LCS1_BASEADDR_LCSBA_CSR_MASK)))
XSrio_SetLCSBA Configures the Local Configuration Space Base Address of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Local Configuration Space Base Address that needs to be configured. |
#define XSrio_SetMasterEnabled | ( | InstancePtr | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_GEN_CTL_CSR_OFFSET) \ | XSRIO_PORT_GEN_CTL_CSR_MENABLE_MASK)))
XSrio_SetMasterEnabled configures the device so that it is allowed to issue requests into the system.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. |
#define XSrio_SetOutboundAckID | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_ACKID_CSR_OFFSET) & \ XSRIO_PORT_N_ACKID_CSR_RESET_OBACKID_MASK) \ | (Value & XSRIO_PORT_N_ACKID_CSR_OBACKID_MASK))))
XSrio_SetOutboundAckID sets value of the next transmitted Ackid of the SRIO Gen2 Core. This api is available only if the software assisted error Recovery option is selected in the core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Outbound Ack Id to be set. |
#define XSrio_SetPortControlStatus | ( | InstancePtr, | |||
Mask | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET, \ (XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET) \ | (Mask & XSRIO_PORT_N_CTL_CSR_STATUS_ALL_MASK))))
XSrio_SetPortControlStatus Configures specific port specified by the Mask.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Mask | is the mask for the port that needs to be enabled. |
#define XSrio_SetPortLinkTimeOutValue | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_LINK_TOUT_CSR_OFFSET , \ (Value << XSRIO_PORT_LINK_TOUT_CSR_TOUTVAL_SHIFT) & \ XSRIO_PORT_LINK_TOUT_CSR_TOUTVAL_MASK))
XSrio_SetPortLinkTimeOutValue sets the Port Link Timeout value for the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Port Link Timeout value to be set. |
#define XSrio_SetPortRespTimeOutValue | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_RESP_TOUT_CSR_OFFSET, \ (Value << XSRIO_PORT_RESP_TOUT_CSR_TOUTVAL_SHIFT) & \ XSRIO_PORT_RESP_TOUT_CSR_TOUTVAL_MASK))
XSrio_SetPortRespTimeOutValue sets the Port Response Timeout value for the The SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Port Response Timeout to be set. |
#define XSrio_SetPortwidthOverride | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_PORT_N_CTL_CSR_OFFSET) & \ XSRIO_PORT_N_CTL_CSR_RESET_PWO_MASK) | \ ((Value << XSRIO_PORT_N_CTL_CSR_PWO_SHIFT) \ & XSRIO_PORT_N_CTL_CSR_PWO_MASK))))
XSrio_SetPortwidthOverride configures the port width override value of the SRIO Gen2 core.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the port width override value needs to be set. |
#define XSrio_SetPriority | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET) & ~XSRIO_IMP_MRIR_REQ_PRIO_MASK) | \ ((Value << XSRIO_IMP_MRIR_REQ_PRIO_SHIFT)& \ XSRIO_IMP_MRIR_REQ_PRIO_MASK))))
XSrio_SetPriority sets the Priority which will be used for outgoing maintenance requests.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the Priority value which will used for outgoing maintenance requests. |
#define XSrio_SetTID | ( | InstancePtr, | |||
Value | ) |
(XSrio_WriteReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET, \ ((XSrio_ReadReg((InstancePtr)->Config.BaseAddress, \ XSRIO_IMP_MRIR_OFFSET) & ~XSRIO_IMP_MRIR_REQ_TID_MASK) | \ ((Value << XSRIO_IMP_MRIR_REQ_TID_SHIFT)& \ XSRIO_IMP_MRIR_REQ_TID_MASK))))
XSrio_SetTID sets the transfer id which will be used for the next outgoing maintenance request.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Value | is the transfer id value which of the next outgoing maintenance request. |
int XSrio_CfgInitialize | ( | XSrio * | InstancePtr, | |
XSrio_Config * | Config, | |||
u32 | EffectiveAddress | |||
) |
Initialization and Control functions in xsrio.c
Initialize the XSrio instance provided by the caller based on the given Config structure.
InstancePtr | is the XSrio instance to operate on. | |
Config | is the device configuration structure containing information about a specific SRIO Device. | |
EffectiveAddress | is the Physical address of the hardware in a Virtual Memory operating system environment.It is the Base Address in a stand alone environment. |
int XSrio_GetPEType | ( | XSrio * | InstancePtr | ) |
XSrio_GetPEType API will check for the Processing Element type and return the type of type of Processing Element
InstancePtr | is the XSrio instance to operate on. |
int XSrio_GetPortStatus | ( | XSrio * | InstancePtr | ) |
XSrio_GetPortStatus will check the status of the port and returns the status of the port to the user
InstancePtr | is the XSrio instance to operate on. |
void XSrio_GetWaterMark | ( | XSrio * | InstancePtr, | |
u8 * | WaterMark0, | |||
u8 * | WaterMark1, | |||
u8 * | WaterMark2 | |||
) |
XSrio_GetWaterMark API reads the water mark values.
InstancePtr | is the XSrio instance to operate on. | |
WaterMark0 | is a pointer to a variable where the driver will pass back the water mark 0 value. | |
WaterMark1 | is a pointer to a variable where the driver will pass back the water mark 1 value. | |
WaterMark2 | is a pointer to a variable where the driver will pass back the water mark 2 value. |
int XSrio_IsOperationSupported | ( | XSrio * | InstancePtr, | |
u8 | Operation, | |||
u8 | Direction | |||
) |
XSrio_IsOperationSupported tells whether the operation is supported by the SRIO Gen2 core or not.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
Operation | type is the operation type of the SRIO Packet | |
Direction | type |
XSrio_Config* XSrio_LookupConfig | ( | u32 | DeviceId | ) |
Looks up the device configuration based on the unique device ID. The table XSrio_ConfigTable contains the configuration info for each device in the system.
DeviceId | is the unique device ID of the device to lookup for |
void XSrio_SetWaterMark | ( | XSrio * | InstancePtr, | |
u8 | WaterMark0, | |||
u8 | WaterMark1, | |||
u8 | WaterMark2 | |||
) |
XSrio_SetWaterMark Configures the watermark to transfer a priority packet.
InstancePtr | is a pointer to the SRIO Gen2 instance to be worked on. | |
WaterMark0 | is the water mark value to transfer a priority 0 packet. | |
WaterMark1 | is the water mark value to transfer a priority 1 packet. | |
WaterMark2 | is the water mark value to transfer a priority 2 packet. |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.