field_init.h (4377B)
1 /** 2 * \file bcm_int/dnx/field/field_init.h 3 * 4 * Field Processor initialization function for DNX. 5 */ 6 /* 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-2020 Broadcom Inc. All rights reserved. 11 */ 12 13 #ifndef DNX_FIELD_FIELD_INIT_H_INCLUDED 14 /* { */ 15 #define DNX_FIELD_FIELD_INIT_H_INCLUDED 16 17 #ifndef BCM_DNX_SUPPORT 18 #error "This file is for use by DNX (JR2) family only!" 19 #endif 20 21 /* 22 * { Include files 23 */ 24 25 #include <bcm/types.h> 26 27 /* 28 * } Include files 29 */ 30 /* 31 * Defines 32 * { 33 */ 34 /** Tells whether the initial keys in iPMF1 should be set to be copied to iPMF2 in init.*/ 35 #define DNX_FIELD_INIT_COPY_INITIAL_KEYS_TO_IPMF2 0 36 /* 37 * } 38 */ 39 /** 40 * MACROS 41 * { 42 */ 43 /** 44 * This macro is used in 'dnx_field_init_is_L4_profile_table'. 45 * In the registers: IPPC_PMF_PRTOCOL_IS_L_4 and ERRP_PMF_PRTOCOL_IS_L_4. 46 * We put 1 to TCP and UDP protocols because they are L4. 47 */ 48 #define DNX_FIELD_INIT_L4_OPS_INIT_VAL(unit) \ 49 (1 << (dnx_data_field.L4_Ops.udp_position_get(unit))) | ( 1 << (dnx_data_field.L4_Ops.tcp_position_get(unit))) 50 /** 51 * } 52 */ 53 /** 54 * \brief 55 * Initiate the parametrs of SW state 56 * \param [in] unit - Device id 57 * \return 58 * shr_error_e - Error Type 59 * \remark 60 * * None 61 * \see 62 * * None 63 */ 64 shr_error_e dnx_field_init_sw_state( 65 int unit); 66 /** 67 * \brief 68 * De-Initiate the parametrs of SW state 69 * \param [in] unit - Device id 70 * \return 71 * shr_error_e - Error Type 72 * \remark 73 * * None 74 * \see 75 * * None 76 */ 77 shr_error_e dnx_field_deinit_sw_state( 78 int unit); 79 /** 80 * \brief 81 * Init all relevant information for Field module 82 * \param [in] unit - Device ID 83 * \return 84 * shr_error_e - Error Type 85 * \remark 86 * * This procedure is not used any more (replaced by automatic \n 87 * 'init' invocations. See dnx_init_deinit_field_seq[]. 88 * * It is left here in case it is required for diagnostics. 89 * \see 90 * * None 91 */ 92 shr_error_e dnx_field_init( 93 int unit); 94 /** 95 * \brief 96 * Init all relevant information for Field related tables 97 * \param [in] unit - Device ID 98 * \return 99 * shr_error_e - Error Type 100 * \remark 101 * * None 102 * \see 103 * * None 104 */ 105 shr_error_e dnx_field_init_tables( 106 int unit); 107 108 /** 109 * \brief 110 * Inits the system headers in the device, the system headers are pre-defined inside "field_init.c" file. 111 * 112 * \param [in] unit - Device ID 113 * \return 114 * shr_error_e - Error Type 115 * \remark 116 * * None 117 * \see 118 * * None 119 */ 120 shr_error_e dnx_field_system_headers_init( 121 int unit); 122 123 /** 124 * \brief 125 * Inits UDH types length inside the device, the type lengths of the UDH are pre-defined in "DNX_DATA" module. 126 * 127 * \param [in] unit - Device ID 128 * \return 129 * shr_error_e - Error Type 130 * \remark 131 * * None 132 * \see 133 * * None 134 */ 135 shr_error_e dnx_field_udh_init( 136 int unit); 137 138 /** 139 * \brief 140 * run over all DBAL tables that the access type is TCAM, create resources in the TCAM manager and update the tcam 141 * handler to the app_db_id 142 * 143 * \param [in] unit - Device ID 144 * \return 145 * shr_error_e - Error Type 146 * \remark 147 * * None 148 * \see 149 * * None 150 */ 151 shr_error_e dnx_field_init_tcam_fwd_tables( 152 int unit); 153 154 shr_error_e dnx_field_init_tcam_handlers_save( 155 int unit); 156 157 /** 158 * \brief 159 * De-Init all relevant information for Field module 160 * \param [in] unit - Device ID 161 * \return 162 * shr_error_e - Error Type 163 * \remark 164 * * This procedure is not used any more (replaced by automatic \n 165 * 'init' invocations. See dnx_init_deinit_field_seq[]. 166 * * It is left here in case it is required for diagnostics. 167 * \see 168 * * None 169 */ 170 shr_error_e dnx_field_init_deinit( 171 int unit); 172 173 #if DBX_FIELD_BRUTE_FORCE_DEINIT_INIT 174 /* { */ 175 /** 176 * \brief 177 * This procedure takes two steps: \n 178 * De-Init all relevant information for Field module (releases all \n 179 * resources but does not touch HW) \n 180 * Init all relevant SW and HW for Field module \n 181 * See 'remarks' below. 182 * \param [in] unit - Device ID 183 * \return 184 * shr_error_e - Error Type 185 * \remark 186 * * This procedure is required for diagnostics only. 187 * \see 188 * * dnx_field_init_deinit 189 * * dnx_field_init 190 */ 191 shr_error_e dnx_field_init_reinit( 192 int unit); 193 194 /* } */ 195 #endif /* DBX_FIELD_BRUTE_FORCE_DEINIT_INIT */ 196 197 /* } */ 198 #endif /* BCM_DNX_SUPPORT */