soc_async_sbusdma.h (4989B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * 8 * File: soc_async_sbusdma.h 9 * Purpose: Maps out structures used for SBUSDMA ASYNC operations and 10 * exports routines. 11 */ 12 13 #ifndef _SOC_ASYNC_SBUSDMA_H 14 #define _SOC_ASYNC_SBUSDMA_H 15 16 #include <soc/defs.h> 17 #include <soc/types.h> 18 #include <sal/types.h> 19 #include <soc/sbusdma.h> 20 #include <soc/soc_async.h> 21 22 23 /******************************************* 24 * @function soc_async_mem_array_sbusdma_write 25 * purpose DMA acceleration for soc_mem_write_range() 26 * If callback function is NULL then the call 27 * will behave as synchronous/Blocked. 28 * 29 * @param unit [in] unit # 30 * @param param [in] soc_sbusdma_reg_param_t pointer 31 * @param cbf [out] soc_async_cb_f, call back function pointer 32 * 33 * @returns SOC_E_BUSY 34 * @returns SOC_E_NONE 35 * 36 * @end 37 */ 38 extern int 39 soc_async_mem_array_sbusdma_write(int unit, 40 soc_sbusdma_reg_param_t *param, soc_async_cb_f cbf); 41 42 43 /******************************************* 44 * @function soc_async_mem_sbusdma_write 45 * purpose DMA acceleration for soc_mem_write_range() 46 * This calls 'soc_mem_array_sbusdma_async_write' 47 * 48 * @param unit [in] unit # 49 * @param param [in] soc_sbusdma_reg_param_t pointer 50 * @param cbf [out] soc_async_cb_f, call back function pointer 51 * 52 * @returns SOC_E_BUSY 53 * @returns SOC_E_NONE 54 * 55 * @end 56 */ 57 extern int 58 soc_async_mem_sbusdma_write(int unit, 59 soc_sbusdma_reg_param_t *param, soc_async_cb_f cbf); 60 61 /******************************************* 62 * @function soc_async_mem_array_sbusdma_read 63 * purpose DMA acceleration for soc_mem_read_range() 64 * If callback function is NULL then the call 65 * will behave as synchronous/Blocked. 66 * 67 * @param unit [in] unit # 68 * @param param [in] soc_sbusdma_reg_param_t pointer 69 * @param cbf [out] soc_async_cb_f, call back function pointer 70 * 71 * @returns SOC_E_BUSY 72 * @returns SOC_E_NONE 73 * 74 * @end 75 */ 76 extern int 77 soc_async_mem_array_sbusdma_read(int unit, 78 soc_sbusdma_reg_param_t *param, soc_async_cb_f cbf); 79 80 81 /******************************************* 82 * @function soc_async_mem_sbusdma_read 83 * purpose DMA acceleration for soc_mem_read_range() 84 * This calls 'soc_mem_array_sbusdma_async_read' 85 * 86 * @param unit [in] unit # 87 * @param param [in] soc_sbusdma_reg_param_t pointer 88 * @param cbf [out] soc_async_cb_f, call back function pointer 89 * 90 * @returns SOC_E_BUSY 91 * @returns SOC_E_NONE 92 * 93 * @end 94 */ 95 extern int 96 soc_async_mem_sbusdma_read(int unit, 97 soc_sbusdma_reg_param_t *param, soc_async_cb_f cbf); 98 99 100 /******************************************* 101 * @function soc_async_mem_sbusdma_clear_specific 102 * purpose Clear a specific memory/table region using 103 * DMA write (slam) acceleration. 104 * If callback function is NULL then the call 105 * will behave as synchronous/Blocked. 106 * 107 * @param unit [in] unit # 108 * @param param [in] soc_sbusdma_reg_param_t pointer 109 * @param cbf [out] soc_async_cb_f, call back function pointer 110 * 111 * @returns SOC_E_BUSY 112 * @returns SOC_E_NONE 113 * 114 * @end 115 */ 116 extern int 117 soc_async_mem_sbusdma_clear_specific(int unit, 118 soc_sbusdma_reg_param_t *param, soc_async_cb_f cbf); 119 120 121 /******************************************* 122 * @function soc_async_mem_sbusdma_clear 123 * This function calls 'soc_mem_sbusdma_async_clear_specific' 124 * This calls 'soc_async_mem_sbusdma_clear_specific' 125 * 126 * @param unit [in] unit # 127 * @param param [in] soc_sbusdma_reg_param_t pointer 128 * @param cbf [out] soc_async_cb_f, call back function pointer 129 * 130 * @returns SOC_E_BUSY 131 * @returns SOC_E_NONE 132 * 133 * @end 134 */ 135 extern int 136 soc_async_mem_sbusdma_clear(int unit, 137 soc_sbusdma_reg_param_t *param, soc_async_cb_f cbf); 138 139 /******************************************* 140 * @function soc_async_sbusdma_ch_try_get 141 * purpose get idle channel on cmc 142 * 143 * @param unit [in] unit # 144 * @param cmc [out] cmc number 0-1 145 * @param ch [out] channel number 0-2 146 * 147 * @returns SOC_E_BUSY 148 * @returns SOC_E_NONE 149 * 150 * @end 151 */ 152 extern int 153 soc_async_sbusdma_ch_try_get(int unit, int cmc, int ch); 154 155 /******************************************* 156 * @function soc_async_sbusdma_ch_put 157 * purpose put back the freed channel on cmc 158 * 159 * @param cmc [in] cmc number 0-1 160 * @param ch [in] channel number 0-2 161 * 162 * @returns SOC_E_PARAM 163 * @returns SOC_E_NONE 164 * 165 * @end 166 */ 167 extern int 168 soc_async_sbusdma_ch_put(int unit, int cmc, int ch); 169 170 /******************************************* 171 * @function soc_async_sbusdma_init 172 * purpose API to Initialize ASYNC SBUS DMA 173 * 174 * @param unit [in] unit 175 * @param prop [in] soc_async_prop_t pointer 176 * 177 * @returns SOC_E_NONE 178 * @returns SOC_E_XXX 179 * 180 * @end 181 */ 182 extern int 183 soc_async_sbusdma_init(int unit, soc_async_prop_t *prop); 184 185 /******************************************* 186 * @function soc_async_sbusdma_deinit 187 * purpose API to DeInitialize ASYNC SBUS DMA 188 * 189 * @param unit [in] unit 190 * 191 * @returns SOC_E_NONE 192 * @returns SOC_E_XXX 193 * 194 * @end 195 */ 196 extern int 197 soc_async_sbusdma_deinit(int unit); 198 199 #endif 200