no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

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

Here is the caller graph for this function:

◆ adxcfg_calibration_check()

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

adxcfg_calibration_check

Here is the caller graph for this function:

◆ adxcfg_read()

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

adxcfg_read

Here is the caller graph for this function:

◆ adxcfg_release_arbitration()

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

adxcfg_release_arbitration

Here is the caller graph for this function:

◆ adxcfg_update()

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

adxcfg_update

Here is the caller graph for this function:

◆ adxcfg_write()

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

adxcfg_write

Here is the caller graph for this function:

◆ 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

Here is the caller graph for this function:

◆ adxcvr_pre_lane_rate_change()

void adxcvr_pre_lane_rate_change ( struct adxcvr * xcvr)

adxcvr_pre_lane_rate_change

Here is the caller graph for this function:

◆ 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

Here is the caller graph for this function:

◆ adxcvr_set_rate()

int32_t adxcvr_set_rate ( struct adxcvr * xcvr,
uint32_t rate_khz )

adxcvr_init

Here is the caller graph for this function:

◆ atx_pll_acquire_arbitration()

void atx_pll_acquire_arbitration ( struct adxcvr * xcvr)

atx_pll_acquire_arbitration

Here is the caller graph for this function:

◆ atx_pll_calibration_check()

int32_t atx_pll_calibration_check ( struct adxcvr * xcvr)

atx_pll_calibration_check

Here is the caller graph for this function:

◆ atx_pll_read()

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

atx_pll_read

Here is the caller graph for this function:

◆ atx_pll_release_arbitration()

void atx_pll_release_arbitration ( struct adxcvr * xcvr,
bool calibrate )

atx_pll_release_arbitration

Here is the caller graph for this function:

◆ atx_pll_update()

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

atx_pll_update

Here is the caller graph for this function:

◆ atx_pll_write()

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

atx_pll_write

Here is the caller graph for this function:

◆ xcvr_calib_tx()

int32_t xcvr_calib_tx ( struct adxcvr * xcvr)

xcvr_calib_tx

Here is the caller graph for this function: