00001
00007 #ifndef EDT_THREEP_REGS_H
00008 #define EDT_THREEP_REGS_H
00009
00010 #include "edt_si5326.h"
00011 #include "edt_si570.h"
00012 #include "edt_s19250.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021 #define THREEP_DATA_PATH 0x0101004A
00022
00023
00024 #define THREEP_P1_CONFIG0 0x010100A0
00025 #define THREEP_P2_CONFIG0 0x010100C0
00026
00027 #define LOCK_REF 0x02
00028 #define RX_SEL_MSK 0x0c
00029 #define AUTO_DETECT 0x10
00030 #define REMOTE_LOOP 0x20
00031 #define LOCAL_LOOP 0x40
00032 #define PRBS_EN 0x80
00033
00034
00035 #define THREEP_P0_LIU_STATUS 0x01010081
00036 #define RX_LOCKDET 0x1
00037 #define TX_LOCKDET 0x2
00038
00039 #define THREEP_P1_CONFIG1 0x010100A1
00040 #define THREEP_P2_CONFIG1 0x010100C1
00041 #define CONFIG2511 0x03
00042 #define PRE2511 0x0c
00043 #define LOOPTIME 0x10
00044
00045 #define THREEP_P1_STATUS 0x010100A2
00046 #define THREEP_P2_STATUS 0x010100C2
00047 #define SPILL2511 0x01
00048 #define PRBSPASS 0x02
00049 #define RATE_DET_MSK 0x0c
00050 #define LOS 0x10
00051 #define LOL 0x20
00052 #define SIG_DET 0x80
00053
00054 #define THREEP_P0_XCVR_STAT 0x01010083
00055 #define THREEP_P1_XCVR_STAT 0x010100A3
00056 #define THREEP_P2_XCVR_STAT 0x010100C3
00057 #define SFPP_TXDIS 0x01
00058 #define SFPP_PRES 0x20
00059 #define SFPP_TXFAULT 0x40
00060 #define SFPP_LOS 0x80
00061
00062 #define SFPP_BYPASS 0x8
00063
00064 #define THREEP_P0_ENABLE 0x01010084
00065 #define THREEP_P1_ENABLE 0x010100A4
00066 #define THREEP_P2_ENABLE 0x010100C4
00067 #define LIU_EN 0x01
00068 #define TXPLL_EN 0x02
00069 #define RXPLL_EN 0x10
00070 #define SYS_LOCKED 0x20
00071 #define THREEP_TX_LOCKED 0x40
00072 #define THREEP_RX_LOCKED 0x80
00073
00074
00075 #define THREEP_P0_RCV_FRAMING 0x01010085
00076
00077 #define THREEP_P1_RCV_FRAMING 0x010100A5
00078 #define THREEP_P2_RCV_FRAMING 0x010100C5
00079
00080 #define RESET_FRM 0x01
00081 #define FRAME_EN 0x02
00082 #define RX_DATA_SRC 0x0C
00083
00084 #define THREEP_10GBE_HI_BER 0x20
00085 #define THREEP_10GBE_SH_LOCK 0x40
00086 #define THREEP_10GBE_LINK_GOOD 0x80
00087
00088 #define DISABLE_SCRAM 0x10
00089 #define SUSPEND_AQ 0x20
00090 #define EN_PAR_CNT 0x40
00091
00092 #define THREEP_P0_RCV_FRM_COUNT_CTRL 0x0101008B
00093 #define THREEP_ENABLE_FRM_COUNT 0x80
00094 #define THREEP_FRM_COUNT_HOLD 0x01
00095
00096 #define THREEP_P0_10GBE_RCV_FILTER 0x01010086
00097 #define THREEP_10GBE_DIS_IDLE_FILT 0x08
00098 #define THREEP_P0_RCV_FILTER 0x01010086
00099 #define THREEP_P1_RCV_FILTER 0x010100A6
00100 #define THREEP_P2_RCV_FILTER 0x010100C6
00101
00102 #define OVERHEAD_ONLY 0x01
00103
00104 #define FORCE_ALL_DATA 0x08
00105
00106 #define THREEP_P1_RCV_STATUS 0x010100A7
00107 #define THREEP_P2_RCV_STATUS 0x010100C7
00108 #define FRAMED 0x01
00109
00110 #define THREEP_P1_RCV_FRAME_STATUS 0x010100A8
00111 #define THREEP_P2_RCV_FRAME_STATUS 0x010100C8
00112 #define BIT_SYNC 0x01
00113 #define BYTE_SYNC 0x02
00114 #define MATCH_CNT 0x0C
00115 #define DROP_CNT 0x30
00116 #define FOUND 0x40
00117 #define LOCKED 0x80
00118
00119 #define THREEP_P0_OUTPUT_DATA_SEL 0x01010089
00120 #define THREEP_10GBE_TXDBG 0x06
00121 #define THREEP_10GBE_PRBS_EN 0x08
00122 #define THREEP_10GBE_TX_DBG_PKT 0x40
00123 #define THREEP_10GBE_RX_PRBS 0x80
00124
00125 #define THREEP_P0_RCV_SYNC_CTRL 0x0101008E
00126 #define THREEP_P0_SYNCH_ARM 0x80
00127 #define THREEP_P0_SYNCH_BYTES 0x4
00128 #define THREEP_P0_SRC_1 0
00129
00130 #define THREEP_P1_XMT_FRAMING 0x010100A9
00131 #define THREEP_P2_XMT_FRAMING 0x010100C9
00132 #define RESET_PTR 0x01
00133 #define TEST_DATA 0x02
00134 #define TX_FRAME_EN 0x04
00135 #define EN_SCRAMBLE 0x08
00136
00137 #define THREEP_P1_TX_STATUS 0x010100AA
00138 #define THREEP_P2_TX_STATUS 0x010100AA
00139 #define TX_FRAMED 0x01
00140
00141 #define THREEP_P0_10GBE_LF_STATUS 0x0101008C
00142 #define THREEP_10GBE_LF_MASK 0x03
00143 #define THREEP_10GBE_RT_RXLF 0x10
00144 #define THREEP_10GBE_RT_TXLF 0x20
00145
00146 #define THREEP_P1_B1_ERROR_MASK 0x010100AC
00147 #define THREEP_P1_B2_ERROR_MASK 0x010100CC
00148
00149 #define THREEP_P0_10GBE_LPBK_CTRL 0x0101008D
00150 #define THREEP_10GBE_LPBK_EN 0x01
00151
00152 #define THREEP_P0_10GBE_PCS_CTRL 0x0101008E
00153 #define THREEP_10GBE_DIS_DEC 0x01
00154 #define THREEP_10GBE_DIS_DESCRAM 0x02
00155 #define THREEP_10GBE_DIS_ENC 0x10
00156 #define THREEP_10GBE_DIS_SCRAM 0x20
00157
00158 #define THREEP_P1_RCV_SYNC_CTRL 0x010100AE
00159 #define THREEP_P2_RCV_SYNC_CTRL 0x010100CE
00160
00161 #define THREEP_SYNC_TRIGGER 0x0101008F
00162 #define SYNC_START 0x20
00163
00164 #define THREEP_P0_PRBS_CTRL 0x01010090
00165 #define THREEP_P1_PRBS_CTRL 0x010100B0
00166 #define THREEP_P2_PRBS_CTRL 0x010100C0
00167 #define CH_PRBS_GEN_EN 0x01
00168 #define CH_PRBS_CHK_EN 0x02
00169 #define CH_PRBS_SYNC 0x10
00170 #define CH_PRBS_ERR 0x20
00171 #define CH_PRBS_HLD_ERR 0x40
00172
00173
00174 #define PHY_RST 0x01
00175 #define IDLY_RDY 0x10
00176 #define PLL_LOCK 0x20
00177 #define PHY_INITDONE 0x40
00178
00179
00180 #define THREEP_UNDERFLOW 0x010100F9
00181 #define THREEP_OVERFLOW 0x010100FA
00182 #define RX_P0 0
00183 #define RX_P1 1
00184 #define RX_P2 2
00185 #define TX_P0 4
00186 #define TX_P1 8
00187 #define TX_P2 0x10
00188
00189 #define THREEP_FREQ_CNT_EN 0x010100F4
00190 #define FREQ_CNT_EN_MASK 0x07
00191 #define FREQ_CNT_SEL_MASK 0xF0
00192
00193 #define THREEP_FREQ_CNT 0x030100F5
00194
00195
00196 #define THREEP_MEZZ_STRING 0x010100E0
00197
00198 #define THREEP_BANK0A_CTRL 0x010100E4
00199 #define THREEP_BANK0B_CTRL 0x010100E5
00200 #define THREEP_BANK1_CTRL 0x010100E6
00201
00202
00203 #define THREEP_I2C_DEVICE 0x010100E7
00204 #define THREEP_I2C_READ_ADDRESS 0x010100E8
00205 #define THREEP_I2C_WRITE_ADDRESS 0x010100E9
00206 #define THREEP_I2C_WRITE_DATA 0x010100EA
00207
00208 #define THREEP_PRBS_MODE 0x010100EE
00209
00210 #define THREEP_FREQ_CNT_EN 0x010100F4
00211 #define THREEP_FREQ_CNT_EN_MSK 0x07
00212
00213 #define THREEP_FREQ_CNT 0x030100F5
00214
00215
00216
00217 #define THREEP_P0_FRAMER_RATE 0x01010091
00218
00219
00220
00221
00222
00223 #define THREEP_DEV_XMT_CLK 0
00224 #define THREEP_P0_REF_CLK 1
00225 #define THREEP_P1_REF_CLK 2
00226 #define THREEP_P2_REF_CLK 3
00227 #define THREEP_P0_SFP_EEPROM 4
00228 #define THREEP_P0_SFP_DIAG 5
00229 #define THREEP_P1_SFP_EEPROM 6
00230 #define THREEP_P1_SFP_DIAG 7
00231 #define THREEP_P2_SFP_EEPROM 8
00232 #define THREEP_P2_SFP_DIAG 9
00233 #define THREEP_AMCC 10
00234
00235 #define THREEP_P0_CLOCK_VALUE 155520000.0
00236 #define THREEP_P1_CLOCK_VALUE 155520000.0
00237 #define THREEP_P2_CLOCK_VALUE 155520000.0
00238
00239
00240
00241
00242 #define THREEP_ADT7461_BASE 0x01010065
00243
00244
00245
00246 #define THREEP_MODE_SDH STM64_RATE
00247 #define THREEP_MODE_G709 OTU2_RATE
00248 #define THREEP_MODE_10GBE GIG10E_RATE
00249 #define THREEP_MODE_10P3 3
00250 #define THREEP_MODE_OTU2E OTU2E_RATE
00251 #define THREEP_MODE_OTU2F OTU2F_RATE
00252
00253
00254
00255
00256
00257
00258 #define THREEP_P0_XMIT_PATTERN EDT_IND_REG_2(0x800001)
00259 #define THREEP_P0_B1_ERROR_CNT EDT_IND_REG_3(0x800005)
00260 #define THREEP_P0_B2_ERROR_CNT EDT_IND_REG_4(0x800008)
00261 #define THREEP_P0_M1_ERROR_CNT EDT_IND_REG_3(0x80000C)
00262 #define THREEP_P0_LOF_CNT EDT_IND_REG_2(0x80000F)
00263 #define THREEP_P0_FRM_PAT_CNT EDT_IND_REG_2(0x800011)
00264 #define THREEP_P0_FALSE_FRM_CNT EDT_IND_REG_2(0x800013)
00265 #define THREEP_P0_DEMUX_BITMASK EDT_IND_REG_2(0x800015)
00266 #define THREEP_P0_DEMUX_BITMASK_LO EDT_IND_REG_1(0x800015)
00267 #define THREEP_P0_DEMUX_BITMASK_HI EDT_IND_REG_1(0x800016)
00268 #define THREEP_P0_DEMUX_MASK_ADDR EDT_IND_REG_1(0x800017)
00269 #define THREEP_P0_DEMUX_BITMASK_RD EDT_IND_REG_2(0x800018)
00270 #define THREEP_P0_DEMUX_BITMASK_RD_LO EDT_IND_REG_1(0x800018)
00271 #define THREEP_P0_DEMUX_BITMASK_RD_HI EDT_IND_REG_1(0x800019)
00272
00273
00274
00275 #define THREEP_P1_XMIT_NATIONAL EDT_IND_REG_4(0x800100)
00276 #define THREEP_P1_XMIT_PATTERN EDT_IND_REG_4(0x800101)
00277 #define THREEP_P1_B1_ERROR_CNT EDT_IND_REG_3(0x800105)
00278 #define THREEP_P1_B2_ERROR_CNT EDT_IND_REG_4(0x800108)
00279 #define THREEP_P1_M1_ERROR_CNT EDT_IND_REG_3(0x80010C)
00280 #define THREEP_P1_LOF_CNT EDT_IND_REG_2(0x80010F)
00281 #define THREEP_P1_FRM_PAT_CNT EDT_IND_REG_2(0x800111)
00282 #define THREEP_P1_FALSE_FRM_CNT EDT_IND_REG_2(0x800113)
00283 #define THREEP_P1_DEMUX_BITMAP EDT_IND_REG_1(0x800115)
00284 #define THREEP_P1_DEMUX_BITMAP_RD EDT_IND_REG_1(0x800116)
00285
00286
00287
00288 #define THREEP_P2_XMIT_NATIONAL EDT_IND_REG_4(0x800200)
00289 #define THREEP_P2_XMIT_PATTERN EDT_IND_REG_4(0x800201)
00290 #define THREEP_P2_B1_ERROR_CNT EDT_IND_REG_3(0x800205)
00291 #define THREEP_P2_B2_ERROR_CNT EDT_IND_REG_4(0x800208)
00292 #define THREEP_P2_M1_ERROR_CNT EDT_IND_REG_3(0x80020C)
00293 #define THREEP_P2_LOF_CNT EDT_IND_REG_2(0x80020F)
00294 #define THREEP_P2_FRM_PAT_CNT EDT_IND_REG_2(0x800211)
00295 #define THREEP_P2_FALSE_FRM_CNT EDT_IND_REG_2(0x800213)
00296 #define THREEP_P2_DEMUX_BITMAP EDT_IND_REG_1(0x800215)
00297 #define THREEP_P2_DEMUX_BITMAP_RD EDT_IND_REG_1(0x800216)
00298
00299 typedef struct {
00300 double ch0_clock_freq;
00301 double ch1_clock_freq;
00302 double ch2_clock_freq;
00303 double xmt_clock_freq;
00304 EdtSI570 ch0_clock_values;
00305 EdtSI570 ch1_clock_values;
00306 EdtSI570 ch2_clock_values;
00307 EdtSI53xx xmt_clock_values;
00308 int xmt_clock_source;
00309 } EdtThreePClocks;
00310
00311 #ifdef __cplusplus
00312 extern "C" {
00313 #endif
00314
00315 EDTAPI int
00316 edt_threep_configure_clks(EdtDev *edt_p,
00317 EdtThreePClocks *clocks);
00318
00319 EDTAPI void
00320 edt_threep_amcc_chk_enable( EdtDev * edt_p, int mode);
00321 EDTAPI void
00322 edt_threep_amcc_local_loop( EdtDev * edt_p, int set);
00323 EDTAPI void
00324 edt_threep_amcc_remote_loop( EdtDev * edt_p, int set);
00325 EDTAPI void
00326 edt_threep_amcc_set_tx_prbs( EdtDev * edt_p, int code);
00327 EDTAPI void
00328 dump_threep_freq_cntrs( EdtDev * edt_p, int en);
00329 EDTAPI int
00330 edt_threep_amcc_clk_mode(double freq);
00331
00332
00333 EDTAPI int
00334 edt_threep_si5326_dump(EdtDev *edt_p, int device);
00335 EDTAPI int
00336 edt_threep_si5326_load_array(EdtDev *edt_p, Edt2WireRegArray *vec, int device);
00337 EDTAPI void
00338 edt_threep_amcc_config_tx( EdtDev * edt_p, int mode);
00339 EDTAPI void
00340 edt_threep_amcc_config_rx( EdtDev * edt_p, int mode);
00341 EDTAPI int
00342 edt_threep_configure_clock(EdtDev *edt_p, double frequency, int port,
00343 EdtSI570 * clock_values);
00344
00345 EDTAPI unsigned char
00346 edt_threep_amcc_reg_read( EdtDev * edt_p, u_int address);
00347 EDTAPI unsigned char
00348 edt_threep_amcc_reg_set_bits( EdtDev * edt_p, u_int address, u_int value,
00349 u_int shift, u_int mask);
00350
00351 EDTAPI uint_t
00352 edt_3p_mn_ser_dev_reg_write(EdtDev * edt_p,
00353 uint_t base_desc,
00354 uint_t device_id,
00355 uint_t address,
00356 uint_t value);
00357
00358 EDTAPI uint_t
00359 edt_3p_mn_ser_dev_reg_read(EdtDev * edt_p,
00360 uint_t base_desc,
00361 uint_t device_id,
00362 uint_t address,
00363 uint_t* bytes);
00364 EDTAPI uint_t
00365 edt_3p_adt7461_reg_read(EdtDev * edt_p,
00366 uint_t base_desc,
00367 uint_t device_id,
00368 uint_t address,
00369 uint_t* bytes);
00370 EDTAPI uint_t
00371 edt_3p_adt7461_reg_write(EdtDev * edt_p,
00372 uint_t base_desc,
00373 uint_t device_id,
00374 uint_t address,
00375 uint_t value);
00376
00377 EDTAPI double edt_3p_v6_temp(EdtDev *edt_p);
00378
00379
00380 #ifdef __cplusplus
00381 }
00382 #endif
00383
00384 #endif
00385