no-OS
Loading...
Searching...
No Matches
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:

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

Variables

const struct no_os_clk_platform_ops adxcvr_clk_ops
 adxcvr clock ops
 

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.

SPDX-License-Identifier: BSD-3-Clause

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

Variable Documentation

◆ adxcvr_clk_ops

const struct no_os_clk_platform_ops adxcvr_clk_ops
extern

adxcvr clock ops