no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
axi_adxcvr.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef AXI_ADXCVR_H_
34#define AXI_ADXCVR_H_
35
36#include <stdint.h>
37#include <stdbool.h>
38#include "xilinx_transceiver.h"
39
40// Selection of PLL reference clock source to drive the RXOUTCLK
41#define ADXCVR_SYS_CLK_CPLL 0x00
42#define ADXCVR_SYS_CLK_QPLL1 0x02
43#define ADXCVR_SYS_CLK_QPLL0 0x03
44
45// adi,out-clk-select
46#define ADXCVR_OUTCLK_PCS 1
47#define ADXCVR_OUTCLK_PMA 2
48#define ADXCVR_REFCLK 3
49#define ADXCVR_REFCLK_DIV2 4
50#define ADXCVR_PROGDIV_CLK 5 /* GTHE3, GTHE4, GTYE4 only */
51
56struct adxcvr {
58 const char *name;
60 uint32_t base;
70 uint32_t num_lanes;
72 uint32_t lane_rate_khz;
74 uint32_t ref_rate_khz;
78 uint32_t sys_clk_sel;
82 uint32_t out_clk_sel;
87};
88
94struct adxcvr_init {
96 const char *name;
98 uint32_t base;
102 uint32_t sys_clk_sel;
106 uint32_t out_clk_sel;
110 uint32_t lane_rate_khz;
112 uint32_t ref_rate_khz;
115};
116
120extern const struct no_os_clk_platform_ops adxcvr_clk_ops;
121
123int adxcvr_drp_read(struct adxcvr *xcvr,
124 unsigned int drp_port,
125 unsigned int reg,
126 unsigned int *val);
128int adxcvr_drp_write(struct adxcvr *xcvr,
129 unsigned int drp_port,
130 unsigned int reg,
131 unsigned int val);
133int32_t adxcvr_status_error(struct adxcvr *xcvr);
135int adxcvr_clk_enable(struct adxcvr *xcvr);
137int adxcvr_clk_disable(struct adxcvr *xcvr);
139int32_t adxcvr_init(struct adxcvr **ad_xcvr,
140 const struct adxcvr_init *init);
142int32_t adxcvr_remove(struct adxcvr *xcvr);
144int adxcvr_clk_set_rate(struct adxcvr *xcvr,
145 unsigned long rate,
146 unsigned long parent_rate);
148int32_t adxcvr_write(struct adxcvr *xcvr, uint32_t reg_addr, uint32_t reg_val);
150int32_t adxcvr_read(struct adxcvr *xcvr, uint32_t reg_addr, uint32_t *reg_val);
151#endif
const struct no_os_clk_platform_ops adxcvr_clk_ops
adxcvr clock ops
Definition axi_adxcvr.c:749
int adxcvr_clk_disable(struct adxcvr *xcvr)
AXI ADXCVR Clock Disable.
Definition axi_adxcvr.c:523
int adxcvr_clk_enable(struct adxcvr *xcvr)
AXI ADXCVR Clock Enable.
Definition axi_adxcvr.c:473
int32_t adxcvr_read(struct adxcvr *xcvr, uint32_t reg_addr, uint32_t *reg_val)
adxcvr_read
Definition altera_adxcvr.c:83
int32_t adxcvr_init(struct adxcvr **ad_xcvr, const struct adxcvr_init *init)
adxcvr_init
Definition altera_adxcvr.c:427
int32_t adxcvr_remove(struct adxcvr *xcvr)
adxcvr_remove
Definition altera_adxcvr.c:478
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:158
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:193
int adxcvr_clk_set_rate(struct adxcvr *xcvr, unsigned long rate, unsigned long parent_rate)
AXI ADXCVR Clock Set Rate.
Definition axi_adxcvr.c:303
int32_t adxcvr_write(struct adxcvr *xcvr, uint32_t reg_addr, uint32_t reg_val)
adxcvr_write
Definition altera_adxcvr.c:71
int32_t adxcvr_status_error(struct adxcvr *xcvr)
AXI ADXCVR Status Read.
Definition axi_adxcvr.c:427
Definition altera_adxcvr.h:92
uint32_t lane_rate_khz
Definition altera_adxcvr.h:97
const char * name
Definition altera_adxcvr.h:93
uint32_t sys_clk_sel
Definition axi_adxcvr.h:102
uint32_t out_clk_sel
Definition axi_adxcvr.h:106
uint32_t ref_rate_khz
Definition axi_adxcvr.h:112
bool export_no_os_clk
Definition axi_adxcvr.h:114
uint32_t base
Definition altera_adxcvr.h:94
bool lpm_enable
Definition axi_adxcvr.h:108
ADI JESD204B/C AXI_ADXCVR Highspeed Transceiver Device structure.
Definition altera_adxcvr.h:79
const char * name
Definition altera_adxcvr.h:80
bool cpll_enable
Definition axi_adxcvr.h:62
uint32_t lane_rate_khz
Definition altera_adxcvr.h:87
uint32_t base
Definition altera_adxcvr.h:81
uint32_t ref_rate_khz
Definition axi_adxcvr.h:74
uint32_t out_clk_sel
Definition axi_adxcvr.h:82
bool qpll_enable
Definition axi_adxcvr.h:64
uint32_t num_lanes
Definition axi_adxcvr.h:70
bool tx_enable
Definition axi_adxcvr.h:66
struct xilinx_xcvr xlx_xcvr
Definition axi_adxcvr.h:84
uint32_t sys_clk_sel
Definition axi_adxcvr.h:78
struct no_os_clk_desc * clk_out
Definition axi_adxcvr.h:86
bool lpm_enable
Definition axi_adxcvr.h:68
Structure holding CLK descriptor.
Definition no_os_clk.h:69
Structure holding CLK function pointers that point to the platform specific function.
Definition no_os_clk.h:85
int(* init)(struct no_os_clk_desc **, const struct no_os_clk_init_param *)
Definition no_os_clk.h:87
xilinx_xcvr parameters structure.
Definition xilinx_transceiver.h:160
Driver for the Xilinx High-speed transceiver dynamic reconfiguration.