no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad9152.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef AD9152_H_
34#define AD9152_H_
35
36#include <stdint.h>
37#include "no_os_delay.h"
38#include "no_os_spi.h"
39
40#define REG_SPI_INTFCONFA 0x000 /* Interface configuration A */
41#define REG_SPI_CHIPTYPE 0x003 /* Chip Type */
42#define REG_SPI_PRODIDL 0x004 /* Product Identification Low Byte */
43#define REG_SPI_PRODIDH 0x005 /* Product Identification High Byte */
44#define REG_SPI_CHIPGRADE 0x006 /* Chip Grade */
45#define REG_PWRCNTRL0 0x011 /* Power Control Reg 1 */
46#define REG_TXENMASK1 0x012 /* TXenable masks */
47#define REG_PWRCNTRL3 0x013 /* Power control register 3 */
48#define REG_PWRCNTRL1 0x014 /* Power control register 1 */
49#define REG_IRQ_ENABLE0 0x01F /* Interrupt Enable */
50#define REG_IRQ_ENABLE1 0x020 /* Interrupt Enable */
51#define REG_IRQ_ENABLE2 0x021 /* Interrupt Enable */
52#define REG_IRQ_STATUS0 0x023 /* Interrupt Status */
53#define REG_IRQ_STATUS1 0x024 /* Interrupt Status */
54#define REG_IRQ_STATUS2 0x025 /* Interrupt Status */
55#define REG_IRQ_STATUS3 0x026 /* Interrupt Status */
56#define REG_IRQ_STATUS4 0x027 /* Interrupt Status */
57#define REG_JESD_CHECKS 0x030 /* JESD Parameter Checking */
58#define REG_SYNC_TESTCTRL 0x031 /* Sync Control Reg0 */
59#define REG_SYNC_DACDELAY_L 0x032 /* Sync Logic DacDelay [7:0] */
60#define REG_SYNC_DACDELAY_H 0x033 /* Sync Logic DacDelay [8] */
61#define REG_SYNC_ERRWINDOW 0x034 /* Sync Error Window */
62#define REG_SYNC_DLYCOUNT 0x035 /* Sync Control Ref Delay Count */
63#define REG_SYNC_REFCOUNT 0x036 /* Sync SysRef InActive Interval */
64#define REG_SYNC_LASTERR_L 0x038 /* SyncLASTerror_L */
65#define REG_SYNC_LASTERR_H 0x039 /* SyncLASTerror_H */
66#define REG_SYNC_CTRL 0x03A /* Sync Mode Control */
67#define REG_SYNC_STATUS 0x03B /* Sync Alignment Flags */
68#define REG_SYNC_CURRERR_L 0x03C /* Sync Alignment Error[7:0] */
69#define REG_SYNC_CURRERR_H 0x03D /* Sync Alignment Error[8] */
70#define REG_ERROR_THERM 0x03E /* Sync Error Thermometer */
71#define REG_DACGAIN0_1 0x040 /* MSBs of Full Scale Adjust DAC */
72#define REG_DACGAIN0_0 0x041 /* LSBs of Full Scale Adjust DAC */
73#define REG_DACGAIN1_1 0x042 /* MSBs of Full Scale Adjust DAC */
74#define REG_DACGAIN1_0 0x043 /* LSBs of Full Scale Adjust DAC */
75#define REG_COARSE_GROUP_DLY 0x047 /* Coarse Group Delay Adjustment */
76#define REG_NCO_ALIGNMODE 0x050 /* NCO Align Mode */
77#define REG_NCOKEY_ILSB 0x051 /* NCO Clear on Data Key I lsb */
78#define REG_NCOKEY_IMSB 0x052 /* NCO Clear on Data Key I msb */
79#define REG_NCOKEY_QLSB 0x053 /* NCO Clear on Data Key Q lsb */
80#define REG_NCOKEY_QMSB 0x054 /* NCO Clear on Data Key Q msb */
81#define REG_PA_THRES0 0x060 /* PDP Threshold */
82#define REG_PA_THRES1 0x061 /* PDP Threshold */
83#define REG_PA_AVG_TIME 0x062 /* PDP Control */
84#define REG_PA_POWER0 0x063 /* PDP Power */
85#define REG_PA_POWER1 0x064 /* PDP Power */
86#define REG_PA_OFFGAIN0 0x065 /* PDP Offgain 0 */
87#define REG_PA_OFFGAIN1 0x066 /* PDP Offgain 1 */
88#define REG_CLKCFG0 0x080 /* Clock Configuration */
89#define REG_SYSREF_ACTRL0 0x081 /* SYSREF Analog Control 0 */
90#define REG_SYSREF_ACTRL1 0x082 /* SYSREF Analog Control 1 */
91#define REG_DACPLLCNTRL 0x083 /* Top Level Control DAC Clock PLL */
92#define REG_DACPLLSTATUS 0x084 /* DAC PLL Status Bits */
93#define REG_DACINTEGERWORD0 0x085 /* Feedback divider tuning word */
94#define REG_DACLOOPFILT1 0x087 /* C1 and C2 control */
95#define REG_DACLOOPFILT2 0x088 /* R1 and C3 control */
96#define REG_DACLOOPFILT3 0x089 /* Bypass and R2 control */
97#define REG_DACCPCNTRL 0x08A /* Charge Pump/Cntrl Voltage */
98#define REG_DACLOGENCNTRL 0x08B /* Logen Control */
99#define REG_DACLDOCNTRL1 0x08C /* LDO Control1 + Reference Divider */
100#define REG_DAC_PLL_CONFIG0 0x08D /* DAC PLL Configuration */
101#define REG_CLK_DETECT 0x08E /* Clock Detect */
102#define REG_DIG_TEST0 0x0F7 /* Digital Test 0 */
103#define REG_DC_TEST_VALUEI0 0x0F8 /* DC Test Value I0 */
104#define REG_DC_TEST_VALUEI1 0x0F9 /* DC Test Value I1 */
105#define REG_DC_TEST_VALUEQ0 0x0FA /* DC Test Value Q0 */
106#define REG_DC_TEST_VALUEQ1 0x0FB /* DC Test Value Q1 */
107#define REG_DATA_FORMAT 0x110 /* Data format */
108#define REG_DATAPATH_CTRL 0x111 /* Datapath Control */
109#define REG_INTERP_MODE 0x112 /* Interpolation Mode */
110#define REG_NCO_FTW_UPDATE 0x113 /* NCO Frequency Tuning Word Update */
111#define REG_FTW0 0x114 /* NCO Frequency Tuning Word LSB */
112#define REG_FTW1 0x115 /* NCO Frequency Tuning Word */
113#define REG_FTW2 0x116 /* NCO Frequency Tuning Word */
114#define REG_FTW3 0x117 /* NCO Frequency Tuning Word */
115#define REG_FTW4 0x118 /* NCO Frequency Tuning Word */
116#define REG_FTW5 0x119 /* NCO Frequency Tuning Word MSB */
117#define REG_NCO_PHASE_OFFSET0 0x11A /* NCO Phase Offset LSB */
118#define REG_NCO_PHASE_OFFSET1 0x11B /* NCO Phase Offset MSB */
119#define REG_NCO_PHASE_ADJ0 0x11C /* I/Q Phase Adjust LSB */
120#define REG_NCO_PHASE_ADJ1 0x11D /* I/Q Phase Adjust MSB */
121#define REG_TXEN_SM_0 0x11F /* Transmit enable power control state machine */
122#define REG_DACOUT_ON_DOWN 0x125 /* DAC out down control and on trigger */
123#define REG_DACOFF 0x12C /* DAC Shutdown Source */
124#define REG_DIE_TEMP_CTRL0 0x12F /* Die Temp Range Control */
125#define REG_DIE_TEMP0 0x132 /* Die temp LSB */
126#define REG_DIE_TEMP1 0x133 /* Die Temp MSB */
127#define REG_DIE_TEMP_UPDATE 0x134 /* Die temperature update */
128#define REG_DC_OFFSET_CTRL 0x135 /* DC Offset Control */
129#define REG_IPATH_DC_OFFSET_1PART0 0x136 /* LSB of first part of DC Offset value for I path */
130#define REG_IPATH_DC_OFFSET_1PART1 0x137 /* MSB of first part of DC Offset value for I path */
131#define REG_QPATH_DC_OFFSET_1PART0 0x138 /* LSB of first part of DC Offset value for Q path */
132#define REG_QPATH_DC_OFFSET_1PART1 0x139 /* MSB of first part of DC Offset value for Q path */
133#define REG_IPATH_DC_OFFSET_2PART 0x13A /* Second part of DC Offset value for I path */
134#define REG_QPATH_DC_OFFSET_2PART 0x13B /* Second part of DC Offset value for Q path */
135#define REG_IDAC_DIG_GAIN0 0x13C /* I DAC Gain LSB */
136#define REG_IDAC_DIG_GAIN1 0x13D /* I DAC Gain MSB */
137#define REG_QDAC_DIG_GAIN0 0x13E /* Q DAC Gain LSB */
138#define REG_QDAC_DIG_GAIN1 0x13F /* Q DAC Gain MSB */
139#define REG_GAIN_RAMP_UP_STP0 0x140 /* LSB of digital gain rises */
140#define REG_GAIN_RAMP_UP_STP1 0x141 /* MSB of digital gain rises */
141#define REG_GAIN_RAMP_DOWN_STP0 0x142 /* LSB of digital gain drops */
142#define REG_GAIN_RAMP_DOWN_STP1 0x143 /* MSB of digital gain drops */
143#define REG_PRBS 0x14B /* PRBS Input Data Checker */
144#define REG_PRBS_ERROR_I 0x14C /* PRBS Error Counter Real */
145#define REG_PRBS_ERROR_Q 0x14D /* PRBS Error Counter Imaginary */
146#define REG_DATAPATH_CTRL2 0x151 /* Datapath Control 2 */
147#define REG_ACC_MODULUS0 0x152 /* ACC Modulus 0 */
148#define REG_ACC_MODULUS1 0x153 /* ACC Modulus 1 */
149#define REG_ACC_MODULUS2 0x154 /* ACC Modulus 2 */
150#define REG_ACC_MODULUS3 0x155 /* ACC Modulus 3 */
151#define REG_ACC_MODULUS4 0x156 /* ACC Modulus 4 */
152#define REG_ACC_MODULUS5 0x157 /* ACC Modulus 5 */
153#define REG_ACC_DELTA0 0x158 /* ACC Delta 0 */
154#define REG_ACC_DELTA1 0x159 /* ACC Delta 1 */
155#define REG_ACC_DELTA2 0x15A /* ACC Delta 2 */
156#define REG_ACC_DELTA3 0x15B /* ACC Delta 3 */
157#define REG_ACC_DELTA4 0x15C /* ACC Delta 4 */
158#define REG_ACC_DELTA5 0x15D /* ACC Delta 5 */
159#define REG_PFIR_COEFF0_L 0x17A /* PFIR Coefficient 0 LSB */
160#define REG_PFIR_COEFF0_H 0x17B /* PFIR Coefficient 0 MSB */
161#define REG_PFIR_COEFF1_L 0x17C /* PFIR Coefficient 1 LSB */
162#define REG_PFIR_COEFF1_H 0x17D /* PFIR Coefficient 1 MSB */
163#define REG_PFIR_COEFF2_L 0x17E /* PFIR Coefficient 2 LSB */
164#define REG_PFIR_COEFF2_H 0x17F /* PFIR Coefficient 2 MSB */
165#define REG_PFIR_COEFF3_L 0x180 /* PFIR Coefficient 3 LSB */
166#define REG_PFIR_COEFF3_H 0x181 /* PFIR Coefficient 3 MSB */
167#define REG_PFIR_COEFF_UPDATE 0x182 /* PFIR Coefficient Update */
168#define REG_DAC_PLL_CONFIG1 0x1B0 /* DAC PLL Configuration */
169#define REG_DACPLLT4 0x1B4 /* VCO Cal Control */
170#define REG_DACPLLT5 0x1B5 /* ALC/Varactor control */
171#define REG_DACPLLT6 0x1B6 /* DAC PLL VCO Control */
172#define REG_DAC_PLL_CONFIG2 0x1B9 /* DAC PLL Configuration */
173#define REG_DACPLLTB 0x1BB /* VCO Bias Control */
174#define REG_DAC_PLL_CONFIG3 0x1BC /* DAC PLL Configuration */
175#define REG_DAC_PLL_CONFIG4 0x1BE /* DAC PLL Configuration */
176#define REG_DAC_PLL_CONFIG5 0x1BF /* DAC PLL Configuration */
177#define REG_DAC_PLL_CONFIG6 0x1C0 /* DAC PLL Configuration */
178#define REG_DAC_PLL_CONFIG7 0x1C1 /* DAC PLL Configuration */
179#define REG_DACPLLT17 0x1C4 /* Varactor ControlV */
180#define REG_DACPLLT18 0x1C5 /* DAC PLL Control */
181#define REG_TEST_MODE 0x1FE /* Test Mode */
182#define REG_MASTER_PD 0x200 /* Master power down for Receiver PHYx */
183#define REG_PHY_PD 0x201 /* Power down for individual Receiver PHYx */
184#define REG_GENERIC_PD 0x203 /* Miscellaneous power down controls */
185#define REG_CDR_RESET 0x206 /* CDR Reset */
186#define REG_CDR_OPERATING_MODE_REG_0 0x230 /* Clock and data recovery operating modes */
187#define REG_EQ_BIAS_REG 0x268 /* Equalizer bias control */
188#define REG_SYNTH_ENABLE_CNTRL 0x280 /* Rx PLL enable controls */
189#define REG_PLL_STATUS 0x281 /* Rx PLL status readbacks */
190#define REG_SERDES_PLL_CONFIG0 0x284 /* SERDES PLL Configuration */
191#define REG_SERDES_PLL_CONFIG1 0x285 /* SERDES PLL Configuration */
192#define REG_SERDES_PLL_CONFIG2 0x286 /* SERDES PLL Configuration */
193#define REG_SERDES_PLL_CONFIG3 0x287 /* SERDES PLL Configuration */
194#define REG_REF_CLK_DIVIDER_LDO 0x289 /* Rx PLL LDO control */
195#define REG_SERDES_PLL_VCO_CONTROL0 0x28A /* SERDES PLL VCO Control 0 */
196#define REG_SERDES_PLL_CONFIG4 0x28B /* SERDES PLL Configuration */
197#define REG_SERDES_PLL_CONFIG5 0x290 /* SERDES PLL Configuration */
198#define REG_SERDES_PLL_VCO_CONTROL1 0x291 /* SERDES PLL VCO Control 1 */
199#define REG_SERDES_PLL_CONFIG6 0x294 /* SERDES PLL Configuration */
200#define REG_SERDES_PLL_VCO_CONTROL2 0x296 /* SERDES PLL VCO Control 2 */
201#define REG_SERDES_PLL_CONFIG7 0x297 /* SERDES PLL Configuration */
202#define REG_SERDES_PLL_CONFIG8 0x299 /* SERDES PLL Configuration */
203#define REG_SERDES_PLL_CONFIG9 0x29A /* SERDES PLL Configuration */
204#define REG_SERDES_PLL_CONFIG10 0x29C /* SERDES PLL Configuration */
205#define REG_SERDES_PLL_CONFIG11 0x29F /* SERDES PLL Configuration */
206#define REG_SERDES_PLL_CONFIG12 0x2A0 /* SERDES PLL Configuration */
207#define REG_TERM_BLK1_CTRLREG0 0x2A7 /* Termination controls for PHYs 0, 1, 6, and 7 */
208#define REG_JESD204B_TERM0 0x2AA /* JESD204B interface termination configuration */
209#define REG_JESD204B_TERM1 0x2AB /* JESD204B interface termination configuration */
210#define REG_GENERAL_JRX_CTRL_0 0x300 /* General JRX Control Register 0 */
211#define REG_GENERAL_JRX_CTRL_1 0x301 /* General JRX Control Register 1 */
212#define REG_DYN_LINK_LATENCY_0 0x302 /* Register 1 description */
213#define REG_LMFC_DELAY_0 0x304 /* Register 3 description */
214#define REG_LMFC_VAR_0 0x306 /* Register 5 description */
215#define REG_XBAR_LN_0_1 0x308 /* Register 7 description */
216#define REG_XBAR_LN_2_3 0x309 /* Register 8 description */
217#define REG_FIFO_STATUS_REG_0 0x30C /* Register 11 description */
218#define REG_FIFO_STATUS_REG_1 0x30D /* Register 12 description */
219#define REG_SYNCB_GEN_0 0x311 /* Register 16 description */
220#define REG_SYNCB_GEN_1 0x312 /* Register 17 description */
221#define REG_SYNCB_GEN_3 0x313 /* Register 18 description */
222#define REG_SERDES_SPI_REG 0x314 /* SERDES SPI Configuration */
223#define REG_PHY_PRBS_TEST_EN 0x315 /* PHY PRBS TEST ENABLE FOR INDIVIDUAL LANES */
224#define REG_PHY_PRBS_TEST_CTRL 0x316 /* Reg 20 Description */
225#define REG_PHY_PRBS_TEST_THRESH_LOBITS 0x317 /* Reg 21 Description */
226#define REG_PHY_PRBS_TEST_THRESH_MIDBITS 0x318 /* Reg 22 Description */
227#define REG_PHY_PRBS_TEST_THRESH_HIBITS 0x319 /* Reg 23 Description */
228#define REG_PHY_PRBS_TEST_ERRCNT_LOBITS 0x31A /* Reg 24 Description */
229#define REG_PHY_PRBS_TEST_ERRCNT_MIDBITS 0x31B /* Reg 25 Description */
230#define REG_PHY_PRBS_TEST_ERRCNT_HIBITS 0x31C /* Reg 26 Description */
231#define REG_PHY_PRBS_TEST_STATUS 0x31D /* Reg 27 Description */
232#define REG_SHORT_TPL_TEST_0 0x32C /* Reg 46 Description */
233#define REG_SHORT_TPL_TEST_1 0x32D /* Reg 47 Description */
234#define REG_SHORT_TPL_TEST_2 0x32E /* Reg 48 Description */
235#define REG_SHORT_TPL_TEST_3 0x32F /* Reg 49 Description */
236#define REG_JESD_BIT_INVERSE_CTRL 0x334 /* Reg 42 Description */
237#define REG_DID_REG 0x400 /* Reg 0 Description */
238#define REG_BID_REG 0x401 /* Reg 1 Description */
239#define REG_LID0_REG 0x402 /* Reg 2 Description */
240#define REG_SCR_L_REG 0x403 /* Reg 3 Description */
241#define REG_F_REG 0x404 /* Reg 4 Description */
242#define REG_K_REG 0x405 /* Reg 5 Description */
243#define REG_M_REG 0x406 /* Reg 6 Description */
244#define REG_CS_N_REG 0x407 /* Reg 7 Description */
245#define REG_NP_REG 0x408 /* Reg 8 Description */
246#define REG_S_REG 0x409 /* Reg 9 Description */
247#define REG_HD_CF_REG 0x40A /* Reg 10 Description */
248#define REG_RES1_REG 0x40B /* Reg 11 Description */
249#define REG_RES2_REG 0x40C /* Reg 12 Description */
250#define REG_CHECKSUM_REG 0x40D /* Reg 13 Description */
251#define REG_COMPSUM0_REG 0x40E /* Reg 14 Description */
252#define REG_LID1_REG 0x412 /* Reg 18 Description */
253#define REG_CHECKSUM1_REG 0x415 /* Reg 19 Description */
254#define REG_COMPSUM1_REG 0x416 /* Reg 22 Description */
255#define REG_LID2_REG 0x41A /* Reg 26 Description */
256#define REG_CHECKSUM2_REG 0x41D /* Reg 29 Description */
257#define REG_COMPSUM2_REG 0x41E /* Reg 30 Description */
258#define REG_LID3_REG 0x422 /* Reg 34 Description */
259#define REG_CHECKSUM3_REG 0x425 /* Reg 37 Description */
260#define REG_COMPSUM3_REG 0x426 /* Reg 38 Description */
261#define REG_ILS_DID 0x450 /* Reg 80 Description */
262#define REG_ILS_BID 0x451 /* Reg 81 Description */
263#define REG_ILS_LID0 0x452 /* Reg 82 Description */
264#define REG_ILS_SCR_L 0x453 /* Reg 83 Description */
265#define REG_ILS_F 0x454 /* Reg 84 Description */
266#define REG_ILS_K 0x455 /* Reg 85 Description */
267#define REG_ILS_M 0x456 /* Reg 86 Description */
268#define REG_ILS_CS_N 0x457 /* Reg 87 Description */
269#define REG_ILS_NP 0x458 /* Reg 88 Description */
270#define REG_ILS_S 0x459 /* Reg 89 Description */
271#define REG_ILS_HD_CF 0x45A /* Reg 90 Description */
272#define REG_ILS_RES1 0x45B /* Reg 91 Description */
273#define REG_ILS_RES2 0x45C /* Reg 92 Description */
274#define REG_ILS_CHECKSUM 0x45D /* Reg 93 Description */
275#define REG_ERRCNTRMON 0x46B /* Reg 107 Description */
276#define REG_LANEDESKEW 0x46C /* Reg 108 Description */
277#define REG_BADDISPARITY 0x46D /* Reg 109 Description */
278#define REG_NITDISPARITY 0x46E /* Reg 110 Description */
279#define REG_UNEXPECTEDKCHAR 0x46F /* Reg 111 Description */
280#define REG_CODEGRPSYNCFLG 0x470 /* Reg 112 Description */
281#define REG_FRAMESYNCFLG 0x471 /* Reg 113 Description */
282#define REG_GOODCHKSUMFLG 0x472 /* Reg 114 Description */
283#define REG_INITLANESYNCFLG 0x473 /* Reg 115 Description */
284#define REG_CTRLREG1 0x476 /* Reg 118 Description */
285#define REG_CTRLREG2 0x477 /* Reg 119 Description */
286#define REG_KVAL 0x478 /* Reg 120 Description */
287#define REG_IRQVECTOR 0x47A /* Reg 122 Description */
288#define REG_SYNCASSERTIONMASK 0x47B /* Reg 123 Description */
289#define REG_ERRORTHRES 0x47C /* Reg 124 Description */
290#define REG_LANEENABLE 0x47D /* Reg 125 Description */
291#define REG_RAMP_ENA 0x47E /* Ramp Check Enable */
292
293/*
294 * REG_SPI_INTFCONFA
295 */
296#define SOFTRESET_M (1 << 7) /* Soft Reset (Mirror) */
297#define LSBFIRST_M (1 << 6) /* LSB First (Mirror) */
298#define ADDRINC_M (1 << 5) /* Address Increment (Mirror) */
299#define SDOACTIVE_M (1 << 4) /* SDO Active (Mirror) */
300#define SDOACTIVE (1 << 3) /* SDO Active */
301#define ADDRINC (1 << 2) /* Address Increment */
302#define LSBFIRST (1 << 1) /* LSB First */
303#define SOFTRESET (1 << 0) /* Soft Reset */
304
305/*
306 * REG_SPI_INTFCONFB
307 */
308#define SINGLEINS (1 << 7) /* Single Instruction */
309#define CSBSTALL (1 << 6) /* CSb Stalling */
310
311/*
312 * REG_SPI_DEVCONF
313 */
314#define DEVSTATUS(x) (((x) & 0xF) << 4) /* Device Status */
315#define CUSTOPMODE(x) (((x) & 0x3) << 2) /* Customer Operating Mode */
316#define SYSOPMODE(x) (((x) & 0x3) << 0) /* System Operating Mode */
317
318/*
319 * REG_SPI_CHIPGRADE
320 */
321#define PROD_GRADE(x) (((x) & 0xF) << 4) /* Product Grade */
322#define DEV_REVISION(x) (((x) & 0xF) << 0) /* Device Revision */
323
324/*
325 * REG_SPI_PAGEINDX
326 */
327#define PAGEINDX(x) (((x) & 0x3) << 0) /* Page or Index Pointer */
328
329/*
330 * REG_SPI_MS_UPDATE
331 */
332#define SLAVEUPDATE (1 << 0) /* M/S Update Bit */
333
334/*
335 * REG_PWRCNTRL0
336 */
337#define PD_BG (1 << 7) /* Reference PowerDown */
338#define PD_DAC_0 (1 << 6) /* PD Ichannel DAC 0 */
339#define PD_DAC_1 (1 << 5) /* PD Qchannel DAC 1 */
340#define PD_DAC_2 (1 << 4) /* PD Ichannel DAC 2 */
341#define PD_DAC_3 (1 << 3) /* PD Qchannel DAC 3 */
342#define PD_DACM (1 << 2) /* PD Dac master Bias */
343
344/*
345 * REG_TXENMASK1
346 */
347#define SYS_MASK (1 << 2) /* SYSREF Receiver TXen mask */
348#define DACB_MASK (1 << 1) /* Dual B Dac TXen1 mask */
349#define DACA_MASK (1 << 0) /* Dual A Dac TXen0 mask */
350
351/*
352 * REG_PWRCNTRL3
353 */
354#define ENA_PA_CTRL_FROM_PAPROT_ERR (1 << 6) /* Control PDP enable from PAProt block */
355#define ENA_PA_CTRL_FROM_TXENSM (1 << 5) /* Control PDP enable from Txen State machine */
356#define ENA_PA_CTRL_FROM_BLSM (1 << 4) /* Control PDP enable from Blanking state machine */
357#define ENA_PA_CTRL_FROM_SPI (1 << 3) /* Control PDP enable via SPI */
358#define SPI_PA_CTRL (1 << 2) /* PDP on/off via SPI */
359#define ENA_SPI_TXEN (1 << 1) /* TXEN from SPI control */
360#define SPI_TXEN (1 << 0) /* Spi TXEN */
361
362/*
363 * REG_COARSE_GROUP_DLY
364 */
365#define COARSE_GROUP_DLY(x) (((x) & 0xF) << 0) /* Coarse group delay */
366
367/*
368 * REG_IRQ_ENABLE0
369 */
370#define EN_CALPASS (1 << 7) /* Enable Calib PASS detection */
371#define EN_CALFAIL (1 << 6) /* Enable Calib FAIL detection */
372#define EN_DACPLLLOST (1 << 5) /* Enable DAC Pll Lost detection */
373#define EN_DACPLLLOCK (1 << 4) /* Enable DAC Pll Lock detection */
374#define EN_SERPLLLOST (1 << 3) /* Enable Serdes PLL Lost detection */
375#define EN_SERPLLLOCK (1 << 2) /* Enable Serdes PLL Lock detection */
376#define EN_LANEFIFOERR (1 << 1) /* Enable Lane FIFO Error detection */
377#define EN_DRDLFIFOERR (1 << 0) /* Enable DRDL FIFO Error detection */
378
379/*
380 * REG_IRQ_ENABLE1
381 */
382#define EN_PARMBAD (1 << 7) /* enable BAD Parameter interrupt */
383#define EN_PRBSQ1 (1 << 3) /* enable PRBS imag DAC B interrupt */
384#define EN_PRBSI1 (1 << 2) /* enable PRBS real DAC B interrupt */
385#define EN_PRBSQ0 (1 << 1) /* enable PRBS imag DAC A interrupt */
386#define EN_PRBSI0 (1 << 0) /* enable PRBS real DAC A interrupt */
387
388/*
389 * REG_IRQ_ENABLE2
390 */
391#define EN_PAERR0 (1 << 7) /* Link A PA Error */
392#define EN_BIST_DONE0 (1 << 6) /* Link A BIST done */
393#define EN_BLNKDONE0 (1 << 5) /* Link A Blanking done */
394#define EN_REFNCOCLR0 (1 << 4) /* Link A Nco Clear Tripped */
395#define EN_REFLOCK0 (1 << 3) /* Link A Alignment Locked */
396#define EN_REFROTA0 (1 << 2) /* Link A Alignment Rotate */
397#define EN_REFWLIM0 (1 << 1) /* Link A Over/Under Threshold */
398#define EN_REFTRIP0 (1 << 0) /* Link A Alignment Trip */
399
400/*
401 * REG_IRQ_ENABLE3
402 */
403#define EN_PAERR1 (1 << 7) /* Link B PA Error */
404#define EN_BIST_DONE1 (1 << 6) /* Link B BIST done */
405#define EN_BLNKDONE1 (1 << 5) /* Link B Blanking done */
406#define EN_REFNCOCLR1 (1 << 4) /* Link B Nco Clear Tripped */
407#define EN_REFLOCK1 (1 << 3) /* Link B Alignment Locked */
408#define EN_REFROTA1 (1 << 2) /* Link B Alignment Rotate */
409#define EN_REFWLIM1 (1 << 1) /* Link B Over/Under Threshold */
410#define EN_REFTRIP1 (1 << 0) /* Link B Alignment Trip */
411
412/*
413 * REG_IRQ_STATUS0
414 */
415#define IRQ_CALPASS (1 << 7) /* Calib PASS detection */
416#define IRQ_CALFAIL (1 << 6) /* Calib FAIL detection */
417#define IRQ_DACPLLLOST (1 << 5) /* DAC PLL Lost */
418#define IRQ_DACPLLLOCK (1 << 4) /* DAC PLL Lock */
419#define IRQ_SERPLLLOST (1 << 3) /* Serdes PLL Lost */
420#define IRQ_SERPLLLOCK (1 << 2) /* Serdes PLL Lock */
421#define IRQ_LANEFIFOERR (1 << 1) /* Lane Fifo Error */
422#define IRQ_DRDLFIFOERR (1 << 0) /* DRDL Fifo Error */
423
424/*
425 * REG_IRQ_STATUS1
426 */
427#define IRQ_PARMBAD (1 << 7) /* BAD Parameter interrupt */
428#define IRQ_PRBSQ1 (1 << 3) /* PRBS data check error DAC 1 imag */
429#define IRQ_PRBSI1 (1 << 2) /* PRBS data check error DAC 1 real */
430#define IRQ_PRBSQ0 (1 << 1) /* PRBS data check error DAC 0 imag */
431#define IRQ_PRBSI0 (1 << 0) /* PRBS data check error DAC 0 real */
432
433/*
434 * REG_IRQ_STATUS2
435 */
436#define IRQ_PAERR0 (1 << 7) /* Link A PA Error */
437#define IRQ_BIST_DONE0 (1 << 6) /* Link A BIST done */
438#define IRQ_BLNKDONE0 (1 << 5) /* Link A Blanking Done */
439#define IRQ_REFNCOCLR0 (1 << 4) /* Link A Alignment UnderRange */
440#define IRQ_REFLOCK0 (1 << 3) /* Link A BIST done */
441#define IRQ_REFROTA0 (1 << 2) /* Link A Alignment Trip */
442#define IRQ_REFWLIM0 (1 << 1) /* Link A Alignment Lock */
443#define IRQ_REFTRIP0 (1 << 0) /* Link A Alignment Rotate */
444
445/*
446 * REG_IRQ_STATUS3
447 */
448#define IRQ_PAERR1 (1 << 7) /* Link B PA Error */
449#define IRQ_BIST_DONE1 (1 << 6) /* Link B BIST done */
450#define IRQ_BLNKDONE1 (1 << 5) /* Link A Blanking Done */
451#define IRQ_REFNCOCLR1 (1 << 4) /* Link B Alignment UnderRange */
452#define IRQ_REFLOCK1 (1 << 3) /* Link B BIST done */
453#define IRQ_REFROTA1 (1 << 2) /* Link B Alignment Trip */
454#define IRQ_REFWLIM1 (1 << 1) /* Link B Alignment Lock */
455#define IRQ_REFTRIP1 (1 << 0) /* Link B Alignment Rotate */
456
457/*
458 * REG_JESD_CHECKS
459 */
460#define ERR_DLYOVER (1 << 5) /* LMFC_Delay > JESD_K parameter */
461#define ERR_WINLIMIT (1 << 4) /* Unsupported Window Limit */
462#define ERR_JESDBAD (1 << 3) /* Unsupported M/L/S/F selection */
463#define ERR_KUNSUPP (1 << 2) /* Unsupported K values */
464#define ERR_SUBCLASS (1 << 1) /* Unsupported SubClassv value */
465#define ERR_INTSUPP (1 << 0) /* Unsupported Interpolation rate factor */
466
467/*
468 * REG_SYNC_TESTCTRL
469 */
470#define TARRFAPHAZ (1 << 0) /* Target Polarity of Rf Divider */
471#define SYNCBYPASS(x) (((x) & 0x3) << 6) /* Sync Bypass handshaking */
472
473/*
474 * REG_SYNC_DACDELAY_H
475 */
476#define DAC_DELAY_H (1 << 0) /* Dac Delay[8] */
477
478/*
479 * REG_SYNC_ERRWINDOW
480 */
481#define ERRWINDOW(x) (((x) & 0x7) << 0) /* Sync Error Window */
482
483/*
484 * REG_SYNC_LASTERR_H
485 */
486#define LASTUNDER (1 << 7) /* Sync Last Error Under Flag */
487#define LASTOVER (1 << 6) /* Sync Last Error Over Flag */
488#define LASTERROR_H (1 << 0) /* Sync Last Error[8] and Flags */
489
490/*
491 * REG_SYNC_CTRL
492 */
493#define SYNCENABLE (1 << 7) /* SyncLogic Enable */
494#define SYNCARM (1 << 6) /* Sync Arming Strobe */
495#define SYNCCLRSTKY (1 << 5) /* Sync Sticky Bit Clear */
496#define SYNCCLRLAST (1 << 4) /* Sync Clear LAST_ */
497#define SYNCMODE(x) (((x) & 0xF) << 0) /* Sync Mode */
498
499/*
500 * REG_SYNC_STATUS
501 */
502#define REFBUSY (1 << 7) /* Sync Machine Busy */
503#define REFLOCK (1 << 3) /* Sync Alignment Locked */
504#define REFROTA (1 << 2) /* Sync Rotated */
505#define REFWLIM (1 << 1) /* Sync Alignment Limit Range */
506#define REFTRIP (1 << 0) /* Sync Tripped after Arming */
507
508/*
509 * REG_SYNC_CURRERR_H
510 */
511#define CURRUNDER (1 << 7) /* Sync Current Error Under Flag */
512#define CURROVER (1 << 6) /* Sync Current Error Over Flag */
513#define CURRERROR_H (1 << 0) /* SyncCurrent Error[8] */
514
515/*
516 * REG_ERROR_THERM
517 */
518#define THRMOLD (1 << 7) /* Error is from a prior sample */
519#define THRMOVER (1 << 4) /* Error > +WinLimit */
520#define THRMPOS (1 << 3) /* Sync Current Error Under Flag */
521#define THRMZERO (1 << 2) /* Error = 0 */
522#define THRMNEG (1 << 1) /* Error < 0 */
523#define THRMUNDER (1 << 0) /* Error < -WinLimit */
524
525/*
526 * REG_DACGAIN0_1
527 */
528#define DACGAIN_IM0(x) (((x) & 0x3) << 0) /* I Channel DAC gain <9:8> Dual A */
529
530/*
531 * REG_DACGAIN1_1
532 */
533#define DACGAIN_IM1(x) (((x) & 0x3) << 0) /* Q Channel DAC gain <9:8> Dual A */
534
535/*
536 * REG_DACGAIN2_1
537 */
538#define DACGAIN_IM2(x) (((x) & 0x3) << 0) /* I Channel DAC gain <9:8> Dual B */
539
540/*
541 * REG_DACGAIN3_1
542 */
543#define DACGAIN_IM3(x) (((x) & 0x3) << 0) /* Q Channel DAC gain <9:8> Dual B */
544
545/*
546 * REG_PD_DACLDO
547 */
548#define ENB_DACLDO3 (1 << 7) /* Disable DAC3 ldo */
549#define ENB_DACLDO2 (1 << 6) /* Disable DAC2 ldo */
550#define ENB_DACLDO1 (1 << 5) /* Disable DAC1 ldo */
551#define ENB_DACLDO0 (1 << 4) /* Disable DAC0 ldo */
552
553/*
554 * REG_STAT_DACLDO
555 */
556#define STAT_LDO3 (1 << 3) /* DAC3 LDO status */
557#define STAT_LDO2 (1 << 2) /* DAC2 LDO status */
558#define STAT_LDO1 (1 << 1) /* DAC1 LDO status */
559#define STAT_LDO0 (1 << 0) /* DAC0 LDO status */
560
561/*
562 * REG_DECODE_CTRL0
563 */
564#define SHUFFLE_MSB0 (1 << 2) /* MSB shuffling mode */
565#define SHUFFLE_ISB0 (1 << 1) /* ISB shuffling mode */
566
567/*
568 * REG_DECODE_CTRL1
569 */
570#define SHUFFLE_MSB1 (1 << 2) /* MSB shuffling mode */
571#define SHUFFLE_ISB1 (1 << 1) /* ISB shuffling mode */
572
573/*
574 * REG_DECODE_CTRL2
575 */
576#define SHUFFLE_MSB2 (1 << 2) /* MSB shuffling mod */
577#define SHUFFLE_ISB2 (1 << 1) /* ISB shuffling mode */
578
579/*
580 * REG_DECODE_CTRL3
581 */
582#define SHUFFLE_MSB3 (1 << 2) /* MSB shuffling mode */
583#define SHUFFLE_ISB3 (1 << 1) /* ISB shuffling mode */
584
585/*
586 * REG_NCO_CLRMODE
587 */
588#define NCOCLRARM (1 << 7) /* Arm NCO Clear */
589#define NCOCLRMTCH (1 << 5) /* NCO Clear Data Match */
590#define NCOCLRPASS (1 << 4) /* NCO Clear PASSed */
591#define NCOCLRFAIL (1 << 3) /* NCO Clear FAILed */
592#define NCOCLRMODE(x) (((x) & 0x3) << 0) /* NCO Clear Mode */
593
594/*
595 * REG_PA_THRES1
596 */
597#define PA_THRESH_MSB(x) (((x) & 0x1F) << 0) /* Average power threshold for comparison. */
598
599/*
600 * REG_PA_AVG_TIME
601 */
602#define PA_ENABLE (1 << 7) /* 1 = Enable average power calculation and error detection */
603#define PA_BUS_SWAP (1 << 6) /* Swap channelA or channelB databus for power calculation */
604#define PA_AVG_TIME(x) (((x) & 0xF) << 0) /* Set power average time */
605
606/*
607 * REG_PA_POWER1
608 */
609#define PA_POWER_MSB(x) (((x) & 0x1F) << 0) /* average power bus = I^2+Q^2 (I/Q use 6MSB of databus) */
610
611/*
612 * REG_CLKCFG0
613 */
614#define PD_CLK01 (1 << 7) /* Powerdown clock for Dual A */
615#define PD_CLK23 (1 << 6) /* Powerdown clock for Dual B */
616#define PD_CLK_DIG (1 << 5) /* Powerdown clocks to all DACs */
617#define PD_PCLK (1 << 4) /* Cal reference/Serdes PLL clock powerdown */
618#define PD_CLK_REC (1 << 3) /* Clock reciever powerdown */
619
620/*
621 * REG_SYSREF_ACTRL0
622 */
623#define PD_SYSREF (1 << 4) /* Powerdown SYSREF buffer */
624#define HYS_ON (1 << 3) /* Hysteresis enabled */
625#define SYSREF_RISE (1 << 2) /* Use SYSREF rising edge */
626#define HYS_CNTRL1(x) (((x) & 0x3) << 0) /* Hysteresis control bits <9:8> */
627
628/*
629 * REG_DACPLLCNTRL
630 */
631#define SYNTH_RECAL (1 << 7) /* Recalibrate VCO Band */
632#define ENABLE_SYNTH (1 << 4) /* Synthesizer Enable */
633
634/*
635 * REG_DACPLLSTATUS
636 */
637#define CP_CAL_VALID (1 << 5) /* Charge Pump Cal Valid */
638#define RFPLL_LOCK (1 << 1) /* PLL Lock bit */
639
640/*
641 * REG_DACLOOPFILT1
642 */
643#define LF_C2_WORD(x) (((x) & 0xF) << 4) /* C2 control word */
644#define LF_C1_WORD(x) (((x) & 0xF) << 0) /* C1 control word */
645
646/*
647 * REG_DACLOOPFILT2
648 */
649#define LF_R1_WORD(x) (((x) & 0xF) << 4) /* R1 control word */
650#define LF_C3_WORD(x) (((x) & 0xF) << 0) /* C3 control word */
651
652/*
653 * REG_DACLOOPFILT3
654 */
655#define LF_BYPASS_R3 (1 << 7) /* Bypass R3 res */
656#define LF_BYPASS_R1 (1 << 6) /* Bypass R1 res */
657#define LF_BYPASS_C2 (1 << 5) /* Bypass C2 cap */
658#define LF_BYPASS_C1 (1 << 4) /* Bypass C1 cap */
659#define LF_R3_WORD(x) (((x) & 0xF) << 0) /* R3 Control Word */
660
661/*
662 * REG_DACCPCNTRL
663 */
664#define CP_CURRENT(x) (((x) & 0x3F) << 0) /* Charge Pump Current Control */
665
666/*
667 * REG_DACLOGENCNTRL
668 */
669#define LO_DIV_MODE(x) (((x) & 0x3) << 0) /* Logen_Division */
670
671/*
672 * REG_DACLDOCNTRL1
673 */
674#define REF_DIVRATE(x) (((x) & 0x7) << 0) /* Reference Clock Division Ratio */
675
676/*
677 * REG_CAL_DAC_ERR
678 */
679#define INIT_SWEEP_ERR_DAC (1 << 1) /* Initial setup sweep failed */
680#define MSB_SWEEP_ERR_DAC (1 << 0) /* MSB sweep failed */
681
682/*
683 * REG_CAL_MSB_THRES
684 */
685#define CAL_MSB_TAC(x) (((x) & 0x7) << 0) /* MSB sweep TAC */
686
687/*
688 * REG_CAL_CTRL_GLOBAL
689 */
690#define CAL_START_GL (1 << 1) /* Global Calibration start */
691#define CAL_EN_GL (1 << 0) /* Global Calibration enable */
692
693/*
694 * REG_CAL_MSBHILVL
695 */
696#define CAL_MSBLVLHI(x) (((x) & 0x3F) << 0) /* High level limit for msb sweep average */
697
698/*
699 * REG_CAL_MSBLOLVL
700 */
701#define CAL_MSBLVLLO(x) (((x) & 0x3F) << 0) /* Low level limit for msb sweep average */
702
703/*
704 * REG_CAL_THRESH
705 */
706#define CAL_LTAC_THRES(x) (((x) & 0x7) << 3) /* Long TAC threshold */
707#define CAL_TAC_THRES(x) (((x) & 0x7) << 0) /* TAC threshold */
708
709/*
710 * REG_CAL_AVG_CNT
711 */
712#define MSB_GLOBAL_SUBAVG(x) (((x) & 0x3) << 6) /* Local Averages for MSB in Global Calibration */
713#define GLOBAL_AVG_CNT(x) (((x) & 0x7) << 3) /* Global avg Terminal count */
714#define LOCAL_AVRG_CNT(x) (((x) & 0x7) << 0) /* Local avg terminal count */
715
716/*
717 * REG_CAL_CLKDIV
718 */
719#define CAL_CLKDIV(x) (((x) & 0xF) << 0) /* Calibration clock divider */
720
721/*
722 * REG_CAL_INDX
723 */
724#define CAL_INDX(x) (((x) & 0xF) << 0) /* DAC Calibration Index paging bits */
725
726/*
727 * REG_CAL_CTRL
728 */
729#define CAL_FIN (1 << 7) /* Calibration finished */
730#define CAL_ACTIVE (1 << 6) /* Calibration active */
731#define CAL_ERRHI (1 << 5) /* SAR data error: too hi */
732#define CAL_ERRLO (1 << 4) /* SAR data error: too lo */
733#define CAL_TXDACBYDAC (1 << 3) /* Calibration of TXDAC by TXDAC */
734#define CAL_START (1 << 1) /* Calibration start */
735#define CAL_EN (1 << 0) /* Calibration enable */
736
737/*
738 * REG_CAL_ADDR
739 */
740#define CAL_ADDR(x) (((x) & 0x3F) << 0) /* Calibration DAC address */
741
742/*
743 * REG_CAL_DATA
744 */
745#define CAL_DATA(x) (((x) & 0x3F) << 0) /* Calibration DAC Coefficient Data */
746
747/*
748 * REG_CAL_UPDATE
749 */
750#define CAL_UPDATE (1 << 7) /* Calibration DAC Coefficient Update */
751
752/*
753 * REG_DATA_FORMAT
754 */
755#define BINARY_FORMAT (1 << 7) /* Binary or 2's complementary format on DATA bus */
756
757/*
758 * REG_DATAPATH_CTRL
759 */
760#define INVSINC_ENABLE (1 << 7) /* 1 = Enable inver sinc filter */
761#define DIG_GAIN_ENABLE (1 << 5) /* 1 = Enable digital gain */
762#define PHASE_ADJ_ENABLE (1 << 4) /* 1 = Enable phase compensation */
763#define SEL_SIDEBAND (1 << 1) /* 1 = Select upper or lower sideband from modulation result */
764#define I_TO_Q (1 << 0) /* 1 = send I datapath into Q DAC */
765#define MODULATION_TYPE(x) (((x) & 0x3) << 2) /* selects type of modulation operation */
766
767/*
768 * REG_INTERP_MODE
769 */
770#define INTERP_MODE(x) (((x) & 0x7) << 0) /* Interpolation Mode */
771
772/*
773 * REG_NCO_FTW_UPDATE
774 */
775#define FTW_UPDATE_ACK (1 << 1) /* Frequency Tuning Word Update Acknowledge */
776#define FTW_UPDATE_REQ (1 << 0) /* Frequency Tuning Word Update Request from SPI */
777
778/*
779 * REG_TXEN_FUNC
780 */
781#define TX_DIG_CLK_PD (1 << 0) /* 1 = Digital clocks will be shut down when Tx_enable pin is low. */
782
783/*
784 * REG_TXEN_SM_0
785 */
786#define GP_PA_ON_INVERT (1 << 2) /* External Modulator polarity invert */
787#define GP_PA_CTRL (1 << 1) /* External PA control */
788#define TXEN_SM_EN (1 << 0) /* Enable TXEN state machine */
789#define PA_FALL(x) (((x) & 0x3) << 6) /* PA fall control */
790#define PA_RISE(x) (((x) & 0x3) << 4) /* PA rises control */
791
792/*
793 * REG_TXEN_SM_1
794 */
795#define DIG_FALL(x) (((x) & 0x3) << 6) /* DIG_FALL */
796#define DIG_RISE(x) (((x) & 0x3) << 4) /* DIG_RISE */
797#define DAC_FALL(x) (((x) & 0x3) << 2) /* DAC_FALL */
798#define DAC_RISE(x) (((x) & 0x3) << 0) /* DAC_RISE */
799
800/*
801 * REG_DACOUT_ON_DOWN
802 */
803#define DACOUT_SHUTDOWN (1 << 1) /* Shut down DAC output. 1 means DAC get shut down manually. */
804#define DACOUT_ON_TRIGGER (1 << 0) /* Turn on DAC output manually. Self clear signal. */
805
806/*
807 * REG_DACOFF
808 */
809#define PROTECT_MODE (1 << 7) /* PROTECT_MODE */
810#define DACOFF_AVG_PW (1 << 0) /* DACOFF_AVG_PW */
811
812/*
813 * REG_DIE_TEMP_CTRL0
814 */
815#define ADC_TESTMODE (1 << 7) /* ADC_TESTMODE */
816#define AUXADC_ENABLE (1 << 0) /* AUXADC_ENABLE */
817#define FS_CURRENT(x) (((x) & 0x7) << 4) /* FS_CURRENT */
818#define REF_CURRENT(x) (((x) & 0x7) << 1) /* REF_CURRENT */
819
820/*
821 * REG_DIE_TEMP_CTRL1
822 */
823#define SELECT_CLKDIG (1 << 3) /* SELECT_CLKDIG */
824#define EN_DIV2 (1 << 2) /* EN_DIV2 */
825#define INCAP_CTRL(x) (((x) & 0x3) << 0) /* INCAP_CTRL */
826
827/*
828 * REG_DIE_TEMP_UPDATE
829 */
830#define DIE_TEMP_UPDATE (1 << 0) /* Die temperature update */
831
832/*
833 * REG_DC_OFFSET_CTRL
834 */
835#define DISABLE_NOISE (1 << 1) /* DISABLE_NOISE */
836#define DC_OFFSET_ON (1 << 0) /* DC_OFFSET_ON */
837
838/*
839 * REG_IPATH_DC_OFFSET_2PART
840 */
841#define IPATH_DC_OFFSET_2PART(x) (((x) & 0x1F) << 0) /* second part of DC Offset value for I path */
842
843/*
844 * REG_QPATH_DC_OFFSET_2PART
845 */
846#define QPATH_DC_OFFSET_2PART(x) (((x) & 0x1F) << 0) /* second part of DC Offset value for Q path */
847
848/*
849 * REG_IDAC_DIG_GAIN1
850 */
851#define IDAC_DIG_GAIN1(x) (((x) & 0xF) << 0) /* MSB of I DAC digital gain */
852
853/*
854 * REG_QDAC_DIG_GAIN1
855 */
856#define QDAC_DIG_GAIN1(x) (((x) & 0xF) << 0) /* MSB of Q DAC digital gain */
857
858/*
859 * REG_GAIN_RAMP_UP_STP1
860 */
861#define GAIN_RAMP_UP_STP1(x) (((x) & 0xF) << 0) /* MSB of digital gain rises */
862
863/*
864 * REG_GAIN_RAMP_DOWN_STP1
865 */
866#define GAIN_RAMP_DOWN_STP1(x) (((x) & 0xF) << 0) /* MSB of digital gain drops */
867
868/*
869 * REG_BLSM_CTRL
870 */
871#define RESET_BLSM (1 << 7) /* Soft rest to the new Blanking SM */
872#define EN_FORCE_GAIN_SOFT_OFF (1 << 4) /* Enable forcing gan_soft_off from SPI */
873#define GAIN_SOFT_OFF (1 << 3) /* gain_soft_off forced value */
874#define GAIN_SOFT_ON (1 << 2) /* gain_soft_on forced value */
875#define EN_FORCE_GAIN_SOFT_ON (1 << 1) /* Force the gain_soft_on from SPI */
876
877/*
878 * REG_BLSM_STAT
879 */
880#define SOFT_OFF_DONE (1 << 5) /* Blanking SoftOff Enable */
881#define SOFT_ON_DONE (1 << 4) /* Blanking SoftOn Done */
882#define GAIN_SOFT_OFF_RB (1 << 3) /* gain soft off readback */
883#define GAIN_SOFT_ON_RB (1 << 2) /* gain soft on readback */
884#define SOFT_OFF_EN_RB (1 << 1) /* Blanking SM soft Off read back */
885#define SOFT_ON_EN_RB (1 << 0) /* Blanking SM soft On read back */
886#define SOFTBLANKRB(x) (((x) & 0x3) << 6) /* Blanking State */
887
888/*
889 * REG_PRBS
890 */
891#define PRBS_GOOD_Q (1 << 7) /* Good data indicator imaginary channel */
892#define PRBS_GOOD_I (1 << 6) /* Good data indicator real channel */
893#define PRBS_INV_Q (1 << 4) /* Data Inversion imaginary channel */
894#define PRBS_INV_I (1 << 3) /* Data Inversion real channel */
895#define PRBS_MODE (1 << 2) /* Polynomial Select */
896#define PRBS_RESET (1 << 1) /* Reset Error Counters */
897#define PRBS_EN (1 << 0) /* Enable PRBS Checker */
898
899/*
900 * REG_DACPLLT5
901 */
902#define VCO_VAR(x) (((x) & 0xF) << 0) /* Varactor KVO setting */
903
904/*
905 * REG_DACPLLTB
906 */
907#define VCO_BIAS_REF(x) (((x) & 0x7) << 0) /* VCO Bias control */
908
909/*
910 * REG_DACPLLTD
911 */
912#define VCO_CAL_REF_MON (1 << 3) /* Sent control voltage to outside world */
913#define VCO_CAL_REF_TCF(x) (((x) & 0x7) << 0) /* TempCo for cal ref */
914
915/*
916 * REG_DACPLLT17
917 */
918#define VCO_VAR_REF_TCF(x) (((x) & 0x7) << 4) /* Varactor Reference TempCo */
919#define VCO_VAR_OFF(x) (((x) & 0xF) << 0) /* Varactor Offset */
920
921/*
922 * REG_SPISTRENGTH
923 */
924#define SPIDRV(x) (((x) & 0xF) << 0) /* Slew and drive strength for cmos interface */
925
926/*
927 * REG_CLK_TEST
928 */
929#define DUTYCYCLEON (1 << 0) /* Clock Duty Cycle Control On */
930
931/*
932 * REG_ATEST_VOLTS
933 */
934#define ATEST_EN (1 << 0) /* Enable Analog Test Mode */
935#define ATEST_TOPVSEL(x) (((x) & 0x3) << 5) /* Which source at analog top to use */
936#define ATEST_DACSEL(x) (((x) & 0x3) << 3) /* DAC from which to get voltage */
937#define ATEST_VSEL(x) (((x) & 0x3) << 1) /* DAC Voltage to Select */
938
939/*
940 * REG_ASPI_CLKSRC
941 */
942#define EN_CLKDIV (1 << 3) /* Enable the fdac/8 clock path to generate PD timing clock */
943#define ASPI_OSC_RATE (1 << 2) /* Aspi Oscillator Rate */
944#define ASPI_CLK_SRC (1 << 1) /* Choose Aspi Clock Source */
945#define EN_ASPI_OSC (1 << 0) /* Enable Aspi Oscillator clock */
946
947/*
948 * REG_MASTER_PD
949 */
950#define SPI_PD_MASTER (1 << 0)
951
952/*
953 * REG_GENERIC_PD
954 */
955#define SPI_SYNC1_PD (1 << 1)
956#define SPI_SYNC2_PD (1 << 0)
957
958/*
959 * REG_CDR_OPERATING_MODE_REG_0
960 */
961#define SPI_ENHALFRATE (1 << 5)
962#define SPI_DIVISION_RATE(x) (((x) & 0x3) << 1)
963
964/*
965 * REG_EQ_CONFIG_PHY_0_1
966 */
967#define SPI_EQ_CONFIG1(x) (((x) & 0xF) << 4)
968#define SPI_EQ_CONFIG0(x) (((x) & 0xF) << 0)
969
970/*
971 * REG_EQ_CONFIG_PHY_2_3
972 */
973#define SPI_EQ_CONFIG3(x) (((x) & 0xF) << 4)
974#define SPI_EQ_CONFIG2(x) (((x) & 0xF) << 0)
975
976/*
977 * REG_EQ_CONFIG_PHY_4_5
978 */
979#define SPI_EQ_CONFIG5(x) (((x) & 0xF) << 4)
980#define SPI_EQ_CONFIG4(x) (((x) & 0xF) << 0)
981
982/*
983 * REG_EQ_CONFIG_PHY_6_7
984 */
985#define SPI_EQ_CONFIG7(x) (((x) & 0xF) << 4)
986#define SPI_EQ_CONFIG6(x) (((x) & 0xF) << 0)
987
988/*
989 * REG_EQ_BIAS_REG
990 */
991#define SPI_EQ_EXTRA_SPI_LSBITS(x) (((x) & 0x3) << 6)
992#define SPI_EQ_BIASPTAT(x) (((x) & 0x7) << 3)
993#define SPI_EQ_BIASPLY(x) (((x) & 0x7) << 0)
994
995/*
996 * REG_SYNTH_ENABLE_CNTRL
997 */
998#define SPI_RECAL_SYNTH (1 << 2)
999#define SPI_ENABLE_SYNTH (1 << 0)
1000
1001/*
1002 * REG_PLL_STATUS
1003 */
1004#define SPI_CP_CAL_VALID_RB (1 << 3)
1005#define SPI_PLL_LOCK_RB (1 << 0)
1006
1007/*
1008 * REG_REF_CLK_DIVIDER_LDO
1009 */
1010#define SPI_CDR_OVERSAMP(x) (((x) & 0x3) << 0)
1011
1012/*
1013 * REG_TERM_BLK1_CTRLREG0
1014 */
1015#define SPI_I_TUNE_R_CAL_TERMBLK1 (1 << 0)
1016
1017/*
1018 * REG_TERM_BLK2_CTRLREG0
1019 */
1020#define SPI_I_TUNE_R_CAL_TERMBLK2 (1 << 0)
1021
1022/*
1023 * REG_GENERAL_JRX_CTRL_0
1024 */
1025#define CHECKSUM_MODE (1 << 6) /* Checksum mode */
1026#define LINK_MODE (1 << 3) /* Link mode */
1027#define SEL_REG_MAP_1 (1 << 2) /* Link register map selection */
1028#define LINK_EN(x) (((x) & 0x3) << 0) /* Link enable */
1029
1030/*
1031 * REG_GENERAL_JRX_CTRL_1
1032 */
1033#define SUBCLASSV_LOCAL(x) (((x) & 0x7) << 0) /* JESD204B subclass */
1034
1035/*
1036 * REG_DYN_LINK_LATENCY_0
1037 */
1038#define DYN_LINK_LATENCY_0(x) (((x) & 0x1F) << 0) /* Dynamic link latency: Link 0 */
1039
1040/*
1041 * REG_DYN_LINK_LATENCY_1
1042 */
1043#define DYN_LINK_LATENCY_1(x) (((x) & 0x1F) << 0) /* Dynamic link latency: Link 1 */
1044
1045/*
1046 * REG_LMFC_DELAY_0
1047 */
1048#define LMFC_DELAY_0(x) (((x) & 0x1F) << 0) /* LMFC delay: Link 0 */
1049
1050/*
1051 * REG_LMFC_DELAY_1
1052 */
1053#define LMFC_DELAY_1(x) (((x) & 0x1F) << 0) /* LMFC delay: Link 1 */
1054
1055/*
1056 * REG_LMFC_VAR_0
1057 */
1058#define LMFC_VAR_0(x) (((x) & 0x1F) << 0) /* Location in RX LMFC where JESD words are read out from buffer */
1059
1060/*
1061 * REG_LMFC_VAR_1
1062 */
1063#define LMFC_VAR_1(x) (((x) & 0x1F) << 0) /* Location in RX LMFC where JESD words are read out from buffer */
1064
1065/*
1066 * REG_XBAR_LN_0_1
1067 */
1068#define SRC_LANE1(x) (((x) & 0x7) << 3) /* Logic Lane 1 source */
1069#define SRC_LANE0(x) (((x) & 0x7) << 0) /* Logic Lane 0 source */
1070
1071/*
1072 * REG_XBAR_LN_2_3
1073 */
1074#define SRC_LANE3(x) (((x) & 0x7) << 3) /* Logic Lane 3 source */
1075#define SRC_LANE2(x) (((x) & 0x7) << 0) /* Logic Lane 2 source */
1076
1077/*
1078 * REG_XBAR_LN_4_5
1079 */
1080#define SRC_LANE5(x) (((x) & 0x7) << 3) /* Logic Lane 5 source */
1081#define SRC_LANE4(x) (((x) & 0x7) << 0) /* Logic Lane 4 source */
1082
1083/*
1084 * REG_XBAR_LN_6_7
1085 */
1086#define SRC_LANE7(x) (((x) & 0x7) << 3) /* Logic Lane 7 source */
1087#define SRC_LANE6(x) (((x) & 0x7) << 0) /* Logic Lane 6 source */
1088
1089/*
1090 * REG_FIFO_STATUS_REG_2
1091 */
1092#define DRDL_FIFO_EMPTY (1 << 1) /* Deterministic latency (DRDL) FIFO is between JESD204B receiver and DAC2 and DAC3 */
1093#define DRDL_FIFO_FULL (1 << 0) /* DRDL FIFO is between JESD204B receiver and DAC2 and DAC3 */
1094
1095/*
1096 * REG_SYNCB_GEN_0
1097 */
1098#define EOMF_MASK_1 (1 << 3) /* EOMF_MASK_1 */
1099#define EOMF_MASK_0 (1 << 2) /* EOMF_MASK_0 */
1100#define EOF_MASK_1 (1 << 1) /* Mask EOF from QBD_1 */
1101#define EOF_MASK_0 (1 << 0) /* Mask EOF from QBD_0 */
1102
1103/*
1104 * REG_SYNCB_GEN_1
1105 */
1106#define SYNCB_ERR_DUR(x) (((x) & 0xF) << 4) /* Duration of SYNCOUT low for the purpose of error reporting */
1107#define SYNCB_SYNCREQ_DUR(x) (((x) & 0xF) << 0) /* Duration of SYNCOUT low for purpose of synchronization request */
1108
1109/*
1110 * REG_PHY_PRBS_TEST_CTRL
1111 */
1112#define PHY_TEST_START (1 << 1) /* PHY PRBS test start */
1113#define PHY_TEST_RESET (1 << 0) /* PHY PRBS test reset */
1114#define PHY_SRC_ERR_CNT(x) (((x) & 0x7) << 4) /* PHY error count source */
1115#define PHY_PRBS_PAT_SEL(x) (((x) & 0x3) << 2) /* PHY PRBS pattern select */
1116
1117/*
1118 * REG_SHORT_TPL_TEST_0
1119 */
1120#define SHORT_TPL_TEST_RESET (1 << 1) /* Short transport layer test reset */
1121#define SHORT_TPL_TEST_EN (1 << 0) /* Short transport layer test enable */
1122#define SHORT_TPL_SP_SEL(x) (((x) & 0x3) << 4) /* Short transport layer sample select */
1123#define SHORT_TPL_M_SEL(x) (((x) & 0x3) << 2) /* Short transport layer test DAC select */
1124
1125/*
1126 * REG_SHORT_TPL_TEST_3
1127 */
1128#define SHORT_TPL_FAIL (1 << 0) /* Short transport layer test fail */
1129
1130/*
1131 * REG_BID_REG
1132 */
1133#define ADJCNT_RD(x) (((x) & 0xF) << 4)
1134#define BID_RD(x) (((x) & 0xF) << 0)
1135
1136/*
1137 * REG_LID0_REG
1138 */
1139#define ADJDIR_RD (1 << 6)
1140#define PHADJ_RD (1 << 5)
1141#define LID0_RD(x) (((x) & 0x1F) << 0)
1142
1143/*
1144 * REG_SCR_L_REG
1145 */
1146#define SCR_RD (1 << 7)
1147#define L_RD(x) (((x) & 0x1F) << 0)
1148
1149/*
1150 * REG_K_REG
1151 */
1152#define K_RD(x) (((x) & 0x1F) << 0)
1153
1154/*
1155 * REG_CS_N_REG
1156 */
1157#define CS_RD(x) (((x) & 0x3) << 6)
1158#define N_RD(x) (((x) & 0x1F) << 0)
1159
1160/*
1161 * REG_NP_REG
1162 */
1163#define SUBCLASSV_RD(x) (((x) & 0x7) << 5)
1164#define NP_RD(x) (((x) & 0x1F) << 0)
1165
1166/*
1167 * REG_S_REG
1168 */
1169#define JESDV_RD(x) (((x) & 0x7) << 5)
1170#define S_RD(x) (((x) & 0x1F) << 0)
1171
1172/*
1173 * REG_HD_CF_REG
1174 */
1175#define HD_RD (1 << 7)
1176#define CF_RD(x) (((x) & 0x1F) << 0)
1177
1178/*
1179 * REG_LID1_REG
1180 */
1181#define LID1_RD(x) (((x) & 0x1F) << 0)
1182
1183/*
1184 * REG_LID2_REG
1185 */
1186#define LID2_RD(x) (((x) & 0x1F) << 0)
1187
1188/*
1189 * REG_LID3_REG
1190 */
1191#define LID3_RD(x) (((x) & 0x1F) << 0)
1192
1193/*
1194 * REG_LID4_REG
1195 */
1196#define LID4_RD(x) (((x) & 0x1F) << 0)
1197
1198/*
1199 * REG_LID5_REG
1200 */
1201#define LID5_RD(x) (((x) & 0x1F) << 0)
1202
1203/*
1204 * REG_LID6_REG
1205 */
1206#define LID6_RD(x) (((x) & 0x1F) << 0)
1207
1208/*
1209 * REG_LID7_REG
1210 */
1211#define LID7_RD(x) (((x) & 0x1F) << 0)
1212
1213/*
1214 * REG_ILS_BID
1215 */
1216#define ADJCNT(x) (((x) & 0xF) << 4)
1217#define BID(x) (((x) & 0xF) << 0)
1218
1219/*
1220 * REG_ILS_LID0
1221 */
1222#define ADJDIR (1 << 6)
1223#define PHADJ (1 << 5)
1224#define LID0(x) (((x) & 0x1F) << 0)
1225
1226/*
1227 * REG_ILS_SCR_L
1228 */
1229#define SCR (1 << 7)
1230#define L(x) (((x) & 0x1F) << 0)
1231
1232/*
1233 * REG_ILS_K
1234 */
1235#define K(x) (((x) & 0x1F) << 0)
1236
1237/*
1238 * REG_ILS_CS_N
1239 */
1240#define CS(x) (((x) & 0x3) << 6)
1241#define N(x) (((x) & 0x1F) << 0)
1242
1243/*
1244 * REG_ILS_NP
1245 */
1246#define SUBCLASSV(x) (((x) & 0x7) << 5)
1247#define NP(x) (((x) & 0x1F) << 0)
1248
1249/*
1250 * REG_ILS_S
1251 */
1252#define JESDV(x) (((x) & 0x7) << 5)
1253#define S(x) (((x) & 0x1F) << 0)
1254
1255/*
1256 * REG_ILS_HD_CF
1257 */
1258#define HD (1 << 7)
1259#define CF(x) (((x) & 0x1F) << 0)
1260
1261/*
1262 * REG_ERRCNTRMON
1263 */
1264#define LANESEL(x) (((x) & 0x7) << 4)
1265#define CNTRSEL(x) (((x) & 0x3) << 0)
1266
1267/*
1268 * REG_BADDISPARITY
1269 */
1270#define RST_IRQ_DIS (1 << 7)
1271#define DIS_ERR_CNTR_DIS (1 << 6)
1272#define RST_ERR_CNTR_DIS (1 << 5)
1273#define LANE_ADDR_DIS(x) (((x) & 0x7) << 0)
1274
1275/*
1276 * REG_NITDISPARITY
1277 */
1278#define RST_IRQ_NIT (1 << 7)
1279#define DIS_ERR_CNTR_NIT (1 << 6)
1280#define RST_ERR_CNTR_NIT (1 << 5)
1281#define LANE_ADDR_NIT(x) (((x) & 0x7) << 0)
1282
1283/*
1284 * REG_UNEXPECTEDKCHAR
1285 */
1286#define RST_IRQ_K (1 << 7)
1287#define DIS_ERR_CNTR_K (1 << 6)
1288#define RST_ERR_CNTR_K (1 << 5)
1289#define LANE_ADDR_K(x) (((x) & 0x7) << 0)
1290
1291/*
1292 * REG_CTRLREG2
1293 */
1294#define ILAS_MODE (1 << 7)
1295#define REPDATATEST (1 << 5)
1296#define QUETESTERR (1 << 4)
1297#define AUTO_ECNTR_RST (1 << 3)
1298
1299/*
1300 * REG_IRQVECTOR
1301 */
1302#define BADDIS_FLAG_OR_MASK (1 << 7)
1303#define NITD_FLAG_OR_MASK (1 << 6)
1304#define UEKC_FLAG_OR_MASK (1 << 5)
1305#define INITIALLANESYNC_FLAG_OR_MASK (1 << 3)
1306#define BADCHECKSUM_FLAG_OR_MASK (1 << 2)
1307#define CODEGRPSYNC_FLAG_OR_MASK (1 << 0)
1308
1309/*
1310 * REG_SYNCASSERTIONMASK
1311 */
1312#define BAD_DIS_S (1 << 7)
1313#define NIT_DIS_S (1 << 6)
1314#define UNEX_K_S (1 << 5)
1315#define CMM_FLAG_OR_MASK (1 << 4)
1316#define CMM_ENABLE (1 << 3)
1317
1318
1319#define AD9152_MAX_DAC_RATE 2000000000UL
1320#define AD9152_CHIP_ID 0x52
1321#define AD9152_TEST_PN15 0x01
1322#define AD9152_TEST_PN7 0x00
1323
1325 /* SPI */
1327 /* Device Settings */
1328 uint32_t stpl_samples[2][4];
1330 uint32_t prbs_type;
1332};
1333
1335 /* SPI */
1337};
1338
1339int32_t ad9152_spi_read(struct ad9152_dev *dev,
1340 uint16_t reg_addr,
1341 uint8_t *reg_data);
1342int32_t ad9152_spi_write(struct ad9152_dev *dev,
1343 uint16_t reg_addr,
1344 uint8_t reg_data);
1345int32_t ad9152_setup(struct ad9152_dev **device,
1347int32_t ad9152_datapath_prbs_test(struct ad9152_dev *dev,
1349int32_t ad9152_short_pattern_test(struct ad9152_dev *dev,
1351int32_t ad9152_status(struct ad9152_dev *dev);
1352int32_t ad9152_remove(struct ad9152_dev *dev);
1353
1354#endif
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int32_t ad9152_remove(struct ad9152_dev *dev)
Free the resources allocated by ad9152_setup().
Definition ad9152.c:198
int32_t ad9152_short_pattern_test(struct ad9152_dev *dev, struct ad9152_init_param init_param)
ad9152_setup
Definition ad9152.c:213
int32_t ad9152_spi_read(struct ad9152_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9152_spi_read
Definition ad9152.c:42
int32_t ad9152_datapath_prbs_test(struct ad9152_dev *dev, struct ad9152_init_param init_param)
ad9152_setup
Definition ad9152.c:253
int32_t ad9152_status(struct ad9152_dev *dev)
ad9152_setup
Definition ad9152.c:293
int32_t ad9152_spi_write(struct ad9152_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9152_spi_write
Definition ad9152.c:65
int32_t ad9152_setup(struct ad9152_dev **device, struct ad9152_init_param init_param)
ad9152_setup
Definition ad9152.c:87
Header file of Delay functions.
Header file of SPI Interface.
Definition ad9152.h:1334
struct no_os_spi_desc * spi_desc
Definition ad9152.h:1336
Definition ad9152.h:1324
uint32_t lane_rate_kbps
Definition ad9152.h:1331
struct no_os_spi_init_param spi_init
Definition ad9152.h:1326
uint32_t prbs_type
Definition ad9152.h:1330
uint32_t interpolation
Definition ad9152.h:1329
uint32_t stpl_samples[2][4]
Definition ad9152.h:1328
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128