falcon_tsc_interface.h (49311B)
1 /*********************************************************************************** 2 *********************************************************************************** 3 * * 4 * * 5 * Description : Interface functions targeted to IP user * 6 * * 7 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 8 * 9 * Copyright 2007-2019 Broadcom Inc. All rights reserved. * 10 * No portions of this material may be reproduced in any form without * 11 * the written permission of: * 12 * Broadcom Corporation * 13 * 5300 California Avenue * 14 * Irvine, CA 92617 * 15 * * 16 * All information contained in this document is Broadcom Corporation * 17 * company private proprietary, and trade secret. * 18 */ 19 20 /*! \mainpage 21 * 22 * \section intro_sec Introduction 23 * 24 * This documentation files are intended to guide a developer in using the 25 * Broadcom SerDes core within a larger ecosystem by providing specific API 26 * function calls which can be used to perform all necessary operations. 27 * 28 * The detailed description about the API directory structure, API overview, 29 * release procedure, and check out process can be found in the Serdes API User Guide 30 * (http://ingbu.broadcom.com/hsip/falcon_tsc/SerDes%20Documents/PMD_Methodology/Serdes%20External%20Micro%20User%20Guide.docx) 31 * \n \n 32 * 33 * \section API_sec Important API Files 34 * 35 * falcon_tsc_interface.h - provides the primary functionality. 36 * 37 * falcon_tsc_dependencies.h - defines the functions to be provided by the IP user 38 * 39 * \n \n 40 * Copyright 2014 Broadcom Corporation all rights reserved 41 */ 42 43 /** @file falcon_tsc_interface.h 44 * Main interface functions provided to IP User 45 */ 46 47 #ifndef FALCON_TSC_API_INTERFACE_H 48 #define FALCON_TSC_API_INTERFACE_H 49 50 #include "falcon_tsc_usr_includes.h" 51 52 #include "falcon_tsc_ipconfig.h" 53 #include "falcon_tsc_enum.h" 54 #include "falcon_api_uc_common.h" 55 #include "common/srds_api_err_code.h" 56 57 58 /*----------------------------------------*/ 59 /* Lane/Core structs (without bitfields) */ 60 /*----------------------------------------*/ 61 62 /** Lane Config Variable Structure in Microcode */ 63 struct falcon_tsc_uc_lane_config_field_st { 64 uint8_t lane_cfg_from_pcs; 65 uint8_t an_enabled; 66 uint8_t dfe_on; 67 uint8_t dfe_lp_mode; 68 uint8_t force_brdfe_on; 69 uint8_t media_type; 70 uint8_t unreliable_los; 71 uint8_t scrambling_dis; 72 uint8_t cl72_auto_polarity_en; 73 uint8_t cl72_restart_timeout_en; 74 uint8_t en_short_chn_osx1; 75 uint8_t reserved; 76 }; 77 78 /** Core Config Variable Structure in Microcode */ 79 struct falcon_tsc_uc_core_config_field_st { 80 uint8_t vco_rate; 81 uint8_t core_cfg_from_pcs; 82 uint8_t disable_write_pll_iqp; 83 uint8_t reserved; 84 }; 85 86 /** Lane Config Struct */ 87 struct falcon_tsc_uc_lane_config_st { 88 struct falcon_tsc_uc_lane_config_field_st field; 89 uint16_t word; 90 }; 91 92 /** Core Config Struct */ 93 struct falcon_tsc_uc_core_config_st { 94 struct falcon_tsc_uc_core_config_field_st field; 95 uint16_t word; 96 int vco_rate_in_Mhz; /* if >0 then will get converted and replace field.vco_rate when update is called */ 97 }; 98 99 /** Eyescan Options Struct */ 100 struct falcon_tsc_eyescan_options_st { 101 uint32_t linerate_in_khz; 102 uint16_t timeout_in_milliseconds; 103 int8_t horz_max; 104 int8_t horz_min; 105 int8_t hstep; 106 int8_t vert_max; 107 int8_t vert_min; 108 int8_t vstep; 109 int8_t mode; 110 }; 111 112 113 /****************************************************/ 114 /* CORE Based APIs - Required to be used per Core */ 115 /****************************************************/ 116 /* Returns API Version Number */ 117 /** API Version Number. 118 * @param pa phymod_access_t struct 119 * @param *api_version API Version Number returned by the API 120 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 121 */ 122 err_code_t falcon_tsc_version (const phymod_access_t *pa, uint32_t *api_version); 123 124 /*------------------------------------------------------*/ 125 /* APIs to Read/Write Core Config variables in uC RAM */ 126 /*------------------------------------------------------*/ 127 /** Write to core_config uC RAM variable. 128 * @param pa phymod_access_t struct 129 * @param struct_val Value to be written into core_config RAM variable. 130 * (Note that struct_val.word must be = 0, only the fields are used) 131 * @param pa phymod_access_t struct 132 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 133 */ 134 err_code_t falcon_tsc_set_uc_core_config (const phymod_access_t *pa, struct falcon_tsc_uc_core_config_st struct_val); 135 136 /** Read value of core_config uC RAM variable. 137 * @param pa phymod_access_t struct 138 * @param *struct_val Value to be written into core_config RAM variable 139 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 140 */ 141 err_code_t falcon_tsc_get_uc_core_config (const phymod_access_t *pa, struct falcon_tsc_uc_core_config_st *struct_val); 142 143 /*----------------------------------------*/ 144 /* Display Core Config and Debug Status */ 145 /*----------------------------------------*/ 146 /** Display Core configurations (RAM config variables and config register fields). 147 * @param pa phymod_access_t struct 148 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 149 */ 150 err_code_t falcon_tsc_display_core_config (const phymod_access_t *pa); 151 152 /** Display current Core state. Read and displays core status variables and fields. 153 * @param pa phymod_access_t struct 154 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 155 */ 156 err_code_t falcon_tsc_display_core_state (const phymod_access_t *pa); 157 158 /** Column definition header for falcon_tsc_display_core_state() API output. 159 * To be called before falcon_tsc_display_core_state_line() API. 160 * @param pa phymod_access_t struct 161 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 162 */ 163 err_code_t falcon_tsc_display_core_state_hdr (const phymod_access_t *pa); 164 165 /** Display current Core state in single line. Read and displays core status variables and fields. 166 * Call falcon_tsc_display_core_state_hdr() API before and falcon_tsc_display_core_state_legend() after 167 * calling this API to get a formatted core state display with legend. 168 * @param pa phymod_access_t struct 169 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 170 */ 171 err_code_t falcon_tsc_display_core_state_line (const phymod_access_t *pa); 172 173 /** Detailed description of each column in falcon_tsc_display_core_state_line() API output. 174 * To be called after falcon_tsc_display_core_state_line() API to display the legends. 175 * @param pa phymod_access_t struct 176 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 177 */ 178 err_code_t falcon_tsc_display_core_state_legend (const phymod_access_t *pa); 179 180 /*----------------------------------------*/ 181 /* Temperature forcing and reading */ 182 /*----------------------------------------*/ 183 /** Forces die temperature in degrees Ceisius (as integer). 184 * @param pa phymod_access_t struct 185 * @param die_temp Die temperature in degrees Celsius. 186 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 187 */ 188 err_code_t falcon_tsc_force_die_temperature (const phymod_access_t *pa, int16_t die_temp); 189 190 /** Read die temperature in degrees Ceisius (as integer) 191 * @param pa phymod_access_t struct 192 * @param *die_temp Die temperature in degrees Celsius 193 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 194 */ 195 err_code_t falcon_tsc_read_die_temperature (const phymod_access_t *pa, int16_t *die_temp); 196 197 /** Read die temperature in degrees Ceisius (as double) 198 * @param pa phymod_access_t struct 199 * @param *die_temp Die temperature in degrees Celsius (as double) 200 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 201 */ 202 err_code_t falcon_tsc_read_die_temperature_double (const phymod_access_t *pa, USR_DOUBLE *die_temp); 203 204 205 206 /** Set the uC active mode. 207 * uC active bit should be set by the user to ensure the ucode loaded into the micro is executed. See Programmers Guide for more details. 208 * @param pa phymod_access_t struct 209 * @param enable Enable/Disable uC Active (1 = Enable; 0 = Disable) 210 * @return Error Code generated by invalid access (returns ERR_CODE_NONE if no errors) 211 */ 212 err_code_t falcon_tsc_uc_active_enable (const phymod_access_t *pa, uint8_t enable); 213 214 /*-----------------------------------*/ 215 /* Microcode Load/Verify Functions */ 216 /*-----------------------------------*/ 217 218 /** Load Microcode into Micro through Register (MDIO) Interface. 219 * Once the microcode is loaded, de-assert reset to 8051 to start executing microcode "wrc_micro_mdio_dw8051_reset_n(0x1)". 220 * \n Note: Micro should be loaded only after issuing a falcon_tsc_uc_reset(1) followed by asserting and de-asserting 221 * core_s_reset. See relevant Programmers guide for more details. 222 * @param pa phymod_access_t struct 223 * @param *ucode_image pointer to the Microcode image organized in bytes 224 * @param ucode_len Length of Microcode Image (number of bytes) 225 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 226 */ 227 err_code_t falcon_tsc_ucode_mdio_load (const phymod_access_t *pa, uint8_t *ucode_image, uint16_t ucode_len); 228 229 /** To verify the Microcode image loaded in the Micro. 230 * Read back the microcode from Micro and check against expected microcode image. 231 * @param pa phymod_access_t struct 232 * @param *ucode_image pointer to the expeted Microcode image organized in bytes 233 * @param ucode_len Length of Microcode Image (number of bytes) 234 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 235 */ 236 err_code_t falcon_tsc_ucode_load_verify (const phymod_access_t *pa, uint8_t *ucode_image, uint16_t ucode_len); 237 238 /** To verify the CRC of the microcode loaded in the Micro. 239 * Instruct uC to read image and calculate CRC and check against expected CRC. 240 * @param pa phymod_access_t struct 241 * @param ucode_len Length of Microcode Image (number of bytes) 242 * @param expected_crc_value Expected CRC value of the microcode 243 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 244 */ 245 err_code_t falcon_tsc_ucode_crc_verify (const phymod_access_t *pa, uint16_t ucode_len, uint16_t expected_crc_value); 246 247 /** To instruct the micro to start calculating the CRC of the microcode. 248 * Instruct uC to read image and calculate CRC. 249 * Control is returned after triggering start of CRC calculation (does NOT wait for completion of CRC calculation). \n \n 250 * NOTE: No uC commands should be executed between starting the CRC calculaion [falcon_tsc_ucode_crc_verify()] and verifying the CRC value [falcon_tsc_start_ucode_crc_calc()]. 251 * @param pa phymod_access_t struct 252 * @param ucode_len Length of Microcode Image (number of bytes) 253 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 254 */ 255 err_code_t falcon_tsc_start_ucode_crc_calc (const phymod_access_t *pa, uint16_t ucode_len); 256 257 /** To check the expected CRC against the CRC calulated by the micro. 258 * NOTE: No uC commands should be executed between starting the CRC calculation [falcon_tsc_ucode_crc_verify()] and verifying the CRC value [falcon_tsc_start_ucode_crc_calc()]. 259 * @param pa phymod_access_t struct 260 * @param expected_crc_value Expected CRC value of the microcode 261 * @param timeout_ms Time interval in milliseconds inside which the previous command (calculate CRC) should be completed 262 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 263 */ 264 err_code_t falcon_tsc_check_ucode_crc (const phymod_access_t *pa, uint16_t expected_crc_value, uint32_t timeout_ms); 265 266 /** To setup the pram bus for Micro load. 267 * When using the pram interface to program the micro, the pram bus must first be setup. 268 * @param pa phymod_access_t struct 269 * @param ucode_len Length of Microcode Image (number of bytes) the value will be padded to 32bit boundary 270 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 271 */ 272 err_code_t falcon_tsc_init_pram_for_uc_load (const phymod_access_t *pa, uint16_t ucode_len); 273 274 /** To disable the pram bus after Micro load. 275 * After using the pram interface to program the micro, the pram bus must then be diabled. 276 * @param pa phymod_access_t struct 277 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 278 */ 279 err_code_t falcon_tsc_finish_pram_load (const phymod_access_t *pa); 280 281 /** Enable or Disable the uC reset. 282 * Note: Micro should be reset using the API everytime before reloading the microcode 283 * @param pa phymod_access_t struct 284 * @param enable Enable/Disable uC reset (1 = Enable; 0 = Disable) 285 * @return Error Code generated by invalid access (returns ERR_CODE_NONE if no errors) 286 */ 287 err_code_t falcon_tsc_uc_reset (const phymod_access_t *pa, uint8_t enable); 288 289 /*----------------*/ 290 /* Lane Mapping */ 291 /*----------------*/ 292 293 /** Configure the lane address mapping. 294 * Note: Micro must not be active when this function is called. 295 * @param pa phymod_access_t struct 296 * @param num_lanes The number of entries in tx_lane_map and rx_lane_map. 297 * This must match the number of lanes associated with the core. 298 * @param pa phymod_access_t struct 299 * @param *tx_lane_map A num_lanes-sized array of lane indexes to map to the TX lanes. 300 * Each entry must be from 0 to num_lanes-1, and each entry must be unique. 301 * @param pa phymod_access_t struct 302 * @param *rx_lane_map A num_lanes-sized array of lane indexes to map to the RX lanes. 303 * Each entry must be from 0 to num_lanes-1, and each entry must be unique. 304 * If independent TX / RX lane mapping is not enabled for a core, then this must match tx_lane_map. 305 * @param pa phymod_access_t struct 306 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 307 */ 308 err_code_t falcon_tsc_map_lanes (const phymod_access_t *pa, uint8_t num_lanes, uint8_t const *tx_lane_map, uint8_t const *rx_lane_map); 309 310 /*------------------------------*/ 311 /* Shared TX Pattern Generator */ 312 /*------------------------------*/ 313 /** Configure Shared TX Pattern API. 314 * An input string (hex or binary) and pattern length are taken in as inputs, based on which the Pattern Generator registers 315 * are programmed to the required values to generate that pattern. 316 * Note: falcon_tsc_tx_shared_patt_gen_en() API should be called to enable the Pattern generator for that particular lane. 317 * @param pa phymod_access_t struct 318 * @param patt_length Pattern length 319 * @param pattern Input Pattern - Can be in hex (eg: "0xB055") or in binary (eg: "011011") 320 * @return Error Code generated by invalid input pattern or pattern length (returns ERR_CODE_NONE if no errors) 321 */ 322 err_code_t falcon_tsc_config_shared_tx_pattern (const phymod_access_t *pa, uint8_t patt_length, const char pattern[]); 323 324 325 /*-----------------------*/ 326 /* IDDQ / Clkgate APIs */ 327 /*-----------------------*/ 328 /** Core configuration for IDDQ. 329 * Note: User also needs to configure all lanes through falcon_tsc_lane_config_for_iddq() 330 * before enabling IDDQ by asserting IDDQ pin. 331 * @param pa phymod_access_t struct 332 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 333 */ 334 err_code_t falcon_tsc_core_config_for_iddq (const phymod_access_t *pa); 335 336 /** Serdes Core Powerdown. 337 * Along with falcon_tsc_core_pwrdn(), all lanes powerdowns should also be issued using 338 * falcon_tsc_lane_pwrdn() to complete a Core Powerdown. 339 * @param pa phymod_access_t struct 340 * @param mode based on enum #srds_core_pwrdn_mode_enum select from ON, CORE, DEEP power down modes 341 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 342 */ 343 err_code_t falcon_tsc_core_pwrdn (const phymod_access_t *pa, enum srds_core_pwrdn_mode_enum mode); 344 345 346 /**************************************************/ 347 /* MISC reg access */ 348 /**************************************************/ 349 350 /** Masked Register Write to the currently selected Serdes IP core/lane through MDIO. 351 * If using MDIO interface to access the registers, use this API to implement falcon_tsc_pmd_mwr_reg(). 352 * @param pa phymod_access_t struct 353 * @param addr Address of register to be written 354 * @param mask 16-bit mask indicating the position of the field with bits of 1s 355 * @param lsb LSB of the field 356 * @param val 16bit value to be written 357 */ 358 err_code_t falcon_tsc_pmd_mdio_mwr_reg (const phymod_access_t *pa, uint16_t addr, uint16_t mask, uint8_t lsb, uint16_t val); 359 360 361 /**************************************************/ 362 /* LANE Based APIs - Required to be used per Lane */ 363 /**************************************************/ 364 365 /*------------------------------------------------------------*/ 366 /* APIs to Write Lane Config and User variables into uC RAM */ 367 /*------------------------------------------------------------*/ 368 /** Write to lane_config uC RAM variable. 369 * Note: This API should be used only during configuration under dp_reset. 370 * @param pa phymod_access_t struct 371 * @param struct_val Value to be written into lane_config RAM variable 372 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 373 */ 374 err_code_t falcon_tsc_set_uc_lane_cfg (const phymod_access_t *pa, struct falcon_tsc_uc_lane_config_st struct_val); 375 376 /*-----------------------------------------------------------*/ 377 /* APIs to Read Lane Config and User variables from uC RAM */ 378 /*-----------------------------------------------------------*/ 379 /** Read value of lane_config uC RAM variable. 380 * @param pa phymod_access_t struct 381 * @param *struct_val Value read from lane_config RAM variable 382 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 383 */ 384 err_code_t falcon_tsc_get_uc_lane_cfg (const phymod_access_t *pa, struct falcon_tsc_uc_lane_config_st *struct_val); 385 386 387 /*-----------------*/ 388 /* Configure PLL */ 389 /*-----------------*/ 390 /** Configure PLL. 391 * 392 * Use core_s_rstb to re-initialize all registers to default before calling this function. 393 * 394 * Configures PLL registers to obtain the required VCO frequency. 395 * @param pa phymod_access_t struct 396 * @param pll_cfg Required PLL configuration 397 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 398 */ 399 err_code_t falcon_tsc_configure_pll (const phymod_access_t *pa, enum falcon_tsc_pll_enum pll_cfg); 400 401 402 /*-------------------------*/ 403 /* Merlin TX Analog APIs */ 404 /*-------------------------*/ 405 406 407 /*-------------------------------*/ 408 /* Falcon/Eagle TX Analog APIs */ 409 /*-------------------------------*/ 410 411 /** Write TX AFE parameters. 412 * @param pa phymod_access_t struct 413 * @param param selects the parameter to write based on #srds_tx_afe_settings_enum 414 * @param val is the signed input value to the parameter 415 * @return Error Code generated by invalid tap settings (returns ERR_CODE_NONE if no errors) 416 */ 417 err_code_t falcon_tsc_write_tx_afe (const phymod_access_t *pa, enum srds_tx_afe_settings_enum param, int8_t val); 418 419 /** Read TX AFE parameters. 420 * @param pa phymod_access_t struct 421 * @param param selects the parameter to read based on #srds_tx_afe_settings_enum 422 * @param *val is the returned signed value of the parameter 423 * @return Error Code generated by invalid tap settings (returns ERR_CODE_NONE if no errors) 424 */ 425 err_code_t falcon_tsc_read_tx_afe (const phymod_access_t *pa, enum srds_tx_afe_settings_enum param, int8_t *val); 426 427 /** Validates Eagle/Falcon TXFIR tap settings. 428 * Returns failcodes if TXFIR settings are invalid. 429 * @param pa phymod_access_t struct 430 * @param pre TXFIR pre tap value (0..31) 431 * @param main TXFIR main tap value (40..112) 432 * @param post1 TXFIR post tap value (0..63) 433 * @param post2 TXFIR post2 tap value (-15..15) 434 * @param post3 TXFIR post3 tap value (-15..15) 435 * @return Error Code generated by invalid tap settings (returns ERR_CODE_NONE if no errors) 436 */ 437 err_code_t falcon_tsc_validate_txfir_cfg (const phymod_access_t *pa, int8_t pre, int8_t main, int8_t post1, int8_t post2, int8_t post3); 438 439 440 /*-------------------*/ 441 /* Display Eye Scan */ 442 /*-------------------*/ 443 444 /** Displays Passive Eye Scan from -0.5 UI to 0.5UI to BER 1e-7. 445 * Function uses uC to acquire data. 446 * It also retrieves the data and displays it in ASCII-art style, where number N corresponds to 1e-N 447 * 448 * This function retrieves the data from uC in horizontal stripe fashion 449 * 450 * @param pa phymod_access_t struct 451 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 452 */ 453 err_code_t falcon_tsc_display_eye_scan (const phymod_access_t *pa); 454 455 /** Displays Passive Eye Scan Data. 456 * This function can be used to display data from meas_lowber_eye_scan() function. 457 * 458 * eyescan_options.horz_max = 31; \n 459 * eyescan_options.horz_min = -31; \n 460 * eyescan_options.vert_max = 31; \n 461 * eyescan_options.vert_min = -31; \n 462 * eyescan_options.hstep = 1; \n 463 * eyescan_options.vstep = 1; \n 464 * eyescan_options.timeout_in_milliseconds = between 4 and 255 465 * (larger numbers will greatly increase test time!) 466 * @param pa phymod_access_t struct 467 * @param eyescan_options is structure of options which control min, max, step, time, and linerate 468 * @param *buffer is pointer to array which contains all samples. 469 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 470 */ 471 err_code_t falcon_tsc_display_lowber_eye (const phymod_access_t *pa, const struct falcon_tsc_eyescan_options_st eyescan_options, uint32_t *buffer); 472 473 /** Measure Passive Eye Scan based on eyescan_options provided and return data in buffer. 474 * It relies on the accuracy of falcon_tsc_delay_us() function. \n\n 475 * The recommend settings are: \n 476 * eyescan_options.horz_max = 31; \n 477 * eyescan_options.horz_min = -31; \n 478 * eyescan_options.vert_max = 31; \n 479 * eyescan_options.vert_min = -31; \n 480 * eyescan_options.hstep = 1; \n 481 * eyescan_options.vstep = 1; \n 482 * eyescan_options.timeout_in_milliseconds = between 4 and 255 483 * (larger numbers will greatly increase test time!) \n 484 * @param pa phymod_access_t struct 485 * @param eyescan_options is structure of options which control min, max, step, time, and linerate 486 * @param *buffer is pointer to array which is large enough to store all samples. 487 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 488 */ 489 err_code_t falcon_tsc_meas_lowber_eye (const phymod_access_t *pa, const struct falcon_tsc_eyescan_options_st eyescan_options, uint32_t *buffer); 490 491 /** Start uC controller eye scan Function. 492 * Eye scan function provides a stripe of data at a time either vertical or horizontal. 493 * This function only initiates the processor actions. User must use falcon_tsc_read_eye_scan_stripe() function 494 * to get the data from uC. 495 * @param pa phymod_access_t struct 496 * @param direction specifies either EYE_SCAN_VERTICAL or EYE_SCAN_HORIZ striping 497 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 498 */ 499 err_code_t falcon_tsc_meas_eye_scan_start (const phymod_access_t *pa, uint8_t direction); 500 501 /** Read a Stripe of eye scan data from uC. 502 * @param pa phymod_access_t struct 503 * @param *buffer must be of size 64 504 * @param *status returns a status word \n 505 * bit 15 - indicates the ey scan is complete \n 506 * bit 14 - indicates uC is slower than read access \n 507 * bit 13 - indicates uC is faster than read access \n 508 * bit 12-8 - reserved \n 509 * bit 7-0 - indicates amount of data in the uC buffer 510 * 511 * @param pa phymod_access_t struct 512 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 513 */ 514 err_code_t falcon_tsc_read_eye_scan_stripe (const phymod_access_t *pa, uint32_t *buffer, uint16_t *status); 515 516 /** Display Stripe of eye scan data to stdout and log. 517 * @param pa phymod_access_t struct 518 * @param y is the vertical step 31 to -31 (Eagle) 124 to -124(Falcon) 519 * @param *buffer must be of size 64 520 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 521 */ 522 err_code_t falcon_tsc_display_eye_scan_stripe (const phymod_access_t *pa, int8_t y, uint32_t *buffer); 523 524 /** Display Eye scan header to stdout and log. 525 * @param pa phymod_access_t struct 526 * @param i indicates the number of headers to display for parallel eye scan 527 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 528 */ 529 err_code_t falcon_tsc_display_eye_scan_header (const phymod_access_t *pa, int8_t i); 530 531 /** Display Eye scan footer to stdout and log. 532 * @param pa phymod_access_t struct 533 * @param i indicates the number of footers to display for parallel eye scan 534 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 535 */ 536 err_code_t falcon_tsc_display_eye_scan_footer (const phymod_access_t *pa, int8_t i); 537 538 /** Check status of eye scan operation in uC. 539 * @param pa phymod_access_t struct 540 * @param *status returns a status word \n 541 * bit 15 - indicates the eye scan is complete \n 542 * bit 14 - indicates uC is slower than read access \n 543 * bit 13 - indicates uC is faster than read access \n 544 * bit 12-8 reserved \n 545 * bit 7-0 - indicates amount of data in the uC buffer 546 * 547 * @param pa phymod_access_t struct 548 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 549 */ 550 err_code_t falcon_tsc_read_eye_scan_status (const phymod_access_t *pa, uint16_t *status); 551 552 /** Restores uC after running diagnostic eye scans. 553 * @param pa phymod_access_t struct 554 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 555 */ 556 err_code_t falcon_tsc_meas_eye_scan_done (const phymod_access_t *pa); 557 558 /** Start a uC controlled BER scan function. 559 * This will tell the uC to make a number of BER measurements at different offsets 560 * and provide data back to API as a block of data. Several types of tests can be 561 * made including Passive (which can be run on any data pattern and does not affect 562 * datapath) or Intrusive (which can be run only when PRBS pattern is being used 563 * and will cause errors to occur). Intrusive test has a limited vertical range! 564 * 565 * @param pa phymod_access_t struct 566 * @param ber_scan_mode configures the type of test (use #srds_diag_ber_mode_enum) \n 567 * \verbatim 568 bit 7 : reserved 569 bit 6 : 1 = BER FAST scan mode (reduce minimum sample time from 0.1sec to 0.02sec 570 bit 5-4 : used for vertical intrusive test only (not recommended) 571 00=move 1 slicer in direction bit0 (slicer selected for max range) 572 11=move both, independent direction(not depend on bit0) legacy 40nm mode 573 01=move only odd(depends on bit0) 574 10=move only even(depends on bit0) 575 bit 3 : 1 = set passive scan to narrow vertical range(150mV); 0 = full range(250mV) 576 bit 2 : 1 = intrusive eye scan; 0 = passive 577 bit 1 : 1 = scan horizontal direction; 0 = scan vertical 578 bit 0 : 1 = scan negative portion of eye to center; 1 = scan positive \endverbatim 579 * @param pa phymod_access_t struct 580 * @param timer_control sets the total test time in units of ~1.31 seconds 581 * @param max_error_control sets the error threshold for test in units of 16.(4=64 error threshold) 582 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 583 */ 584 err_code_t falcon_tsc_start_ber_scan_test (const phymod_access_t *pa, uint8_t ber_scan_mode, uint8_t timer_control, uint8_t max_error_control); 585 586 /** Reads the BER scan data from uC after test has completed. 587 * @param pa phymod_access_t struct 588 * @param *errors is pointer to 32 element array of uint32 which will contain error data 589 * @param *timer_values is pointer to 32 element array of uint32 which will contain time data 590 * @param *cnt returns the number of samples 591 * @param timeout for polling data from uC (typically 2000) 592 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 593 */ 594 err_code_t falcon_tsc_read_ber_scan_data (const phymod_access_t *pa, uint32_t *errors, uint32_t *timer_values, uint8_t *cnt, uint32_t timeout); 595 596 /** Extrapolate BER and display margin information 597 * @param pa phymod_access_t struct 598 * @param rate specifies the data rate in Hz 599 * @param ber_scan_mode the type of test used to take the data(use #srds_diag_ber_mode_enum) 600 * @param *total_errs is pointer to 32 element array of uint32 containing the error data 601 * @param *total_time is pointer to 32 element array of uint32 containing the time data 602 * @param max_offset is the maximum offset setting which is present in data (usually 31) 603 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 604 */ 605 err_code_t falcon_tsc_display_ber_scan_data (const phymod_access_t *pa, USR_DOUBLE rate, uint8_t ber_scan_mode, uint32_t *total_errs, uint32_t *total_time, uint8_t max_offset); 606 607 /** Example eye margin projection API. 608 * This is an example function which uses the following API's to measure and display BER margin projections 609 * falcon_tsc_start_ber_scan_test(), falcon_tsc_read_ber_scan_data(), falcon_tsc_display_ber_scan_data(). 610 * 611 * @param pa phymod_access_t struct 612 * @param rate specifies the data rate in Hz 613 * @param ber_scan_mode the type of test used to take the data(use #srds_diag_ber_mode_enum) 614 * @param timer_control sets the total test time in units of ~1.31 seconds 615 * @param max_error_control sets the error threshold for test in units of 16.(4=64 errors) 616 * @return Error Code during data collection (returns ERR_CODE_NONE if no errors) 617 */ 618 err_code_t falcon_tsc_eye_margin_proj (const phymod_access_t *pa, USR_DOUBLE rate, uint8_t ber_scan_mode, uint8_t timer_control, uint8_t max_error_control); 619 620 /*-----------------------------------------------*/ 621 /* Get dynamic eye margin estimation values */ 622 /*-----------------------------------------------*/ 623 /** Get dynamic eye estimation values 624 * Reads and converts the Eye margin estimation from the uC. 625 * @param pa phymod_access_t struct 626 * @param *left_eye_mUI a pointer to integer with return value of eye margin in units of mUI 627 * @param *right_eye_mUI a pointer to integer with return value of eye margin in units of mUI 628 * @param *upper_eye_mV a pointer to integer with return value of eye margin in units of mV 629 * @param *lower_eye_mV a pointer to integer with return value of eye margin in units of mV 630 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 631 */ 632 err_code_t falcon_tsc_get_eye_margin_est (const phymod_access_t *pa, int *left_eye_mUI, int *right_eye_mUI, int *upper_eye_mV, int *lower_eye_mV); 633 634 /*-----------------------------------------------*/ 635 /* Display Serdes Lane Config and Debug Status */ 636 /*-----------------------------------------------*/ 637 /** Display current lane configuration. 638 * Reads and displays all important lane configuration RAM variables and register fields. 639 * @param pa phymod_access_t struct 640 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 641 */ 642 err_code_t falcon_tsc_display_lane_config (const phymod_access_t *pa); 643 644 /** Display current lane debug status. 645 * Reads and displays all vital lane user status and debug status. 646 * @param pa phymod_access_t struct 647 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 648 */ 649 err_code_t falcon_tsc_display_lane_debug_status (const phymod_access_t *pa); 650 651 652 /*-----------------------------*/ 653 /* Display Serdes Lane State */ 654 /*-----------------------------*/ 655 /** Display current lane state. 656 * Reads and displays all important lane state values in a single line. 657 * \n Note: Call functions falcon_tsc_display_lane_state_hdr() before and falcon_tsc_display_lane_state_legend() after 658 * to get a formatted lane state display with legend 659 * @param pa phymod_access_t struct 660 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 661 */ 662 err_code_t falcon_tsc_display_lane_state (const phymod_access_t *pa); 663 664 /** Column definition header for falcon_tsc display state. 665 * To be called before falcon_tsc_display_lane_state() function. 666 * @param pa phymod_access_t struct 667 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 668 */ 669 err_code_t falcon_tsc_display_lane_state_hdr (const phymod_access_t *pa); 670 671 /** Detailed explanation of each column in falcon_tsc display state. 672 * To be called after falcon_tsc_display_lane_state() function to display the legends. 673 * @param pa phymod_access_t struct 674 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 675 */ 676 err_code_t falcon_tsc_display_lane_state_legend (const phymod_access_t *pa); 677 678 /*---------------------------------------*/ 679 /* Required Serdes Diag/Debug routines */ 680 /*---------------------------------------*/ 681 /** Parameterized diagnostic function which provides comprehensive diagnostic and debug information 682 * This function is required to be implemented by upper level software to enable falcon_tsc support. 683 * @param pa phymod_access_t struct 684 * @param diag_level is a MASK style parameter to enable variable level of display 685 * enum #srds_diag_level_enum can be used to help set the diag_level 686 * bit 0 : 1 = display extended lane state similar to existing falcon ext lane state. 687 * 0 = standard display lane state 688 * bit 1 = display core state 689 * bit 2 = event log 690 * bit 3 = display fast eye scan 691 * bit 4 = dump reg_dump 1 (core level registers) 692 * bit 5 = dump reg_dump 2 (lane level registers) 693 * bit 6 = dump core uC vars 694 * bit 7 = dump lane uC vars 695 * bit 8 = display lane debug state 696 * bit 9 = display data for ber projection vertical 697 * bit 10 = display data for ber projection horzontal 698 * 699 * @param pa phymod_access_t struct 700 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 701 */ 702 err_code_t falcon_tsc_display_diag_data (const phymod_access_t *pa, int32_t diag_level); 703 704 /** Parameterized diagnostic function which access to all falcon_tsc control and status bits 705 * This function is required to be implemented by upper level software to enable falcon_tsc support. 706 * @param pa phymod_access_t struct 707 * @param type controls the type of access requested specified through enum #srds_diag_access_enum 708 * type = 0 : Register Read (param becomes count) 709 * type = 1 : Register Read-Modify-Write (param becomes mask) 710 * type = 2 : CORE RAM Read byte (data becomes count) 711 * type = 3 : CORE RAM Read-Modify-Write byte (param becomes mask) 712 * type = 4 : CORE RAM Read word (data becomes count) 713 * type = 5 : CORE RAM Read-Modify-Write word (param becomes mask) 714 * type = 6 : LANE RAM Read byte (data becomes count) 715 * type = 7 : LANE RAM Read-Modify-Write byte (param becomes mask) 716 * type = 8 : LANE RAM Read word (data becomes count) 717 * type = 9 : LANE RAM Read-Modify-Write word (param becomes mask) 718 * type = 10 : Global RAM Read byte (data becomes count) 719 * type = 11 : Global RAM Read-Modify-Write byte (param becomes mask) 720 * type = 12 : Global RAM Read word (data becomes count) 721 * type = 13 : Global RAM Read-Modify-Write word (param becomes mask) 722 * type = 14 : uC Command (addr becomes command; param becomes supp_info) 723 * See microcode for available commands and further information. 724 * type = 15 : Enable Breakboint 725 * type = 16 : Next or Goto Breakpoint (addr becomes breakpoint #) 726 * type = 17 : Read Breakpoint 727 * type = 18 : Disable Breakpoint 728 * type = 19 : Gather BER projection data (addr becomes ber_mode;data becomes max time;param becomes error threshold) 729 * 730 * Global RAM access will ONLY WORK on Cores with direct RAM access 731 * 732 * @param pa phymod_access_t struct 733 * @param addr in most cases is the address of the register or RAM location 734 * @param data in most cases is the data to be written 735 * @param param is the multipurpose parameter and can be mask or other data 736 */ 737 err_code_t falcon_tsc_diag_access (const phymod_access_t *pa, enum srds_diag_access_enum type, uint16_t addr, uint16_t data, uint16_t param); 738 739 /*-------------------------------------*/ 740 /* PMD_RX_LOCK and CL72/CL93 Status */ 741 /*-------------------------------------*/ 742 743 /** PMD rx lock status of current lane. 744 * @param pa phymod_access_t struct 745 * @param *pmd_rx_lock PMD_RX_LOCK status of current lane returned by API 746 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 747 */ 748 err_code_t falcon_tsc_pmd_lock_status (const phymod_access_t *pa, uint8_t *pmd_rx_lock); 749 750 /** Display CL93n72 Status of current lane. 751 * @param pa phymod_access_t struct 752 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 753 */ 754 err_code_t falcon_tsc_display_cl93n72_status (const phymod_access_t *pa); 755 756 757 #if defined(SERDES_ENABLE_FAST_LINK_RECOVERY) 758 /*----------------------*/ 759 /* Fast Link Recovery */ 760 /*----------------------*/ 761 762 /** Configure Fast Link Recovery (FLR) for the lane. 763 * This may only be performed while the lane is in reset. 764 * @param pa phymod_access_t struct 765 * @param enable Enables the FLR feature (0 = Disable FLR; 1 = Enable Default FLR algorithm; 2 = Enable Enhanced FLR algorithm) 766 * @param enable_timeout Enables timeout 767 * @param timeout_time The timeout time, if enable_timeout is set 768 * @param enable_2ms_yield Enables minimum of 2ms between status checks. 769 * @param filter_count The number of good status reads to require before resuming tuning. 770 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 771 */ 772 err_code_t falcon_tsc_configure_fast_link_recovery(const phymod_access_t *pa, uint8_t enable, uint8_t enable_timeout, enum falcon_tsc_flr_timeout_enum timeout_time, uint8_t enable_2ms_yield, uint8_t filter_count); 773 #endif /* defined(SERDES_ENABLE_FAST_LINK_RECOVERY) */ 774 775 /*--------------------------------*/ 776 /* Serdes TX disable/RX Restart */ 777 /*--------------------------------*/ 778 /** TX Disable. 779 * @param pa phymod_access_t struct 780 * @param enable Enable/Disable TX disable (1 = TX Disable asserted; 0 = TX Disable removed) 781 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 782 */ 783 err_code_t falcon_tsc_tx_disable (const phymod_access_t *pa, uint8_t enable); 784 785 /** Enable/disable Restart RX and hold. 786 * (Reset DSC state machine into RESTART State and hold it till disabled) 787 * @param pa phymod_access_t struct 788 * @param enable Enable/Disable Restart RX and hold (1 = RX restart and hold; 0 = Release hold in restart state) 789 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 790 */ 791 err_code_t falcon_tsc_rx_restart (const phymod_access_t *pa, uint8_t enable); 792 793 794 /*-----------------------------*/ 795 /* Stop/Resume RX Adaptation */ 796 /*-----------------------------*/ 797 /** Stop RX Adaptation on a Lane. Control is returned only after attempting to stop adaptation. 798 * RX Adaptation needs to be stopped before modifying any of the VGA, PF or DFE taps. 799 * @param pa phymod_access_t struct 800 * @param enable Enable RX Adaptation stop (1 = Stop RX Adaptation on lane; 0 = Resume RX Adaptation on lane) 801 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 802 */ 803 err_code_t falcon_tsc_stop_rx_adaptation (const phymod_access_t *pa, uint8_t enable); 804 805 /** Request to stop RX Adaptation on a Lane. 806 * Control will be returned immediately before adaptaion is completely stopped. 807 * RX Adaptation needs to be stopped before modifying any of the VGA, PF or DFE taps. 808 * To resume RX adaptation, use the falcon_tsc_stop_rx_adaptation() API. 809 * @param pa phymod_access_t struct 810 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 811 */ 812 err_code_t falcon_tsc_request_stop_rx_adaptation (const phymod_access_t *pa); 813 814 /*------------------------------------*/ 815 /* Read/Write all RX AFE parameters */ 816 /*------------------------------------*/ 817 818 /** Write to RX AFE settings. 819 * Note: RX Adaptation needs to be stopped before modifying any of the VGA, PF or DFE taps. 820 * @param pa phymod_access_t struct 821 * @param param Enum (#srds_rx_afe_settings_enum) to select the required RX AFE setting to be modified 822 * @param val Value to be written to the selected AFE setting 823 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 824 */ 825 err_code_t falcon_tsc_write_rx_afe (const phymod_access_t *pa, enum srds_rx_afe_settings_enum param, int8_t val); 826 827 /** Read from RX AFE settings. 828 * @param pa phymod_access_t struct 829 * @param param Enum (#srds_rx_afe_settings_enum) to select the required RX AFE setting to be read 830 * @param *val Value to be written to the selected AFE setting 831 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 832 */ 833 err_code_t falcon_tsc_read_rx_afe (const phymod_access_t *pa, enum srds_rx_afe_settings_enum param, int8_t *val); 834 835 /*----------------------------*/ 836 /* Enable Pattern Generator */ 837 /*----------------------------*/ 838 /** Enable/Disable Shared TX pattern generator. 839 * Note: The patt_length input to the function should be the value sent to the falcon_tsc_config_shared_tx_pattern() function 840 * @param pa phymod_access_t struct 841 * @param enable Enable shared fixed pattern generator (1 = Enable; 0 = Disable) 842 * @param patt_length length of the pattern used in falcon_tsc_config_shared_tx_pattern() 843 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 844 */ 845 err_code_t falcon_tsc_tx_shared_patt_gen_en (const phymod_access_t *pa, uint8_t enable, uint8_t patt_length); 846 847 848 /*----------------------------*/ 849 /* Configure PRBS Functions */ 850 /*----------------------------*/ 851 /** Configure PRBS Generator. 852 * Once the PRBS generator is configured, to enable PRBS use the falcon_tsc_tx_prbs_en() API. 853 * @param pa phymod_access_t struct 854 * @param prbs_poly_mode PRBS generator mode select (selects required PRBS polynomial) 855 * @param prbs_inv PRBS invert enable 856 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 857 */ 858 err_code_t falcon_tsc_config_tx_prbs (const phymod_access_t *pa, enum srds_prbs_polynomial_enum prbs_poly_mode, uint8_t prbs_inv); 859 860 /** Get PRBS Generator Configuration. 861 * @param pa phymod_access_t struct 862 * @param *prbs_poly_mode PRBS generator mode select (selects required PRBS polynomial) 863 * @param *prbs_inv PRBS invert enable 864 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 865 */ 866 err_code_t falcon_tsc_get_tx_prbs_config (const phymod_access_t *pa, enum srds_prbs_polynomial_enum *prbs_poly_mode, uint8_t *prbs_inv); 867 868 /** PRBS Generator Enable/Disable. 869 * @param pa phymod_access_t struct 870 * @param enable Enable PRBS Generator (1 = Enable; 0 = Disable) 871 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 872 */ 873 err_code_t falcon_tsc_tx_prbs_en (const phymod_access_t *pa, uint8_t enable); 874 875 /** Get PRBS Generator Enable/Disable. 876 * @param pa phymod_access_t struct 877 * @param *enable returns the value of Enable PRBS Generator (1 = Enable; 0 = Disable) 878 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 879 */ 880 err_code_t falcon_tsc_get_tx_prbs_en (const phymod_access_t *pa, uint8_t *enable); 881 882 /** PRBS Generator Single Bit Error Injection. 883 * @param pa phymod_access_t struct 884 * @param enable (1 = error is injected; 0 = no error is injected) 885 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 886 */ 887 err_code_t falcon_tsc_tx_prbs_err_inject (const phymod_access_t *pa, uint8_t enable); 888 889 /** Configure PRBS Checker. 890 * Once the PRBS checker is configured, use the falcon_tsc_rx_prbs_en() API to enable the checker. 891 * @param pa phymod_access_t struct 892 * @param prbs_poly_mode PRBS checker mode select (selects required PRBS polynomial) 893 * @param prbs_checker_mode Checker Mode to select PRBS LOCK state machine 894 * @param prbs_inv PRBS invert enable 895 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 896 */ 897 err_code_t falcon_tsc_config_rx_prbs (const phymod_access_t *pa, enum srds_prbs_polynomial_enum prbs_poly_mode, enum srds_prbs_checker_mode_enum prbs_checker_mode, uint8_t prbs_inv); 898 899 /** Get PRBS Checker congifuration. 900 * @param pa phymod_access_t struct 901 * @param *prbs_poly_mode PRBS checker mode select (selects required PRBS polynomial) 902 * @param *prbs_checker_mode Checker Mode to select PRBS LOCK state machine 903 * @param *prbs_inv PRBS invert enable 904 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 905 */ 906 err_code_t falcon_tsc_get_rx_prbs_config (const phymod_access_t *pa, enum srds_prbs_polynomial_enum *prbs_poly_mode, enum srds_prbs_checker_mode_enum *prbs_checker_mode, uint8_t *prbs_inv); 907 908 /** PRBS Checker Enable/Disable. 909 * @param pa phymod_access_t struct 910 * @param enable Enable PRBS Checker (1 = Enable; 0 = Disable) 911 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 912 */ 913 err_code_t falcon_tsc_rx_prbs_en (const phymod_access_t *pa, uint8_t enable); 914 915 /** Get PRBS Checker Enable/Disable. 916 * @param pa phymod_access_t struct 917 * @param *enable returns with the value of Enable PRBS Checker (1 = Enable; 0 = Disable) 918 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 919 */ 920 err_code_t falcon_tsc_get_rx_prbs_en (const phymod_access_t *pa, uint8_t *enable); 921 922 /** PRBS Checker LOCK status (live status). 923 * @param pa phymod_access_t struct 924 * @param *chk_lock Live lock status read by API 925 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 926 */ 927 err_code_t falcon_tsc_prbs_chk_lock_state (const phymod_access_t *pa, uint8_t *chk_lock); 928 929 /** PRBS Error Count and Lock Lost status. 930 * Error count and lock lost read back as a single 32bit value. Bit 31 is lock lost and [30:0] is error count. 931 * @param pa phymod_access_t struct 932 * @param *prbs_err_cnt 32bit value returned by API ([30:0] = Error Count; [31] = Lock lost) 933 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 934 */ 935 err_code_t falcon_tsc_prbs_err_count_ll (const phymod_access_t *pa, uint32_t *prbs_err_cnt); 936 937 /** PRBS Error Count and Lock Lost status. 938 * Error count and lock lost read back on separate variables 939 * @param pa phymod_access_t struct 940 * @param *prbs_err_cnt 32bit Error count value 941 * @param *lock_lost Lock Lost status (1 = if lock was ever lost) 942 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 943 */ 944 err_code_t falcon_tsc_prbs_err_count_state (const phymod_access_t *pa, uint32_t *prbs_err_cnt, uint8_t *lock_lost); 945 946 /*--------------------------------------------------------------*/ 947 /* IDDQ / Powerdown / Deep Powerdown / Isolate Pins */ 948 /*--------------------------------------------------------------*/ 949 /** Lane configurations for IDDQ. 950 * Note: User needs to configure all lanes through falcon_tsc_lane_config_for_iddq() and also call falcon_tsc_core_config_for_iddq() 951 * before enabling IDDQ by asserting IDDQ pin. 952 * @param pa phymod_access_t struct 953 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 954 */ 955 err_code_t falcon_tsc_lane_config_for_iddq (const phymod_access_t *pa); 956 957 /** Serdes Lane Powerdown. 958 * Powers down option available - TX only, RX only, complete LANE, complete lane DEEP, PWR_ON 959 * Note: To wake up from lane DEEP powerdown, first call PWR_ON and then de-assert lane_dp_reset [wr_ln_dp_s_rstb(0x1)]. 960 * @param pa phymod_access_t struct 961 * @param mode Enable/Disable lane powerdown based on #srds_core_pwrdn_mode_enum 962 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 963 */ 964 err_code_t falcon_tsc_lane_pwrdn (const phymod_access_t *pa, enum srds_core_pwrdn_mode_enum mode); 965 966 /** TX_PI Fixed Frequency Mode. 967 * @param pa phymod_access_t struct 968 * @param enable Enable/Disable TX_PI (1 = Enable; 0 = Disable) 969 * @param freq_override_val Fixed Frequency Override value (freq_override_val = desired_ppm*8192/781.25; Range: -8192 to + 8192); 970 * @return Error Code generated by invalid TX_PI settings (returns ERR_CODE_NONE if no errors) 971 */ 972 err_code_t falcon_tsc_tx_pi_freq_override (const phymod_access_t *pa, uint8_t enable, int16_t freq_override_val); 973 974 975 /*--------------------------------------------*/ 976 /* Loopback and Ultra-Low Latency Functions */ 977 /*--------------------------------------------*/ 978 979 /** Locks TX_PI to Loop timing. 980 * @param pa phymod_access_t struct 981 * @param enable Enable TX_PI lock to loop timing (1 = Enable Lock; 0 = Disable Lock) 982 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 983 */ 984 err_code_t falcon_tsc_loop_timing (const phymod_access_t *pa, uint8_t enable); 985 986 /** Enable/Disable Digital Loopback. 987 * @param pa phymod_access_t struct 988 * @param enable Enable Digital Loopback (1 = Enable dig_lpbk; 0 = Disable dig_lpbk) 989 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 990 */ 991 err_code_t falcon_tsc_dig_lpbk (const phymod_access_t *pa, uint8_t enable); 992 993 994 /** Enable/Disable Remote Loopback. 995 * @param pa phymod_access_t struct 996 * @param enable Enable Remote Loopback (1 = Enable rmt_lpbk; 0 = Disable rmt_lpbk) 997 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 998 */ 999 err_code_t falcon_tsc_rmt_lpbk (const phymod_access_t *pa, uint8_t enable); 1000 1001 1002 1003 #endif