mdb_init.h (2941B)
1 /* 2 * ! \file mdb_init.h $Id$ Contains all the MDB initialize files includes. 3 */ 4 /* 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 8 */ 9 10 #ifndef MDB_H_INIT_INCLUDED 11 /* 12 * { 13 */ 14 #define MDB_H_INIT_INCLUDED 15 16 /* 17 * Include files. 18 * { 19 */ 20 #include <shared/swstate/sw_state.h> 21 #include <soc/dnx/swstate/auto_generated/access/mdb_access.h> 22 #include <soc/dnx/swstate/auto_generated/types/mdb_types.h> 23 #include <soc/dnx/dnx_data/auto_generated/dnx_data_mdb.h> 24 #include <shared/shrextend/shrextend_debug.h> 25 #include <soc/dnx/dbal/auto_generated/dbal_defines_fields.h> 26 #include <soc/dnx/mdb.h> 27 /* 28 * } 29 */ 30 31 /* 32 * DEFINEs 33 * { 34 */ 35 #define MDB_LPM_MAX_FMT (11) 36 #define MDB_LPM_NOF_FMT_BITS (4) 37 #define MDB_LPM_MIN_FMT (1) 38 #define MDB_NOF_DIRECT_FMT (32) 39 40 41 #define MDB_BPU_MODE_BITS (3) 42 #define MDB_BPU_MODE_LPM (0) 43 #define MDB_BPU_MODE_TCAM (1) 44 #define MDB_BPU_MODE_EM_120 (2) 45 #define MDB_BPU_MODE_EM_240 (3) 46 #define MDB_BPU_MODE_DIRECT_120 (4) 47 #define MDB_BPU_MODE_DIRECT_240 (5) 48 49 /* 50 * } 51 */ 52 53 /* 54 * MACROs 55 * { 56 */ 57 58 #define MDB_DIRECT_ROW_SIZE_TO_DIVIDER(_row_size) ((_row_size / MDB_NOF_CLUSTER_ROW_BITS) - 1) 59 60 #define MDB_CALC_FEC_BANK_SIZE(unit,bank_id) (MDB_CALC_FEC_ID_START_ADDR_OF_BANK_ID(unit,(bank_id+1)) - MDB_CALC_FEC_ID_START_ADDR_OF_BANK_ID(unit,bank_id)) 61 62 /* 63 * } 64 */ 65 66 /* 67 * ENUMs 68 * { 69 */ 70 71 /* 72 * } 73 */ 74 75 /* 76 * Structures 77 * { 78 */ 79 80 /* 81 * } 82 */ 83 /* 84 * Globals 85 * { 86 */ 87 88 /* 89 * } 90 */ 91 /* 92 * Externs 93 * { 94 */ 95 96 /* 97 * Function headers 98 * { 99 */ 100 shr_error_e mdb_init_add_table_resources( 101 int unit, 102 int nof_valid_clusters, 103 mdb_cluster_alloc_info_t clusters[MDB_MAX_NOF_CLUSTERS]); 104 shr_error_e mdb_init_delete_table_resources( 105 int unit, 106 int nof_valid_clusters, 107 mdb_cluster_alloc_info_t clusters[MDB_MAX_NOF_CLUSTERS]); 108 shr_error_e mdb_dh_init( 109 int unit); 110 111 shr_error_e mdb_step_table_init( 112 int unit); 113 114 shr_error_e mdb_dh_init_table( 115 int unit, 116 dbal_enum_value_field_mdb_physical_table_e mdb_physical_table_id); 117 118 shr_error_e mdb_dh_init_table_em_encoding( 119 int unit, 120 dbal_physical_tables_e dbal_physical_table_id); 121 122 shr_error_e mdb_init_update_vmv( 123 int unit, 124 dbal_physical_tables_e dbal_physical_table_id); 125 126 shr_error_e mdb_init_dh_add_em_format( 127 int unit, 128 uint32 key_size, 129 dbal_physical_tables_e dbal_physical_table_id); 130 131 shr_error_e mdb_dh_set_bpu_setting( 132 int unit); 133 134 shr_error_e mdb_init_em_logical_table( 135 int unit, 136 dbal_tables_e dbal_table, 137 const dbal_logical_table_t * dbal_logical_table); 138 139 shr_error_e mdb_init_logical_table( 140 int unit, 141 dbal_tables_e dbal_table, 142 void *access_info); 143 144 /* 145 * } 146 */ 147 #endif /* !MDB_H_INIT_INCLUDED */