no-OS
|
Driver for the Xilinx High-speed transceiver dynamic reconfiguration. More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Classes | |
struct | xilinx_xcvr |
xilinx_xcvr parameters structure. More... | |
struct | xilinx_xcvr_drp_ops |
struct | clk_ops |
struct | xilinx_xcvr_cpll_config |
Structure holding CPLL configuration. More... | |
struct | xilinx_xcvr_qpll_config |
Structure holding QPLL configuration. More... | |
Macros | |
#define | AXI_PCORE_VER(major, minor, letter) ((major << 16) | (minor << 8) | letter) |
#define | AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff) |
#define | AXI_PCORE_VER_MINOR(version) ((version >> 8) & 0xff) |
#define | AXI_PCORE_VER_LETTER(version) (version & 0xff) |
#define | AXI_REG_VERSION 0x0000 |
#define | AXI_VERSION(x) (((x) & 0xffffffff) << 0) |
#define | AXI_VERSION_IS(x, y, z) ((x) << 16 | (y) << 8 | (z)) |
#define | AXI_VERSION_MAJOR(x) ((x) >> 16) |
#define | AXI_REG_FPGA_INFO 0x001C |
#define | AXI_REG_FPGA_VOLTAGE 0x0140 |
#define | AXI_INFO_FPGA_TECH(info) ((info) >> 24) |
#define | AXI_INFO_FPGA_FAMILY(info) (((info) >> 16) & 0xff) |
#define | AXI_INFO_FPGA_SPEED_GRADE(info) (((info) >> 8) & 0xff) |
#define | AXI_INFO_FPGA_DEV_PACKAGE(info) ((info) & 0xff) |
#define | AXI_INFO_FPGA_VOLTAGE(val) ((val) & 0xffff) |
#define | ENC_8B10B 810 |
#define | ENC_66B64B 6664 |
Functions | |
int | xilinx_xcvr_configure_cdr (struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t lane_rate, uint32_t out_div, bool lpm_enable) |
int | xilinx_xcvr_configure_lpm_dfe_mode (struct xilinx_xcvr *xcvr, uint32_t drp_port, bool lpm) |
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) |
int | xilinx_xcvr_cpll_read_config (struct xilinx_xcvr *xcvr, uint32_t drp_port, struct xilinx_xcvr_cpll_config *conf) |
int | xilinx_xcvr_cpll_write_config (struct xilinx_xcvr *xcvr, uint32_t drp_port, const struct xilinx_xcvr_cpll_config *conf) |
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) |
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) |
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) |
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) |
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) |
int | xilinx_xcvr_read_out_div (struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t *rx_out_div, uint32_t *tx_out_div) |
int | xilinx_xcvr_write_out_div (struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_out_div, int32_t tx_out_div) |
int | xilinx_xcvr_write_rx_clk25_div (struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t div) |
int | xilinx_xcvr_write_tx_clk25_div (struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t div) |
int | xilinx_xcvr_prbsel_enc_get (struct xilinx_xcvr *xcvr, uint32_t prbs, bool reverse_lu) |
int | xilinx_xcvr_prbs_err_cnt_get (struct xilinx_xcvr *xcvr, uint32_t drp_port, uint32_t *cnt) |
int | xilinx_xcvr_write_prog_div_rate (struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_rate, int32_t tx_rate) |
int | xilinx_xcvr_write_prog_div (struct xilinx_xcvr *xcvr, uint32_t drp_port, int32_t rx_prog_div, int32_t tx_prog_div) |
int | xilinx_xcvr_write_async_gearbox_en (struct xilinx_xcvr *xcvr, uint32_t drp_port, bool en) |
Driver for the Xilinx High-speed transceiver dynamic reconfiguration.
Copyright 2018(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AXI_INFO_FPGA_DEV_PACKAGE | ( | info | ) | ((info) & 0xff) |
#define AXI_INFO_FPGA_FAMILY | ( | info | ) | (((info) >> 16) & 0xff) |
#define AXI_INFO_FPGA_SPEED_GRADE | ( | info | ) | (((info) >> 8) & 0xff) |
#define AXI_INFO_FPGA_TECH | ( | info | ) | ((info) >> 24) |
#define AXI_INFO_FPGA_VOLTAGE | ( | val | ) | ((val) & 0xffff) |
#define AXI_PCORE_VER | ( | major, | |
minor, | |||
letter | |||
) | ((major << 16) | (minor << 8) | letter) |
#define AXI_PCORE_VER_LETTER | ( | version | ) | (version & 0xff) |
#define AXI_PCORE_VER_MAJOR | ( | version | ) | (((version) >> 16) & 0xff) |
#define AXI_PCORE_VER_MINOR | ( | version | ) | ((version >> 8) & 0xff) |
#define AXI_REG_FPGA_INFO 0x001C |
#define AXI_REG_FPGA_VOLTAGE 0x0140 |
#define AXI_REG_VERSION 0x0000 |
#define AXI_VERSION | ( | x | ) | (((x) & 0xffffffff) << 0) |
#define AXI_VERSION_IS | ( | x, | |
y, | |||
z | |||
) | ((x) << 16 | (y) << 8 | (z)) |
#define AXI_VERSION_MAJOR | ( | x | ) | ((x) >> 16) |
#define ENC_66B64B 6664 |
#define ENC_8B10B 810 |
enum axi_fgpa_technology |
enum axi_fpga_dev_pack |
Enum for device package.
enum axi_fpga_family |
enum axi_fpga_speed_grade |
enum xilinx_xcvr_type |
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 | ||
) |
Configure Channel PLL.
Ref: https://www.xilinx.com/support/documentation/user_guides/ug476_7Series_Transceivers.pdf Page: 48 Vco_Freq = (RefClk * n1 * n2) / m LineRate = (Vco_Freq * 2) / d
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 | ||
) |
Calculate Quad PLL configuration parameters.
Ref: https://www.xilinx.com/support/documentation/user_guides/ug476_7Series_Transceivers.pdf Page: 55 Vco_Freq = (refclk_khz * n) / m LineRate = Vco_Freq / d
Make sure to not confuse Vco_Freq with fPLLClkout. fPLLClkout = (refclk_khz * n) / (m * 2), so technically Vco_Freq = 2 * fPLLClkout And the 2 is reduced in both equations.
Ref: https://www.xilinx.com/support/documentation/user_guides/ug578-ultrascale-gty-transceivers.pdf Page: 49 For GTY4: LineRate = (2 * Vco_Freq) / d Try Full-rate
int xilinx_xcvr_configure_cdr | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
uint32_t | lane_rate, | ||
uint32_t | out_div, | ||
bool | lpm_enable | ||
) |
Configure the Clock Data Recovery circuit.
int xilinx_xcvr_configure_lpm_dfe_mode | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
bool | lpm | ||
) |
Selection of Low-Power mode (LPM) or Decision Feedback Equalization (DFE).
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 | ||
) |
Calculate Channel PLL lane rate.
int xilinx_xcvr_cpll_read_config | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
struct xilinx_xcvr_cpll_config * | conf | ||
) |
Read Channel PLL configuration.
int xilinx_xcvr_cpll_write_config | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
const struct xilinx_xcvr_cpll_config * | conf | ||
) |
Write Channel PLL configuration.
int xilinx_xcvr_prbs_err_cnt_get | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
uint32_t * | cnt | ||
) |
Get PRBS error counter value.
int xilinx_xcvr_prbsel_enc_get | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | prbs, | ||
bool | reverse_lu | ||
) |
Get PRBS generator test pattern control setting.
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 | ||
) |
Calculate Quad PLL lane rate.
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 | ||
) |
Read Quad PLL configuration.
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 | ||
) |
Write Quad PLL configuration.
int xilinx_xcvr_read_out_div | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
uint32_t * | rx_out_div, | ||
uint32_t * | tx_out_div | ||
) |
Read TX/RXOUT_DIV value.
int xilinx_xcvr_write_async_gearbox_en | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
bool | en | ||
) |
TX Asynchronous Gearbox.
int xilinx_xcvr_write_out_div | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
int32_t | rx_out_div, | ||
int32_t | tx_out_div | ||
) |
Write TX/RXOUT_DIV value.
int xilinx_xcvr_write_prog_div | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
int32_t | rx_prog_div, | ||
int32_t | tx_prog_div | ||
) |
Write RX/TX programmable divider ratio.
int xilinx_xcvr_write_prog_div_rate | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
int32_t | rx_rate, | ||
int32_t | tx_rate | ||
) |
Set programmable divider ratio (RX|TX_PROGDIV_RATE), pre-divider value.
int xilinx_xcvr_write_rx_clk25_div | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
uint32_t | div | ||
) |
Write RX_CLK25_DIV value.
int xilinx_xcvr_write_tx_clk25_div | ( | struct xilinx_xcvr * | xcvr, |
uint32_t | drp_port, | ||
uint32_t | div | ||
) |
Write RX_CLK25_DIV value.