no-OS
Loading...
Searching...
No Matches
altera_adxcvr.h File Reference

Driver for the Altera ADXCVR Configuration. More...

#include <stdint.h>
#include <stdbool.h>
Include dependency graph for altera_adxcvr.h:

Classes

struct  adxcvr
 ADI JESD204B/C AXI_ADXCVR Highspeed Transceiver Device structure. More...
 
struct  adxcvr_init
 

Macros

#define XCVR_REG_ARBITRATION   0x000
 
#define XCVR_ARBITRATION_MASK   0xFF
 
#define XCVR_ARBITRATION_GET_AVMM   0x02
 
#define XCVR_ARBITRATION_RELEASE_AVMM_CALIB   0x01
 
#define XCVR_ARBITRATION_RELEASE_AVMM   0x03
 
#define XCVR_REG_CALIB_ATX_PLL_EN   0x100
 
#define XCVR_CALIB_ATX_PLL_EN_MASK   0x01
 
#define XCVR_CALIB_ATX_PLL_EN   0x01
 
#define XCVR_REG_CAPAB_ATX_PLL_STAT   0x280
 
#define XCVR_CAPAB_ATX_PLL_CAL_BSY_MASK   0x02
 
#define XCVR_CAPAB_ATX_PLL_CAL_DONE   0x00
 
#define XCVR_REG_CALIB_PMA_EN   0x100
 
#define XCVR_CALIB_TX_TERM_VOD_MASK   0x20
 
#define XCVR_CALIB_TX_TERM_VOD_EN   0x20
 
#define XCVR_CALIB_CMU_CDR_PLL_EN_MASK   0x02
 
#define XCVR_CALIB_CMU_CDR_PLL_EN   0x02
 
#define XCVR_REG_CAPAB_PMA   0x281
 
#define XCVR_CAPAB_RX_CAL_BUSY_EN_MASK   0x20
 
#define XCVR_CAPAB_RX_CAL_BUSY_EN   0x20
 
#define XCVR_CAPAB_RX_CAL_BUSY_DIS   0x00
 
#define XCVR_CAPAB_RX_CAL_BUSY_MASK   0x02
 
#define XCVR_CAPAB_RX_CAL_DONE   0x00
 
#define XCVR_CAPAB_TX_CAL_BUSY_EN_MASK   0x10
 
#define XCVR_CAPAB_TX_CAL_BUSY_EN   0x10
 
#define XCVR_CAPAB_TX_CAL_BUSY_DIS   0x00
 
#define XCVR_CAPAB_TX_CAL_BUSY_MASK   0x01
 
#define XCVR_CAPAB_TX_CAL_DONE   0x00
 
#define XCVR_REG_RATE_SWITCH_FLAG   0x166
 
#define XCVR_RATE_SWITCH_FLAG_MASK   0x80
 
#define XCVR_RATE_SWITCH_FLAG_RATE_SWITCH   0x00
 
#define XCVR_RATE_SWITCH_FLAG_NO_RATE_SWITCH   0x80
 

Functions

int32_t adxcvr_init (struct adxcvr **ad_xcvr, const struct adxcvr_init *init)
 adxcvr_init
 
int32_t adxcvr_remove (struct adxcvr *xcvr)
 adxcvr_remove
 
void adxcvr_post_lane_rate_change (struct adxcvr *xcvr, unsigned int lane_rate_khz)
 adxcvr_post_lane_rate_change
 
int32_t adxcvr_round_rate (struct adxcvr *xcvr, uint32_t rate_khz)
 adxcvr_round_rate
 
int32_t adxcvr_set_rate (struct adxcvr *xcvr, uint32_t rate_khz)
 adxcvr_init
 
uint32_t adxcvr_recalc_rate (struct adxcvr *xcvr)
 adxcvr_recalc_rate
 
void adxcvr_pre_lane_rate_change (struct adxcvr *xcvr)
 adxcvr_pre_lane_rate_change
 
void atx_pll_acquire_arbitration (struct adxcvr *xcvr)
 atx_pll_acquire_arbitration
 
void atx_pll_release_arbitration (struct adxcvr *xcvr, bool calibrate)
 atx_pll_release_arbitration
 
int32_t atx_pll_write (struct adxcvr *xcvr, uint32_t reg, uint32_t val)
 atx_pll_write
 
int32_t atx_pll_read (struct adxcvr *xcvr, uint32_t reg, uint32_t *val)
 atx_pll_read
 
void atx_pll_update (struct adxcvr *xcvr, uint32_t reg, uint32_t mask, uint32_t val)
 atx_pll_update
 
