no-OS
Classes | Macros | Functions | Variables
axi_adxcvr.h File Reference

Driver for the ADI AXI-ADXCVR Module. More...

#include <stdint.h>
#include <stdbool.h>
#include "xilinx_transceiver.h"
Include dependency graph for axi_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 ADXCVR_SYS_CLK_CPLL   0x00
 
#define ADXCVR_SYS_CLK_QPLL1   0x02
 
#define ADXCVR_SYS_CLK_QPLL0   0x03
 
#define ADXCVR_OUTCLK_PCS   1
 
#define ADXCVR_OUTCLK_PMA   2
 
#define ADXCVR_REFCLK   3
 
#define ADXCVR_REFCLK_DIV2   4
 
#define ADXCVR_PROGDIV_CLK   5 /* GTHE3, GTHE4, GTYE4 only */
 

Functions

int adxcvr_drp_read (struct adxcvr *xcvr, unsigned int drp_port, unsigned int reg, unsigned int *val)
 AXI ADXCVR DPR Port Read. More...
 
int adxcvr_drp_write (struct adxcvr *xcvr, unsigned int drp_port, unsigned int reg, unsigned int val)
 AXI ADXCVR DPR Port Write. More...
 
int32_t adxcvr_status_error (struct adxcvr *xcvr)
 AXI ADXCVR Status Read. More...
 
int adxcvr_clk_enable (struct adxcvr *xcvr)
 AXI ADXCVR Clock Enable. More...
 
int adxcvr_clk_disable (struct adxcvr *xcvr)
 AXI ADXCVR Clock Disable. More...
 
int32_t adxcvr_init (struct adxcvr **ad_xcvr, const struct adxcvr_init *init)
 adxcvr_init More...
 
int32_t adxcvr_remove (struct adxcvr *xcvr)
 adxcvr_remove More...
 
int adxcvr_clk_set_rate (struct adxcvr *xcvr, unsigned long rate, unsigned long parent_rate)
 AXI ADXCVR Clock Set Rate. More...
 
int32_t adxcvr_write (struct adxcvr *xcvr, uint32_t reg_addr, uint32_t reg_val)
 adxcvr_write More...
 
int32_t adxcvr_read (struct adxcvr *xcvr, uint32_t reg_addr, uint32_t *reg_val)
 adxcvr_read More...
 

Variables

const struct no_os_clk_platform_ops adxcvr_clk_ops
 adxcvr clock ops More...
 

Detailed Description

Driver for the ADI AXI-ADXCVR Module.

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.

All rights reserved.

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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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

◆ ADXCVR_OUTCLK_PCS

#define ADXCVR_OUTCLK_PCS   1

◆ ADXCVR_OUTCLK_PMA

#define ADXCVR_OUTCLK_PMA   2

◆ ADXCVR_PROGDIV_CLK

#define ADXCVR_PROGDIV_CLK   5 /* GTHE3, GTHE4, GTYE4 only */

◆ ADXCVR_REFCLK

#define ADXCVR_REFCLK   3

◆ ADXCVR_REFCLK_DIV2

#define ADXCVR_REFCLK_DIV2   4

◆ ADXCVR_SYS_CLK_CPLL

#define ADXCVR_SYS_CLK_CPLL   0x00

◆ ADXCVR_SYS_CLK_QPLL0

#define ADXCVR_SYS_CLK_QPLL0   0x03

◆ ADXCVR_SYS_CLK_QPLL1

#define ADXCVR_SYS_CLK_QPLL1   0x02

Function Documentation

◆ adxcvr_clk_disable()

int adxcvr_clk_disable ( struct adxcvr xcvr)

AXI ADXCVR Clock Disable.

AXI ADXCVR Clock Disable

Parameters
xcvr- The device structure.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ adxcvr_clk_enable()

int adxcvr_clk_enable ( struct adxcvr xcvr)

AXI ADXCVR Clock Enable.

AXI ADXCVR Clock Enable

Parameters
xcvr- The device structure.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ adxcvr_clk_set_rate()

int adxcvr_clk_set_rate ( struct adxcvr xcvr,
unsigned long  rate,
unsigned long  parent_rate 
)

AXI ADXCVR Clock Set Rate.

AXI ADXCVR Clock Set Rate

Parameters
xcvr- The device structure.
rate- The output rate (kHz).
parent_rate- The parent rate (kHz).
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ adxcvr_drp_read()

int adxcvr_drp_read ( struct adxcvr xcvr,
unsigned int  drp_port,
unsigned int  reg,
unsigned int *  val 
)

AXI ADXCVR DPR Port Read.

AXI ADXCVR DPR Port Read

Parameters
xcvr- The device structure.
drp_port- The DRP Port.
reg- DRP Register address.
val- Data read.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adxcvr_drp_write()

int adxcvr_drp_write ( struct adxcvr xcvr,
unsigned int  drp_port,
unsigned int  reg,
unsigned int  val 
)

AXI ADXCVR DPR Port Write.

AXI ADXCVR DPR Port Write

Parameters
xcvr- The device structure.
drp_port- The DRP Port.
reg- DRP Register address.
val- Data to be written.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ adxcvr_init()

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

adxcvr_init

AXI ADXCVR Device Initialization

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.
Here is the caller graph for this function:

◆ adxcvr_read()

int32_t adxcvr_read ( struct adxcvr xcvr,
uint32_t  reg_addr,
uint32_t *  reg_val 
)

adxcvr_read

AXI ADXCVR Read

adxcvr_read

Parameters
xcvr- Device Structure.
reg_addr- The register address.
reg_val- Data read from the device.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ adxcvr_remove()

int32_t adxcvr_remove ( struct adxcvr xcvr)

adxcvr_remove

AXI ADXCVR Resources Deallocation

adxcvr_remove

Parameters
xcvr- The device structure.
Returns
Returns 0 in case of success or negative error code.
Here is the caller graph for this function:

◆ adxcvr_status_error()

int32_t adxcvr_status_error ( struct adxcvr xcvr)

AXI ADXCVR Status Read.

AXI ADXCVRS Status Read

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

◆ adxcvr_write()

int32_t adxcvr_write ( struct adxcvr xcvr,
uint32_t  reg_addr,
uint32_t  reg_val 
)

adxcvr_write

AXI ADXCVR Write

adxcvr_write

Parameters
xcvr- Device Structure.
reg_addr- The register address.
reg_val- Data value to write.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

Variable Documentation

◆ adxcvr_clk_ops

const struct no_os_clk_platform_ops adxcvr_clk_ops

adxcvr clock ops