no-OS
axi_jesd204_rx.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AXI_JESD204_RX_H_
40 #define AXI_JESD204_RX_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include <stdbool.h>
47 
48 /******************************************************************************/
49 /*************************** Types Declarations *******************************/
50 /******************************************************************************/
55 };
56 
57 /* JESD204 Supported encoding scheme */
63 };
64 
71  const char *name;
73  uint32_t base;
75  uint32_t version;
76  /* Number of lanes of the peripheral */
77  uint32_t num_lanes;
79  uint32_t data_path_width;
85  uint32_t device_clk_khz;
87  uint32_t lane_clk_khz;
90 };
91 
98  const char *name;
100  uint32_t base;
106  uint8_t subclass;
108  uint32_t device_clk_khz;
110  uint32_t lane_clk_khz;
111 };
112 
113 /******************************************************************************/
114 /************************ Functions Declarations ******************************/
115 /******************************************************************************/
117 int32_t axi_jesd204_rx_lane_clk_enable(struct axi_jesd204_rx *jesd);
119 int32_t axi_jesd204_rx_lane_clk_disable(struct axi_jesd204_rx *jesd);
121 uint32_t axi_jesd204_rx_status_read(struct axi_jesd204_rx *jesd);
123 int32_t axi_jesd204_rx_laneinfo_read(struct axi_jesd204_rx *jesd,
124  uint32_t lane);
126 int32_t axi_jesd204_rx_watchdog(struct axi_jesd204_rx *jesd);
128 int32_t axi_jesd204_rx_init(struct axi_jesd204_rx **jesd204,
129  const struct jesd204_rx_init *init);
131 int32_t axi_jesd204_rx_remove(struct axi_jesd204_rx *jesd);
132 #endif
JESD204_RX_REG_MAGIC
#define JESD204_RX_REG_MAGIC
Definition: axi_jesd204_rx.c:56
JESD204_RX_REG_LINK_CONF2
#define JESD204_RX_REG_LINK_CONF2
Definition: axi_jesd204_rx.c:78
JESD204_RX_REG_ILAS
#define JESD204_RX_REG_ILAS(x, y)
Definition: axi_jesd204_rx.c:89
JESD204_EMB_STATE_GET
#define JESD204_EMB_STATE_GET(x)
Definition: axi_jesd204_rx.c:85
ADI_AXI_PCORE_VER
#define ADI_AXI_PCORE_VER(major, minor, patch)
Definition: axi_jesd204_rx.c:102
jesd204_rx_config::subclass_version
uint8_t subclass_version
Definition: axi_jesd204_rx.h:54
axi_jesd204_rx::num_lanes
uint32_t num_lanes
Definition: axi_jesd204_rx.h:77
axi_jesd204_rx_check_lane_status
bool axi_jesd204_rx_check_lane_status(struct axi_jesd204_rx *jesd, uint32_t lane)
Check JESD204 RX Lane Status.
Definition: axi_jesd204_rx.c:439
axi_jesd204_rx_lane_clk_disable
int32_t axi_jesd204_rx_lane_clk_disable(struct axi_jesd204_rx *jesd)
JESD204 RX Lane Clock Disable.
Definition: axi_jesd204_rx.c:198
jesd204_rx_init::frames_per_multiframe
uint16_t frames_per_multiframe
Definition: axi_jesd204_rx.h:104
jesd204_rx_init::lane_clk_khz
uint32_t lane_clk_khz
Definition: axi_jesd204_rx.h:110
axi_jesd204_rx::data_path_width
uint32_t data_path_width
Definition: axi_jesd204_rx.h:79
axi_jesd204_rx::base
uint32_t base
Definition: axi_jesd204_rx.h:73
no_os_delay.h
Header file of Delay functions.
axi_jesd204_rx_status_read
uint32_t axi_jesd204_rx_status_read(struct axi_jesd204_rx *jesd)
Read status of the JESD204 Receive Peripherial.
Definition: axi_jesd204_rx.c:208
JESD204_RX_REG_SYNTH_NUM_LANES
#define JESD204_RX_REG_SYNTH_NUM_LANES
Definition: axi_jesd204_rx.c:58
NO_OS_DIV_ROUND_CLOSEST_ULL
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:60
JESD204_RX_REG_LINK_DISABLE
#define JESD204_RX_REG_LINK_DISABLE
Definition: axi_jesd204_rx.c:65
JESD204_RX_REG_LANE_ERRORS
#define JESD204_RX_REG_LANE_ERRORS(x)
Definition: axi_jesd204_rx.c:88
axi_jesd204_rx_link_status_label
const char * axi_jesd204_rx_link_status_label[]
Definition: axi_jesd204_rx.c:115
JESD204_EMB_STATE_INIT
@ JESD204_EMB_STATE_INIT
Definition: axi_jesd204_rx.c:110
axi_jesd204_rx_status_read
uint32_t axi_jesd204_rx_status_read(struct axi_jesd204_rx *jesd)
Read status of the JESD204 Receive Peripherial.
Definition: axi_jesd204_rx.c:208
JESD204_RX_ENCODER_GET
#define JESD204_RX_ENCODER_GET(x)
Definition: axi_jesd204_rx.c:63
JESD204_RX_ENCODER_64B66B
@ JESD204_RX_ENCODER_64B66B
Definition: axi_jesd204_rx.h:61
jesd204_rx_config::octets_per_frame
uint8_t octets_per_frame
Definition: axi_jesd204_rx.h:52
axi_jesd204_rx::tpl_data_path_width
uint32_t tpl_data_path_width
Definition: axi_jesd204_rx.h:81
axi_jesd204_rx_link_status_64b66b_l
const char * axi_jesd204_rx_link_status_64b66b_l[]
Definition: axi_jesd204_rx.c:129
axi_jesd204_rx_init
int32_t axi_jesd204_rx_init(struct axi_jesd204_rx **jesd204, const struct jesd204_rx_init *init)
Device initialization.
Definition: axi_jesd204_rx.c:559
no_os_axi_io.h
Header file of AXI IO.
axi_jesd204_rx_remove
int32_t axi_jesd204_rx_remove(struct axi_jesd204_rx *jesd)
Free resoulces allocated for JESD204 RX peripheral.
Definition: axi_jesd204_rx.c:634
jesd204_rx_init::name
const char * name
Definition: axi_jesd204_rx.h:98
axi_jesd204_rx::version
uint32_t version
Definition: axi_jesd204_rx.h:75
JESD204_RX_REG_SYSREF_CONF_SYSREF_DISABLE
#define JESD204_RX_REG_SYSREF_CONF_SYSREF_DISABLE
Definition: axi_jesd204_rx.c:70
jesd204_rx_init::octets_per_frame
uint8_t octets_per_frame
Definition: axi_jesd204_rx.h:102
JESD204_RX_LINK_CONF2_BUFFER_EARLY_RELEASE
#define JESD204_RX_LINK_CONF2_BUFFER_EARLY_RELEASE
Definition: axi_jesd204_rx.c:79
axi_jesd204_rx_init
int32_t axi_jesd204_rx_init(struct axi_jesd204_rx **jesd204, const struct jesd204_rx_init *init)
Device initialization.
Definition: axi_jesd204_rx.c:559
jesd204_rx_config
Definition: axi_jesd204_rx.h:51
axi_jesd204_rx::encoder
enum jesd204_rx_encoder encoder
Definition: axi_jesd204_rx.h:89
JESD204_RX_REG_SYNTH_REG_1
#define JESD204_RX_REG_SYNTH_REG_1
Definition: axi_jesd204_rx.c:61
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:130
axi_jesd204_rx_lane_clk_enable
int32_t axi_jesd204_rx_lane_clk_enable(struct axi_jesd204_rx *jesd)
JESD204 RX Lane Clock Enable.
Definition: axi_jesd204_rx.c:185
JESD204_RX_REG_LINK_CONF0
#define JESD204_RX_REG_LINK_CONF0
Definition: axi_jesd204_rx.c:74
no_os_error.h
Error codes definition.
axi_jesd204_rx::device_clk_khz
uint32_t device_clk_khz
Definition: axi_jesd204_rx.h:85
jesd204_rx_encoder
jesd204_rx_encoder
Definition: axi_jesd204_rx.h:58
jesd204_rx_init::subclass
uint8_t subclass
Definition: axi_jesd204_rx.h:106
axi_jesd204_rx_remove
int32_t axi_jesd204_rx_remove(struct axi_jesd204_rx *jesd)
Free resoulces allocated for JESD204 RX peripheral.
Definition: axi_jesd204_rx.c:634
JESD204_RX_REG_LINK_CONF4
#define JESD204_RX_REG_LINK_CONF4
Definition: axi_jesd204_rx.c:76
JESD204_RX_REG_LINK_STATE
#define JESD204_RX_REG_LINK_STATE
Definition: axi_jesd204_rx.c:66
JESD204_RX_REG_LANE_LATENCY
#define JESD204_RX_REG_LANE_LATENCY(x)
Definition: axi_jesd204_rx.c:87
jesd204_rx_config::frames_per_multiframe
uint16_t frames_per_multiframe
Definition: axi_jesd204_rx.h:53
jesd204_rx_init::device_clk_khz
uint32_t device_clk_khz
Definition: axi_jesd204_rx.h:108
axi_jesd204_rx_read
int32_t axi_jesd204_rx_read(struct axi_jesd204_rx *jesd, uint32_t reg_addr, uint32_t *reg_val)
JESD204 RX AXI Data Read.
Definition: axi_jesd204_rx.c:172
JESD204_RX_REG_SYNTH_DATA_PATH_WIDTH
#define JESD204_RX_REG_SYNTH_DATA_PATH_WIDTH
Definition: axi_jesd204_rx.c:59
PCORE_VERSION_MAJOR
#define PCORE_VERSION_MAJOR(x)
Definition: axi_jesd204_rx.c:105
axi_jesd204_rx_emb_state_label
const char * axi_jesd204_rx_emb_state_label[]
Definition: axi_jesd204_rx.c:136
no_os_axi_io_read
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: axi_io.c:59
axi_jesd204_rx_apply_config
int32_t axi_jesd204_rx_apply_config(struct axi_jesd204_rx *jesd, struct jesd204_rx_config *config)
Apply the JESD204 RX configuration.
Definition: axi_jesd204_rx.c:507
JESD204_SYNTH_DATA_PATH_WIDTH_GET
#define JESD204_SYNTH_DATA_PATH_WIDTH_GET(x)
Definition: axi_jesd204_rx.c:98
PCORE_VERSION_PATCH
#define PCORE_VERSION_PATCH(x)
Definition: axi_jesd204_rx.c:107
axi_jesd204_rx::config
struct jesd204_rx_config config
Definition: axi_jesd204_rx.h:83
axi_jesd204_rx_watchdog
int32_t axi_jesd204_rx_watchdog(struct axi_jesd204_rx *jesd)
JESD204 RX Watchdog.
Definition: axi_jesd204_rx.c:475
JESD204_RX_ENCODER_UNKNOWN
@ JESD204_RX_ENCODER_UNKNOWN
Definition: axi_jesd204_rx.h:59
JESD204_RX_REG_SYSREF_STATUS
#define JESD204_RX_REG_SYSREF_STATUS
Definition: axi_jesd204_rx.c:72
JESD204_EMB_STATE_LOCK
@ JESD204_EMB_STATE_LOCK
Definition: axi_jesd204_rx.c:112
axi_jesd204_rx_lane_status_label
const char * axi_jesd204_rx_lane_status_label[]
Definition: axi_jesd204_rx.c:122
axi_jesd204_rx_watchdog
int32_t axi_jesd204_rx_watchdog(struct axi_jesd204_rx *jesd)
JESD204 RX Watchdog.
Definition: axi_jesd204_rx.c:475
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
JESD204_RX_REG_LINK_STATUS
#define JESD204_RX_REG_LINK_STATUS
Definition: axi_jesd204_rx.c:81
axi_jesd204_rx_laneinfo_read
int32_t axi_jesd204_rx_laneinfo_read(struct axi_jesd204_rx *jesd, uint32_t lane)
Read JESD204 RX Lane Info.
Definition: axi_jesd204_rx.c:411
JESD204_TPL_DATA_PATH_WIDTH_GET
#define JESD204_TPL_DATA_PATH_WIDTH_GET(x)
Definition: axi_jesd204_rx.c:100
JESD204_EMB_STATE_HUNT
@ JESD204_EMB_STATE_HUNT
Definition: axi_jesd204_rx.c:111
axi_jesd204_rx_laneinfo_read
int32_t axi_jesd204_rx_laneinfo_read(struct axi_jesd204_rx *jesd, uint32_t lane)
Read JESD204 RX Lane Info.
Definition: axi_jesd204_rx.c:411
axi_jesd204_rx
Definition: axi_jesd204_rx.h:69
JESD204_RX_REG_VERSION
#define JESD204_RX_REG_VERSION
Definition: axi_jesd204_rx.c:55
JESD204_RX_ENCODER_8B10B
@ JESD204_RX_ENCODER_8B10B
Definition: axi_jesd204_rx.h:60
axi_jesd204_rx.h
Driver for the Analog Devices AXI-JESD204-RX peripheral.
no_os_axi_io_write
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: axi_io.c:73
jesd204_rx_init::base
uint32_t base
Definition: axi_jesd204_rx.h:100
JESD204_RX_MAGIC
#define JESD204_RX_MAGIC
Definition: axi_jesd204_rx.c:94
jesd204_rx_init
JESD204B/C Receive Peripheral Initialization Structure.
Definition: axi_jesd204_rx.h:96
axi_jesd204_rx_write
int32_t axi_jesd204_rx_write(struct axi_jesd204_rx *jesd, uint32_t reg_addr, uint32_t reg_val)
JESD204 RX AXI Data Write.
Definition: axi_jesd204_rx.c:157
axi_jesd204_rx_get_lane_errors
int32_t axi_jesd204_rx_get_lane_errors(struct axi_jesd204_rx *jesd, uint32_t lane, uint32_t *errors)
Read the JESD204 RX Lane Errors.
Definition: axi_jesd204_rx.c:293
axi_jesd204_rx::lane_clk_khz
uint32_t lane_clk_khz
Definition: axi_jesd204_rx.h:87
axi_jesd204_rx::name
const char * name
Definition: axi_jesd204_rx.h:71
no_os_util.h
Implementation of utility functions.
PCORE_VERSION_MINOR
#define PCORE_VERSION_MINOR(x)
Definition: axi_jesd204_rx.c:106
JESD204_RX_REG_SYSREF_CONF
#define JESD204_RX_REG_SYSREF_CONF
Definition: axi_jesd204_rx.c:69
axi_jesd204_rx_lane_clk_disable
int32_t axi_jesd204_rx_lane_clk_disable(struct axi_jesd204_rx *jesd)
JESD204 RX Lane Clock Disable.
Definition: axi_jesd204_rx.c:198
JESD204_RX_ENCODER_MAX
@ JESD204_RX_ENCODER_MAX
Definition: axi_jesd204_rx.h:62
axi_jesd204_rx_lane_clk_enable
int32_t axi_jesd204_rx_lane_clk_enable(struct axi_jesd204_rx *jesd)
JESD204 RX Lane Clock Enable.
Definition: axi_jesd204_rx.c:185
JESD204_RX_REG_LANE_STATUS
#define JESD204_RX_REG_LANE_STATUS(x)
Definition: axi_jesd204_rx.c:83
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:58
JESD204_RX_REG_LINK_CLK_RATIO
#define JESD204_RX_REG_LINK_CLK_RATIO
Definition: axi_jesd204_rx.c:67