int32_t atx_pll_calibration_check (struct adxcvr *xcvr)
 atx_pll_calibration_check
 
int32_t xcvr_calib_tx (struct adxcvr *xcvr)
 xcvr_calib_tx
 
void adxcfg_acquire_arbitration (struct adxcvr *xcvr, uint32_t lane)
 adxcfg_acquire_arbitration
 
void adxcfg_release_arbitration (struct adxcvr *xcvr, uint32_t lane, bool calibrate)
 adxcfg_release_arbitration
 
int32_t adxcfg_write (struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t val)
 adxcfg_write
 
int32_t adxcfg_read (struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t *val)
 adxcfg_read
 
void adxcfg_update (struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t mask, uint32_t val)
 adxcfg_update
 
int32_t adxcfg_calibration_check (struct adxcvr *xcvr, uint32_t lane, bool tx)
 adxcfg_calibration_check
 

Detailed Description

Driver for the Altera ADXCVR Configuration.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2018(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ XCVR_ARBITRATION_GET_AVMM

#define XCVR_ARBITRATION_GET_AVMM   0x02

◆ XCVR_ARBITRATION_MASK

#define XCVR_ARBITRATION_MASK   0xFF

◆ XCVR_ARBITRATION_RELEASE_AVMM

#define XCVR_ARBITRATION_RELEASE_AVMM   0x03

◆ XCVR_ARBITRATION_RELEASE_AVMM_CALIB

#define XCVR_ARBITRATION_RELEASE_AVMM_CALIB   0x01

◆ XCVR_CALIB_ATX_PLL_EN

#define XCVR_CALIB_ATX_PLL_EN   0x01

◆ XCVR_CALIB_ATX_PLL_EN_MASK

#define XCVR_CALIB_ATX_PLL_EN_MASK   0x01

◆ XCVR_CALIB_CMU_CDR_PLL_EN

#define XCVR_CALIB_CMU_CDR_PLL_EN   0x02

◆ XCVR_CALIB_CMU_CDR_PLL_EN_MASK

#define XCVR_CALIB_CMU_CDR_PLL_EN_MASK   0x02

◆ XCVR_CALIB_TX_TERM_VOD_EN

#define XCVR_CALIB_TX_TERM_VOD_EN   0x20

◆ XCVR_CALIB_TX_TERM_VOD_MASK

#define XCVR_CALIB_TX_TERM_VOD_MASK   0x20

◆ XCVR_CAPAB_ATX_PLL_CAL_BSY_MASK

#define XCVR_CAPAB_ATX_PLL_CAL_BSY_MASK   0x02

◆ XCVR_CAPAB_ATX_PLL_CAL_DONE

#define XCVR_CAPAB_ATX_PLL_CAL_DONE   0x00

◆ XCVR_CAPAB_RX_CAL_BUSY_DIS

#define XCVR_CAPAB_RX_CAL_BUSY_DIS   0x00

◆ XCVR_CAPAB_RX_CAL_BUSY_EN

#define XCVR_CAPAB_RX_CAL_BUSY_EN   0x20

◆ XCVR_CAPAB_RX_CAL_BUSY_EN_MASK

#define XCVR_CAPAB_RX_CAL_BUSY_EN_MASK   0x20

◆ XCVR_CAPAB_RX_CAL_BUSY_MASK

#define XCVR_CAPAB_RX_CAL_BUSY_MASK   0x02

◆ XCVR_CAPAB_RX_CAL_DONE

#define XCVR_CAPAB_RX_CAL_DONE   0x00

◆ XCVR_CAPAB_TX_CAL_BUSY_DIS

#define XCVR_CAPAB_TX_CAL_BUSY_DIS   0x00

◆ XCVR_CAPAB_TX_CAL_BUSY_EN

#define XCVR_CAPAB_TX_CAL_BUSY_EN   0x10

◆ XCVR_CAPAB_TX_CAL_BUSY_EN_MASK

#define XCVR_CAPAB_TX_CAL_BUSY_EN_MASK   0x10

◆ XCVR_CAPAB_TX_CAL_BUSY_MASK

#define XCVR_CAPAB_TX_CAL_BUSY_MASK   0x01

◆ XCVR_CAPAB_TX_CAL_DONE

#define XCVR_CAPAB_TX_CAL_DONE   0x00

◆ XCVR_RATE_SWITCH_FLAG_MASK

#define XCVR_RATE_SWITCH_FLAG_MASK   0x80

◆ XCVR_RATE_SWITCH_FLAG_NO_RATE_SWITCH

#define XCVR_RATE_SWITCH_FLAG_NO_RATE_SWITCH   0x80

◆ XCVR_RATE_SWITCH_FLAG_RATE_SWITCH

#define XCVR_RATE_SWITCH_FLAG_RATE_SWITCH   0x00

◆ XCVR_REG_ARBITRATION

#define XCVR_REG_ARBITRATION   0x000

◆ XCVR_REG_CALIB_ATX_PLL_EN

#define XCVR_REG_CALIB_ATX_PLL_EN   0x100

◆ XCVR_REG_CALIB_PMA_EN

#define XCVR_REG_CALIB_PMA_EN   0x100

◆ XCVR_REG_CAPAB_ATX_PLL_STAT

#define XCVR_REG_CAPAB_ATX_PLL_STAT   0x280

◆ XCVR_REG_CAPAB_PMA

#define XCVR_REG_CAPAB_PMA   0x281

◆ XCVR_REG_RATE_SWITCH_FLAG

#define XCVR_REG_RATE_SWITCH_FLAG   0x166

Function Documentation

◆ adxcfg_acquire_arbitration()

void adxcfg_acquire_arbitration ( struct adxcvr * xcvr,
uint32_t lane )

adxcfg_acquire_arbitration

◆ adxcfg_calibration_check()

int32_t adxcfg_calibration_check ( struct adxcvr * xcvr,
uint32_t lane,
bool tx )

adxcfg_calibration_check

◆ adxcfg_read()

int32_t adxcfg_read ( struct adxcvr * xcvr,
uint32_t lane,
uint32_t reg,
uint32_t * val )

adxcfg_read

◆ adxcfg_release_arbitration()

void adxcfg_release_arbitration ( struct adxcvr * xcvr,
uint32_t lane,
bool calibrate )

adxcfg_release_arbitration

◆ adxcfg_update()

void adxcfg_update ( struct adxcvr * xcvr,
uint32_t lane,
uint32_t reg,
uint32_t mask,
uint32_t val )

adxcfg_update

◆ adxcfg_write()

int32_t adxcfg_write ( struct adxcvr * xcvr,
uint32_t lane,
uint32_t reg,
uint32_t val )

adxcfg_write

◆ adxcvr_init()

int32_t adxcvr_init ( struct adxcvr ** ad_xcvr,
const struct adxcvr_init * init )

adxcvr_init

adxcvr_init

Parameters
ad_xcvr- The device structure.
init- The structure containing the device initial parameters.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adxcvr_post_lane_rate_change()

void adxcvr_post_lane_rate_change ( struct adxcvr * xcvr,
unsigned int lane_rate_khz )

adxcvr_post_lane_rate_change

◆ adxcvr_pre_lane_rate_change()

void adxcvr_pre_lane_rate_change ( struct adxcvr * xcvr)

adxcvr_pre_lane_rate_change

◆ adxcvr_recalc_rate()

uint32_t adxcvr_recalc_rate ( struct adxcvr * xcvr)

adxcvr_recalc_rate

◆ adxcvr_remove()

int32_t adxcvr_remove ( struct adxcvr * xcvr)

adxcvr_remove

adxcvr_remove

Parameters
xcvr- The device structure.
Returns
Returns 0 in case of success or negative error code.

◆ adxcvr_round_rate()

int32_t adxcvr_round_rate ( struct adxcvr * xcvr,
uint32_t rate_khz )

adxcvr_round_rate

◆ adxcvr_set_rate()

int32_t adxcvr_set_rate ( struct adxcvr * xcvr,
uint32_t rate_khz )

◆ atx_pll_acquire_arbitration()

void atx_pll_acquire_arbitration ( struct adxcvr * xcvr)

atx_pll_acquire_arbitration

◆ atx_pll_calibration_check()

int32_t atx_pll_calibration_check ( struct adxcvr * xcvr)

atx_pll_calibration_check

◆ atx_pll_read()

int32_t atx_pll_read ( struct adxcvr * xcvr,
uint32_t reg,
uint32_t * val )

atx_pll_read

◆ atx_pll_release_arbitration()

void atx_pll_release_arbitration ( struct adxcvr * xcvr,
bool calibrate )

atx_pll_release_arbitration

◆ atx_pll_update()

void atx_pll_update ( struct adxcvr * xcvr,
uint32_t reg,
uint32_t mask,
uint32_t val )

atx_pll_update

◆ atx_pll_write()

int32_t atx_pll_write ( struct adxcvr * xcvr,
uint32_t reg,
uint32_t val )

atx_pll_write

◆ xcvr_calib_tx()

int32_t xcvr_calib_tx ( struct adxcvr * xcvr)

xcvr_calib_tx