1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
14 * The SRAM Table module provides processing of managed SRAM types.
19 * @page tblsram SRAM Table
21 * @ref tf_tbl_sram_bind
23 * @ref tf_tbl_sram_unbind
25 * @ref tf_tbl_sram_alloc
27 * @ref tf_tbl_sram_free
29 * @ref tf_tbl_sram_set
31 * @ref tf_tbl_sram_get
33 * @ref tf_tbl_sram_bulk_get
37 * Initializes the Table module with the requested DBs. Must be
38 * invoked as the first thing before any of the access functions.
41 * Pointer to TF handle, used for HCAPI communication
44 * Pointer to Table configuration parameters
47 * - (0) if successful.
48 * - (-EINVAL) on failure.
50 int tf_tbl_sram_bind(struct tf *tfp);
53 * Cleans up the private DBs and releases all the data.
56 * Pointer to TF handle, used for HCAPI communication
59 * Pointer to parameters
62 * - (0) if successful.
63 * - (-EINVAL) on failure.
65 int tf_tbl_sram_unbind(struct tf *tfp);
68 * Allocates the requested table type from the internal RM DB.
71 * Pointer to TF handle, used for HCAPI communication
74 * Pointer to Table allocation parameters
77 * - (0) if successful.
78 * - (-EINVAL) on failure.
80 int tf_tbl_sram_alloc(struct tf *tfp,
81 struct tf_tbl_alloc_parms *parms);
84 * Free's the requested table type and returns it to the DB. If shadow
85 * DB is enabled its searched first and if found the element refcount
86 * is decremented. If refcount goes to 0 then its returned to the
90 * Pointer to TF handle, used for HCAPI communication
93 * Pointer to Table free parameters
96 * - (0) if successful.
97 * - (-EINVAL) on failure.
99 int tf_tbl_sram_free(struct tf *tfp,
100 struct tf_tbl_free_parms *parms);
104 * Configures the requested element by sending a firmware request which
105 * then installs it into the device internal structures.
108 * Pointer to TF handle, used for HCAPI communication
111 * Pointer to Table set parameters
114 * - (0) if successful.
115 * - (-EINVAL) on failure.
117 int tf_tbl_sram_set(struct tf *tfp,
118 struct tf_tbl_set_parms *parms);
121 * Retrieves the requested element by sending a firmware request to get
125 * Pointer to TF handle, used for HCAPI communication
128 * Pointer to Table get parameters
131 * - (0) if successful.
132 * - (-EINVAL) on failure.
134 int tf_tbl_sram_get(struct tf *tfp,
135 struct tf_tbl_get_parms *parms);
138 * Retrieves bulk block of elements by sending a firmware request to
142 * Pointer to TF handle, used for HCAPI communication
145 * Pointer to Table get bulk parameters
148 * - (0) if successful.
149 * - (-EINVAL) on failure.
151 int tf_tbl_sram_bulk_get(struct tf *tfp,
152 struct tf_tbl_get_bulk_parms *parms);
154 #endif /* TF_TBL_SRAM_H */