1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2020 Broadcom
6 #ifndef TF_GLOBAL_CFG_H_
7 #define TF_GLOBAL_CFG_H_
13 * The global cfg module provides processing of global cfg types.
19 * Global cfg configuration enumeration.
21 enum tf_global_cfg_cfg_type {
25 TF_GLOBAL_CFG_CFG_NULL,
29 TF_GLOBAL_CFG_CFG_HCAPI,
33 * Global cfg configuration structure, used by the Device to configure
34 * how an individual global cfg type is configured in regard to the HCAPI type.
36 struct tf_global_cfg_cfg {
38 * Global cfg config controls how the DB for that element is
41 enum tf_global_cfg_cfg_type cfg_type;
44 * HCAPI Type for the element. Used for TF to HCAPI type
51 * Global Cfg configuration parameters
53 struct tf_global_cfg_cfg_parms {
55 * Number of table types in the configuration array
57 uint16_t num_elements;
59 * Table Type element configuration array
61 struct tf_global_cfg_cfg *cfg;
65 * global cfg parameters
67 struct tf_dev_global_cfg_parms {
69 * [in] Receive or transmit direction
73 * [in] Global config type
75 enum tf_global_config_type type;
77 * [in] Offset @ the type
81 * [in/out] Value of the configuration
82 * set - Read, Modify and Write
83 * get - Read the full configuration
87 * [in] struct containing size
89 uint16_t config_sz_in_bytes;
95 * @ref tf_global_cfg_bind
97 * @ref tf_global_cfg_unbind
99 * @ref tf_global_cfg_set
101 * @ref tf_global_cfg_get
105 * Initializes the Global Cfg module with the requested DBs. Must be
106 * invoked as the first thing before any of the access functions.
109 * Pointer to TF handle
112 * Pointer to Global Cfg configuration parameters
115 * - (0) if successful.
116 * - (-EINVAL) on failure.
119 tf_global_cfg_bind(struct tf *tfp,
120 struct tf_global_cfg_cfg_parms *parms);
123 * Cleans up the private DBs and releases all the data.
126 * Pointer to TF handle
129 * Pointer to Global Cfg configuration parameters
132 * - (0) if successful.
133 * - (-EINVAL) on failure.
136 tf_global_cfg_unbind(struct tf *tfp);
139 * Updates the global configuration table
142 * Pointer to TF handle, used for HCAPI communication
145 * Pointer to global cfg parameters
148 * - (0) if successful.
149 * - (-EINVAL) on failure.
151 int tf_global_cfg_set(struct tf *tfp,
152 struct tf_dev_global_cfg_parms *parms);
155 * Get global configuration
158 * Pointer to TF handle, used for HCAPI communication
161 * Pointer to global cfg parameters
164 * - (0) if successful.
165 * - (-EINVAL) on failure.
167 int tf_global_cfg_get(struct tf *tfp,
168 struct tf_dev_global_cfg_parms *parms);
170 #endif /* TF_GLOBAL_CFG_H */