Go to the documentation of this file.
33 #ifndef ALTERA_ADXCVR_H_
34 #define ALTERA_ADXCVR_H_
48 #define XCVR_REG_ARBITRATION 0x000
49 #define XCVR_ARBITRATION_MASK 0xFF
50 #define XCVR_ARBITRATION_GET_AVMM 0x02
51 #define XCVR_ARBITRATION_RELEASE_AVMM_CALIB 0x01
52 #define XCVR_ARBITRATION_RELEASE_AVMM 0x03
54 #define XCVR_REG_CALIB_ATX_PLL_EN 0x100
55 #define XCVR_CALIB_ATX_PLL_EN_MASK 0x01
56 #define XCVR_CALIB_ATX_PLL_EN 0x01
58 #define XCVR_REG_CAPAB_ATX_PLL_STAT 0x280
59 #define XCVR_CAPAB_ATX_PLL_CAL_BSY_MASK 0x02
60 #define XCVR_CAPAB_ATX_PLL_CAL_DONE 0x00
63 #define XCVR_REG_CALIB_PMA_EN 0x100
64 #define XCVR_CALIB_TX_TERM_VOD_MASK 0x20
65 #define XCVR_CALIB_TX_TERM_VOD_EN 0x20
66 #define XCVR_CALIB_CMU_CDR_PLL_EN_MASK 0x02
67 #define XCVR_CALIB_CMU_CDR_PLL_EN 0x02
69 #define XCVR_REG_CAPAB_PMA 0x281
70 #define XCVR_CAPAB_RX_CAL_BUSY_EN_MASK 0x20
71 #define XCVR_CAPAB_RX_CAL_BUSY_EN 0x20
72 #define XCVR_CAPAB_RX_CAL_BUSY_DIS 0x00
73 #define XCVR_CAPAB_RX_CAL_BUSY_MASK 0x02
74 #define XCVR_CAPAB_RX_CAL_DONE 0x00
75 #define XCVR_CAPAB_TX_CAL_BUSY_EN_MASK 0x10
76 #define XCVR_CAPAB_TX_CAL_BUSY_EN 0x10
77 #define XCVR_CAPAB_TX_CAL_BUSY_DIS 0x00
78 #define XCVR_CAPAB_TX_CAL_BUSY_MASK 0x01
79 #define XCVR_CAPAB_TX_CAL_DONE 0x00
81 #define XCVR_REG_RATE_SWITCH_FLAG 0x166
82 #define XCVR_RATE_SWITCH_FLAG_MASK 0x80
83 #define XCVR_RATE_SWITCH_FLAG_RATE_SWITCH 0x00
84 #define XCVR_RATE_SWITCH_FLAG_NO_RATE_SWITCH 0x80
118 unsigned int lane_rate_khz);
126 unsigned int lane_rate);
134 uint32_t mask, uint32_t val);
141 uint32_t lane,
bool calibrate);
145 uint32_t reg, uint32_t *val);
147 uint32_t reg, uint32_t mask, uint32_t val);
Driver for the Altera CDR/CMU PLL dynamic reconfiguration.
int32_t xcvr_calib_tx(struct adxcvr *xcvr)
xcvr_calib_tx
Definition: altera_adxcvr.c:312
uint32_t timeout
Definition: ad413x.c:49
int32_t atx_pll_calibration_check(struct adxcvr *xcvr)
atx_pll_calibration_check
Definition: altera_adxcvr.c:248
uint32_t lane_rate_khz
Definition: altera_adxcvr.h:97
int32_t adxcfg_write(struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t val)
adxcfg_write
Definition: altera_adxcvr.c:193
uint32_t parent_rate_khz
Definition: altera_adxcvr.h:98
#define XCVR_CAPAB_TX_CAL_BUSY_MASK
Definition: altera_adxcvr.h:78
const char * name
Definition: altera_adxcvr.h:90
int32_t atx_pll_read(struct adxcvr *xcvr, uint32_t reg, uint32_t *val)
atx_pll_read
Definition: altera_adxcvr.c:151
void adxcvr_post_lane_rate_change(struct adxcvr *xcvr, unsigned int lane_rate_khz)
adxcvr_post_lane_rate_change
Definition: altera_adxcvr.c:393
int32_t xcvr_calib_tx(struct adxcvr *xcvr)
xcvr_calib_tx
Definition: altera_adxcvr.c:312
void adxcvr_release_arbitration(uint32_t addr, bool calibrate)
adxcvr_release_arbitration
Definition: altera_adxcvr.c:127
void adxcfg_update(struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t mask, uint32_t val)
adxcfg_update
Definition: altera_adxcvr.c:215
#define ADXCVR_REG_SYNTH_CONF
Definition: altera_adxcvr.c:73
#define ADXCVR_RESETN
Definition: altera_adxcvr.c:65
void adxcfg_release_arbitration(struct adxcvr *xcvr, uint32_t lane, bool calibrate)
adxcfg_release_arbitration
Definition: altera_adxcvr.c:239
#define XCVR_CALIB_TX_TERM_VOD_EN
Definition: altera_adxcvr.h:65
ADI JESD204B/C AXI_ADXCVR Highspeed Transceiver Device structure.
Definition: altera_adxcvr.h:89
void adxcfg_release_arbitration(struct adxcvr *xcvr, uint32_t lane, bool calibrate)
adxcfg_release_arbitration
Definition: altera_adxcvr.c:239
bool is_transmit
Definition: altera_adxcvr.h:92
int32_t altera_a10_cdr_pll_set_rate(struct adxcvr *xcvr, uint32_t rate_khz)
altera_a10_cdr_pll_set_rate
Definition: altera_a10_cdr_pll.c:357
bool initial_recalc
Definition: altera_adxcvr.h:99
int32_t adxcvr_set_rate(struct adxcvr *xcvr, uint32_t rate_khz)
adxcvr_init
Definition: altera_adxcvr.c:415
int32_t atx_pll_read(struct adxcvr *xcvr, uint32_t reg, uint32_t *val)
atx_pll_read
Definition: altera_adxcvr.c:151
long altera_a10_cdr_pll_round_rate(struct adxcvr *xcvr, uint32_t rate_khz)
altera_a10_cdr_pll_round_rate
Definition: altera_a10_cdr_pll.c:335
uint32_t atx_pll_base
Definition: altera_adxcvr.h:95
int32_t atx_pll_write(struct adxcvr *xcvr, uint32_t reg, uint32_t val)
atx_pll_write
Definition: altera_adxcvr.c:141
uint32_t base
Definition: altera_adxcvr.h:91
int32_t adxcvr_init(struct adxcvr **ad_xcvr, const struct adxcvr_init *init)
adxcvr_init
Definition: altera_adxcvr.c:438
int32_t adxcfg_read(struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t *val)
adxcfg_read
Definition: altera_adxcvr.c:204
int32_t adxcvr_set_rate(struct adxcvr *xcvr, uint32_t rate_khz)
adxcvr_init
Definition: altera_adxcvr.c:415
void atx_pll_release_arbitration(struct adxcvr *xcvr, bool calibrate)
atx_pll_release_arbitration
Definition: altera_adxcvr.c:184
#define XCVR_ARBITRATION_GET_AVMM
Definition: altera_adxcvr.h:50
#define XCVR_CAPAB_RX_CAL_BUSY_MASK
Definition: altera_adxcvr.h:73
bool
Definition: common.h:48
#define XCVR_REG_CAPAB_ATX_PLL_STAT
Definition: altera_adxcvr.h:58
void adxcfg_acquire_arbitration(struct adxcvr *xcvr, uint32_t lane)
adxcfg_acquire_arbitration
Definition: altera_adxcvr.c:229
#define ADXCVR_REG_STATUS2
Definition: altera_adxcvr.c:70
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
void adxcfg_acquire_arbitration(struct adxcvr *xcvr, uint32_t lane)
adxcfg_acquire_arbitration
Definition: altera_adxcvr.c:229
#define XCVR_REG_CAPAB_PMA
Definition: altera_adxcvr.h:69
#define ADXCVR_REG_STATUS
Definition: altera_adxcvr.c:67
int32_t adxcvr_round_rate(struct adxcvr *xcvr, uint32_t rate_khz)
adxcvr_round_rate
Definition: altera_adxcvr.c:404
int32_t adxcvr_remove(struct adxcvr *xcvr)
adxcvr_remove
Definition: altera_adxcvr.c:489
Driver for the Altera ADXCVR Configuration.
int32_t atx_pll_calibration_check(struct adxcvr *xcvr)
atx_pll_calibration_check
Definition: altera_adxcvr.c:248
uint32_t adxcfg_base[4]
Definition: altera_adxcvr.h:105
#define XCVR_CAPAB_RX_CAL_BUSY_EN_MASK
Definition: altera_adxcvr.h:70
uint32_t altera_a10_atx_pll_recalc_rate(struct adxcvr *xcvr)
altera_a10_atx_pll_recalc_rate
Definition: altera_a10_atx_pll.c:283
void atx_pll_release_arbitration(struct adxcvr *xcvr, bool calibrate)
atx_pll_release_arbitration
Definition: altera_adxcvr.c:184
int32_t adxcvr_write(struct adxcvr *xcvr, uint32_t reg_addr, uint32_t reg_val)
adxcvr_write
Definition: altera_adxcvr.c:82
#define ADXCVR_STATUS2_XCVR(x)
Definition: altera_adxcvr.c:71
Definition: altera_adxcvr.h:102
#define XCVR_CAPAB_ATX_PLL_CAL_BSY_MASK
Definition: altera_adxcvr.h:59
#define XCVR_CAPAB_ATX_PLL_CAL_DONE
Definition: altera_adxcvr.h:60
int32_t adxcvr_read(struct adxcvr *xcvr, uint32_t reg_addr, uint32_t *reg_val)
adxcvr_read
Definition: altera_adxcvr.c:94
const char * name
Definition: altera_adxcvr.h:103
uint32_t base
Definition: altera_adxcvr.h:104
void atx_pll_update(struct adxcvr *xcvr, uint32_t reg, uint32_t mask, uint32_t val)
atx_pll_update
Definition: altera_adxcvr.c:161
uint32_t adxcfg_base[4]
Definition: altera_adxcvr.h:94
#define XCVR_CAPAB_RX_CAL_BUSY_DIS
Definition: altera_adxcvr.h:72
#define XCVR_ARBITRATION_RELEASE_AVMM_CALIB
Definition: altera_adxcvr.h:51
int32_t altera_a10_atx_pll_round_rate(struct adxcvr *xcvr, uint32_t rate_khz)
altera_a10_atx_pll_round_rate
Definition: altera_a10_atx_pll.c:185
int32_t adxcfg_calibration_check(struct adxcvr *xcvr, uint32_t lane, bool tx)
adxcfg_calibration_check
Definition: altera_adxcvr.c:275
int32_t adxcfg_read(struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t *val)
adxcfg_read
Definition: altera_adxcvr.c:204
uint32_t altera_a10_cdr_pll_recalc_rate(struct adxcvr *xcvr)
altera_a10_cdr_pll_recalc_rate
Definition: altera_a10_cdr_pll.c:479
void atx_pll_update(struct adxcvr *xcvr, uint32_t reg, uint32_t mask, uint32_t val)
atx_pll_update
Definition: altera_adxcvr.c:161
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
#define ADXCVR_STATUS
Definition: altera_adxcvr.c:68
int32_t adxcfg_calibration_check(struct adxcvr *xcvr, uint32_t lane, bool tx)
adxcfg_calibration_check
Definition: altera_adxcvr.c:275
uint32_t atx_pll_base
Definition: altera_adxcvr.h:106
uint32_t lane_rate_khz
Definition: altera_adxcvr.h:107
void adxcvr_pre_lane_rate_change(struct adxcvr *xcvr)
adxcvr_pre_lane_rate_change
Definition: altera_adxcvr.c:345
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
uint32_t adxcvr_recalc_rate(struct adxcvr *xcvr)
adxcvr_recalc_rate
Definition: altera_adxcvr.c:427
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
#define XCVR_ARBITRATION_RELEASE_AVMM
Definition: altera_adxcvr.h:52
void adxcvr_pre_lane_rate_change(struct adxcvr *xcvr)
adxcvr_pre_lane_rate_change
Definition: altera_adxcvr.c:345
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
void adxcvr_acquire_arbitration(struct adxcvr *xcvr, uint32_t addr, uint32_t status_reg)
adxcvr_acquire_arbitration
Definition: altera_adxcvr.c:106
int32_t altera_a10_atx_pll_set_rate(struct adxcvr *xcvr, uint32_t rate_khz)
altera_a10_atx_pll_set_rate
Definition: altera_a10_atx_pll.c:206
void atx_pll_acquire_arbitration(struct adxcvr *xcvr)
atx_pll_acquire_arbitration
Definition: altera_adxcvr.c:175
uint32_t reset_counter
Definition: altera_adxcvr.h:96
int32_t adxcvr_round_rate(struct adxcvr *xcvr, uint32_t rate_khz)
adxcvr_round_rate
Definition: altera_adxcvr.c:404
#define XCVR_CAPAB_TX_CAL_BUSY_EN_MASK
Definition: altera_adxcvr.h:75
int32_t adxcvr_remove(struct adxcvr *xcvr)
adxcvr_remove
Definition: altera_adxcvr.c:489
#define XCVR_CALIB_TX_TERM_VOD_MASK
Definition: altera_adxcvr.h:64
void adxcfg_update(struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t mask, uint32_t val)
adxcfg_update
Definition: altera_adxcvr.c:215
#define ADXCVR_REG_RESETN
Definition: altera_adxcvr.c:64
void adxcvr_finalize_lane_rate_change(struct adxcvr *xcvr)
adxcvr_finalize_lane_rate_change
Definition: altera_adxcvr.c:359
uint32_t lanes_per_link
Definition: altera_adxcvr.h:93
Header file of utility functions.
void atx_pll_acquire_arbitration(struct adxcvr *xcvr)
atx_pll_acquire_arbitration
Definition: altera_adxcvr.c:175
uint32_t adxcvr_recalc_rate(struct adxcvr *xcvr)
adxcvr_recalc_rate
Definition: altera_adxcvr.c:427
void adxcvr_post_lane_rate_change(struct adxcvr *xcvr, unsigned int lane_rate_khz)
adxcvr_post_lane_rate_change
Definition: altera_adxcvr.c:393
#define XCVR_REG_CALIB_PMA_EN
Definition: altera_adxcvr.h:63
uint32_t parent_rate_khz
Definition: altera_adxcvr.h:108
int32_t atx_pll_write(struct adxcvr *xcvr, uint32_t reg, uint32_t val)
atx_pll_write
Definition: altera_adxcvr.c:141
int32_t adxcvr_init(struct adxcvr **ad_xcvr, const struct adxcvr_init *init)
adxcvr_init
Definition: altera_adxcvr.c:438
int32_t adxcfg_write(struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t val)
adxcfg_write
Definition: altera_adxcvr.c:193
#define XCVR_CAPAB_TX_CAL_BUSY_EN
Definition: altera_adxcvr.h:76