merlin16_pcieg3_debug_functions.h (9045B)
1 /***************************************************************************************** 2 ***************************************************************************************** 3 * * 4 * Revision : * 5 * * 6 * Description : Functions used internally and available in debug shell only * 7 * * 8 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 9 * 10 * Copyright 2007-2019 Broadcom Inc. All rights reserved. * 11 * No portions of this material may be reproduced in any form without * 12 * the written permission of: * 13 * Broadcom Corporation * 14 * 5300 California Avenue * 15 * Irvine, CA 92617 * 16 * * 17 * All information contained in this document is Broadcom Corporation * 18 * company private proprietary, and trade secret. * 19 */ 20 21 /** @file merlin16_pcieg3_debug_functions.h 22 * Functions used internally and available in debug shell only 23 */ 24 25 #ifndef MERLIN16_PCIEG3_DEBUG_FUNCTIONS_H 26 #define MERLIN16_PCIEG3_DEBUG_FUNCTIONS_H 27 28 #include "merlin16_pcieg3_ipconfig.h" 29 #include "common/srds_api_enum.h" 30 #include "common/srds_api_err_code.h" 31 #include "common/srds_api_uc_common.h" 32 #include "merlin16_pcieg3_dependencies.h" 33 #include "merlin16_pcieg3_types.h" 34 #include "merlin16_pcieg3_usr_includes.h" 35 36 /** Isolate Control pins. 37 * Can be used for debug to avoid any interference from inputs coming through pins. 38 * @param sa__ is an opaque state vector passed through to device access functions. 39 * @param enable Isolate pins enable (1 = Isolate pins; 0 = Pins not isolated) 40 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 41 */ 42 err_code_t merlin16_pcieg3_isolate_ctrl_pins(srds_access_t *sa__, uint8_t enable); 43 44 /** Isolate Lane Control pins. 45 * Can be used for debug to avoid any interference from inputs coming through pins. 46 * @param sa__ is an opaque state vector passed through to device access functions. 47 * @param enable Isolate pins enable (1 = Isolate pins; 0 = Pins not isolated) 48 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 49 */ 50 err_code_t merlin16_pcieg3_isolate_lane_ctrl_pins(srds_access_t *sa__, uint8_t enable); 51 52 /** Isolate Core Control pins. 53 * Can be used for debug to avoid any interference from inputs coming through pins. 54 * @param sa__ is an opaque state vector passed through to device access functions. 55 * @param enable Isolate pins enable (1 = Isolate pins; 0 = Pins not isolated) 56 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 57 */ 58 err_code_t merlin16_pcieg3_isolate_core_ctrl_pins(srds_access_t *sa__, uint8_t enable); 59 60 /*-----------------------*/ 61 /* Stop/Resume uC Lane */ 62 /*-----------------------*/ 63 /** Stop/Resume Micro operations on a Lane (Graceful Stop). 64 * @param sa__ is an opaque state vector passed through to device access functions. 65 * @param enable Enable micro lane stop (1 = Stop Micro opetarions on lane; 0 = Resume Micro operations on lane) 66 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 67 */ 68 err_code_t merlin16_pcieg3_stop_uc_lane(srds_access_t *sa__, uint8_t enable); 69 70 /** Status of whether Micro is stopped on a lane. 71 * @param sa__ is an opaque state vector passed through to device access functions. 72 * @param *uc_lane_stopped Micro lane stopped status returned by API 73 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 74 */ 75 err_code_t merlin16_pcieg3_stop_uc_lane_status(srds_access_t *sa__, uint8_t *uc_lane_stopped); 76 77 78 /*-------------------------------------------*/ 79 /* Registers and Core uC RAM Variable Dump */ 80 /*-------------------------------------------*/ 81 /** Display values of both Core level and (currently selected) Lane level Registers. 82 * @param sa__ is an opaque state vector passed through to device access functions. 83 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 84 */ 85 err_code_t merlin16_pcieg3_reg_dump(srds_access_t *sa__); 86 87 /** Display values of all Core uC RAM Variables (Core RAM Variable Dump). 88 * @param sa__ is an opaque state vector passed through to device access functions. 89 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 90 */ 91 err_code_t merlin16_pcieg3_uc_core_var_dump(srds_access_t *sa__); 92 93 94 /*-----------------------------*/ 95 /* uC RAM Lane Variable Dump */ 96 /*-----------------------------*/ 97 /** Display values of all Lane uC RAM Variables (Lane RAM Variable Dump). 98 * @param sa__ is an opaque state vector passed through to device access functions. 99 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 100 */ 101 err_code_t merlin16_pcieg3_uc_lane_var_dump(srds_access_t *sa__); 102 103 104 /*--------------------------*/ 105 /* TX_PI Jitter Generation */ 106 /*--------------------------*/ 107 108 /** Generate TX_PI Sinusoidal or Spread-Spectrum (SSC) jitter. 109 * @param sa__ is an opaque state vector passed through to device access functions. 110 * @param enable Enable/Disable jitter generation (1 = Enable; 0 = Disable) 111 * @param freq_override_val Fixed Frequency Override value (-8192 to + 8192) 112 * @param jit_type Jitter generation mode 113 * @param tx_pi_jit_freq_idx Jitter generation frequency index (0 to 63) [see spec for more details] 114 * @param tx_pi_jit_amp Jitter generation amplification factor (0 to 63) [max value of this register depends on tx_pi_jit_freq_idx and freq_override values] 115 * @return Error Code generated by invalid TX_PI settings (returns ERR_CODE_NONE if no errors) 116 */ 117 err_code_t merlin16_pcieg3_tx_pi_jitt_gen(srds_access_t *sa__, uint8_t enable, int16_t freq_override_val, enum srds_tx_pi_freq_jit_gen_enum jit_type, uint8_t tx_pi_jit_freq_idx, uint8_t tx_pi_jit_amp); 118 119 120 /*-------------*/ 121 /* Event Log */ 122 /*-------------*/ 123 /** Get Event Log from uC. 124 * Dump uC events from core memory. 125 * @param sa__ is an opaque state vector passed through to device access functions. 126 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 127 */ 128 err_code_t merlin16_pcieg3_read_event_log(srds_access_t *sa__); 129 130 /** Write to usr_ctrl_lane_event_log_level uC RAM variable. 131 * Note: This function should be used only during configuration under dp_reset. 132 * @param sa__ is an opaque state vector passed through to device access functions. 133 * @param lane_event_log_level Value to be written into usr_ctrl_lane_event_log_level RAM variable 134 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 135 */ 136 err_code_t merlin16_pcieg3_set_usr_ctrl_lane_event_log_level(srds_access_t *sa__, uint8_t lane_event_log_level); 137 138 /** Read value of usr_ctrl_lane_event_log_level uC RAM variable. 139 * @param sa__ is an opaque state vector passed through to device access functions. 140 * @param *lane_event_log_level Value read from usr_ctrl_lane_event_log_level RAM variable 141 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 142 */ 143 err_code_t merlin16_pcieg3_get_usr_ctrl_lane_event_log_level(srds_access_t *sa__, uint8_t *lane_event_log_level); 144 145 /** Write to usr_ctrl_core_event_log_level uC RAM variable. 146 * @param sa__ is an opaque state vector passed through to device access functions. 147 * @param core_event_log_level Value to be written into the usr_ctrl_core_event_log_level RAM variable 148 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 149 */ 150 err_code_t merlin16_pcieg3_set_usr_ctrl_core_event_log_level(srds_access_t *sa__, uint8_t core_event_log_level); 151 152 /** Read value of usr_ctrl_core_event_log_level uC RAM variable. 153 * @param sa__ is an opaque state vector passed through to device access functions. 154 * @param *core_event_log_level Value read from usr_ctrl_core_event_log_level RAM variable 155 * @return Error Code, if generated (returns ERR_CODE_NONE if no errors) 156 */ 157 err_code_t merlin16_pcieg3_get_usr_ctrl_core_event_log_level(srds_access_t *sa__, uint8_t *core_event_log_level); 158 159 160 /*------------------------------*/ 161 /* Digital Loopback Functions */ 162 /*------------------------------*/ 163 164 /** Enable/Disable Digital Loopback. 165 * @param sa__ is an opaque state vector passed through to device access functions. 166 * @param enable Enable Digital Loopback (1 = Enable dig_lpbk; 0 = Disable dig_lpbk) 167 * @return Error Code generated by API (returns ERR_CODE_NONE if no errors) 168 */ 169 err_code_t merlin16_pcieg3_dig_lpbk(srds_access_t *sa__, uint8_t enable); 170 171 172 #endif