Go to the documentation of this file.
34 #ifndef XILINX_TRANSCEIVER_H_
35 #define XILINX_TRANSCEIVER_H_
46 #define AXI_PCORE_VER(major, minor, letter) ((major << 16) | (minor << 8) | letter)
47 #define AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff)
48 #define AXI_PCORE_VER_MINOR(version) ((version >> 8) & 0xff)
49 #define AXI_PCORE_VER_LETTER(version) (version & 0xff)
51 #define AXI_REG_VERSION 0x0000
52 #define AXI_VERSION(x) (((x) & 0xffffffff) << 0)
53 #define AXI_VERSION_IS(x, y, z) ((x) << 16 | (y) << 8 | (z))
54 #define AXI_VERSION_MAJOR(x) ((x) >> 16)
56 #define AXI_REG_FPGA_INFO 0x001C
57 #define AXI_REG_FPGA_VOLTAGE 0x0140
59 #define AXI_INFO_FPGA_TECH(info) ((info) >> 24)
60 #define AXI_INFO_FPGA_FAMILY(info) (((info) >> 16) & 0xff)
61 #define AXI_INFO_FPGA_SPEED_GRADE(info) (((info) >> 8) & 0xff)
62 #define AXI_INFO_FPGA_DEV_PACKAGE(info) ((info) & 0xff)
63 #define AXI_INFO_FPGA_VOLTAGE(val) ((val) & 0xffff)
187 unsigned int reg,
unsigned int val);
189 unsigned int reg,
unsigned int *val);
236 unsigned long parent_rate);
239 unsigned long parent_rate);
242 unsigned long parent_rate);
267 #define ENC_8B10B 810
268 #define ENC_66B64B 6664
276 uint32_t drp_port, uint32_t lane_rate, uint32_t out_div,
280 uint32_t drp_port,
bool lpm);
285 uint32_t refclk_khz, uint32_t lane_rate_khz,
300 uint32_t refclk_khz, uint32_t lane_rate_khz,
307 uint32_t sys_clk_sel, uint32_t drp_port,
316 uint32_t *rx_out_div, uint32_t *tx_out_div);
319 int32_t rx_out_div, int32_t tx_out_div);
323 uint32_t drp_port, uint32_t div);
326 uint32_t drp_port, uint32_t div);
330 uint32_t prbs,
bool reverse_lu);
334 uint32_t drp_port, uint32_t *cnt);
338 uint32_t drp_port, int32_t rx_rate, int32_t tx_rate);
342 uint32_t drp_port, int32_t rx_prog_div, int32_t tx_prog_div);
346 uint32_t drp_port,
bool en);
#define QPLL_CFG0_LOWBAND_MASK
Definition: xilinx_transceiver.c:73
@ AXI_FPGA_DEV_CL
Definition: xilinx_transceiver.h:156
enum axi_fpga_speed_grade speed_grade
Definition: xilinx_transceiver.h:174
int xilinx_xcvr_write_async_gearbox_en(struct xilinx_xcvr *xcvr, uint32_t drp_port, bool en)
Definition: xilinx_transceiver.c:1985
uint32_t vco1_max
Definition: xilinx_transceiver.h:182
#define GTY4_QPLL_CLKOUT_RATE(xcvr, x)
Definition: xilinx_transceiver.c:114
#define CPLL_REFCLK_DIV_M_ADDR
Definition: xilinx_transceiver.c:92
@ AXI_FPGA_SPEED_2L
Definition: xilinx_transceiver.h:132
int xilinx_xcvr_gtx2_cpll_read_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, struct xilinx_xcvr_cpll_config *conf)
Definition: xilinx_transceiver.c:864
#define QPLL_REFCLK_DIV_M(x)
Definition: xilinx_transceiver.c:78
#define AXI_PCORE_VER_MAJOR(version)
Definition: axi_sysid.h:59
Driver for the Xilinx High-speed transceiver dynamic reconfiguration.
@ AXI_FPGA_DEV_FH
Definition: xilinx_transceiver.h:148
int xilinx_xcvr_calc_qpll_config(struct xilinx_xcvr *xcvr, uint32_t sys_clk_sel, uint32_t refclk_khz, uint32_t lane_rate_khz, struct xilinx_xcvr_qpll_config *conf, uint32_t *out_div)
Definition: xilinx_transceiver.c:668
@ AXI_FPGA_DEV_FT
Definition: xilinx_transceiver.h:151
long(* round_rate)(struct adxcvr *xcvr, unsigned long rate, unsigned long parent_rate)
Definition: xilinx_transceiver.h:237
@ AXI_FPGA_DEV_HC
Definition: xilinx_transceiver.h:147
#define GTH4_RX_PRBS_ERR_CNT
Definition: xilinx_transceiver.c:108
@ AXI_FPGA_SPEED_3
Definition: xilinx_transceiver.h:134
int(* write)(struct adxcvr *xcvr, unsigned int drp_port, unsigned int reg, unsigned int val)
Definition: xilinx_transceiver.h:186
uint32_t fb_div_N1
Definition: xilinx_transceiver.h:251
enum axi_fpga_family family
Definition: xilinx_transceiver.h:173
#define TX_CLK25_DIV
Definition: xilinx_transceiver.c:101
ADI JESD204B/C AXI_ADXCVR Highspeed Transceiver Device structure.
Definition: altera_adxcvr.h:89
uint32_t refclk_div
Definition: xilinx_transceiver.h:250
#define QPLL_CFG0_ADDR
Definition: xilinx_transceiver.c:72
@ PM_1250
Definition: xilinx_transceiver.h:94
@ AXI_FPGA_FAMILY_KINTEX
Definition: clk_axi_clkgen.c:135
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
@ AXI_FPGA_DEV_BA
Definition: xilinx_transceiver.h:158
#define RXCDR_CFG1_ADDR
Definition: xilinx_transceiver.c:57
#define GTH34_QPLL_REFCLK_DIV(xcvr, x)
Definition: xilinx_transceiver.c:112
@ XILINX_XCVR_LEGACY_TYPE_S7_GTX2
Definition: xilinx_transceiver.h:81
int xilinx_xcvr_read_out_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t *rx_out_div, uint32_t *tx_out_div)
Definition: xilinx_transceiver.c:1560
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
enum xilinx_xcvr_type type
Definition: xilinx_transceiver.h:167
int xilinx_xcvr_configure_cdr(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t lane_rate, uint32_t out_div, bool lpm_enable)
Definition: xilinx_transceiver.c:357
axi_fgpa_technology
Enum for technology/generation of the FPGA device.
Definition: clk_axi_clkgen.c:125
struct adxcvr * ad_xcvr
Definition: xilinx_transceiver.h:170
#define CPLL_REFCLK_DIV_M_MASK
Definition: xilinx_transceiver.c:93
@ AXI_FPGA_DEV_CP
Definition: xilinx_transceiver.h:150
@ AXI_FPGA_SPEED_1
Definition: xilinx_transceiver.h:126
uint32_t qty4_full_rate
Definition: xilinx_transceiver.h:263
@ XILINX_XCVR_TYPE_US_GTY4
Definition: xilinx_transceiver.h:73
int xilinx_xcvr_calc_cpll_config(struct xilinx_xcvr *xcvr, uint32_t refclk_khz, uint32_t lane_rate_khz, struct xilinx_xcvr_cpll_config *conf, uint32_t *out_div)
Definition: xilinx_transceiver.c:539
int xilinx_xcvr_qpll_read_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t sys_clk_sel, struct xilinx_xcvr_qpll_config *conf)
Definition: xilinx_transceiver.c:1260
@ PM_200
Definition: xilinx_transceiver.h:92
#define QPLL_FBDIV_RATIO_ADDR
Definition: xilinx_transceiver.c:83
#define OUT_DIV_TX_OFFSET
Definition: xilinx_transceiver.c:51
uint32_t version
Definition: xilinx_transceiver.h:171
uint32_t vco1_min
Definition: xilinx_transceiver.h:181
#define RXCDR_CFG4_ADDR
Definition: xilinx_transceiver.c:66
int xilinx_xcvr_configure_cdr(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t lane_rate, uint32_t out_div, bool lpm_enable)
Definition: xilinx_transceiver.c:357
xilinx_xcvr_type
Enum for GT type.
Definition: xilinx_transceiver.h:69
#define RXCDR_CFG4_MASK
Definition: xilinx_transceiver.c:67
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
int xilinx_xcvr_write_prog_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_prog_div, int32_t tx_prog_div)
Definition: xilinx_transceiver.c:1863
axi_fpga_dev_pack
Enum for device package.
Definition: xilinx_transceiver.h:141
#define RX_CLK25_DIV_MASK
Definition: xilinx_transceiver.c:99
#define QPLL_CFG1_ADDR
Definition: xilinx_transceiver.c:75
@ AXI_FPGA_SPEED_1LV
Definition: xilinx_transceiver.h:130
int xilinx_xcvr_qpll_calc_lane_rate(struct xilinx_xcvr *xcvr, uint32_t refclk_hz, const struct xilinx_xcvr_qpll_config *conf, uint32_t out_div)
Definition: xilinx_transceiver.c:1470
Definition: xilinx_transceiver.h:185
int(* enable)(struct adxcvr *xcvr)
Definition: xilinx_transceiver.h:233
@ AXI_FPGA_DEV_UNKNOWN
Definition: xilinx_transceiver.h:142
xilinx_xcvr_legacy_type
Enum for legacy GT type.
Definition: xilinx_transceiver.h:80
#define QPLL_FBDIV_RATIO_MASK
Definition: xilinx_transceiver.c:84
enum xilinx_xcvr_refclk_ppm refclk_ppm
Definition: xilinx_transceiver.h:168
#define RX_CLK25_DIV_OFFSET
Definition: xilinx_transceiver.c:98
int xilinx_xcvr_prbsel_enc_get(struct xilinx_xcvr *xcvr, uint32_t prbs, bool reverse_lu)
Definition: xilinx_transceiver.c:2094
enum axi_fgpa_technology tech
Definition: xilinx_transceiver.h:172
#define OUT_DIV_RX_OFFSET
Definition: xilinx_transceiver.c:52
Driver for the ADI AXI-ADXCVR Module.
int xilinx_xcvr_qpll_calc_lane_rate(struct xilinx_xcvr *xcvr, uint32_t refclk_hz, const struct xilinx_xcvr_qpll_config *conf, uint32_t out_div)
Definition: xilinx_transceiver.c:1470
@ PM_700
Definition: xilinx_transceiver.h:93
@ AXI_FPGA_DEV_CS
Definition: xilinx_transceiver.h:149
int xilinx_xcvr_cpll_write_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, const struct xilinx_xcvr_cpll_config *conf)
Definition: xilinx_transceiver.c:1070
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:129
@ AXI_FPGA_SPEED_2LV
Definition: xilinx_transceiver.h:133
#define QPLL_REFCLK_DIV_M_OFFSET
Definition: xilinx_transceiver.c:77
#define RXCDR_CFG0_ADDR
Definition: xilinx_transceiver.c:54
uint32_t vco0_max
Definition: xilinx_transceiver.h:180
int xilinx_xcvr_read_out_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t *rx_out_div, uint32_t *tx_out_div)
Definition: xilinx_transceiver.c:1560
@ XILINX_XCVR_LEGACY_TYPE_US_GTH3
Definition: xilinx_transceiver.h:82
#define GTH3_RX_PRBS_ERR_CNT
Definition: xilinx_transceiver.c:107
int xilinx_xcvr_write_rx_clk25_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t div)
Definition: xilinx_transceiver.c:2013
#define N(x)
Definition: ad9144.h:1269
int xilinx_xcvr_drp_update(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t reg, uint32_t mask, uint32_t val)
Definition: xilinx_transceiver.c:198
int xilinx_xcvr_prbs_err_cnt_get(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t *cnt)
Definition: xilinx_transceiver.c:2138
int xilinx_xcvr_calc_qpll_config(struct xilinx_xcvr *xcvr, uint32_t sys_clk_sel, uint32_t refclk_khz, uint32_t lane_rate_khz, struct xilinx_xcvr_qpll_config *conf, uint32_t *out_div)
Definition: xilinx_transceiver.c:668
int xilinx_xcvr_calc_cpll_config(struct xilinx_xcvr *xcvr, uint32_t refclk_khz, uint32_t lane_rate_khz, struct xilinx_xcvr_cpll_config *conf, uint32_t *out_div)
Definition: xilinx_transceiver.c:539
#define TX_CLK25_DIV_MASK
Definition: xilinx_transceiver.c:102
#define GTX_RX_PRBS_ERR_CNT
Definition: xilinx_transceiver.c:106
@ AXI_FPGA_SPEED_1H
Definition: xilinx_transceiver.h:128
int xilinx_xcvr_qpll_write_config(struct xilinx_xcvr *xcvr, uint32_t sys_clk_sel, uint32_t drp_port, const struct xilinx_xcvr_qpll_config *conf)
Definition: xilinx_transceiver.c:1442
@ AXI_FPGA_FAMILY_ARTIX
Definition: xilinx_transceiver.h:114
int xilinx_xcvr_prbs_err_cnt_get(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t *cnt)
Definition: xilinx_transceiver.c:2138
int xilinx_xcvr_write_prog_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_prog_div, int32_t tx_prog_div)
Definition: xilinx_transceiver.c:1863
@ AXI_FPGA_DEV_SF
Definition: xilinx_transceiver.h:157
enum axi_fpga_dev_pack dev_package
Definition: xilinx_transceiver.h:175
@ AXI_FPGA_FAMILY_KINTEX
Definition: xilinx_transceiver.h:115
int xilinx_xcvr_qpll_write_config(struct xilinx_xcvr *xcvr, uint32_t sys_clk_sel, uint32_t drp_port, const struct xilinx_xcvr_qpll_config *conf)
Definition: xilinx_transceiver.c:1442
@ AXI_FPGA_TECH_ULTRASCALE_PLUS
Definition: xilinx_transceiver.h:105
#define RXCDR_CFG3_ADDR
Definition: xilinx_transceiver.c:63
@ AXI_FPGA_DEV_FF
Definition: xilinx_transceiver.h:145
@ AXI_FPGA_DEV_SB
Definition: xilinx_transceiver.h:153
@ AXI_FPGA_DEV_FB
Definition: xilinx_transceiver.h:146
#define CPLL_FBDIV_N2_MASK
Definition: xilinx_transceiver.c:95
int xilinx_xcvr_write_prog_div_rate(struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_rate, int32_t tx_rate)
Definition: xilinx_transceiver.c:1942
@ AXI_FPGA_DEV_RF
Definition: xilinx_transceiver.h:143
uint32_t encoding
Definition: xilinx_transceiver.h:169
int(* read)(struct adxcvr *xcvr, unsigned int drp_port, unsigned int reg, unsigned int *val)
Definition: xilinx_transceiver.h:188
xilinx_xcvr_refclk_ppm
Enum for reference clock ppm.
Definition: xilinx_transceiver.h:91
@ XILINX_XCVR_TYPE_US_GTH3
Definition: xilinx_transceiver.h:71
int xilinx_xcvr_qpll_read_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t sys_clk_sel, struct xilinx_xcvr_qpll_config *conf)
Definition: xilinx_transceiver.c:1260
Structure holding CPLL configuration.
Definition: xilinx_transceiver.h:249
#define GTH34_SYSCLK_QPLL1
Definition: xilinx_transceiver.c:104
int xilinx_xcvr_write_rx_clk25_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t div)
Definition: xilinx_transceiver.c:2013
@ AXI_FPGA_DEV_FG
Definition: xilinx_transceiver.h:152
@ AXI_FPGA_TECH_SERIES7
Definition: xilinx_transceiver.h:103
int xilinx_xcvr_write_out_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_out_div, int32_t tx_out_div)
Definition: xilinx_transceiver.c:1673
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
int xilinx_xcvr_write_tx_clk25_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t div)
Definition: xilinx_transceiver.c:2055
@ AXI_FPGA_DEV_RB
Definition: xilinx_transceiver.h:154
@ AXI_FPGA_DEV_FL
Definition: xilinx_transceiver.h:144
uint32_t voltage
Definition: xilinx_transceiver.h:176
@ AXI_FPGA_SPEED_2
Definition: xilinx_transceiver.h:131
uint32_t fb_div_N2
Definition: xilinx_transceiver.h:252
int xilinx_xcvr_cpll_calc_lane_rate(struct xilinx_xcvr *xcvr, uint32_t refclk_hz, const struct xilinx_xcvr_cpll_config *conf, uint32_t out_div)
Definition: xilinx_transceiver.c:1096
int xilinx_xcvr_write_out_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_out_div, int32_t tx_out_div)
Definition: xilinx_transceiver.c:1673
int xilinx_xcvr_write_prog_div_rate(struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_rate, int32_t tx_rate)
Definition: xilinx_transceiver.c:1942
int adxcvr_drp_read(struct adxcvr *xcvr, unsigned int drp_port, unsigned int reg, unsigned int *val)
AXI ADXCVR DPR Port Read.
Definition: axi_adxcvr.c:164
@ AXI_FPGA_FAMILY_ZYNQ
Definition: xilinx_transceiver.h:117
int xilinx_xcvr_cpll_calc_lane_rate(struct xilinx_xcvr *xcvr, uint32_t refclk_hz, const struct xilinx_xcvr_cpll_config *conf, uint32_t out_div)
Definition: xilinx_transceiver.c:1096
int xilinx_xcvr_prbsel_enc_get(struct xilinx_xcvr *xcvr, uint32_t prbs, bool reverse_lu)
Definition: xilinx_transceiver.c:2094
xilinx_xcvr parameters structure.
Definition: xilinx_transceiver.h:166
int(* disable)(struct adxcvr *xcvr)
Definition: xilinx_transceiver.h:234
#define QPLL_REFCLK_DIV_M_MASK
Definition: xilinx_transceiver.c:76
int xilinx_xcvr_configure_lpm_dfe_mode(struct xilinx_xcvr *xcvr, uint32_t drp_port, bool lpm)
Definition: xilinx_transceiver.c:384
uint32_t vco0_min
Definition: xilinx_transceiver.h:179
#define QPLL_FBDIV_N_ADDR
Definition: xilinx_transceiver.c:80
#define CPLL_FB_DIV_45_N1_MASK
Definition: xilinx_transceiver.c:94
Structure holding QPLL configuration.
Definition: xilinx_transceiver.h:259
axi_fpga_speed_grade
Enum for FPGA's speed-grade.
Definition: clk_axi_clkgen.c:140
uint32_t fb_div
Definition: xilinx_transceiver.h:261
unsigned long(* recalc_rate)(struct adxcvr *xcvr, unsigned long parent_rate)
Definition: xilinx_transceiver.h:235
@ AXI_FPGA_DEV_RS
Definition: xilinx_transceiver.h:155
Definition: xilinx_transceiver.h:232
uint32_t refclk_div
Definition: xilinx_transceiver.h:260
#define RX_CLK25_DIV
Definition: xilinx_transceiver.c:97
#define QPLL_FBDIV_N_MASK
Definition: xilinx_transceiver.c:81
@ AXI_FPGA_SPEED_1HV
Definition: xilinx_transceiver.h:129
Header file of utility functions.
@ XILINX_XCVR_LEGACY_TYPE_US_GTY4
Definition: xilinx_transceiver.h:84
int(* set_rate)(struct adxcvr *xcvr, unsigned long rate, unsigned long parent_rate)
Definition: xilinx_transceiver.h:240
#define RXCDR_CFG2_ADDR
Definition: xilinx_transceiver.c:60
@ XILINX_XCVR_TYPE_US_GTH4
Definition: xilinx_transceiver.h:72
@ XILINX_XCVR_LEGACY_TYPE_US_GTH4
Definition: xilinx_transceiver.h:83
@ AXI_FPGA_TECH_ULTRASCALE
Definition: xilinx_transceiver.h:104
int xilinx_xcvr_write_tx_clk25_div(struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t div)
Definition: xilinx_transceiver.c:2055
axi_fpga_family
Enum for family variant of the FPGA device.
Definition: clk_axi_clkgen.c:132
int adxcvr_drp_write(struct adxcvr *xcvr, unsigned int drp_port, unsigned int reg, unsigned int val)
AXI ADXCVR DPR Port Write.
Definition: axi_adxcvr.c:199
#define ENC_8B10B
Definition: xilinx_transceiver.h:267
int xilinx_xcvr_cpll_read_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, struct xilinx_xcvr_cpll_config *conf)
Definition: xilinx_transceiver.c:915
int xilinx_xcvr_configure_lpm_dfe_mode(struct xilinx_xcvr *xcvr, uint32_t drp_port, bool lpm)
Definition: xilinx_transceiver.c:384
@ AXI_FPGA_SPEED_UNKNOWN
Definition: xilinx_transceiver.h:125
@ AXI_FPGA_SPEED_1L
Definition: xilinx_transceiver.h:127
int xilinx_xcvr_cpll_write_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, const struct xilinx_xcvr_cpll_config *conf)
Definition: xilinx_transceiver.c:1070
int xilinx_xcvr_write_async_gearbox_en(struct xilinx_xcvr *xcvr, uint32_t drp_port, bool en)
Definition: xilinx_transceiver.c:1985
#define GTH34_QPLL_FBDIV(xcvr, x)
Definition: xilinx_transceiver.c:110
uint32_t band
Definition: xilinx_transceiver.h:262
#define OUT_DIV_ADDR
Definition: xilinx_transceiver.c:50
int xilinx_xcvr_cpll_read_config(struct xilinx_xcvr *xcvr, uint32_t drp_port, struct xilinx_xcvr_cpll_config *conf)
Definition: xilinx_transceiver.c:915
@ AXI_FPGA_FAMILY_UNKNOWN
Definition: xilinx_transceiver.h:113
@ AXI_FPGA_TECH_UNKNOWN
Definition: xilinx_transceiver.h:102
@ AXI_FPGA_DEV_FA
Definition: xilinx_transceiver.h:159
@ AXI_FPGA_FAMILY_VIRTEX
Definition: xilinx_transceiver.h:116
@ XILINX_XCVR_TYPE_S7_GTX2
Definition: xilinx_transceiver.h:70