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