no-OS
axi_jesd204_tx.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AXI_JESD204_TX_H_
40 #define AXI_JESD204_TX_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include <stdbool.h>
47 #include "jesd204.h"
48 
49 /******************************************************************************/
50 /*************************** Types Declarations *******************************/
51 /******************************************************************************/
53  uint8_t device_id;
54  uint8_t bank_id;
55  uint8_t lane_id;
60  uint8_t resolution;
61  uint8_t bits_per_sample;
63  uint8_t jesd_version;
66  uint32_t version;
69 };
70 
77  const char *name;
79  uint32_t base;
81  uint32_t num_lanes;
83  uint32_t data_path_width;
89  uint32_t device_clk_khz;
91  uint32_t lane_clk_khz;
94 
95  struct jesd204_dev *jdev;
96 };
97 
104  const char *name;
106  uint32_t base;
122  uint8_t subclass;
124  uint32_t device_clk_khz;
126  uint32_t lane_clk_khz;
127 };
128 
129 /******************************************************************************/
130 /************************ Functions Declarations ******************************/
131 /******************************************************************************/
133 int32_t axi_jesd204_tx_lane_clk_enable(struct axi_jesd204_tx *jesd);
135 int32_t axi_jesd204_tx_lane_clk_disable(struct axi_jesd204_tx *jesd);
137 uint32_t axi_jesd204_tx_status_read(struct axi_jesd204_tx *jesd);
139 int32_t axi_jesd204_tx_init(struct axi_jesd204_tx **jesd204,
140  const struct jesd204_tx_init *init);
142 int32_t axi_jesd204_tx_init_jesd_fsm(struct axi_jesd204_tx **jesd204,
143  const struct jesd204_tx_init *init);
145 int32_t axi_jesd204_tx_remove(struct axi_jesd204_tx *jesd);
146 #endif
jesd204_tx_config::subclass_version
uint8_t subclass_version
Definition: axi_jesd204_tx.h:64
JESD204_LINK_STATUS_DATA
#define JESD204_LINK_STATUS_DATA
Definition: axi_jesd204_tx.c:82
JESD204_TX_REG_LINK_CONF4
#define JESD204_TX_REG_LINK_CONF4
Definition: axi_jesd204_tx.c:79
jesd204_tx_config::converters_per_device
uint8_t converters_per_device
Definition: axi_jesd204_tx.h:59
JESD204_TX_REG_MAGIC
#define JESD204_TX_REG_MAGIC
Definition: axi_jesd204_tx.c:57
ADI_AXI_PCORE_VER
#define ADI_AXI_PCORE_VER(major, minor, patch)
Definition: axi_jesd204_tx.c:94
jesd204_tx_config::device_id
uint8_t device_id
Definition: axi_jesd204_tx.h:53
axi_jesd204_tx::name
const char * name
Definition: axi_jesd204_tx.h:77
JESD204_TX_REG_LINK_STATE
#define JESD204_TX_REG_LINK_STATE
Definition: axi_jesd204_tx.c:67
NO_OS_GENMASK
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:86
jesd204_dev_data::state_ops
struct jesd204_state_op state_ops[__JESD204_MAX_OPS]
Definition: jesd204.h:232
JESD204_STATE_OP_REASON_INIT
@ JESD204_STATE_OP_REASON_INIT
Definition: jesd204.h:148
JESD204_TX_REG_LINK_STATUS
#define JESD204_TX_REG_LINK_STATUS
Definition: axi_jesd204_tx.c:81
jesd204_tx_init::bits_per_sample
uint8_t bits_per_sample
Definition: axi_jesd204_tx.h:116
JESD204_TX_REG_SYSREF_CONF_SYSREF_DISABLE
#define JESD204_TX_REG_SYSREF_CONF_SYSREF_DISABLE
Definition: axi_jesd204_tx.c:71
jesd204_tx_config::control_bits_per_sample
uint8_t control_bits_per_sample
Definition: axi_jesd204_tx.h:65
jesd204_tx_config::bits_per_sample
uint8_t bits_per_sample
Definition: axi_jesd204_tx.h:61
JESD204_TX_ENCODER_GET
#define JESD204_TX_ENCODER_GET(x)
Definition: axi_jesd204_tx.c:64
jesd204_tx_config::octets_per_frame
uint8_t octets_per_frame
Definition: axi_jesd204_tx.h:57
axi_jesd204_tx::device_clk_khz
uint32_t device_clk_khz
Definition: axi_jesd204_tx.h:89
pr_err
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:94
jesd204_tx_config::high_density
bool high_density
Definition: axi_jesd204_tx.h:68
no_os_delay.h
Header file of Delay functions.
JESD204_ENCODER_8B10B
@ JESD204_ENCODER_8B10B
Definition: jesd204.h:30
JESD204_TX_REG_VERSION
#define JESD204_TX_REG_VERSION
Definition: axi_jesd204_tx.c:56
jesd204_state_op_reason
jesd204_state_op_reason
Definition: jesd204.h:147
jesd204_tx_init::subclass
uint8_t subclass
Definition: axi_jesd204_tx.h:122
jesd204_tx_init::control_bits_per_sample
uint8_t control_bits_per_sample
Definition: axi_jesd204_tx.h:120
NO_OS_DIV_ROUND_CLOSEST_ULL
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:60
axi_jesd204_tx::num_lanes
uint32_t num_lanes
Definition: axi_jesd204_tx.h:81
JESD204_TX_REG_SYSREF_CONF
#define JESD204_TX_REG_SYSREF_CONF
Definition: axi_jesd204_tx.c:70
axi_jesd204_tx_apply_config_legacy
int32_t axi_jesd204_tx_apply_config_legacy(struct axi_jesd204_tx *jesd, struct jesd204_tx_config *config)
Apply the JESD204 TX configuration.
Definition: axi_jesd204_tx.c:471
no_os_print_log.h
Print messages helpers.
JESD204_TX_REG_ILAS
#define JESD204_TX_REG_ILAS(x, y)
Definition: axi_jesd204_tx.c:84
JESD204_TX_REG_LINK_CLK_RATIO
#define JESD204_TX_REG_LINK_CLK_RATIO
Definition: axi_jesd204_tx.c:68
JESD204_TX_REG_CONF_DATA_PATH_WIDTH
#define JESD204_TX_REG_CONF_DATA_PATH_WIDTH
Definition: axi_jesd204_tx.c:60
jesd204_tx_config
Definition: axi_jesd204_tx.h:52
no_os_axi_io.h
Header file of AXI IO.
JESD204_TX_REG_SYNTH_REG_1
#define JESD204_TX_REG_SYNTH_REG_1
Definition: axi_jesd204_tx.c:62
JESD204_STATE_OP_REASON_UNINIT
@ JESD204_STATE_OP_REASON_UNINIT
Definition: jesd204.h:149
axi_jesd204_tx_init_jesd_fsm
int32_t axi_jesd204_tx_init_jesd_fsm(struct axi_jesd204_tx **jesd204, const struct jesd204_tx_init *init)
Device initialization.
Definition: axi_jesd204_tx.c:801
axi_jesd204_tx_apply_config
int32_t axi_jesd204_tx_apply_config(struct axi_jesd204_tx *jesd, struct jesd204_link *config)
Apply the JESD204 TX configuration.
Definition: axi_jesd204_tx.c:411
jesd204_tx_init::device_clk_khz
uint32_t device_clk_khz
Definition: axi_jesd204_tx.h:124
axi_jesd204_tx_lane_clk_enable
int32_t axi_jesd204_tx_lane_clk_enable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Enable.
Definition: axi_jesd204_tx.c:151
jesd204_tx_config::resolution
uint8_t resolution
Definition: axi_jesd204_tx.h:60
jesd204_dev_priv
void * jesd204_dev_priv(struct jesd204_dev *jdev)
axi_jesd204_tx_set_lane_ilas_legacy
void axi_jesd204_tx_set_lane_ilas_legacy(struct axi_jesd204_tx *jesd, struct jesd204_tx_config *config, uint32_t lane)
Set the JESD204 TX lane ILAS.
Definition: axi_jesd204_tx.c:365
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
jesd204_link_get_device_clock
int jesd204_link_get_device_clock(struct jesd204_link *lnk, unsigned long *device_clock)
axi_jesd204_tx_lane_clk_enable
int32_t axi_jesd204_tx_lane_clk_enable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Enable.
Definition: axi_jesd204_tx.c:151
JESD204_OP_CLOCKS_ENABLE
@ JESD204_OP_CLOCKS_ENABLE
Definition: jesd204.h:210
no_os_error.h
Error codes definition.
axi_jesd204_tx_remove
int32_t axi_jesd204_tx_remove(struct axi_jesd204_tx *jesd)
Free resoulces allocated for JESD204 TX peripheral.
Definition: axi_jesd204_tx.c:875
pr_debug
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:135
jesd204_tx_config::enable_scrambling
bool enable_scrambling
Definition: axi_jesd204_tx.h:67
jesd204.h
axi_jesd204_tx_jesd204_priv
Definition: axi_jesd204_tx.c:108
jesd204_tx_config::lanes_per_device
uint8_t lanes_per_device
Definition: axi_jesd204_tx.h:56
axi_jesd204_tx::base
uint32_t base
Definition: axi_jesd204_tx.h:79
JESD204_ENCODER_MAX
@ JESD204_ENCODER_MAX
Definition: jesd204.h:34
axi_jesd204_tx_jesd204_priv::jesd
struct axi_jesd204_tx * jesd
Definition: axi_jesd204_tx.c:109
JESD204_TX_MAGIC
#define JESD204_TX_MAGIC
Definition: axi_jesd204_tx.c:87
jesd204_tx_init::high_density
bool high_density
Definition: axi_jesd204_tx.h:118
jesd204_tx_init::octets_per_frame
uint8_t octets_per_frame
Definition: axi_jesd204_tx.h:108
axi_jesd204_tx::tpl_data_path_width
uint32_t tpl_data_path_width
Definition: axi_jesd204_tx.h:85
jesd204_tx_init::base
uint32_t base
Definition: axi_jesd204_tx.h:106
axi_jesd204_tx_status_read
uint32_t axi_jesd204_tx_status_read(struct axi_jesd204_tx *jesd)
Read status of the JESD204 Transmit Peripherial.
Definition: axi_jesd204_tx.c:174
axi_jesd204_tx_remove
int32_t axi_jesd204_tx_remove(struct axi_jesd204_tx *jesd)
Free resoulces allocated for JESD204 TX peripheral.
Definition: axi_jesd204_tx.c:875
PCORE_VERSION_MAJOR
#define PCORE_VERSION_MAJOR(x)
Definition: axi_jesd204_tx.c:97
JESD204_OP_LINK_ENABLE
@ JESD204_OP_LINK_ENABLE
Definition: jesd204.h:211
axi_jesd204_tx_write
int32_t axi_jesd204_tx_write(struct axi_jesd204_tx *jesd, uint32_t reg_addr, uint32_t reg_val)
JESD204 TX AXI Data Write.
Definition: axi_jesd204_tx.c:123
JESD204_TX_REG_LINK_DISABLE
#define JESD204_TX_REG_LINK_DISABLE
Definition: axi_jesd204_tx.c:66
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: altera_axi_io.c:59
JESD204_TX_REG_SYSREF_STATUS
#define JESD204_TX_REG_SYSREF_STATUS
Definition: axi_jesd204_tx.c:75
jesd204_tx_config::lane_id
uint8_t lane_id
Definition: axi_jesd204_tx.h:55
axi_jesd204_tx_lane_clk_disable
int32_t axi_jesd204_tx_lane_clk_disable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Disable.
Definition: axi_jesd204_tx.c:164
jesd204_tx_config::version
uint32_t version
Definition: axi_jesd204_tx.h:66
JESD204_ENCODER_64B66B
@ JESD204_ENCODER_64B66B
Definition: jesd204.h:31
JESD204_SYNTH_DATA_PATH_WIDTH_GET
#define JESD204_SYNTH_DATA_PATH_WIDTH_GET(x)
Definition: axi_jesd204_tx.c:91
PCORE_VERSION_PATCH
#define PCORE_VERSION_PATCH(x)
Definition: axi_jesd204_tx.c:99
JESD204_STATE_CHANGE_ERROR
@ JESD204_STATE_CHANGE_ERROR
Definition: jesd204.h:44
JESD204_OP_LINK_PRE_SETUP
@ JESD204_OP_LINK_PRE_SETUP
Definition: jesd204.h:200
jesd204_tx_init::converter_resolution
uint8_t converter_resolution
Definition: axi_jesd204_tx.h:114
JESD204_SUBCLASS_0
@ JESD204_SUBCLASS_0
Definition: jesd204.h:16
axi_jesd204_tx_calc_ilas_chksum_legacy
uint32_t axi_jesd204_tx_calc_ilas_chksum_legacy(const struct jesd204_tx_config *config)
Compute the JESD204 TX ILAS checksum.
Definition: axi_jesd204_tx.c:290
axi_jesd204_tx_read
int32_t axi_jesd204_tx_read(struct axi_jesd204_tx *jesd, uint32_t reg_addr, uint32_t *reg_val)
JESD204 TX AXI Data Read.
Definition: axi_jesd204_tx.c:138
axi_jesd204_tx
Definition: axi_jesd204_tx.h:75
axi_jesd204_tx::jdev
struct jesd204_dev * jdev
Definition: axi_jesd204_tx.h:95
axi_jesd204_tx_init
int32_t axi_jesd204_tx_init(struct axi_jesd204_tx **jesd204, const struct jesd204_tx_init *init)
Device initialization.
Definition: axi_jesd204_tx.c:711
JESD204_TX_REG_CONF_NUM_LANES
#define JESD204_TX_REG_CONF_NUM_LANES
Definition: axi_jesd204_tx.c:59
axi_jesd204_tx_init_jesd_fsm
int32_t axi_jesd204_tx_init_jesd_fsm(struct axi_jesd204_tx **jesd204, const struct jesd204_tx_init *init)
Device initialization.
Definition: axi_jesd204_tx.c:801
jesd204_dev_register
int jesd204_dev_register(struct jesd204_dev **jdev, const struct jesd204_dev_data *dev_data)
JESD204_TX_REG_CONF0
#define JESD204_TX_REG_CONF0
Definition: axi_jesd204_tx.c:77
JESD204_TPL_DATA_PATH_WIDTH_GET
#define JESD204_TPL_DATA_PATH_WIDTH_GET(x)
Definition: axi_jesd204_tx.c:93
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
axi_jesd204_tx_init
int32_t axi_jesd204_tx_init(struct axi_jesd204_tx **jesd204, const struct jesd204_tx_init *init)
Device initialization.
Definition: axi_jesd204_tx.c:711
axi_jesd204_tx::data_path_width
uint32_t data_path_width
Definition: axi_jesd204_tx.h:83
axi_jesd204_tx_status_read
uint32_t axi_jesd204_tx_status_read(struct axi_jesd204_tx *jesd)
Read status of the JESD204 Transmit Peripherial.
Definition: axi_jesd204_tx.c:174
jesd204_encoder
jesd204_encoder
Definition: jesd204.h:28
axi_jesd204_tx::config
struct jesd204_tx_config config
Definition: axi_jesd204_tx.h:87
jesd204_tx_init::converters_per_device
uint8_t converters_per_device
Definition: axi_jesd204_tx.h:112
jesd204_link_get_rate_khz
int jesd204_link_get_rate_khz(struct jesd204_link *lnk, unsigned long *lane_rate_khz)
JESD204_STATE_CHANGE_DONE
@ JESD204_STATE_CHANGE_DONE
Definition: jesd204.h:46
axi_jesd204_tx_lane_clk_disable
int32_t axi_jesd204_tx_lane_clk_disable(struct axi_jesd204_tx *jesd)
JESD204 TX Lane Clock Disable.
Definition: axi_jesd204_tx.c:164
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: altera_axi_io.c:73
jesd204_tx_init::frames_per_multiframe
uint16_t frames_per_multiframe
Definition: axi_jesd204_tx.h:110
jesd204_tx_config::bank_id
uint8_t bank_id
Definition: axi_jesd204_tx.h:54
jesd204_tx_init::name
const char * name
Definition: axi_jesd204_tx.h:104
JESD204_ENCODER_UNKNOWN
@ JESD204_ENCODER_UNKNOWN
Definition: jesd204.h:29
jesd204_state_op::per_link
jesd204_link_cb per_link
Definition: jesd204.h:192
no_os_util.h
Header file of utility functions.
axi_jesd204_tx::lane_clk_khz
uint32_t lane_clk_khz
Definition: axi_jesd204_tx.h:91
PCORE_VERSION_MINOR
#define PCORE_VERSION_MINOR(x)
Definition: axi_jesd204_tx.c:98
jesd204_tx_config::samples_per_frame
uint8_t samples_per_frame
Definition: axi_jesd204_tx.h:62
JESD204_OP_LINK_RUNNING
@ JESD204_OP_LINK_RUNNING
Definition: jesd204.h:212
jesd204_tx_config::jesd_version
uint8_t jesd_version
Definition: axi_jesd204_tx.h:63
jesd204_tx_init
JESD204B/C Transmit Peripheral Initialization Structure.
Definition: axi_jesd204_tx.h:102
jesd204_dev_data
JESD204 device initialization data.
Definition: jesd204.h:227
axi_jesd204_tx_link_status_label
const char * axi_jesd204_tx_link_status_label[]
Definition: axi_jesd204_tx.c:101
axi_jesd204_tx::encoder
enum jesd204_encoder encoder
Definition: axi_jesd204_tx.h:93
jesd204_tx_init::lane_clk_khz
uint32_t lane_clk_khz
Definition: axi_jesd204_tx.h:126
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:58
JESD204_OP_LINK_SETUP
@ JESD204_OP_LINK_SETUP
Definition: jesd204.h:204
axi_jesd204_tx.h
Driver for the Analog Devices AXI-JESD204-TX peripheral.
jesd204_tx_config::frames_per_multiframe
uint16_t frames_per_multiframe
Definition: axi_jesd204_tx.h:58
no_os_div_u64
uint64_t no_os_div_u64(uint64_t dividend, uint32_t divisor)