soc_mem_bulk.h (3088B)
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 * Header file for SOC memory Bulk API. 9 */ 10 11 #ifndef _SOC_MEM_BULK_H 12 #define _SOC_MEM_BULK_H 13 14 #include <soc/mem.h> 15 16 /*! 17 * Handle for SOC mem bulk operation. 18 */ 19 20 typedef uint32 soc_mem_blk_handle_t; 21 22 /*! 23 * SOC mem bulk operation flags 24 */ 25 26 typedef enum { 27 /*! Init opeartion creates the handle and return as out parameter */ 28 SOC_MEM_BULK_WRITE_INIT = 1, 29 30 /*! 31 * Stage opeartion stages the schan commands in local queue 32 * In case handle is null PIO is used to commit immediately 33 */ 34 SOC_MEM_BULK_WRITE_STAGE, 35 36 /* Commit opeartion will execute the commnand sequence */ 37 SOC_MEM_BULK_WRITE_COMMIT 38 } soc_mem_bulk_write_flags_t; 39 40 /*! 41 * SOC bulk memory opeartion 42 * NO memory read on same index between multiple STAGEs. 43 * Memory cache will only be updated after a successful COMMIT. 44 * Entry_data can be valid or NULL when flags OP is either INIT and COMMIT. 45 * When flags OP is COMMIT: the handle would be deallocated. 46 * When flags OP is COMMIT: is a blocked call till the operation is complete. 47 * Entry_data: size should be less than or equal to 80 words. 48 * No data will be staged during INIT and COMMIT Operation 49 * handle should only be used with the unit for which it is initialized. 50 * 51 * \param [in] unit, Logical device id. 52 * \param [in] flags, Bulk memory op flags. 53 * \param [in, out] handle, handle of soc mem bulk. 54 * \param [in] mem, memory table type. 55 * \param [in] index, index of memory table. 56 * \param [in] copyno, block for memory table. 57 * \param [in] entry_data, buffer pointer of entry data. 58 * 59 * \retval SHR_E_XXX 60 */ 61 62 extern int 63 soc_mem_bulk_op(int unit, 64 int flags, 65 soc_mem_blk_handle_t *handle, 66 soc_mem_t mem, 67 int index, 68 int copyno, 69 uint32 *entry_data); 70 71 72 /*! 73 * Bulk write for memory entry array. 74 * The call will be blocked till all the commands in array are executed. 75 * Same usage as soc_mem_write 76 * 77 * \param [in] unit, Logical device id. 78 * \param [in] mem, array of memory table type. 79 * \param [in] index, array of table index of memory table. 80 * \param [in] copyno, array of block for memory table. 81 * \param [in] entry_data, buffer pointer of entry data. 82 * \param [in] count, count of entry data. 83 * 84 * \retval SHR_E_XXX 85 */ 86 extern int 87 soc_mem_bulk_write(int unit, 88 soc_mem_t *mem, 89 int *index, 90 int *copyno, 91 uint32 **entry_data, 92 int count); 93 94 95 /*! 96 * Bulk mem module init 97 * Initialize the software resources. 98 * 99 * \param [in] unit, Logical device id. 100 * 101 * \retval SHR_E_XXX 102 */ 103 extern int 104 soc_mem_bulk_init(int unit); 105 106 /*! 107 * Bulk mem module cleanup 108 * Cleanup the software resources. 109 * 110 * \param [in] unit, Logical device id. 111 * 112 * \retval SHR_E_XXX 113 */ 114 extern int 115 soc_mem_bulk_cleanup(int unit); 116 117 118 #endif