edt_ocm.h

00001 /*
00002 
00003  * register definition for OCM interface
00004  * Xilinx bitfile.
00005  */
00006 
00007 #ifndef _EDT_OCM_H
00008 #define _EDT_OCM_H
00009 
00010 
00011 /*
00012  * OCM definitions.
00013  */
00014 /*
00015   * OCM specific registers -
00016   * channel 0 registers are 0x20 - 0x24 have the same definitions as
00017   * channel 1 registers 0x30-0x34 except the channel does not have DDR memory fifo
00018   * so not bit to reset same.
00019   */
00020 
00021 /* -- reg_group OCM */
00022 
00023 #define OCM_CH0_CONFIGL 0x01010020
00024 #define OCM_CH0_CONFIGH 0x01010021
00025 #define OCM_CH0_STATUS  0x01010022
00026 #define OCM_CH0_XCVR    0x01010023
00027 #define OCM_CH0_ENABLE  0x01010024
00028 
00029 #define  OCM_CH0_CONFIG0            0x01010020
00030 #define  OCM_CH0_CONFIG1            0x01010021
00031 #define  OCM_CH0_STATUS             0x01010022
00032 #define  OCM_CH0_TRANSCEIVER        0x01010023
00033 #define  OCM_CH0_ENABLE             0x01010024
00034 
00035 #define  OCM_CH1_CONFIG0            0x01010030
00036 #define  OCM_CH1_CONFIG1            0x01010031
00037 #define  OCM_CH1_STATUS             0x01010032
00038 #define  OCM_CH1_TRANSCEIVER        0x01010033
00039 #define  OCM_CH1_ENABLE             0x01010034
00040 
00041 #define  OCM_FPGA0_LOAD             0x01010040
00042 #define  OCM_FPGA1_LOAD             0x01010041
00043 #define  OCM_FPGA2_LOAD             0x01010042
00044 #define  OCM_FPGA3_LOAD             0x01010043
00045 
00046 #define  OCM_CH0_RCV_FRAMING        0x01010080
00047 #define  OCM_CH0_XMT_FRAMING        0x01010081
00048 #define  OCM_CH0_XMT_NATIONAL       0x01010082
00049 #define  OCM_CH0_RCV_FILTER         0x01010083
00050 #define  OCM_CH0_XMT_TEST_DATA      0x04010084
00051 #define  OCM_CH0_RCV_STATUS         0x01010094
00052 #define  OCM_CH0_RCV_FRAME_STATUS   0x01010095
00053 #define  OCM_CH0_DEMUX_BITMAP       0x01010097
00054 #define  OCM_CH0_DEMUX_BITMAP_READ  0x01010098
00055 #define  OCM_CH0_TX_STATUS          0x01010099
00056 #define  OCM_CH0_BITFILE_VER        0x010100A0
00057 
00058 #define  OCM_CH1_RCV_FRAMING        0x010100C0
00059 #define  OCM_CH1_XMT_FRAMING        0x010100C1
00060 #define  OCM_CH1_XMT_NATIONAL       0x010100C2
00061 #define  OCM_CH1_RCV_FILTER         0x010100C3
00062 #define  OCM_CH1_XMT_TEST_DATA      0x040100C4
00063 #define  OCM_CH1_RCV_STATUS         0x010100D4
00064 #define  OCM_CH1_RCV_FRAME_STATUS   0x010100D5
00065 #define  OCM_CH1_DEMUX_BITMAP       0x010100D7
00066 #define  OCM_CH1_DEMUX_BITMAP_READ  0x010100D8
00067 #define  OCM_CH1_TX_STATUS          0x010100D9
00068 #define  OCM_CH1_BITFILE_VER        0x010100E0
00069 
00070 
00071 #define OCM_REG_CH0_MASK 0x01010097
00072 #define OCM_REG_CH0_MASK_READBACK 0x01010098
00073 
00074 /* Framing error registers */
00075 
00076 #define OCM_CH0_B1_ERROR_CNT    0x03010088
00077 #define OCM_CH0_B1_ERROR_MASK   0x0101008b
00078 #define OCM_CH1_B1_ERROR_CNT    0x030100c8
00079 #define OCM_CH1_B1_ERROR_MASK   0x010100cb
00080 
00081 #define OCM_CH0_B2_ERROR_CNT    0x0401008c
00082 #define OCM_CH1_B2_ERROR_CNT    0x040100cc
00083 
00084 #define OCM_CH0_M1_ERROR_CNT    0x03010090
00085 #define OCM_CH1_M2_ERROR_CNT    0x030100d0
00086 
00087 #define OCM_CH0_CNT_CTRL        0x01010093
00088 #define OCM_CH1_CNT_CTRL        0x010100D3
00089 
00090 #define OCM_CH0_LOF_CNT         0x0201009C
00091 #define OCM_CH1_LOF_CNT         0x020100DC
00092 
00093 #define OCM_CH0_FRM_PAT_CNT     0x0201009E
00094 #define OCM_CH1_FRM_PAT_CNT     0x020100DE
00095 
00096 #define OCM_CH0_FALSE_FRM_CNT   0x020100A4
00097 #define OCM_CH1_FALSE_FRM_CNT   0x020100E4
00098 
00099 /* -- */
00100 
00101 /* synonyms */
00102 
00103 #define  OCM_RX_CTRL    0x01010080 
00104 #define  OCM_TX_CONFIG  0x01010081 
00105 
00106 #define OCM_NAT_BYTE    0x01010082 
00107 #define OCM_RX_FILTER   0x01010083
00108 #define TEST_DATA_REG   0x03010084 
00109 #define OCM_RX_STATUS   0x01010094 
00110 #define FRAME_STATUS    0x01010095 
00111 
00112 /*
00113  * registers 0 (PCD_CMD), 1 (PCD_DATA_PATH_STAT), 2 (OCD_FUNCT), 3 (PCD_STAT),  0xf (PCD_CONFIG),
00114  * 0x10 (SSD16_CHEN), 0x16 (SSD16_LSB), 0x18 (SSD16_UNDER) and 0x1b (SSD16_OVER) have
00115  * the regular address definition with the standard bit placement and definition as follows:
00116  * command - PCD_ENABLE bit 0x8 only, others are read/write but unused
00117  * data_path - bits are read/write but not used
00118  * funct - bits are read write but unused
00119  * status - bit 0 indicates the sysclk DCM on the Xilinx is locked to the clock from the OCM board
00120  */
00121 
00122 /* --reg_bits PCD_STAT */
00123 
00124 #define LOCAL_SYS_LOCK          0x1
00125 
00126  /*
00127   * config - bit 0 is byteswap (PCD_BYTESWAP) and 3 is short swap (PCD_SHORTSWAP)
00128   * channel enable - bit 0 and 1 enable channel 0 and 1
00129   * lsb_first - bit 0 and 1 control channel 0 and 1
00130   * underflow - bit 0 and 1 report status, bit 2 to 15 are always 0.
00131   * overflow - bit 0 and 1 report status, bit 2 to 15 are always 0.
00132   */
00133 
00134  
00135 /* channel enable bits in SSD16_CHEN */
00136 
00137 /* --reg_bits SSD16_CHEN */
00138 
00139 #define OCM_CH0_RX_ENABLE 0x1
00140 #define OCM_CH1_RX_ENABLE 0x2
00141 #define OCM_CH0_TX_ENABLE 0x4
00142 #define OCM_CH1_TX_ENABLE 0x8
00143 
00144 /* -- */
00145 
00146 /* 
00147  * config register low bits
00148  * these bits directly control the SLK2511
00149  * the FRAME_EN bit also controls the framesync state machine for the channel
00150  */
00151 
00152 #define OFFSET_CH1_BASE 0x10
00153 #define OFFSET_CH1_MEZ  0x40
00154 
00155 /* --reg_bits OCM_CH0_CONFIG0 */
00156 /* --reg_bits OCM_CH1_CONFIG0 */
00157 #define OCM_FRAME_EN    0x01
00158 #define LOCK_REF        0x02
00159 #define RX_SEL_MSK      0x0c
00160 #define AUTO_DETECT     0x10
00161 #define REMOTE_LOOP     0x20
00162 #define LOCAL_LOOP      0x40
00163 #define PRBS_EN         0x80
00164 
00165 /* -- reg_enum OCM_RSEL_MSK */
00166 
00167 #define OC48_STM16      0x00
00168 #define OC24            0x04
00169 #define OC12_STM4       0x08
00170 #define OC3_STM1        0x0c
00171 
00172 /*
00173  * config high bits
00174  */
00175 
00176 /* --reg_bits OCM_CH0_CONFIG1 */
00177 /* --reg_bits OCM_CH1_CONFIG1 */
00178 
00179 
00180 #define OCM_MODE_MSK    0x3
00181 #define OCM_PRE_MSK             0xc
00182 #define OCM_LOOPTIME    0x10
00183 
00184 /* -- reg_enum OCM_MODE_MSK */
00185 
00186 #define OCM_PRE_DIS             0x0
00187 #define OCM_PRE_10              0x4
00188 #define OCM_PRE_20              0x8
00189 #define OCM_PRE_30              0xc
00190 
00191 /* -- reg_enum OCM_PRE_MSK */
00192 
00193 #define OCM_MODE_FULL   0x0
00194 #define OCM_MODE_TX             0x1
00195 #define OCM_MODE_RX             0x2
00196 #define OCM_MODE_REP    0x3
00197 
00198 /*
00199  * SLK2511 LIU  Status
00200  */
00201 /* --reg_bits OCM_CH0_STATUS */
00202 /* --reg_bits OCM_CH1_STATUS */
00203 
00204 #define SPILL2511       0x01
00205 #define PRBSPASS        0x02
00206 #define RATE_DET_MSK    0x0c
00207 /* bit defines for rates are the same as the config register above */
00208 #define LOS             0x10
00209 #define LOL             0x20
00210 #define SIG_DET         0x80
00211 
00212 /*
00213  * Transceiver Control and serial acess register
00214  */
00215 /* --reg_bits OCM_CH0_XCVR */
00216 /* --reg_bits OCM_CH1_XCVR */
00217 
00218 #define DISABLE_TX      0x01
00219 #define XCVR_SCL        0x02
00220 #define XCVR_WDATA      0x04
00221 #define XCVR_TS         0x08
00222 #define XCVR_RDATA      0x10
00223 #define XCVR_PRES       0x20
00224 #define XCVR_FLT        0x40
00225 /*
00226  * Enable Registers
00227  */
00228 /* --reg_bits OCM_CH0_ENABLE */
00229 /* --reg_bits OCM_CH1_ENABLE */
00230 
00231 #define SLK_EN          0x01
00232 #define PLL_EN          0x02
00233 #define SYS_EN          0x04
00234 #define RAM_EN          0x08
00235 /* read status in top bits */
00236 #define SYS_LOCK        0x20
00237 #define RX_LOCK         0x40
00238 
00239 /* -- */
00240 
00241 
00242 /*
00243  * Receive Framer control register
00244  */
00245 
00246 
00247 /* --reg_bits OCM_CH0_RCV_FRAMING */
00248 /* --reg_bits OCM_CH1_RCV_FRAMING */
00249 
00250 #define RESET_FRM       0x01
00251 #define FRAME_EN        0x02
00252 #define RX_DATA_SRC_2G  0x04
00253 #define DISABLE_SCRAM   0x10
00254 #define SUSPEND_AQ      0x20
00255 #define EN_PAR_CNT      0x40
00256 #define EN_ERR_CNT      0x80
00257 /*
00258  * Configure Transmit Framer
00259  */
00260 
00261 /* --reg_bits OCM_CH0_XMT_FRAMING */
00262 /* --reg_bits OCM_CH1_XMT_FRAMING */
00263 
00264 #define RESET_PTR       0x01
00265 #define TEST_DATA       0x02
00266 #define EN_TX_FRAME     0x04
00267 #define EN_IDLE         0x04
00268 #define CLOCK_SEL_MSK   0xC0
00269 #define CLK_125MHZ      0x00
00270 #define CLOCK_SEL_MSK   0xC0
00271 #define CLK_SONET_SDH   0x40
00272 #define CLK_GE          0x80
00273 #define CLK_FEC         0xC0
00274 
00275 
00276 /* --reg_bits OCM_CH0_RCV_FILTER */
00277 /* --reg_bits OCM_CH1_RCV_FILTER */
00278 
00279 /* for sdh bitfiles */
00280 
00281 #define OVERHEAD_ONLY   0x01
00282 /* enable counter data substitution */
00283 /* for ethernet bitfiles only right now*/
00284 #define EN_DATA_COUNTER 0x02
00285 #define COUNT_FREERUN   0x04
00286 #define EN_ALL_DECODED  0x08
00287 
00288 /* -- */
00289 
00290 
00291 
00292 /* --reg_bits OCM_CH0_XMT_TEST_DATA */
00293 /* --reg_bits OCM_CH1_XMT_TEST_DATA */
00294 
00295 #define FRAMED          0x01
00296 #define RX_LOCKED       0x01
00297 #define RATE12          0x02
00298 /*
00299  * Transmit test pattern 32 bit
00300  */
00301 
00302 /* --reg_bits OCM_CH0_RCV_FRAME_STATUS */
00303 
00304 #define BIT_SYNC        0x01
00305 #define BYTE_SYNC       0x02
00306 #define MATCH_CNT_MSK   0x0c
00307 #define MATCH_CNT_SHFT  2
00308 #define DROP_CNT_MSK    0x30
00309 #define DROP_CNT_SHFT   4
00310 #define FOUND           0x40
00311 #define LOCKED          0x80
00312 
00313 /* -- */
00314 
00315 
00316 /* Bit masks for OCM_CHX_CNT_CTRL */
00317 
00318 /* --reg_bits OCM_CH0_CNT_CTRL */
00319 /* --reg_bits OCM_CH1_CNT_CTRL */
00320 
00321 
00322 #define OCM_EN_ERROR_COUNT      0x80
00323 #define OCM_ERROR_COUNT_HOLD    0x1
00324 
00325 /* new defines for edt_ocm.h */
00326 /* OCM_CH0_CONFIG1 */
00327 #define EN_PRBSPASS_LATCH       0x80
00328 
00329 
00330 /* prbs7 biterror counters in FPGA */
00331 #define OCM_CH0_PRBS_ERR_CNTRL  0x010100ac
00332 #define OCM_CH1_PRBS_ERR_CNTRL  0x010100ec
00333 
00334 /* --reg_bits OCM_CH0_PRBS_ERR_CNTRL */
00335 /* --reg_bits OCM_CH1_PRBS_ERR_CNTRL */
00336 
00337 #define CLR_PRBS_CNT    0x01
00338 
00339 #define OCM_CH0_PRBS_STATUS     0x010100ad
00340 #define OCM_CH1_PRBS_STATUS     0x010100ed
00341 
00342 /* --reg_bits OCM_CH0_PRBS_STATUS */
00343 /* --reg_bits OCM_CH1_PRBS_STATUS */
00344 
00345 #define PRBS_SYNCED     0x01
00346 #define PRBS_ERROR      0x02
00347 #define PRBS_ERR_LATCH  0x04
00348 
00349 /* -- */
00350 
00351 #define OCM_CH0_PRBS_ERR_CNT    0x010100ae
00352 #define OCM_CH1_PRBS_ERR_CNT    0x010100ee
00353 #define OCM_CH0_PRBS_LOS_CNT    0x010100af
00354 #define OCM_CH1_PRBS_LOS_CNT    0x010100ef
00355 
00356 /* frequency counter */
00357 #define OCM_CH0_FREQ_CNT_CTRL   0x010100b0
00358 #define OCM_CH1_FREQ_CNT_CTRL   0x010100f0
00359 
00360 /* --reg_bits OCM_CH0_FREQ_CNT_CTRL */
00361 /* --reg_bits OCM_CH1_FREQ_CNT_CTRL */
00362 
00363 #define CLEAR_VALID     0x01
00364 
00365 #define OCM_CH0_FREQ_STATUS     0x010100b1
00366 #define OCM_CH1_FREQ_STATUS     0x010100f1
00367 
00368 /* --reg_bits OCM_CH0_FREQ_STATUS */
00369 /* --reg_bits OCM_CH1_FREQ_STATUS */
00370 
00371 #define FREQ_VALID      0x01
00372 
00373 /* -- */
00374 
00375 #define OCM_CH0_FREQUENCY       0x020100b2
00376 #define OCM_CH1_FREQUENCY       0x020100f2
00377 
00378 /* receive clock phase control */
00379 #define OCM_CH0_RX_CLK_CTRL     0x0101009e
00380 #define OCM_CH1_RX_CLK_CTRL     0x010100de
00381 
00382 /* --reg_bits OCM_CH0_RX_CLK_CTRL */
00383 /* --reg_bits OCM_CH1_RX_CLK_CTRL */
00384 
00385 /* the first 4 bits select what is read back in the OCM_CHX_RX_CLK_STAT reg */
00386 #define STAT_SEL_MSK            0x0f
00387 #define SIG_STAT                0x0
00388 /* resd the phase positions at edges and current */
00389 #define CLK_POS_START           0x4
00390 #define CLK_NEG_EDGE            0x5
00391 #define CLK_NXT_POS             0x6
00392 #define CLK_FINAL               0x7
00393 #define SHADOW_CNT              0x8
00394 /* phase select control bits */
00395 #define PRG_PS_EN               0x10
00396 #define PRG_PS_INC              0x20
00397 
00398 #define OCM_CH0_RX_CLK_STAT     0x0101009f
00399 #define OCM_CH1_RX_CLK_STAT     0x010100df
00400 
00401 /* --reg_bits OCM_CH0_RX_CLK_STAT */
00402 /* --reg_bits OCM_CH1_RX_CLK_STAT */
00403 
00404 /* when the OCM_CHX_RX_CTRL STAT_SEL is set to SIG_STAT */
00405 #define CLK_F                   0x01
00406 #define CLK_R                   0x02
00407 
00408 /* next two bits store the state of the auto phase adjust */
00409 #define DONE_STATE_MSK          0x0c
00410 
00411 /* last 5 bits (one unused) */
00412 
00413 #define STATE_DONE_EN_1         0x08
00414 #define DCM_LOCK_SET            0x10
00415 #define NO_RXCLK                0x40
00416 #define PHASE_OVF               0x80
00417 
00418 /* -- reg_enum DONE_STATE_MSK */
00419 
00420 #define STATE_AUTO              0x00
00421 #define STATE_DONE              0x04
00422 #define STATE_PRG_WAIT          0x0c
00423 
00424 /* -- */
00425 
00426 /*
00427  * additional bits for OCM_CHX_RCV_STATUS for ethernet
00428  * 0 - RX PLL LOCKED
00429  * 1 - SLK2511 set to OC12/STM4 Rate or ethernet (should be on for ethernet)
00430  */
00431 #define CATCH_FIFO_OVF  0x4
00432 #define CATCH_ALIGN_CHG 0x8
00433 /* following errors when either bit or both are set */
00434 #define CATCH_CODE_VIOL 0x30
00435 #define CATCH_CODE_ERR  0xc0
00436 /*
00437  * ethernet bits for OCM_CHX_RCV_FRAME_STATUS
00438  * reflect the state of the 10 bit alignment to 8B/10B commas
00439  */
00440 #define COMMA_ALIGNED   0x01
00441 /* set when the catch registers are active for errors above */
00442 #define CATCH_ENABLED   0x02
00443 /* two bits are unused */
00444 #define ALIGNMENT_MSK   0xf0
00445 
00446 /*
00447  * program the Xilinx for channel 0  and 1 registers
00448  * the data register is loaded with the bit file data. It is a fifo which holds 15 bytes
00449  * the number of bytes in the fifo is read in the top 4 bist of the status register
00450  * The CONT register controls the PROGL and INIT pins of each Xilinx, bit 4 controls which
00451  * xilinx gets the data being loaded in the data register
00452  * The STAT register reflects the status of the DONE and INIT pins.
00453  * The constant register is written and read to determine if the ocm.bit file is loaded before
00454  * attempting to load the individual channel xilinx.
00455  */
00456 
00457 #define OCM_X_DATA        0x01010040
00458 #define OCM_X_CONT        0x01010041
00459 #define OCM_X_STAT        0x01010042
00460 #define OCM_X_CONST       0x01010043
00461 
00462 /* control register bits */
00463 #define OCM_CONT_CH0_INIT    0x1  /* one tristates INIT pin */
00464 #define OCM_CONT_CH0_PROG    0x2  /* one drives the PROG_L pin low (resets xilinx program) */
00465 #define OCM_CONT_CH1_INIT    0x4
00466 #define OCM_CONT_CH1_PROG    0x8
00467 #define OCM_CONT_PRG_CH1     0x10  /* directs data to channel 1 */
00468 #define OCM_CONT_ENABLE      0x20  /* enables the fifo, cclk and bit serializer */
00469 #define OCM_CONT_EN_FIFO     0x40  /* enables the fifo, cclk and bit serializer */
00470 
00471 /* status bits  */
00472 #define OCM_STAT_CH0_INIT       0x1     /* reads state of INIT pin */
00473 #define OCM_STAT_CH0_DONE       0x2     /* reads state of DONE pin */
00474 #define OCM_STAT_CH1_INIT       0x4     
00475 #define OCM_STAT_CH1_DONE       0x8     
00476 #define OCM_FCNT_MSK            0xf0
00477 #define OCM_FCNT_SHFT           4
00478 
00479 #define OCM_CONSTANT            0x0c    /* fixed pattern in OCM_X_CONST register */
00480 
00481 #ifdef PCD
00482 
00491 typedef enum {
00492 
00493 STM0_RATE =     0,
00494 GIGE_RATE  =    10,
00495 GIG10E_RATE =   100,
00496 STM1_RATE =     1,
00497 STM4_RATE =     4,
00498 STM16_RATE =    16,
00499 OTU1_RATE =     17,
00500 STM64_RATE =    64,
00501 OTU2_RATE =     65,
00502 STM256_RATE =   256,
00503 OTU3_RATE =     257,
00504 OC3_RATE =      3,
00505 OC12_RATE =     12,
00506 OC48_RATE =     48,
00507 OC192_RATE =    192,
00508 OC768_RATE =    768
00509 
00510 } EdtLineRate;
00511 
00512 
00513 
00515 /* low three bits describe the bit and byte order */
00516 
00517 #define EDT_OCX_BYTE_SWAP   0x1
00518 #define EDT_OCX_SHORT_SWAP  0x2
00519 #define EDT_OCX_LSB_FIRST   0x4
00520 
00522 #define EDT_OCX_SWAP (EDT_OCX_BYTE_SWAP | EDT_OCX_SHORT_SWAP)
00523 
00524 #define EDT_OCX_ORDER_MASK  0x7
00525 
00527 #define EDT_OCX_FRAMED      0x8 
00528 
00529 #define EDT_OCX_DESCRAMBLE  0x10
00530 
00531 #define EDT_OCX_ENABLE_MEM  0x20
00532 
00533 #define EDT_OCX_OVHD_ONLY   0x40
00534 
00535 #define EDT_OCX_PRBS_EN     0x200
00536 
00537 #define EDT_OCX_SKIP_LOAD   0x400
00538 
00539 #define EDT_OCX_FULL_INIT   0x800
00540 
00541 #define EDT_OCX_LOOPBACK    0x2000
00542 
00543 #define EDT_OCX_REMOTE_LPBK 0x10000
00544 
00545 #define EDT_OCX_SCRAMBLE    0x1000
00546 
00547 #define EDT_OCX_INVERT      0x4000
00548 
00549 #define EDT_OCX_SET_DEMUX   0x8000
00550 
00551 #define EDT_OCX_RESYNCH     0x10000
00552 
00553 #define EDT_OCX_FORCE_LOAD  0x20000
00554 
00555 #define EDT_OCX_NO_SIG_DET  0x40000
00556 
00558 #define EDT_OCX_TAGGED_DATA  0x80000
00559 
00560 /* enable a 32 bit counter data instead of input data for debug */
00561 #define EDT_OCX_ENABLE_COUNT_DATA 0x100000
00562 /* enable the 32 bit counter to free run to get latency and bandwidth info */
00563 #define EDT_OCX_FREERUN_COUNT_DATA 0x200000
00564 /* enable the the ethernet fcs layer to output all byte */
00565 #define EDT_OCX_ETHERNET_ALL_DECODE 0x400000
00566 
00567 #define EDT_OCX_NO_SETUP    0x800000
00568 
00569 #define EDT_OCX_WAIT_ON_SYNCH   0x1000000
00570 #define EDT_OCX_SYNCH_MASTER    0x2000000
00571 #define EDT_OCX_SYNCH_SLAVE     0x4000000
00572 
00573 
00574 /* align on frames but captuire on
00575   byte alignment */
00576 
00577 #define EDT_OCX_FRAMED_BYTES    0x8000000
00578 
00579 
00582 #define EDT_OCX_BITFILE_MATCH   0x1
00583 #define EDT_OCX_MEZZFILE_MATCH  0x2
00584 #define EDT_OCX_LOCAL_LOCKED    0x4
00585 #define EDT_OCX_CHANNEL_LOCKED  0x8
00586 #define EDT_OCX_HAS_XCVR        0x10
00587 #define EDT_OCX_LIU_LOCKED      0x20
00588 #define EDT_OCX_RX_DCM_LOCKED    0x40
00589 #define EDT_OCX_FRAME_LOCKED    0x80
00590 #define EDT_OCX_SIG_DET         0x100
00591 #define EDT_OCX_CLOCK_SELECTED  0x200
00592 #define EDT_OCX_ENABLED         0x400
00593 #define EDT_OCX_CAPTURE_ENABLED 0x800
00594 #define EDT_OCX_WAITING_ON_SYNCH   0x1000
00595 
00596 
00597 
00607 #ifndef _KERNEL
00608 #include "lib_xfp_sfp.h"
00609 
00610 typedef struct  {
00611     EdtLineRate line_rate; 
00612     int timeout; 
00613     u_int flags; 
00635     edt_bitpath intfc; 
00636     edt_bitpath mezz_0; 
00637     edt_bitpath mezz_1; 
00638     char tributary[6];
00639     u_char demux_mask[192]; 
00640     int tagid;
00641     /* added 12/2010 jsc */
00642 
00643     u_int state;
00644     u_int frame_timeout;
00645     u_int signal_timeout;
00646     u_int receive_dcm_timeout;
00647     u_int transceiver_timeout;
00648     
00649     u_char writing;
00650 
00651     EdtXfpSfpDevice *xfp_p;
00652 
00653 }  EdtOCConfig;
00654 
00666 typedef struct {
00667     u_int b1_errors;
00668     u_char b1_error_mask;
00669     u_int b2_errors;
00670     u_int m1_errors;
00671     u_int lof_errors;
00672     u_int frame_pattern_errors;
00673     u_int false_frame_errors;
00674 } EdtOCXFrameErrors;
00675 
00676 
00677 
00678 
00679 typedef struct _OcxDemux {
00680     EdtLineRate rate;
00681     u_char current_values[192];
00682     u_char enable[192];
00683     u_char disable[192];
00684 } EdtOcxDemux;
00685 
00697 /***********************************************************/
00698 /* These functions are specific to the OCM mezzanine board */
00699 /***********************************************************/
00700 
00701 
00702 EDTAPI  int
00703 edt_ocm_lock_clocks(EdtDev *edt_p, int timeout);
00704 
00705 EDTAPI  const char *
00706 edt_ocm_mezz_filename(EdtDev *edt_p, EdtLineRate line_rate);
00707 
00708 EDTAPI  int
00709 edt_ocm_load_default_mezzanine(EdtDev *edt_p, 
00710         EdtLineRate line_rate,
00711         char *mezz_0,
00712         char *mezz_1);
00713 
00714 EDTAPI  int
00715 edt_ocm_speed_capable(int channel, EdtLineRate line_rate);
00716 
00717 EDTAPI  int
00718 edt_ocm_has_mezz_bitfile(EdtDev *edt_p, const char *bitfile_name);
00719 
00720 EDTAPI  int
00721 edt_ocm_set_clock_select(EdtDev *edt_p, EdtLineRate line_rate);
00722 
00723 EDTAPI  int
00724 edt_ocm_channel_lock_frontend(EdtDev *edt_p, EdtOCConfig *cfg);
00725 
00726 EDTAPI int
00727 edt_ocm_channel_setup(EdtDev *edt_p, EdtOCConfig *cfg);
00728 
00729 EDTAPI  int
00730 edt_ocm_wait_for_frame(EdtDev *edt_p, int timeout);
00731 
00732 
00733 
00734 EDTAPI int
00735 edt_ocm_demux_set(EdtDev *edt_p, EdtLineRate line_rate, u_char *onoff);
00736 
00737 EDTAPI int
00738 edt_ocm_demux_get(EdtDev *edt_p, EdtLineRate line_rate, u_char *onoff);
00739 
00740 EDTAPI int
00741 edt_ocm_demux_chan_enable(EdtDev *edt_p, int channel, int enable);
00742 
00743 EDTAPI int
00744 edt_ocm_demux_get_chan_enabled(EdtDev *edt_p, int channel);
00745 
00746 EDTAPI int 
00747 edt_ocx_print_auto_phase(EdtDev *edt_p);
00748 
00749 EDTAPI int 
00750 edt_ocx_read_frequency(EdtDev *edt_p, EdtOCConfig *cfg);
00751 
00752 EDTAPI int
00753 edt_ocx_rx_clk_phase(EdtDev *edt_p, int change);
00754 
00767 /*****************************************************/
00768 /* These functions will work for either OCM or OC192 */
00769 /* mezzanine boards                                  */
00770 /*****************************************************/
00771 
00772 EDTAPI  int
00773 edt_ocx_lock_local_clock(EdtDev *edt_p, int timeout);
00774 
00775 EDTAPI  void
00776 edt_ocx_enable_framing_errors(EdtDev *edt_p, int state);
00777 
00778 EDTAPI  int 
00779 edt_ocx_get_framing_errors(EdtDev *edt_p, EdtOCXFrameErrors *err_p);
00780 
00781 EDTAPI  int
00782 edt_ocx_lock_channel_clock(EdtDev *edt_p, int channel, int timeout);
00783 
00784 EDTAPI  char *
00785 edt_ocx_default_bitfile(int mezz_id);
00786 
00787 EDTAPI  int
00788 edt_ocx_check_interface(EdtDev *edt_p, char *target_file, int force_load);
00789 
00790 
00791 
00792 EDTAPI  int
00793 edt_ocx_lock_clocks(EdtDev *edt_p, int timeout);
00794 
00795 EDTAPI  int
00796 edt_ocx_load_default_mezzanine(EdtDev *edt_p, 
00797         EdtLineRate line_rate,
00798         char *mezz_0,
00799         char *mezz_1);
00800 
00801 EDTAPI  int
00802 edt_ocx_base_init(EdtDev *edt_p, 
00803                   EdtOCConfig *cfg);
00804 
00805 EDTAPI  int
00806 edt_ocx_speed_capable(EdtDev *edt_p, EdtLineRate line_rate);
00807 
00808 EDTAPI  int
00809 edt_ocx_has_mezz_bitfile(EdtDev *edt_p, const char *bitfile_name);
00810 
00811 EDTAPI  const char *
00812 edt_ocx_mezz_filename(EdtDev *edt_p, EdtLineRate line_rate);
00813 
00814 EDTAPI  int
00815 edt_ocx_check_mezz_bitfile(EdtDev *edt_p, 
00816                            EdtOCConfig *cfg);
00817 
00818 EDTAPI  int
00819 edt_ocx_set_clock_select(EdtDev *edt_p, EdtLineRate line_rate);
00820 
00821 EDTAPI  void
00822 edt_ocx_set_channel_enable(EdtDev *edt_p, int channel, int state);
00823 
00824 EDTAPI  void
00825 edt_ocx_set_lsbfirst(EdtDev *edt_p, int channel, int state);
00826 
00827 EDTAPI  void
00828 edt_ocx_reset_sys_en(EdtDev *edt_p, int channel);
00829 
00830 EDTAPI  int
00831 edt_ocx_channel_set_rate(EdtDev *edt_p, EdtOCConfig *cfg);
00832 
00833 EDTAPI  int
00834 edt_ocx_channel_setup(EdtDev *edt_p,
00835                    EdtOCConfig *cfg);
00836 EDTAPI int
00837 edt_ocm_channel_lock_frontend(EdtDev *edt_p, EdtOCConfig *cfg);
00838 
00839 EDTAPI  int
00840 edt_ocm_channel_lock_frontend_pll(EdtDev *edt_p, EdtOCConfig *cfg);
00841 
00842 EDTAPI  int
00843 edt_ocx_configure(EdtDev *edt_p, 
00844                   EdtOCConfig *cfg);
00845 
00846 EDTAPI  int
00847 edt_ocx_wait_for_frame(EdtDev *edt_p, int timeout);
00848 
00849 EDTAPI int
00850 edt_ocx_channel_start(EdtDev *edt_p);
00851 
00852 EDTAPI int
00853 edt_ocx_channel_signal_detect(EdtDev *edt_p);
00854 
00855 EDTAPI int
00856 edt_ocx_prepare_for_dma(EdtDev *edt_p, EdtOCConfig *cfg);
00857 
00858 
00859 EDTAPI int
00860 edt_ocx_post_start(EdtDev *edt_p, EdtOCConfig *cfg);
00861 
00862 
00863 EDTAPI int
00864 edt_ocx_channel_start_cfg(EdtDev *edt_p, EdtOCConfig *cfg, int n);
00865 
00866 /* demux access functions */
00867 
00868 EDTAPI int
00869 edt_ocx_demux_set(EdtDev *edt_p, EdtLineRate line_rate, u_char *onoff);
00870 
00871 EDTAPI int
00872 edt_ocx_demux_get(EdtDev *edt_p, EdtLineRate line_rate, u_char *onoff);
00873 
00874 EDTAPI int
00875 edt_ocx_demux_chan_enable(EdtDev *edt_p, int channel, u_char state);
00876 
00877 EDTAPI int
00878 edt_ocx_demux_get_chan_enabled(EdtDev *edt_p, int channel);
00879 
00880 EDTAPI int
00881 edt_reg_set_bitmask(EdtDev *edt_p, u_int reg, u_int mask, int state);
00882 
00883 
00884 EDTAPI void
00885 edt_ocx_set_channel_direction(EdtDev *edt_p, int channel, int do_write);
00886 
00891 #include "edt_oc192.h"
00892 
00893 EDTAPI int edt_ocx_demux_print(EdtOcxDemux *demux);
00894 
00895 EDTAPI void edt_ocx_print_byte_array(char *tag, u_char *pvec, int n);
00896 
00897 EDTAPI int edt_ocx_parse_demux(EdtOcxDemux *demux, char *word, char *errorstr);
00898 
00899 #endif
00900 
00901 #endif /* PCD */
00902 #endif

Generated on Mon Mar 21 14:14:39 2011 by  doxygen 1.4.7