/*-------------------------------------------------------------------------------------------------
--
-- File Name    : coaxpressXcvrSpeed.h



-- Description  : This module replicates the CoaXPress Device Speed settings.




-- Targeted device : Microchip FPGAs
-- Author          : India Solutions Team




--
-- COPYRIGHT 2023 BY MICROCHIP
-- THE INFORMATION CONTAINED IN THIS DOCUMENT IS SUBJECT TO LICENSING RESTRICTIONS
-- FROM MICROCHIP CORP.  IF YOU ARE NOT IN POSSESSION OF WRITTEN AUTHORIZATION FROM
-- MICROCHIP FOR USE OF THIS FILE, THEN THE FILE SHOULD BE IMMEDIATELY DESTROYED AND
-- NO BACK-UP OF THE FILE SHOULD BE MADE.
--



-------------------------------------------------------------------------------------------------*/

#ifndef COAXPRESSXCVRSPEED_H_
#define COAXPRESSXCVRSPEED_H_

#define CXP_DEV_XCVR_BASE   0x60000000UL
// XVCR Register Offsets
#define DES_CDR_CTRL_2      0x01081008
#define DES_CDR_CTRL_3      0x0108100c
#define DES_DFEEM_CTRL_1    0x01081010
#define DES_DFEEM_CTRL_2    0x01081014
#define DES_DFEEM_CTRL_3    0x01081018
#define DES_DFE_CTRL_2      0x01081024
#define DES_EM_CTRL_2       0x0108102c
#define DES_RXPLL_DIV       0x01081040
#define DES_RSTPD           0x0108104c
#define SER_CLK_CTRL        0x01081074
#define SER_RSTPD           0x01081078

#define SERDES_RTL_CTRL     0x010810c0
#define DES_DFE_CAL_CTRL_0  0x010810d0
#define DES_DFE_CAL_CTRL_1  0x010810d4
#define DES_DFE_CAL_CTRL_2  0x010810d8
#define DES_DFE_CAL_CMD     0x010810dc
#define DES_DFE_CAL_FLAG    0x01081100

#define TXPLL_DIV_1         0x01090010
#define TXPLL_DIV_2         0x01090014

//Configuring different rates 1.25G, 2.5G, 3.125G, 5.0G, 6.25G, 10.0G, 12.5G
#define RATE_1DOT25G    0x28
#define RATE_2DOT5G     0x30
#define RATE_3DOT125G   0x38
#define RATE_5DOT0G     0x40
#define RATE_6DOT25G    0x48
#define RATE_10DOT0G    0x50
#define RATE_12DOT5G    0x58

void wait_for_pll_lock();
void update_hdmi_xcvr_speed(uint32_t gpio_status);
void update_cxp_xcvr_uplink_speed(uint8_t data);

#endif /* COAXPRESSXCVRSPEED_H_ */
