.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | | - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify it |
---|
5 | | - * under the terms and conditions of the GNU General Public License, |
---|
6 | | - * version 2, as published by the Free Software Foundation. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
9 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
10 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
11 | | - * more details. |
---|
12 | | - * |
---|
13 | | - * You should have received a copy of the GNU General Public License |
---|
14 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
| 3 | + * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. |
---|
15 | 4 | */ |
---|
16 | 5 | |
---|
17 | | -#ifndef _ABI_BPMP_ABI_H_ |
---|
18 | | -#define _ABI_BPMP_ABI_H_ |
---|
| 6 | +#ifndef ABI_BPMP_ABI_H |
---|
| 7 | +#define ABI_BPMP_ABI_H |
---|
19 | 8 | |
---|
20 | | -#ifdef LK |
---|
| 9 | +#if defined(LK) || defined(BPMP_ABI_HAVE_STDC) |
---|
| 10 | +#include <stddef.h> |
---|
21 | 11 | #include <stdint.h> |
---|
22 | 12 | #endif |
---|
23 | 13 | |
---|
24 | | -#ifndef __ABI_PACKED |
---|
25 | | -#define __ABI_PACKED __attribute__((packed)) |
---|
| 14 | +#ifndef BPMP_ABI_PACKED |
---|
| 15 | +#ifdef __ABI_PACKED |
---|
| 16 | +#define BPMP_ABI_PACKED __ABI_PACKED |
---|
| 17 | +#else |
---|
| 18 | +#define BPMP_ABI_PACKED __attribute__((packed)) |
---|
| 19 | +#endif |
---|
26 | 20 | #endif |
---|
27 | 21 | |
---|
28 | 22 | #ifdef NO_GCC_EXTENSIONS |
---|
29 | | -#define EMPTY char empty; |
---|
30 | | -#define EMPTY_ARRAY 1 |
---|
| 23 | +#define BPMP_ABI_EMPTY char empty; |
---|
| 24 | +#define BPMP_ABI_EMPTY_ARRAY 1 |
---|
31 | 25 | #else |
---|
32 | | -#define EMPTY |
---|
33 | | -#define EMPTY_ARRAY 0 |
---|
| 26 | +#define BPMP_ABI_EMPTY |
---|
| 27 | +#define BPMP_ABI_EMPTY_ARRAY 0 |
---|
34 | 28 | #endif |
---|
35 | 29 | |
---|
36 | | -#ifndef __UNION_ANON |
---|
37 | | -#define __UNION_ANON |
---|
| 30 | +#ifndef BPMP_UNION_ANON |
---|
| 31 | +#ifdef __UNION_ANON |
---|
| 32 | +#define BPMP_UNION_ANON __UNION_ANON |
---|
| 33 | +#else |
---|
| 34 | +#define BPMP_UNION_ANON |
---|
38 | 35 | #endif |
---|
| 36 | +#endif |
---|
| 37 | + |
---|
39 | 38 | /** |
---|
40 | 39 | * @file |
---|
41 | 40 | */ |
---|
42 | | - |
---|
43 | 41 | |
---|
44 | 42 | /** |
---|
45 | 43 | * @defgroup MRQ MRQ Messages |
---|
.. | .. |
---|
53 | 51 | */ |
---|
54 | 52 | |
---|
55 | 53 | /** |
---|
56 | | - * @addtogroup MRQ_Format Message Format |
---|
| 54 | + * @addtogroup MRQ_Format |
---|
57 | 55 | * @{ |
---|
58 | 56 | * The CPU requests the BPMP to perform a particular service by |
---|
59 | 57 | * sending it an IVC frame containing a single MRQ message. An MRQ |
---|
.. | .. |
---|
76 | 74 | |
---|
77 | 75 | /** |
---|
78 | 76 | * @ingroup MRQ_Format |
---|
79 | | - * @brief header for an MRQ message |
---|
| 77 | + * @brief Header for an MRQ message |
---|
80 | 78 | * |
---|
81 | 79 | * Provides the MRQ number for the MRQ message: #mrq. The remainder of |
---|
82 | 80 | * the MRQ message is a payload (immediately following the |
---|
.. | .. |
---|
85 | 83 | struct mrq_request { |
---|
86 | 84 | /** @brief MRQ number of the request */ |
---|
87 | 85 | uint32_t mrq; |
---|
| 86 | + |
---|
88 | 87 | /** |
---|
89 | | - * @brief flags providing follow up directions to the receiver |
---|
| 88 | + * @brief Flags providing follow up directions to the receiver |
---|
90 | 89 | * |
---|
91 | 90 | * | Bit | Description | |
---|
92 | 91 | * |-----|--------------------------------------------| |
---|
.. | .. |
---|
94 | 93 | * | 0 | should be 1 | |
---|
95 | 94 | */ |
---|
96 | 95 | uint32_t flags; |
---|
97 | | -} __ABI_PACKED; |
---|
| 96 | +} BPMP_ABI_PACKED; |
---|
98 | 97 | |
---|
99 | 98 | /** |
---|
100 | 99 | * @ingroup MRQ_Format |
---|
101 | | - * @brief header for an MRQ response |
---|
| 100 | + * @brief Header for an MRQ response |
---|
102 | 101 | * |
---|
103 | 102 | * Provides an error code for the associated MRQ message. The |
---|
104 | 103 | * remainder of the MRQ response is a payload (immediately following |
---|
.. | .. |
---|
106 | 105 | * mrq_request::mrq |
---|
107 | 106 | */ |
---|
108 | 107 | struct mrq_response { |
---|
109 | | - /** @brief error code for the MRQ request itself */ |
---|
| 108 | + /** @brief Error code for the MRQ request itself */ |
---|
110 | 109 | int32_t err; |
---|
111 | | - /** @brief reserved for future use */ |
---|
| 110 | + /** @brief Reserved for future use */ |
---|
112 | 111 | uint32_t flags; |
---|
113 | | -} __ABI_PACKED; |
---|
| 112 | +} BPMP_ABI_PACKED; |
---|
114 | 113 | |
---|
115 | 114 | /** |
---|
116 | 115 | * @ingroup MRQ_Format |
---|
117 | 116 | * Minimum needed size for an IPC message buffer |
---|
118 | 117 | */ |
---|
119 | | -#define MSG_MIN_SZ 128 |
---|
| 118 | +#define MSG_MIN_SZ 128U |
---|
120 | 119 | /** |
---|
121 | 120 | * @ingroup MRQ_Format |
---|
122 | 121 | * Minimum size guaranteed for data in an IPC message buffer |
---|
123 | 122 | */ |
---|
124 | | -#define MSG_DATA_MIN_SZ 120 |
---|
| 123 | +#define MSG_DATA_MIN_SZ 120U |
---|
125 | 124 | |
---|
126 | 125 | /** |
---|
127 | 126 | * @ingroup MRQ_Codes |
---|
.. | .. |
---|
130 | 129 | * @{ |
---|
131 | 130 | */ |
---|
132 | 131 | |
---|
133 | | -#define MRQ_PING 0 |
---|
134 | | -#define MRQ_QUERY_TAG 1 |
---|
135 | | -#define MRQ_MODULE_LOAD 4 |
---|
136 | | -#define MRQ_MODULE_UNLOAD 5 |
---|
137 | | -#define MRQ_TRACE_MODIFY 7 |
---|
138 | | -#define MRQ_WRITE_TRACE 8 |
---|
139 | | -#define MRQ_THREADED_PING 9 |
---|
140 | | -#define MRQ_MODULE_MAIL 11 |
---|
141 | | -#define MRQ_DEBUGFS 19 |
---|
142 | | -#define MRQ_RESET 20 |
---|
143 | | -#define MRQ_I2C 21 |
---|
144 | | -#define MRQ_CLK 22 |
---|
145 | | -#define MRQ_QUERY_ABI 23 |
---|
146 | | -#define MRQ_PG_READ_STATE 25 |
---|
147 | | -#define MRQ_PG_UPDATE_STATE 26 |
---|
148 | | -#define MRQ_THERMAL 27 |
---|
149 | | -#define MRQ_CPU_VHINT 28 |
---|
150 | | -#define MRQ_ABI_RATCHET 29 |
---|
151 | | -#define MRQ_EMC_DVFS_LATENCY 31 |
---|
152 | | -#define MRQ_TRACE_ITER 64 |
---|
153 | | -#define MRQ_RINGBUF_CONSOLE 65 |
---|
154 | | -#define MRQ_PG 66 |
---|
| 132 | +#define MRQ_PING 0U |
---|
| 133 | +#define MRQ_QUERY_TAG 1U |
---|
| 134 | +#define MRQ_MODULE_LOAD 4U |
---|
| 135 | +#define MRQ_MODULE_UNLOAD 5U |
---|
| 136 | +#define MRQ_TRACE_MODIFY 7U |
---|
| 137 | +#define MRQ_WRITE_TRACE 8U |
---|
| 138 | +#define MRQ_THREADED_PING 9U |
---|
| 139 | +#define MRQ_MODULE_MAIL 11U |
---|
| 140 | +#define MRQ_DEBUGFS 19U |
---|
| 141 | +#define MRQ_RESET 20U |
---|
| 142 | +#define MRQ_I2C 21U |
---|
| 143 | +#define MRQ_CLK 22U |
---|
| 144 | +#define MRQ_QUERY_ABI 23U |
---|
| 145 | +#define MRQ_PG_READ_STATE 25U |
---|
| 146 | +#define MRQ_PG_UPDATE_STATE 26U |
---|
| 147 | +#define MRQ_THERMAL 27U |
---|
| 148 | +#define MRQ_CPU_VHINT 28U |
---|
| 149 | +#define MRQ_ABI_RATCHET 29U |
---|
| 150 | +#define MRQ_EMC_DVFS_LATENCY 31U |
---|
| 151 | +#define MRQ_TRACE_ITER 64U |
---|
| 152 | +#define MRQ_RINGBUF_CONSOLE 65U |
---|
| 153 | +#define MRQ_PG 66U |
---|
| 154 | +#define MRQ_CPU_NDIV_LIMITS 67U |
---|
| 155 | +#define MRQ_STRAP 68U |
---|
| 156 | +#define MRQ_UPHY 69U |
---|
| 157 | +#define MRQ_CPU_AUTO_CC3 70U |
---|
| 158 | +#define MRQ_QUERY_FW_TAG 71U |
---|
| 159 | +#define MRQ_FMON 72U |
---|
| 160 | +#define MRQ_EC 73U |
---|
| 161 | +#define MRQ_DEBUG 75U |
---|
155 | 162 | |
---|
156 | 163 | /** @} */ |
---|
157 | 164 | |
---|
.. | .. |
---|
160 | 167 | * @brief Maximum MRQ code to be sent by CPU software to |
---|
161 | 168 | * BPMP. Subject to change in future |
---|
162 | 169 | */ |
---|
163 | | -#define MAX_CPU_MRQ_ID 66 |
---|
| 170 | +#define MAX_CPU_MRQ_ID 75U |
---|
164 | 171 | |
---|
165 | 172 | /** |
---|
166 | | - * @addtogroup MRQ_Payloads Message Payloads |
---|
| 173 | + * @addtogroup MRQ_Payloads |
---|
167 | 174 | * @{ |
---|
168 | | - * @defgroup Ping |
---|
| 175 | + * @defgroup Ping Ping |
---|
169 | 176 | * @defgroup Query_Tag Query Tag |
---|
170 | 177 | * @defgroup Module Loadable Modules |
---|
171 | | - * @defgroup Trace |
---|
172 | | - * @defgroup Debugfs |
---|
173 | | - * @defgroup Reset |
---|
174 | | - * @defgroup I2C |
---|
175 | | - * @defgroup Clocks |
---|
| 178 | + * @defgroup Trace Trace |
---|
| 179 | + * @defgroup Debugfs Debug File System |
---|
| 180 | + * @defgroup Reset Reset |
---|
| 181 | + * @defgroup I2C I2C |
---|
| 182 | + * @defgroup Clocks Clocks |
---|
176 | 183 | * @defgroup ABI_info ABI Info |
---|
177 | | - * @defgroup MC_Flush MC Flush |
---|
178 | | - * @defgroup Powergating |
---|
179 | | - * @defgroup Thermal |
---|
| 184 | + * @defgroup Powergating Power Gating |
---|
| 185 | + * @defgroup Thermal Thermal |
---|
180 | 186 | * @defgroup Vhint CPU Voltage hint |
---|
181 | | - * @defgroup MRQ_Deprecated Deprecated MRQ messages |
---|
182 | | - * @defgroup EMC |
---|
183 | | - * @defgroup RingbufConsole |
---|
| 187 | + * @defgroup EMC EMC |
---|
| 188 | + * @defgroup CPU NDIV Limits |
---|
| 189 | + * @defgroup RingbufConsole Ring Buffer Console |
---|
| 190 | + * @defgroup Strap Straps |
---|
| 191 | + * @defgroup UPHY UPHY |
---|
| 192 | + * @defgroup CC3 Auto-CC3 |
---|
| 193 | + * @defgroup FMON FMON |
---|
| 194 | + * @defgroup EC EC |
---|
| 195 | + * @defgroup Fbvolt_status Fuse Burn Voltage Status |
---|
184 | 196 | * @} |
---|
185 | 197 | */ |
---|
186 | | - |
---|
187 | 198 | |
---|
188 | 199 | /** |
---|
189 | 200 | * @ingroup MRQ_Codes |
---|
.. | .. |
---|
214 | 225 | |
---|
215 | 226 | /** |
---|
216 | 227 | * @ingroup Ping |
---|
217 | | - * @brief request with #MRQ_PING |
---|
| 228 | + * @brief Request with #MRQ_PING |
---|
218 | 229 | * |
---|
219 | 230 | * Used by the sender of an #MRQ_PING message to request a pong from |
---|
220 | 231 | * recipient. The response from the recipient is computed based on |
---|
221 | 232 | * #challenge. |
---|
222 | 233 | */ |
---|
223 | 234 | struct mrq_ping_request { |
---|
224 | | -/** @brief arbitrarily chosen value */ |
---|
| 235 | +/** @brief Arbitrarily chosen value */ |
---|
225 | 236 | uint32_t challenge; |
---|
226 | | -} __ABI_PACKED; |
---|
| 237 | +} BPMP_ABI_PACKED; |
---|
227 | 238 | |
---|
228 | 239 | /** |
---|
229 | 240 | * @ingroup Ping |
---|
230 | | - * @brief response to #MRQ_PING |
---|
| 241 | + * @brief Response to #MRQ_PING |
---|
231 | 242 | * |
---|
232 | 243 | * Sent in response to an #MRQ_PING message. #reply should be the |
---|
233 | 244 | * mrq_ping_request challenge left shifted by 1 with the carry-bit |
---|
.. | .. |
---|
235 | 246 | * |
---|
236 | 247 | */ |
---|
237 | 248 | struct mrq_ping_response { |
---|
238 | | - /** @brief response to the MRQ_PING challege */ |
---|
| 249 | + /** @brief Response to the MRQ_PING challege */ |
---|
239 | 250 | uint32_t reply; |
---|
240 | | -} __ABI_PACKED; |
---|
| 251 | +} BPMP_ABI_PACKED; |
---|
241 | 252 | |
---|
242 | 253 | /** |
---|
243 | 254 | * @ingroup MRQ_Codes |
---|
244 | 255 | * @def MRQ_QUERY_TAG |
---|
245 | | - * @brief Query BPMP firmware's tag (i.e. version information) |
---|
| 256 | + * @brief Query BPMP firmware's tag (i.e. unique identifer) |
---|
| 257 | + * |
---|
| 258 | + * @deprecated Use #MRQ_QUERY_FW_TAG instead. |
---|
246 | 259 | * |
---|
247 | 260 | * * Platforms: All |
---|
248 | 261 | * * Initiators: CCPLEX |
---|
.. | .. |
---|
254 | 267 | |
---|
255 | 268 | /** |
---|
256 | 269 | * @ingroup Query_Tag |
---|
257 | | - * @brief request with #MRQ_QUERY_TAG |
---|
| 270 | + * @brief Request with #MRQ_QUERY_TAG |
---|
258 | 271 | * |
---|
259 | | - * Used by #MRQ_QUERY_TAG call to ask BPMP to fill in the memory |
---|
260 | | - * pointed by #addr with BPMP firmware header. |
---|
261 | | - * |
---|
262 | | - * The sender is reponsible for ensuring that #addr is mapped in to |
---|
263 | | - * the recipient's address map. |
---|
| 272 | + * @deprecated This structure will be removed in future version. |
---|
| 273 | + * Use MRQ_QUERY_FW_TAG instead. |
---|
264 | 274 | */ |
---|
265 | 275 | struct mrq_query_tag_request { |
---|
266 | | - /** @brief base address to store the firmware header */ |
---|
| 276 | + /** @brief Base address to store the firmware tag */ |
---|
267 | 277 | uint32_t addr; |
---|
268 | | -} __ABI_PACKED; |
---|
| 278 | +} BPMP_ABI_PACKED; |
---|
| 279 | + |
---|
| 280 | + |
---|
| 281 | +/** |
---|
| 282 | + * @ingroup MRQ_Codes |
---|
| 283 | + * @def MRQ_QUERY_FW_TAG |
---|
| 284 | + * @brief Query BPMP firmware's tag (i.e. unique identifier) |
---|
| 285 | + * |
---|
| 286 | + * * Platforms: All |
---|
| 287 | + * * Initiators: Any |
---|
| 288 | + * * Targets: BPMP |
---|
| 289 | + * * Request Payload: N/A |
---|
| 290 | + * * Response Payload: @ref mrq_query_fw_tag_response |
---|
| 291 | + * |
---|
| 292 | + */ |
---|
| 293 | + |
---|
| 294 | +/** |
---|
| 295 | + * @ingroup Query_Tag |
---|
| 296 | + * @brief Response to #MRQ_QUERY_FW_TAG |
---|
| 297 | + * |
---|
| 298 | + * Sent in response to #MRQ_QUERY_FW_TAG message. #tag contains the unique |
---|
| 299 | + * identifier for the version of firmware issuing the reply. |
---|
| 300 | + * |
---|
| 301 | + */ |
---|
| 302 | +struct mrq_query_fw_tag_response { |
---|
| 303 | + /** @brief Array to store tag information */ |
---|
| 304 | + uint8_t tag[32]; |
---|
| 305 | +} BPMP_ABI_PACKED; |
---|
269 | 306 | |
---|
270 | 307 | /** |
---|
271 | 308 | * @ingroup MRQ_Codes |
---|
272 | 309 | * @def MRQ_MODULE_LOAD |
---|
273 | | - * @brief dynamically load a BPMP code module |
---|
| 310 | + * @brief Dynamically load a BPMP code module |
---|
274 | 311 | * |
---|
275 | | - * * Platforms: All |
---|
| 312 | + * * Platforms: T210, T210B01, T186 |
---|
| 313 | + * @cond (bpmp_t210 || bpmp_t210b01 || bpmp_t186) |
---|
276 | 314 | * * Initiators: CCPLEX |
---|
277 | 315 | * * Targets: BPMP |
---|
278 | 316 | * * Request Payload: @ref mrq_module_load_request |
---|
.. | .. |
---|
284 | 322 | |
---|
285 | 323 | /** |
---|
286 | 324 | * @ingroup Module |
---|
287 | | - * @brief request with #MRQ_MODULE_LOAD |
---|
| 325 | + * @brief Request with #MRQ_MODULE_LOAD |
---|
288 | 326 | * |
---|
289 | 327 | * Used by #MRQ_MODULE_LOAD calls to ask the recipient to dynamically |
---|
290 | 328 | * load the code located at #phys_addr and having size #size |
---|
.. | .. |
---|
300 | 338 | * |
---|
301 | 339 | */ |
---|
302 | 340 | struct mrq_module_load_request { |
---|
303 | | - /** @brief base address of the code to load. Treated as (void *) */ |
---|
304 | | - uint32_t phys_addr; /* (void *) */ |
---|
305 | | - /** @brief size in bytes of code to load */ |
---|
| 341 | + /** @brief Base address of the code to load */ |
---|
| 342 | + uint32_t phys_addr; |
---|
| 343 | + /** @brief Size in bytes of code to load */ |
---|
306 | 344 | uint32_t size; |
---|
307 | | -} __ABI_PACKED; |
---|
| 345 | +} BPMP_ABI_PACKED; |
---|
308 | 346 | |
---|
309 | 347 | /** |
---|
310 | 348 | * @ingroup Module |
---|
311 | | - * @brief response to #MRQ_MODULE_LOAD |
---|
| 349 | + * @brief Response to #MRQ_MODULE_LOAD |
---|
312 | 350 | * |
---|
313 | 351 | * @todo document mrq_response::err |
---|
314 | 352 | */ |
---|
315 | 353 | struct mrq_module_load_response { |
---|
316 | | - /** @brief handle to the loaded module */ |
---|
| 354 | + /** @brief Handle to the loaded module */ |
---|
317 | 355 | uint32_t base; |
---|
318 | | -} __ABI_PACKED; |
---|
| 356 | +} BPMP_ABI_PACKED; |
---|
| 357 | +/** @endcond*/ |
---|
319 | 358 | |
---|
320 | 359 | /** |
---|
321 | 360 | * @ingroup MRQ_Codes |
---|
322 | 361 | * @def MRQ_MODULE_UNLOAD |
---|
323 | | - * @brief unload a previously loaded code module |
---|
| 362 | + * @brief Unload a previously loaded code module |
---|
324 | 363 | * |
---|
325 | | - * * Platforms: All |
---|
| 364 | + * * Platforms: T210, T210B01, T186 |
---|
| 365 | + * @cond (bpmp_t210 || bpmp_t210b01 || bpmp_t186) |
---|
326 | 366 | * * Initiators: CCPLEX |
---|
327 | 367 | * * Targets: BPMP |
---|
328 | 368 | * * Request Payload: @ref mrq_module_unload_request |
---|
.. | .. |
---|
333 | 373 | |
---|
334 | 374 | /** |
---|
335 | 375 | * @ingroup Module |
---|
336 | | - * @brief request with #MRQ_MODULE_UNLOAD |
---|
| 376 | + * @brief Request with #MRQ_MODULE_UNLOAD |
---|
337 | 377 | * |
---|
338 | 378 | * Used by #MRQ_MODULE_UNLOAD calls to request that a previously loaded |
---|
339 | 379 | * module be unloaded. |
---|
340 | 380 | */ |
---|
341 | 381 | struct mrq_module_unload_request { |
---|
342 | | - /** @brief handle of the module to unload */ |
---|
| 382 | + /** @brief Handle of the module to unload */ |
---|
343 | 383 | uint32_t base; |
---|
344 | | -} __ABI_PACKED; |
---|
| 384 | +} BPMP_ABI_PACKED; |
---|
| 385 | +/** @endcond*/ |
---|
345 | 386 | |
---|
346 | 387 | /** |
---|
347 | 388 | * @ingroup MRQ_Codes |
---|
348 | 389 | * @def MRQ_TRACE_MODIFY |
---|
349 | | - * @brief modify the set of enabled trace events |
---|
| 390 | + * @brief Modify the set of enabled trace events |
---|
| 391 | + * |
---|
| 392 | + * @deprecated |
---|
350 | 393 | * |
---|
351 | 394 | * * Platforms: All |
---|
352 | 395 | * * Initiators: CCPLEX |
---|
.. | .. |
---|
359 | 402 | |
---|
360 | 403 | /** |
---|
361 | 404 | * @ingroup Trace |
---|
362 | | - * @brief request with #MRQ_TRACE_MODIFY |
---|
| 405 | + * @brief Request with #MRQ_TRACE_MODIFY |
---|
363 | 406 | * |
---|
364 | 407 | * Used by %MRQ_TRACE_MODIFY calls to enable or disable specify trace |
---|
365 | 408 | * events. #set takes precedence for any bit set in both #set and |
---|
366 | 409 | * #clr. |
---|
367 | 410 | */ |
---|
368 | 411 | struct mrq_trace_modify_request { |
---|
369 | | - /** @brief bit mask of trace events to disable */ |
---|
| 412 | + /** @brief Bit mask of trace events to disable */ |
---|
370 | 413 | uint32_t clr; |
---|
371 | | - /** @brief bit mask of trace events to enable */ |
---|
| 414 | + /** @brief Bit mask of trace events to enable */ |
---|
372 | 415 | uint32_t set; |
---|
373 | | -} __ABI_PACKED; |
---|
| 416 | +} BPMP_ABI_PACKED; |
---|
374 | 417 | |
---|
375 | 418 | /** |
---|
376 | 419 | * @ingroup Trace |
---|
377 | | - * @brief response to #MRQ_TRACE_MODIFY |
---|
| 420 | + * @brief Response to #MRQ_TRACE_MODIFY |
---|
378 | 421 | * |
---|
379 | 422 | * Sent in repsonse to an #MRQ_TRACE_MODIFY message. #mask reflects the |
---|
380 | 423 | * state of which events are enabled after the recipient acted on the |
---|
.. | .. |
---|
382 | 425 | * |
---|
383 | 426 | */ |
---|
384 | 427 | struct mrq_trace_modify_response { |
---|
385 | | - /** @brief bit mask of trace event enable states */ |
---|
| 428 | + /** @brief Bit mask of trace event enable states */ |
---|
386 | 429 | uint32_t mask; |
---|
387 | | -} __ABI_PACKED; |
---|
| 430 | +} BPMP_ABI_PACKED; |
---|
388 | 431 | |
---|
389 | 432 | /** |
---|
390 | 433 | * @ingroup MRQ_Codes |
---|
391 | 434 | * @def MRQ_WRITE_TRACE |
---|
392 | 435 | * @brief Write trace data to a buffer |
---|
| 436 | + * |
---|
| 437 | + * @deprecated |
---|
393 | 438 | * |
---|
394 | 439 | * * Platforms: All |
---|
395 | 440 | * * Initiators: CCPLEX |
---|
.. | .. |
---|
407 | 452 | |
---|
408 | 453 | /** |
---|
409 | 454 | * @ingroup Trace |
---|
410 | | - * @brief request with #MRQ_WRITE_TRACE |
---|
| 455 | + * @brief Request with #MRQ_WRITE_TRACE |
---|
411 | 456 | * |
---|
412 | 457 | * Used by MRQ_WRITE_TRACE calls to ask the recipient to copy trace |
---|
413 | 458 | * data from the recipient's local buffer to the output buffer. #area |
---|
.. | .. |
---|
420 | 465 | * overwrites. |
---|
421 | 466 | */ |
---|
422 | 467 | struct mrq_write_trace_request { |
---|
423 | | - /** @brief base address of output buffer */ |
---|
| 468 | + /** @brief Base address of output buffer */ |
---|
424 | 469 | uint32_t area; |
---|
425 | | - /** @brief size in bytes of the output buffer */ |
---|
| 470 | + /** @brief Size in bytes of the output buffer */ |
---|
426 | 471 | uint32_t size; |
---|
427 | | -} __ABI_PACKED; |
---|
| 472 | +} BPMP_ABI_PACKED; |
---|
428 | 473 | |
---|
429 | 474 | /** |
---|
430 | 475 | * @ingroup Trace |
---|
431 | | - * @brief response to #MRQ_WRITE_TRACE |
---|
| 476 | + * @brief Response to #MRQ_WRITE_TRACE |
---|
432 | 477 | * |
---|
433 | 478 | * Once this response is sent, the respondent will not access the |
---|
434 | 479 | * output buffer further. |
---|
435 | 480 | */ |
---|
436 | 481 | struct mrq_write_trace_response { |
---|
437 | 482 | /** |
---|
438 | | - * @brief flag whether more data remains in local buffer |
---|
| 483 | + * @brief Flag whether more data remains in local buffer |
---|
439 | 484 | * |
---|
440 | 485 | * Value is 1 if the entire local trace buffer has been |
---|
441 | 486 | * drained to the outputbuffer. Value is 0 otherwise. |
---|
442 | 487 | */ |
---|
443 | 488 | uint32_t eof; |
---|
444 | | -} __ABI_PACKED; |
---|
| 489 | +} BPMP_ABI_PACKED; |
---|
445 | 490 | |
---|
446 | 491 | /** @private */ |
---|
447 | 492 | struct mrq_threaded_ping_request { |
---|
448 | 493 | uint32_t challenge; |
---|
449 | | -} __ABI_PACKED; |
---|
| 494 | +} BPMP_ABI_PACKED; |
---|
450 | 495 | |
---|
451 | 496 | /** @private */ |
---|
452 | 497 | struct mrq_threaded_ping_response { |
---|
453 | 498 | uint32_t reply; |
---|
454 | | -} __ABI_PACKED; |
---|
| 499 | +} BPMP_ABI_PACKED; |
---|
455 | 500 | |
---|
456 | 501 | /** |
---|
457 | 502 | * @ingroup MRQ_Codes |
---|
458 | 503 | * @def MRQ_MODULE_MAIL |
---|
459 | | - * @brief send a message to a loadable module |
---|
| 504 | + * @brief Send a message to a loadable module |
---|
460 | 505 | * |
---|
461 | | - * * Platforms: All |
---|
| 506 | + * * Platforms: T210, T210B01, T186 |
---|
| 507 | + * @cond (bpmp_t210 || bpmp_t210b01 || bpmp_t186) |
---|
462 | 508 | * * Initiators: Any |
---|
463 | 509 | * * Targets: BPMP |
---|
464 | 510 | * * Request Payload: @ref mrq_module_mail_request |
---|
.. | .. |
---|
469 | 515 | |
---|
470 | 516 | /** |
---|
471 | 517 | * @ingroup Module |
---|
472 | | - * @brief request with #MRQ_MODULE_MAIL |
---|
| 518 | + * @brief Request with #MRQ_MODULE_MAIL |
---|
473 | 519 | */ |
---|
474 | 520 | struct mrq_module_mail_request { |
---|
475 | | - /** @brief handle to the previously loaded module */ |
---|
| 521 | + /** @brief Handle to the previously loaded module */ |
---|
476 | 522 | uint32_t base; |
---|
477 | | - /** @brief module-specific mail payload |
---|
| 523 | + /** @brief Module-specific mail payload |
---|
478 | 524 | * |
---|
479 | 525 | * The length of data[ ] is unknown to the BPMP core firmware |
---|
480 | 526 | * but it is limited to the size of an IPC message. |
---|
481 | 527 | */ |
---|
482 | | - uint8_t data[EMPTY_ARRAY]; |
---|
483 | | -} __ABI_PACKED; |
---|
| 528 | + uint8_t data[BPMP_ABI_EMPTY_ARRAY]; |
---|
| 529 | +} BPMP_ABI_PACKED; |
---|
484 | 530 | |
---|
485 | 531 | /** |
---|
486 | 532 | * @ingroup Module |
---|
487 | | - * @brief response to #MRQ_MODULE_MAIL |
---|
| 533 | + * @brief Response to #MRQ_MODULE_MAIL |
---|
488 | 534 | */ |
---|
489 | 535 | struct mrq_module_mail_response { |
---|
490 | | - /** @brief module-specific mail payload |
---|
| 536 | + /** @brief Module-specific mail payload |
---|
491 | 537 | * |
---|
492 | 538 | * The length of data[ ] is unknown to the BPMP core firmware |
---|
493 | 539 | * but it is limited to the size of an IPC message. |
---|
494 | 540 | */ |
---|
495 | | - uint8_t data[EMPTY_ARRAY]; |
---|
496 | | -} __ABI_PACKED; |
---|
| 541 | + uint8_t data[BPMP_ABI_EMPTY_ARRAY]; |
---|
| 542 | +} BPMP_ABI_PACKED; |
---|
| 543 | +/** @endcond */ |
---|
497 | 544 | |
---|
498 | 545 | /** |
---|
499 | 546 | * @ingroup MRQ_Codes |
---|
500 | 547 | * @def MRQ_DEBUGFS |
---|
501 | 548 | * @brief Interact with BPMP's debugfs file nodes |
---|
502 | 549 | * |
---|
503 | | - * * Platforms: T186 |
---|
| 550 | + * @deprecated use MRQ_DEBUG instead. |
---|
| 551 | + * |
---|
| 552 | + * * Platforms: T186, T194 |
---|
504 | 553 | * * Initiators: Any |
---|
505 | 554 | * * Targets: BPMP |
---|
506 | 555 | * * Request Payload: @ref mrq_debugfs_request |
---|
.. | .. |
---|
529 | 578 | * |
---|
530 | 579 | * @} |
---|
531 | 580 | */ |
---|
| 581 | + |
---|
532 | 582 | /** @ingroup Debugfs */ |
---|
533 | 583 | enum mrq_debugfs_commands { |
---|
| 584 | + /** @brief Perform read */ |
---|
534 | 585 | CMD_DEBUGFS_READ = 1, |
---|
| 586 | + /** @brief Perform write */ |
---|
535 | 587 | CMD_DEBUGFS_WRITE = 2, |
---|
| 588 | + /** @brief Perform dumping directory */ |
---|
536 | 589 | CMD_DEBUGFS_DUMPDIR = 3, |
---|
| 590 | + /** @brief Not a command */ |
---|
537 | 591 | CMD_DEBUGFS_MAX |
---|
538 | 592 | }; |
---|
539 | 593 | |
---|
540 | 594 | /** |
---|
541 | 595 | * @ingroup Debugfs |
---|
542 | | - * @brief parameters for CMD_DEBUGFS_READ/WRITE command |
---|
| 596 | + * @brief Parameters for CMD_DEBUGFS_READ/WRITE command |
---|
543 | 597 | */ |
---|
544 | 598 | struct cmd_debugfs_fileop_request { |
---|
545 | | - /** @brief physical address pointing at filename */ |
---|
| 599 | + /** @brief Physical address pointing at filename */ |
---|
546 | 600 | uint32_t fnameaddr; |
---|
547 | | - /** @brief length in bytes of filename buffer */ |
---|
| 601 | + /** @brief Length in bytes of filename buffer */ |
---|
548 | 602 | uint32_t fnamelen; |
---|
549 | | - /** @brief physical address pointing to data buffer */ |
---|
| 603 | + /** @brief Physical address pointing to data buffer */ |
---|
550 | 604 | uint32_t dataaddr; |
---|
551 | | - /** @brief length in bytes of data buffer */ |
---|
| 605 | + /** @brief Length in bytes of data buffer */ |
---|
552 | 606 | uint32_t datalen; |
---|
553 | | -} __ABI_PACKED; |
---|
| 607 | +} BPMP_ABI_PACKED; |
---|
554 | 608 | |
---|
555 | 609 | /** |
---|
556 | 610 | * @ingroup Debugfs |
---|
557 | | - * @brief parameters for CMD_DEBUGFS_READ/WRITE command |
---|
| 611 | + * @brief Parameters for CMD_DEBUGFS_READ/WRITE command |
---|
558 | 612 | */ |
---|
559 | 613 | struct cmd_debugfs_dumpdir_request { |
---|
560 | | - /** @brief physical address pointing to data buffer */ |
---|
| 614 | + /** @brief Physical address pointing to data buffer */ |
---|
561 | 615 | uint32_t dataaddr; |
---|
562 | | - /** @brief length in bytes of data buffer */ |
---|
| 616 | + /** @brief Length in bytes of data buffer */ |
---|
563 | 617 | uint32_t datalen; |
---|
564 | | -} __ABI_PACKED; |
---|
| 618 | +} BPMP_ABI_PACKED; |
---|
565 | 619 | |
---|
566 | 620 | /** |
---|
567 | 621 | * @ingroup Debugfs |
---|
568 | | - * @brief response data for CMD_DEBUGFS_READ/WRITE command |
---|
| 622 | + * @brief Response data for CMD_DEBUGFS_READ/WRITE command |
---|
569 | 623 | */ |
---|
570 | 624 | struct cmd_debugfs_fileop_response { |
---|
571 | | - /** @brief always 0 */ |
---|
| 625 | + /** @brief Always 0 */ |
---|
572 | 626 | uint32_t reserved; |
---|
573 | | - /** @brief number of bytes read from or written to data buffer */ |
---|
| 627 | + /** @brief Number of bytes read from or written to data buffer */ |
---|
574 | 628 | uint32_t nbytes; |
---|
575 | | -} __ABI_PACKED; |
---|
| 629 | +} BPMP_ABI_PACKED; |
---|
576 | 630 | |
---|
577 | 631 | /** |
---|
578 | 632 | * @ingroup Debugfs |
---|
579 | | - * @brief response data for CMD_DEBUGFS_DUMPDIR command |
---|
| 633 | + * @brief Response data for CMD_DEBUGFS_DUMPDIR command |
---|
580 | 634 | */ |
---|
581 | 635 | struct cmd_debugfs_dumpdir_response { |
---|
582 | | - /** @brief always 0 */ |
---|
| 636 | + /** @brief Always 0 */ |
---|
583 | 637 | uint32_t reserved; |
---|
584 | | - /** @brief number of bytes read from or written to data buffer */ |
---|
| 638 | + /** @brief Number of bytes read from or written to data buffer */ |
---|
585 | 639 | uint32_t nbytes; |
---|
586 | | -} __ABI_PACKED; |
---|
| 640 | +} BPMP_ABI_PACKED; |
---|
587 | 641 | |
---|
588 | 642 | /** |
---|
589 | 643 | * @ingroup Debugfs |
---|
590 | | - * @brief request with #MRQ_DEBUGFS. |
---|
| 644 | + * @brief Request with #MRQ_DEBUGFS. |
---|
591 | 645 | * |
---|
592 | 646 | * The sender of an MRQ_DEBUGFS message uses #cmd to specify a debugfs |
---|
593 | 647 | * command to execute. Legal commands are the values of @ref |
---|
.. | .. |
---|
601 | 655 | * |CMD_DEBUGFS_DUMPDIR|dumpdir| |
---|
602 | 656 | */ |
---|
603 | 657 | struct mrq_debugfs_request { |
---|
| 658 | + /** @brief Sub-command (@ref mrq_debugfs_commands) */ |
---|
604 | 659 | uint32_t cmd; |
---|
605 | 660 | union { |
---|
606 | 661 | struct cmd_debugfs_fileop_request fop; |
---|
607 | 662 | struct cmd_debugfs_dumpdir_request dumpdir; |
---|
608 | | - } __UNION_ANON; |
---|
609 | | -} __ABI_PACKED; |
---|
| 663 | + } BPMP_UNION_ANON; |
---|
| 664 | +} BPMP_ABI_PACKED; |
---|
610 | 665 | |
---|
611 | 666 | /** |
---|
612 | 667 | * @ingroup Debugfs |
---|
613 | 668 | */ |
---|
614 | 669 | struct mrq_debugfs_response { |
---|
615 | | - /** @brief always 0 */ |
---|
| 670 | + /** @brief Always 0 */ |
---|
616 | 671 | int32_t reserved; |
---|
617 | 672 | union { |
---|
618 | | - /** @brief response data for CMD_DEBUGFS_READ OR |
---|
| 673 | + /** @brief Response data for CMD_DEBUGFS_READ OR |
---|
619 | 674 | * CMD_DEBUGFS_WRITE command |
---|
620 | 675 | */ |
---|
621 | 676 | struct cmd_debugfs_fileop_response fop; |
---|
622 | | - /** @brief response data for CMD_DEBUGFS_DUMPDIR command */ |
---|
| 677 | + /** @brief Response data for CMD_DEBUGFS_DUMPDIR command */ |
---|
623 | 678 | struct cmd_debugfs_dumpdir_response dumpdir; |
---|
624 | | - } __UNION_ANON; |
---|
625 | | -} __ABI_PACKED; |
---|
| 679 | + } BPMP_UNION_ANON; |
---|
| 680 | +} BPMP_ABI_PACKED; |
---|
626 | 681 | |
---|
627 | 682 | /** |
---|
628 | 683 | * @addtogroup Debugfs |
---|
.. | .. |
---|
633 | 688 | #define DEBUGFS_S_IWUSR (1 << 7) |
---|
634 | 689 | /** @} */ |
---|
635 | 690 | |
---|
| 691 | +/** |
---|
| 692 | + * @ingroup MRQ_Codes |
---|
| 693 | + * @def MRQ_DEBUG |
---|
| 694 | + * @brief Interact with BPMP's debugfs file nodes. Use message payload |
---|
| 695 | + * for exchanging data. This is functionally equivalent to |
---|
| 696 | + * @ref MRQ_DEBUGFS. But the way in which data is exchanged is different. |
---|
| 697 | + * When software running on CPU tries to read a debugfs file, |
---|
| 698 | + * the file path and read data will be stored in message payload. |
---|
| 699 | + * Since the message payload size is limited, a debugfs file |
---|
| 700 | + * transaction might require multiple frames of data exchanged |
---|
| 701 | + * between BPMP and CPU until the transaction completes. |
---|
| 702 | + * |
---|
| 703 | + * * Platforms: T194 |
---|
| 704 | + * * Initiators: Any |
---|
| 705 | + * * Targets: BPMP |
---|
| 706 | + * * Request Payload: @ref mrq_debug_request |
---|
| 707 | + * * Response Payload: @ref mrq_debug_response |
---|
| 708 | + */ |
---|
| 709 | + |
---|
| 710 | +/** @ingroup Debugfs */ |
---|
| 711 | +enum mrq_debug_commands { |
---|
| 712 | + /** @brief Open required file for read operation */ |
---|
| 713 | + CMD_DEBUG_OPEN_RO = 0, |
---|
| 714 | + /** @brief Open required file for write operation */ |
---|
| 715 | + CMD_DEBUG_OPEN_WO = 1, |
---|
| 716 | + /** @brief Perform read */ |
---|
| 717 | + CMD_DEBUG_READ = 2, |
---|
| 718 | + /** @brief Perform write */ |
---|
| 719 | + CMD_DEBUG_WRITE = 3, |
---|
| 720 | + /** @brief Close file */ |
---|
| 721 | + CMD_DEBUG_CLOSE = 4, |
---|
| 722 | + /** @brief Not a command */ |
---|
| 723 | + CMD_DEBUG_MAX |
---|
| 724 | +}; |
---|
| 725 | + |
---|
| 726 | +/** |
---|
| 727 | + * @ingroup Debugfs |
---|
| 728 | + * @brief Maximum number of files that can be open at a given time |
---|
| 729 | + */ |
---|
| 730 | +#define DEBUG_MAX_OPEN_FILES 1 |
---|
| 731 | + |
---|
| 732 | +/** |
---|
| 733 | + * @ingroup Debugfs |
---|
| 734 | + * @brief Maximum size of null-terminated file name string in bytes. |
---|
| 735 | + * Value is derived from memory available in message payload while |
---|
| 736 | + * using @ref cmd_debug_fopen_request |
---|
| 737 | + * Value 4 corresponds to size of @ref mrq_debug_commands |
---|
| 738 | + * in @ref mrq_debug_request. |
---|
| 739 | + * 120 - 4 dbg_cmd(32bit) = 116 |
---|
| 740 | + */ |
---|
| 741 | +#define DEBUG_FNAME_MAX_SZ (MSG_DATA_MIN_SZ - 4) |
---|
| 742 | + |
---|
| 743 | +/** |
---|
| 744 | + * @ingroup Debugfs |
---|
| 745 | + * @brief Parameters for CMD_DEBUG_OPEN command |
---|
| 746 | + */ |
---|
| 747 | +struct cmd_debug_fopen_request { |
---|
| 748 | + /** @brief File name - Null-terminated string with maximum |
---|
| 749 | + * length @ref DEBUG_FNAME_MAX_SZ |
---|
| 750 | + */ |
---|
| 751 | + char name[DEBUG_FNAME_MAX_SZ]; |
---|
| 752 | +} BPMP_ABI_PACKED; |
---|
| 753 | + |
---|
| 754 | +/** |
---|
| 755 | + * @ingroup Debugfs |
---|
| 756 | + * @brief Response data for CMD_DEBUG_OPEN_RO/WO command |
---|
| 757 | + */ |
---|
| 758 | +struct cmd_debug_fopen_response { |
---|
| 759 | + /** @brief Identifier for file access */ |
---|
| 760 | + uint32_t fd; |
---|
| 761 | + /** @brief Data length. File data size for READ command. |
---|
| 762 | + * Maximum allowed length for WRITE command |
---|
| 763 | + */ |
---|
| 764 | + uint32_t datalen; |
---|
| 765 | +} BPMP_ABI_PACKED; |
---|
| 766 | + |
---|
| 767 | +/** |
---|
| 768 | + * @ingroup Debugfs |
---|
| 769 | + * @brief Parameters for CMD_DEBUG_READ command |
---|
| 770 | + */ |
---|
| 771 | +struct cmd_debug_fread_request { |
---|
| 772 | + /** @brief File access identifier received in response |
---|
| 773 | + * to CMD_DEBUG_OPEN_RO request |
---|
| 774 | + */ |
---|
| 775 | + uint32_t fd; |
---|
| 776 | +} BPMP_ABI_PACKED; |
---|
| 777 | + |
---|
| 778 | +/** |
---|
| 779 | + * @ingroup Debugfs |
---|
| 780 | + * @brief Maximum size of read data in bytes. |
---|
| 781 | + * Value is derived from memory available in message payload while |
---|
| 782 | + * using @ref cmd_debug_fread_response. |
---|
| 783 | + */ |
---|
| 784 | +#define DEBUG_READ_MAX_SZ (MSG_DATA_MIN_SZ - 4) |
---|
| 785 | + |
---|
| 786 | +/** |
---|
| 787 | + * @ingroup Debugfs |
---|
| 788 | + * @brief Response data for CMD_DEBUG_READ command |
---|
| 789 | + */ |
---|
| 790 | +struct cmd_debug_fread_response { |
---|
| 791 | + /** @brief Size of data provided in this response in bytes */ |
---|
| 792 | + uint32_t readlen; |
---|
| 793 | + /** @brief File data from seek position */ |
---|
| 794 | + char data[DEBUG_READ_MAX_SZ]; |
---|
| 795 | +} BPMP_ABI_PACKED; |
---|
| 796 | + |
---|
| 797 | +/** |
---|
| 798 | + * @ingroup Debugfs |
---|
| 799 | + * @brief Maximum size of write data in bytes. |
---|
| 800 | + * Value is derived from memory available in message payload while |
---|
| 801 | + * using @ref cmd_debug_fwrite_request. |
---|
| 802 | + */ |
---|
| 803 | +#define DEBUG_WRITE_MAX_SZ (MSG_DATA_MIN_SZ - 12) |
---|
| 804 | + |
---|
| 805 | +/** |
---|
| 806 | + * @ingroup Debugfs |
---|
| 807 | + * @brief Parameters for CMD_DEBUG_WRITE command |
---|
| 808 | + */ |
---|
| 809 | +struct cmd_debug_fwrite_request { |
---|
| 810 | + /** @brief File access identifier received in response |
---|
| 811 | + * to CMD_DEBUG_OPEN_RO request |
---|
| 812 | + */ |
---|
| 813 | + uint32_t fd; |
---|
| 814 | + /** @brief Size of write data in bytes */ |
---|
| 815 | + uint32_t datalen; |
---|
| 816 | + /** @brief Data to be written */ |
---|
| 817 | + char data[DEBUG_WRITE_MAX_SZ]; |
---|
| 818 | +} BPMP_ABI_PACKED; |
---|
| 819 | + |
---|
| 820 | +/** |
---|
| 821 | + * @ingroup Debugfs |
---|
| 822 | + * @brief Parameters for CMD_DEBUG_CLOSE command |
---|
| 823 | + */ |
---|
| 824 | +struct cmd_debug_fclose_request { |
---|
| 825 | + /** @brief File access identifier received in response |
---|
| 826 | + * to CMD_DEBUG_OPEN_RO request |
---|
| 827 | + */ |
---|
| 828 | + uint32_t fd; |
---|
| 829 | +} BPMP_ABI_PACKED; |
---|
| 830 | + |
---|
| 831 | +/** |
---|
| 832 | + * @ingroup Debugfs |
---|
| 833 | + * @brief Request with #MRQ_DEBUG. |
---|
| 834 | + * |
---|
| 835 | + * The sender of an MRQ_DEBUG message uses #cmd to specify a debugfs |
---|
| 836 | + * command to execute. Legal commands are the values of @ref |
---|
| 837 | + * mrq_debug_commands. Each command requires a specific additional |
---|
| 838 | + * payload of data. |
---|
| 839 | + * |
---|
| 840 | + * |command |payload| |
---|
| 841 | + * |-------------------|-------| |
---|
| 842 | + * |CMD_DEBUG_OPEN_RO |fop | |
---|
| 843 | + * |CMD_DEBUG_OPEN_WO |fop | |
---|
| 844 | + * |CMD_DEBUG_READ |frd | |
---|
| 845 | + * |CMD_DEBUG_WRITE |fwr | |
---|
| 846 | + * |CMD_DEBUG_CLOSE |fcl | |
---|
| 847 | + */ |
---|
| 848 | +struct mrq_debug_request { |
---|
| 849 | + /** @brief Sub-command (@ref mrq_debug_commands) */ |
---|
| 850 | + uint32_t cmd; |
---|
| 851 | + union { |
---|
| 852 | + /** @brief Request payload for CMD_DEBUG_OPEN_RO/WO command */ |
---|
| 853 | + struct cmd_debug_fopen_request fop; |
---|
| 854 | + /** @brief Request payload for CMD_DEBUG_READ command */ |
---|
| 855 | + struct cmd_debug_fread_request frd; |
---|
| 856 | + /** @brief Request payload for CMD_DEBUG_WRITE command */ |
---|
| 857 | + struct cmd_debug_fwrite_request fwr; |
---|
| 858 | + /** @brief Request payload for CMD_DEBUG_CLOSE command */ |
---|
| 859 | + struct cmd_debug_fclose_request fcl; |
---|
| 860 | + } BPMP_UNION_ANON; |
---|
| 861 | +} BPMP_ABI_PACKED; |
---|
| 862 | + |
---|
| 863 | +/** |
---|
| 864 | + * @ingroup Debugfs |
---|
| 865 | + */ |
---|
| 866 | +struct mrq_debug_response { |
---|
| 867 | + union { |
---|
| 868 | + /** @brief Response data for CMD_DEBUG_OPEN_RO/WO command */ |
---|
| 869 | + struct cmd_debug_fopen_response fop; |
---|
| 870 | + /** @brief Response data for CMD_DEBUG_READ command */ |
---|
| 871 | + struct cmd_debug_fread_response frd; |
---|
| 872 | + } BPMP_UNION_ANON; |
---|
| 873 | +} BPMP_ABI_PACKED; |
---|
636 | 874 | |
---|
637 | 875 | /** |
---|
638 | 876 | * @ingroup MRQ_Codes |
---|
639 | 877 | * @def MRQ_RESET |
---|
640 | | - * @brief reset an IP block |
---|
| 878 | + * @brief Reset an IP block |
---|
641 | 879 | * |
---|
642 | | - * * Platforms: T186 |
---|
| 880 | + * * Platforms: T186, T194 |
---|
643 | 881 | * * Initiators: Any |
---|
644 | 882 | * * Targets: BPMP |
---|
645 | 883 | * * Request Payload: @ref mrq_reset_request |
---|
646 | 884 | * * Response Payload: @ref mrq_reset_response |
---|
| 885 | + * |
---|
| 886 | + * @addtogroup Reset |
---|
| 887 | + * @{ |
---|
647 | 888 | */ |
---|
648 | 889 | |
---|
649 | | -/** |
---|
650 | | - * @ingroup Reset |
---|
651 | | - */ |
---|
652 | 890 | enum mrq_reset_commands { |
---|
| 891 | + /** |
---|
| 892 | + * @brief Assert module reset |
---|
| 893 | + * |
---|
| 894 | + * mrq_response::err is 0 if the operation was successful, or @n |
---|
| 895 | + * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n |
---|
| 896 | + * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n |
---|
| 897 | + * -#BPMP_ENOTSUP if target domain h/w state does not allow reset |
---|
| 898 | + */ |
---|
653 | 899 | CMD_RESET_ASSERT = 1, |
---|
| 900 | + /** |
---|
| 901 | + * @brief Deassert module reset |
---|
| 902 | + * |
---|
| 903 | + * mrq_response::err is 0 if the operation was successful, or @n |
---|
| 904 | + * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n |
---|
| 905 | + * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n |
---|
| 906 | + * -#BPMP_ENOTSUP if target domain h/w state does not allow reset |
---|
| 907 | + */ |
---|
654 | 908 | CMD_RESET_DEASSERT = 2, |
---|
| 909 | + /** |
---|
| 910 | + * @brief Assert and deassert the module reset |
---|
| 911 | + * |
---|
| 912 | + * mrq_response::err is 0 if the operation was successful, or @n |
---|
| 913 | + * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n |
---|
| 914 | + * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n |
---|
| 915 | + * -#BPMP_ENOTSUP if target domain h/w state does not allow reset |
---|
| 916 | + */ |
---|
655 | 917 | CMD_RESET_MODULE = 3, |
---|
| 918 | + /** |
---|
| 919 | + * @brief Get the highest reset ID |
---|
| 920 | + * |
---|
| 921 | + * mrq_response::err is 0 if the operation was successful, or @n |
---|
| 922 | + * -#BPMP_ENODEV if no reset domains are supported (number of IDs is 0) |
---|
| 923 | + */ |
---|
656 | 924 | CMD_RESET_GET_MAX_ID = 4, |
---|
657 | | - CMD_RESET_MAX, /* not part of ABI and subject to change */ |
---|
| 925 | + |
---|
| 926 | + /** @brief Not part of ABI and subject to change */ |
---|
| 927 | + CMD_RESET_MAX, |
---|
658 | 928 | }; |
---|
659 | 929 | |
---|
660 | 930 | /** |
---|
661 | | - * @ingroup Reset |
---|
662 | | - * @brief request with MRQ_RESET |
---|
| 931 | + * @brief Request with MRQ_RESET |
---|
663 | 932 | * |
---|
664 | 933 | * Used by the sender of an #MRQ_RESET message to request BPMP to |
---|
665 | 934 | * assert or or deassert a given reset line. |
---|
666 | 935 | */ |
---|
667 | 936 | struct mrq_reset_request { |
---|
668 | | - /** @brief reset action to perform (@enum mrq_reset_commands) */ |
---|
| 937 | + /** @brief Reset action to perform (@ref mrq_reset_commands) */ |
---|
669 | 938 | uint32_t cmd; |
---|
670 | | - /** @brief id of the reset to affected */ |
---|
| 939 | + /** @brief Id of the reset to affected */ |
---|
671 | 940 | uint32_t reset_id; |
---|
672 | | -} __ABI_PACKED; |
---|
| 941 | +} BPMP_ABI_PACKED; |
---|
673 | 942 | |
---|
674 | 943 | /** |
---|
675 | | - * @ingroup Reset |
---|
676 | 944 | * @brief Response for MRQ_RESET sub-command CMD_RESET_GET_MAX_ID. When |
---|
677 | 945 | * this sub-command is not supported, firmware will return -BPMP_EBADCMD |
---|
678 | 946 | * in mrq_response::err. |
---|
679 | 947 | */ |
---|
680 | 948 | struct cmd_reset_get_max_id_response { |
---|
681 | | - /** @brief max reset id */ |
---|
| 949 | + /** @brief Max reset id */ |
---|
682 | 950 | uint32_t max_id; |
---|
683 | | -} __ABI_PACKED; |
---|
| 951 | +} BPMP_ABI_PACKED; |
---|
684 | 952 | |
---|
685 | 953 | /** |
---|
686 | | - * @ingroup Reset |
---|
687 | 954 | * @brief Response with MRQ_RESET |
---|
688 | 955 | * |
---|
689 | 956 | * Each sub-command supported by @ref mrq_reset_request may return |
---|
.. | .. |
---|
700 | 967 | struct mrq_reset_response { |
---|
701 | 968 | union { |
---|
702 | 969 | struct cmd_reset_get_max_id_response reset_get_max_id; |
---|
703 | | - } __UNION_ANON; |
---|
704 | | -} __ABI_PACKED; |
---|
| 970 | + } BPMP_UNION_ANON; |
---|
| 971 | +} BPMP_ABI_PACKED; |
---|
| 972 | + |
---|
| 973 | +/** @} */ |
---|
705 | 974 | |
---|
706 | 975 | /** |
---|
707 | 976 | * @ingroup MRQ_Codes |
---|
708 | 977 | * @def MRQ_I2C |
---|
709 | | - * @brief issue an i2c transaction |
---|
| 978 | + * @brief Issue an i2c transaction |
---|
710 | 979 | * |
---|
711 | | - * * Platforms: T186 |
---|
| 980 | + * * Platforms: T186, T194 |
---|
712 | 981 | * * Initiators: Any |
---|
713 | 982 | * * Targets: BPMP |
---|
714 | 983 | * * Request Payload: @ref mrq_i2c_request |
---|
715 | 984 | * * Response Payload: @ref mrq_i2c_response |
---|
716 | | - */ |
---|
717 | | - |
---|
718 | | -/** |
---|
| 985 | + * |
---|
719 | 986 | * @addtogroup I2C |
---|
720 | 987 | * @{ |
---|
721 | 988 | */ |
---|
722 | | -#define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12) |
---|
723 | | -#define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4) |
---|
724 | | -/** @} */ |
---|
| 989 | +#define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12U) |
---|
| 990 | +#define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4U) |
---|
725 | 991 | |
---|
726 | | -/** |
---|
727 | | - * @ingroup I2C |
---|
728 | | - * @name Serial I2C flags |
---|
729 | | - * Use these flags with serial_i2c_request::flags |
---|
730 | | - * @{ |
---|
731 | | - */ |
---|
732 | | -#define SERIALI2C_TEN 0x0010 |
---|
733 | | -#define SERIALI2C_RD 0x0001 |
---|
734 | | -#define SERIALI2C_STOP 0x8000 |
---|
735 | | -#define SERIALI2C_NOSTART 0x4000 |
---|
736 | | -#define SERIALI2C_REV_DIR_ADDR 0x2000 |
---|
737 | | -#define SERIALI2C_IGNORE_NAK 0x1000 |
---|
738 | | -#define SERIALI2C_NO_RD_ACK 0x0800 |
---|
739 | | -#define SERIALI2C_RECV_LEN 0x0400 |
---|
740 | | -/** @} */ |
---|
741 | | -/** @ingroup I2C */ |
---|
| 992 | +#define SERIALI2C_TEN 0x0010U |
---|
| 993 | +#define SERIALI2C_RD 0x0001U |
---|
| 994 | +#define SERIALI2C_STOP 0x8000U |
---|
| 995 | +#define SERIALI2C_NOSTART 0x4000U |
---|
| 996 | +#define SERIALI2C_REV_DIR_ADDR 0x2000U |
---|
| 997 | +#define SERIALI2C_IGNORE_NAK 0x1000U |
---|
| 998 | +#define SERIALI2C_NO_RD_ACK 0x0800U |
---|
| 999 | +#define SERIALI2C_RECV_LEN 0x0400U |
---|
| 1000 | + |
---|
742 | 1001 | enum { |
---|
743 | 1002 | CMD_I2C_XFER = 1 |
---|
744 | 1003 | }; |
---|
745 | 1004 | |
---|
746 | 1005 | /** |
---|
747 | | - * @ingroup I2C |
---|
748 | | - * @brief serializable i2c request |
---|
| 1006 | + * @brief Serializable i2c request |
---|
749 | 1007 | * |
---|
750 | 1008 | * Instances of this structure are packed (little-endian) into |
---|
751 | 1009 | * cmd_i2c_xfer_request::data_buf. Each instance represents a single |
---|
.. | .. |
---|
762 | 1020 | struct serial_i2c_request { |
---|
763 | 1021 | /** @brief I2C slave address */ |
---|
764 | 1022 | uint16_t addr; |
---|
765 | | - /** @brief bitmask of SERIALI2C_ flags */ |
---|
| 1023 | + /** @brief Bitmask of SERIALI2C_ flags */ |
---|
766 | 1024 | uint16_t flags; |
---|
767 | | - /** @brief length of I2C transaction in bytes */ |
---|
| 1025 | + /** @brief Length of I2C transaction in bytes */ |
---|
768 | 1026 | uint16_t len; |
---|
769 | | - /** @brief for write transactions only, #len bytes of data */ |
---|
| 1027 | + /** @brief For write transactions only, #len bytes of data */ |
---|
770 | 1028 | uint8_t data[]; |
---|
771 | | -} __ABI_PACKED; |
---|
| 1029 | +} BPMP_ABI_PACKED; |
---|
772 | 1030 | |
---|
773 | 1031 | /** |
---|
774 | | - * @ingroup I2C |
---|
775 | | - * @brief trigger one or more i2c transactions |
---|
| 1032 | + * @brief Trigger one or more i2c transactions |
---|
776 | 1033 | */ |
---|
777 | 1034 | struct cmd_i2c_xfer_request { |
---|
778 | | - /** @brief valid bus number from mach-t186/i2c-t186.h*/ |
---|
| 1035 | + /** @brief Valid bus number from @ref bpmp_i2c_ids*/ |
---|
779 | 1036 | uint32_t bus_id; |
---|
780 | 1037 | |
---|
781 | | - /** @brief count of valid bytes in #data_buf*/ |
---|
| 1038 | + /** @brief Count of valid bytes in #data_buf*/ |
---|
782 | 1039 | uint32_t data_size; |
---|
783 | 1040 | |
---|
784 | | - /** @brief serialized packed instances of @ref serial_i2c_request*/ |
---|
| 1041 | + /** @brief Serialized packed instances of @ref serial_i2c_request*/ |
---|
785 | 1042 | uint8_t data_buf[TEGRA_I2C_IPC_MAX_IN_BUF_SIZE]; |
---|
786 | | -} __ABI_PACKED; |
---|
| 1043 | +} BPMP_ABI_PACKED; |
---|
787 | 1044 | |
---|
788 | 1045 | /** |
---|
789 | | - * @ingroup I2C |
---|
790 | | - * @brief container for data read from the i2c bus |
---|
| 1046 | + * @brief Container for data read from the i2c bus |
---|
791 | 1047 | * |
---|
792 | 1048 | * Processing an cmd_i2c_xfer_request::data_buf causes BPMP to execute |
---|
793 | 1049 | * zero or more I2C reads. The data read from the bus is serialized |
---|
794 | 1050 | * into #data_buf. |
---|
795 | 1051 | */ |
---|
796 | 1052 | struct cmd_i2c_xfer_response { |
---|
797 | | - /** @brief count of valid bytes in #data_buf*/ |
---|
| 1053 | + /** @brief Count of valid bytes in #data_buf*/ |
---|
798 | 1054 | uint32_t data_size; |
---|
799 | | - /** @brief i2c read data */ |
---|
| 1055 | + /** @brief I2c read data */ |
---|
800 | 1056 | uint8_t data_buf[TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE]; |
---|
801 | | -} __ABI_PACKED; |
---|
| 1057 | +} BPMP_ABI_PACKED; |
---|
802 | 1058 | |
---|
803 | 1059 | /** |
---|
804 | | - * @ingroup I2C |
---|
805 | | - * @brief request with #MRQ_I2C |
---|
| 1060 | + * @brief Request with #MRQ_I2C |
---|
806 | 1061 | */ |
---|
807 | 1062 | struct mrq_i2c_request { |
---|
808 | | - /** @brief always CMD_I2C_XFER (i.e. 1) */ |
---|
| 1063 | + /** @brief Always CMD_I2C_XFER (i.e. 1) */ |
---|
809 | 1064 | uint32_t cmd; |
---|
810 | | - /** @brief parameters of the transfer request */ |
---|
| 1065 | + /** @brief Parameters of the transfer request */ |
---|
811 | 1066 | struct cmd_i2c_xfer_request xfer; |
---|
812 | | -} __ABI_PACKED; |
---|
| 1067 | +} BPMP_ABI_PACKED; |
---|
813 | 1068 | |
---|
814 | 1069 | /** |
---|
815 | | - * @ingroup I2C |
---|
816 | | - * @brief response to #MRQ_I2C |
---|
| 1070 | + * @brief Response to #MRQ_I2C |
---|
| 1071 | + * |
---|
| 1072 | + * mrq_response:err is |
---|
| 1073 | + * 0: Success |
---|
| 1074 | + * -#BPMP_EBADCMD: if mrq_i2c_request::cmd is other than 1 |
---|
| 1075 | + * -#BPMP_EINVAL: if cmd_i2c_xfer_request does not contain correctly formatted request |
---|
| 1076 | + * -#BPMP_ENODEV: if cmd_i2c_xfer_request::bus_id is not supported by BPMP |
---|
| 1077 | + * -#BPMP_EACCES: if i2c transaction is not allowed due to firewall rules |
---|
| 1078 | + * -#BPMP_ETIMEDOUT: if i2c transaction times out |
---|
| 1079 | + * -#BPMP_ENXIO: if i2c slave device does not reply with ACK to the transaction |
---|
| 1080 | + * -#BPMP_EAGAIN: if ARB_LOST condition is detected by the i2c controller |
---|
| 1081 | + * -#BPMP_EIO: any other i2c controller error code than NO_ACK or ARB_LOST |
---|
817 | 1082 | */ |
---|
818 | 1083 | struct mrq_i2c_response { |
---|
819 | 1084 | struct cmd_i2c_xfer_response xfer; |
---|
820 | | -} __ABI_PACKED; |
---|
| 1085 | +} BPMP_ABI_PACKED; |
---|
| 1086 | + |
---|
| 1087 | +/** @} */ |
---|
821 | 1088 | |
---|
822 | 1089 | /** |
---|
823 | 1090 | * @ingroup MRQ_Codes |
---|
824 | 1091 | * @def MRQ_CLK |
---|
| 1092 | + * @brief Perform a clock operation |
---|
825 | 1093 | * |
---|
826 | | - * * Platforms: T186 |
---|
| 1094 | + * * Platforms: T186, T194 |
---|
827 | 1095 | * * Initiators: Any |
---|
828 | 1096 | * * Targets: BPMP |
---|
829 | 1097 | * * Request Payload: @ref mrq_clk_request |
---|
830 | 1098 | * * Response Payload: @ref mrq_clk_response |
---|
| 1099 | + * |
---|
831 | 1100 | * @addtogroup Clocks |
---|
832 | | - * @{ |
---|
833 | | - */ |
---|
834 | | - |
---|
835 | | -/** |
---|
836 | | - * @name MRQ_CLK sub-commands |
---|
837 | 1101 | * @{ |
---|
838 | 1102 | */ |
---|
839 | 1103 | enum { |
---|
.. | .. |
---|
847 | 1111 | CMD_CLK_DISABLE = 8, |
---|
848 | 1112 | CMD_CLK_GET_ALL_INFO = 14, |
---|
849 | 1113 | CMD_CLK_GET_MAX_CLK_ID = 15, |
---|
| 1114 | + CMD_CLK_GET_FMAX_AT_VMIN = 16, |
---|
850 | 1115 | CMD_CLK_MAX, |
---|
851 | 1116 | }; |
---|
852 | | -/** @} */ |
---|
853 | 1117 | |
---|
854 | | -/** |
---|
855 | | - * @name MRQ_CLK properties |
---|
856 | | - * Flag bits for cmd_clk_properties_response::flags and |
---|
857 | | - * cmd_clk_get_all_info_response::flags |
---|
858 | | - * @{ |
---|
859 | | - */ |
---|
860 | | -#define BPMP_CLK_HAS_MUX (1 << 0) |
---|
861 | | -#define BPMP_CLK_HAS_SET_RATE (1 << 1) |
---|
862 | | -#define BPMP_CLK_IS_ROOT (1 << 2) |
---|
863 | | -/** @} */ |
---|
| 1118 | +#define BPMP_CLK_HAS_MUX (1U << 0U) |
---|
| 1119 | +#define BPMP_CLK_HAS_SET_RATE (1U << 1U) |
---|
| 1120 | +#define BPMP_CLK_IS_ROOT (1U << 2U) |
---|
| 1121 | +#define BPMP_CLK_IS_VAR_ROOT (1U << 3U) |
---|
864 | 1122 | |
---|
865 | | -#define MRQ_CLK_NAME_MAXLEN 40 |
---|
866 | | -#define MRQ_CLK_MAX_PARENTS 16 |
---|
| 1123 | +#define MRQ_CLK_NAME_MAXLEN 40U |
---|
| 1124 | +#define MRQ_CLK_MAX_PARENTS 16U |
---|
867 | 1125 | |
---|
868 | 1126 | /** @private */ |
---|
869 | 1127 | struct cmd_clk_get_rate_request { |
---|
870 | | - EMPTY |
---|
871 | | -} __ABI_PACKED; |
---|
| 1128 | + BPMP_ABI_EMPTY |
---|
| 1129 | +} BPMP_ABI_PACKED; |
---|
872 | 1130 | |
---|
873 | 1131 | struct cmd_clk_get_rate_response { |
---|
874 | 1132 | int64_t rate; |
---|
875 | | -} __ABI_PACKED; |
---|
| 1133 | +} BPMP_ABI_PACKED; |
---|
876 | 1134 | |
---|
877 | 1135 | struct cmd_clk_set_rate_request { |
---|
878 | 1136 | int32_t unused; |
---|
879 | 1137 | int64_t rate; |
---|
880 | | -} __ABI_PACKED; |
---|
| 1138 | +} BPMP_ABI_PACKED; |
---|
881 | 1139 | |
---|
882 | 1140 | struct cmd_clk_set_rate_response { |
---|
883 | 1141 | int64_t rate; |
---|
884 | | -} __ABI_PACKED; |
---|
| 1142 | +} BPMP_ABI_PACKED; |
---|
885 | 1143 | |
---|
886 | 1144 | struct cmd_clk_round_rate_request { |
---|
887 | 1145 | int32_t unused; |
---|
888 | 1146 | int64_t rate; |
---|
889 | | -} __ABI_PACKED; |
---|
| 1147 | +} BPMP_ABI_PACKED; |
---|
890 | 1148 | |
---|
891 | 1149 | struct cmd_clk_round_rate_response { |
---|
892 | 1150 | int64_t rate; |
---|
893 | | -} __ABI_PACKED; |
---|
| 1151 | +} BPMP_ABI_PACKED; |
---|
894 | 1152 | |
---|
895 | 1153 | /** @private */ |
---|
896 | 1154 | struct cmd_clk_get_parent_request { |
---|
897 | | - EMPTY |
---|
898 | | -} __ABI_PACKED; |
---|
| 1155 | + BPMP_ABI_EMPTY |
---|
| 1156 | +} BPMP_ABI_PACKED; |
---|
899 | 1157 | |
---|
900 | 1158 | struct cmd_clk_get_parent_response { |
---|
901 | 1159 | uint32_t parent_id; |
---|
902 | | -} __ABI_PACKED; |
---|
| 1160 | +} BPMP_ABI_PACKED; |
---|
903 | 1161 | |
---|
904 | 1162 | struct cmd_clk_set_parent_request { |
---|
905 | 1163 | uint32_t parent_id; |
---|
906 | | -} __ABI_PACKED; |
---|
| 1164 | +} BPMP_ABI_PACKED; |
---|
907 | 1165 | |
---|
908 | 1166 | struct cmd_clk_set_parent_response { |
---|
909 | 1167 | uint32_t parent_id; |
---|
910 | | -} __ABI_PACKED; |
---|
| 1168 | +} BPMP_ABI_PACKED; |
---|
911 | 1169 | |
---|
912 | 1170 | /** @private */ |
---|
913 | 1171 | struct cmd_clk_is_enabled_request { |
---|
914 | | - EMPTY |
---|
915 | | -} __ABI_PACKED; |
---|
| 1172 | + BPMP_ABI_EMPTY |
---|
| 1173 | +} BPMP_ABI_PACKED; |
---|
916 | 1174 | |
---|
| 1175 | +/** |
---|
| 1176 | + * @brief Response data to #MRQ_CLK sub-command CMD_CLK_IS_ENABLED |
---|
| 1177 | + */ |
---|
917 | 1178 | struct cmd_clk_is_enabled_response { |
---|
| 1179 | + /** |
---|
| 1180 | + * @brief The state of the clock that has been succesfully |
---|
| 1181 | + * requested with CMD_CLK_ENABLE or CMD_CLK_DISABLE by the |
---|
| 1182 | + * master invoking the command earlier. |
---|
| 1183 | + * |
---|
| 1184 | + * The state may not reflect the physical state of the clock |
---|
| 1185 | + * if there are some other masters requesting it to be |
---|
| 1186 | + * enabled. |
---|
| 1187 | + * |
---|
| 1188 | + * Value 0 is disabled, all other values indicate enabled. |
---|
| 1189 | + */ |
---|
918 | 1190 | int32_t state; |
---|
919 | | -} __ABI_PACKED; |
---|
| 1191 | +} BPMP_ABI_PACKED; |
---|
920 | 1192 | |
---|
921 | 1193 | /** @private */ |
---|
922 | 1194 | struct cmd_clk_enable_request { |
---|
923 | | - EMPTY |
---|
924 | | -} __ABI_PACKED; |
---|
| 1195 | + BPMP_ABI_EMPTY |
---|
| 1196 | +} BPMP_ABI_PACKED; |
---|
925 | 1197 | |
---|
926 | 1198 | /** @private */ |
---|
927 | 1199 | struct cmd_clk_enable_response { |
---|
928 | | - EMPTY |
---|
929 | | -} __ABI_PACKED; |
---|
| 1200 | + BPMP_ABI_EMPTY |
---|
| 1201 | +} BPMP_ABI_PACKED; |
---|
930 | 1202 | |
---|
931 | 1203 | /** @private */ |
---|
932 | 1204 | struct cmd_clk_disable_request { |
---|
933 | | - EMPTY |
---|
934 | | -} __ABI_PACKED; |
---|
| 1205 | + BPMP_ABI_EMPTY |
---|
| 1206 | +} BPMP_ABI_PACKED; |
---|
935 | 1207 | |
---|
936 | 1208 | /** @private */ |
---|
937 | 1209 | struct cmd_clk_disable_response { |
---|
938 | | - EMPTY |
---|
939 | | -} __ABI_PACKED; |
---|
| 1210 | + BPMP_ABI_EMPTY |
---|
| 1211 | +} BPMP_ABI_PACKED; |
---|
940 | 1212 | |
---|
941 | 1213 | /** @private */ |
---|
942 | 1214 | struct cmd_clk_get_all_info_request { |
---|
943 | | - EMPTY |
---|
944 | | -} __ABI_PACKED; |
---|
| 1215 | + BPMP_ABI_EMPTY |
---|
| 1216 | +} BPMP_ABI_PACKED; |
---|
945 | 1217 | |
---|
946 | 1218 | struct cmd_clk_get_all_info_response { |
---|
947 | 1219 | uint32_t flags; |
---|
.. | .. |
---|
949 | 1221 | uint32_t parents[MRQ_CLK_MAX_PARENTS]; |
---|
950 | 1222 | uint8_t num_parents; |
---|
951 | 1223 | uint8_t name[MRQ_CLK_NAME_MAXLEN]; |
---|
952 | | -} __ABI_PACKED; |
---|
| 1224 | +} BPMP_ABI_PACKED; |
---|
953 | 1225 | |
---|
954 | 1226 | /** @private */ |
---|
955 | 1227 | struct cmd_clk_get_max_clk_id_request { |
---|
956 | | - EMPTY |
---|
957 | | -} __ABI_PACKED; |
---|
| 1228 | + BPMP_ABI_EMPTY |
---|
| 1229 | +} BPMP_ABI_PACKED; |
---|
958 | 1230 | |
---|
959 | 1231 | struct cmd_clk_get_max_clk_id_response { |
---|
960 | 1232 | uint32_t max_id; |
---|
961 | | -} __ABI_PACKED; |
---|
962 | | -/** @} */ |
---|
| 1233 | +} BPMP_ABI_PACKED; |
---|
| 1234 | + |
---|
| 1235 | +/** @private */ |
---|
| 1236 | +struct cmd_clk_get_fmax_at_vmin_request { |
---|
| 1237 | + BPMP_ABI_EMPTY |
---|
| 1238 | +} BPMP_ABI_PACKED; |
---|
| 1239 | + |
---|
| 1240 | +struct cmd_clk_get_fmax_at_vmin_response { |
---|
| 1241 | + int64_t rate; |
---|
| 1242 | +} BPMP_ABI_PACKED; |
---|
963 | 1243 | |
---|
964 | 1244 | /** |
---|
965 | 1245 | * @ingroup Clocks |
---|
966 | | - * @brief request with #MRQ_CLK |
---|
| 1246 | + * @brief Request with #MRQ_CLK |
---|
967 | 1247 | * |
---|
968 | 1248 | * Used by the sender of an #MRQ_CLK message to control clocks. The |
---|
969 | 1249 | * clk_request is split into several sub-commands. Some sub-commands |
---|
.. | .. |
---|
982 | 1262 | * |CMD_CLK_DISABLE |- | |
---|
983 | 1263 | * |CMD_CLK_GET_ALL_INFO |- | |
---|
984 | 1264 | * |CMD_CLK_GET_MAX_CLK_ID |- | |
---|
| 1265 | + * |CMD_CLK_GET_FMAX_AT_VMIN |- |
---|
| 1266 | + * | |
---|
985 | 1267 | * |
---|
986 | 1268 | */ |
---|
987 | 1269 | |
---|
988 | 1270 | struct mrq_clk_request { |
---|
989 | | - /** @brief sub-command and clock id concatenated to 32-bit word. |
---|
| 1271 | + /** @brief Sub-command and clock id concatenated to 32-bit word. |
---|
990 | 1272 | * - bits[31..24] is the sub-cmd. |
---|
991 | 1273 | * - bits[23..0] is the clock id |
---|
992 | 1274 | */ |
---|
.. | .. |
---|
1010 | 1292 | struct cmd_clk_get_all_info_request clk_get_all_info; |
---|
1011 | 1293 | /** @private */ |
---|
1012 | 1294 | struct cmd_clk_get_max_clk_id_request clk_get_max_clk_id; |
---|
1013 | | - } __UNION_ANON; |
---|
1014 | | -} __ABI_PACKED; |
---|
| 1295 | + /** @private */ |
---|
| 1296 | + struct cmd_clk_get_fmax_at_vmin_request clk_get_fmax_at_vmin; |
---|
| 1297 | + } BPMP_UNION_ANON; |
---|
| 1298 | +} BPMP_ABI_PACKED; |
---|
1015 | 1299 | |
---|
1016 | 1300 | /** |
---|
1017 | 1301 | * @ingroup Clocks |
---|
1018 | | - * @brief response to MRQ_CLK |
---|
| 1302 | + * @brief Response to MRQ_CLK |
---|
1019 | 1303 | * |
---|
1020 | 1304 | * Each sub-command supported by @ref mrq_clk_request may return |
---|
1021 | 1305 | * sub-command-specific data. Some do and some do not as indicated in |
---|
.. | .. |
---|
1033 | 1317 | * |CMD_CLK_DISABLE |- | |
---|
1034 | 1318 | * |CMD_CLK_GET_ALL_INFO |clk_get_all_info | |
---|
1035 | 1319 | * |CMD_CLK_GET_MAX_CLK_ID |clk_get_max_id | |
---|
| 1320 | + * |CMD_CLK_GET_FMAX_AT_VMIN |clk_get_fmax_at_vmin | |
---|
1036 | 1321 | * |
---|
1037 | 1322 | */ |
---|
1038 | 1323 | |
---|
.. | .. |
---|
1050 | 1335 | struct cmd_clk_is_enabled_response clk_is_enabled; |
---|
1051 | 1336 | struct cmd_clk_get_all_info_response clk_get_all_info; |
---|
1052 | 1337 | struct cmd_clk_get_max_clk_id_response clk_get_max_clk_id; |
---|
1053 | | - } __UNION_ANON; |
---|
1054 | | -} __ABI_PACKED; |
---|
| 1338 | + struct cmd_clk_get_fmax_at_vmin_response clk_get_fmax_at_vmin; |
---|
| 1339 | + } BPMP_UNION_ANON; |
---|
| 1340 | +} BPMP_ABI_PACKED; |
---|
| 1341 | + |
---|
| 1342 | +/** @} */ |
---|
1055 | 1343 | |
---|
1056 | 1344 | /** |
---|
1057 | 1345 | * @ingroup MRQ_Codes |
---|
1058 | 1346 | * @def MRQ_QUERY_ABI |
---|
1059 | | - * @brief check if an MRQ is implemented |
---|
| 1347 | + * @brief Check if an MRQ is implemented |
---|
1060 | 1348 | * |
---|
1061 | 1349 | * * Platforms: All |
---|
1062 | 1350 | * * Initiators: Any |
---|
.. | .. |
---|
1067 | 1355 | |
---|
1068 | 1356 | /** |
---|
1069 | 1357 | * @ingroup ABI_info |
---|
1070 | | - * @brief request with MRQ_QUERY_ABI |
---|
| 1358 | + * @brief Request with MRQ_QUERY_ABI |
---|
1071 | 1359 | * |
---|
1072 | 1360 | * Used by #MRQ_QUERY_ABI call to check if MRQ code #mrq is supported |
---|
1073 | 1361 | * by the recipient. |
---|
.. | .. |
---|
1075 | 1363 | struct mrq_query_abi_request { |
---|
1076 | 1364 | /** @brief MRQ code to query */ |
---|
1077 | 1365 | uint32_t mrq; |
---|
1078 | | -} __ABI_PACKED; |
---|
| 1366 | +} BPMP_ABI_PACKED; |
---|
1079 | 1367 | |
---|
1080 | 1368 | /** |
---|
1081 | 1369 | * @ingroup ABI_info |
---|
1082 | | - * @brief response to MRQ_QUERY_ABI |
---|
| 1370 | + * @brief Response to MRQ_QUERY_ABI |
---|
1083 | 1371 | * |
---|
1084 | 1372 | * @note mrq_response::err of 0 indicates that the query was |
---|
1085 | 1373 | * successful, not that the MRQ itself is supported! |
---|
.. | .. |
---|
1087 | 1375 | struct mrq_query_abi_response { |
---|
1088 | 1376 | /** @brief 0 if queried MRQ is supported. Else, -#BPMP_ENODEV */ |
---|
1089 | 1377 | int32_t status; |
---|
1090 | | -} __ABI_PACKED; |
---|
| 1378 | +} BPMP_ABI_PACKED; |
---|
1091 | 1379 | |
---|
1092 | 1380 | /** |
---|
1093 | 1381 | * @ingroup MRQ_Codes |
---|
1094 | 1382 | * @def MRQ_PG_READ_STATE |
---|
1095 | | - * @brief read the power-gating state of a partition |
---|
| 1383 | + * @brief Read the power-gating state of a partition |
---|
1096 | 1384 | * |
---|
1097 | 1385 | * * Platforms: T186 |
---|
| 1386 | + * @cond bpmp_t186 |
---|
1098 | 1387 | * * Initiators: Any |
---|
1099 | 1388 | * * Targets: BPMP |
---|
1100 | 1389 | * * Request Payload: @ref mrq_pg_read_state_request |
---|
1101 | 1390 | * * Response Payload: @ref mrq_pg_read_state_response |
---|
1102 | | - * @addtogroup Powergating |
---|
1103 | | - * @{ |
---|
1104 | 1391 | */ |
---|
1105 | 1392 | |
---|
1106 | 1393 | /** |
---|
1107 | | - * @brief request with #MRQ_PG_READ_STATE |
---|
| 1394 | + * @ingroup Powergating |
---|
| 1395 | + * @brief Request with #MRQ_PG_READ_STATE |
---|
1108 | 1396 | * |
---|
1109 | 1397 | * Used by MRQ_PG_READ_STATE call to read the current state of a |
---|
1110 | 1398 | * partition. |
---|
.. | .. |
---|
1112 | 1400 | struct mrq_pg_read_state_request { |
---|
1113 | 1401 | /** @brief ID of partition */ |
---|
1114 | 1402 | uint32_t partition_id; |
---|
1115 | | -} __ABI_PACKED; |
---|
| 1403 | +} BPMP_ABI_PACKED; |
---|
1116 | 1404 | |
---|
1117 | 1405 | /** |
---|
1118 | | - * @brief response to MRQ_PG_READ_STATE |
---|
| 1406 | + * @ingroup Powergating |
---|
| 1407 | + * @brief Response to MRQ_PG_READ_STATE |
---|
1119 | 1408 | * @todo define possible errors. |
---|
1120 | 1409 | */ |
---|
1121 | 1410 | struct mrq_pg_read_state_response { |
---|
1122 | | - /** @brief read as don't care */ |
---|
| 1411 | + /** @brief Read as don't care */ |
---|
1123 | 1412 | uint32_t sram_state; |
---|
1124 | | - /** @brief state of power partition |
---|
| 1413 | + /** @brief State of power partition |
---|
1125 | 1414 | * * 0 : off |
---|
1126 | 1415 | * * 1 : on |
---|
1127 | 1416 | */ |
---|
1128 | 1417 | uint32_t logic_state; |
---|
1129 | | -} __ABI_PACKED; |
---|
1130 | | - |
---|
| 1418 | +} BPMP_ABI_PACKED; |
---|
| 1419 | +/** @endcond*/ |
---|
1131 | 1420 | /** @} */ |
---|
1132 | 1421 | |
---|
1133 | 1422 | /** |
---|
1134 | 1423 | * @ingroup MRQ_Codes |
---|
1135 | 1424 | * @def MRQ_PG_UPDATE_STATE |
---|
1136 | | - * @brief modify the power-gating state of a partition. In contrast to |
---|
| 1425 | + * @brief Modify the power-gating state of a partition. In contrast to |
---|
1137 | 1426 | * MRQ_PG calls, the operations that change state (on/off) of power |
---|
1138 | 1427 | * partition are reference counted. |
---|
1139 | 1428 | * |
---|
1140 | 1429 | * * Platforms: T186 |
---|
| 1430 | + * @cond bpmp_t186 |
---|
1141 | 1431 | * * Initiators: Any |
---|
1142 | 1432 | * * Targets: BPMP |
---|
1143 | 1433 | * * Request Payload: @ref mrq_pg_update_state_request |
---|
1144 | 1434 | * * Response Payload: N/A |
---|
1145 | | - * @addtogroup Powergating |
---|
1146 | | - * @{ |
---|
1147 | 1435 | */ |
---|
1148 | 1436 | |
---|
1149 | 1437 | /** |
---|
1150 | | - * @brief request with mrq_pg_update_state_request |
---|
| 1438 | + * @ingroup Powergating |
---|
| 1439 | + * @brief Request with mrq_pg_update_state_request |
---|
1151 | 1440 | * |
---|
1152 | 1441 | * Used by #MRQ_PG_UPDATE_STATE call to request BPMP to change the |
---|
1153 | 1442 | * state of a power partition #partition_id. |
---|
.. | .. |
---|
1155 | 1444 | struct mrq_pg_update_state_request { |
---|
1156 | 1445 | /** @brief ID of partition */ |
---|
1157 | 1446 | uint32_t partition_id; |
---|
1158 | | - /** @brief secondary control of power partition |
---|
| 1447 | + /** @brief Secondary control of power partition |
---|
1159 | 1448 | * @details Ignored by many versions of the BPMP |
---|
1160 | 1449 | * firmware. For maximum compatibility, set the value |
---|
1161 | | - * according to @logic_state |
---|
| 1450 | + * according to @ref logic_state |
---|
1162 | 1451 | * * 0x1: power ON partition (@ref logic_state == 0x3) |
---|
1163 | 1452 | * * 0x3: power OFF partition (@ref logic_state == 0x1) |
---|
1164 | 1453 | */ |
---|
1165 | 1454 | uint32_t sram_state; |
---|
1166 | | - /** @brief controls state of power partition, legal values are |
---|
| 1455 | + /** @brief Controls state of power partition, legal values are |
---|
1167 | 1456 | * * 0x1 : power OFF partition |
---|
1168 | 1457 | * * 0x3 : power ON partition |
---|
1169 | 1458 | */ |
---|
1170 | 1459 | uint32_t logic_state; |
---|
1171 | | - /** @brief change state of clocks of the power partition, legal values |
---|
| 1460 | + /** @brief Change state of clocks of the power partition, legal values |
---|
1172 | 1461 | * * 0x0 : do not change clock state |
---|
1173 | 1462 | * * 0x1 : disable partition clocks (only applicable when |
---|
1174 | 1463 | * @ref logic_state == 0x1) |
---|
.. | .. |
---|
1176 | 1465 | * @ref logic_state == 0x3) |
---|
1177 | 1466 | */ |
---|
1178 | 1467 | uint32_t clock_state; |
---|
1179 | | -} __ABI_PACKED; |
---|
1180 | | -/** @} */ |
---|
| 1468 | +} BPMP_ABI_PACKED; |
---|
| 1469 | +/** @endcond*/ |
---|
1181 | 1470 | |
---|
1182 | 1471 | /** |
---|
1183 | 1472 | * @ingroup MRQ_Codes |
---|
.. | .. |
---|
1186 | 1475 | * MRQ_PG_UPDATE_STATE, operations that change the power partition |
---|
1187 | 1476 | * state are NOT reference counted |
---|
1188 | 1477 | * |
---|
1189 | | - * * Platforms: T186 |
---|
| 1478 | + * @note BPMP-FW forcefully turns off some partitions as part of SC7 entry |
---|
| 1479 | + * because their state cannot be adequately restored on exit. Therefore, |
---|
| 1480 | + * it is recommended to power off all domains via MRQ_PG prior to SC7 entry. |
---|
| 1481 | + * See @ref bpmp_pdomain_ids for further detail. |
---|
| 1482 | + * |
---|
| 1483 | + * * Platforms: T186, T194 |
---|
1190 | 1484 | * * Initiators: Any |
---|
1191 | 1485 | * * Targets: BPMP |
---|
1192 | 1486 | * * Request Payload: @ref mrq_pg_request |
---|
1193 | 1487 | * * Response Payload: @ref mrq_pg_response |
---|
| 1488 | + * |
---|
1194 | 1489 | * @addtogroup Powergating |
---|
1195 | | - * @{ |
---|
1196 | | - */ |
---|
1197 | | - |
---|
1198 | | -/** |
---|
1199 | | - * @name MRQ_PG sub-commands |
---|
1200 | 1490 | * @{ |
---|
1201 | 1491 | */ |
---|
1202 | 1492 | enum mrq_pg_cmd { |
---|
.. | .. |
---|
1232 | 1522 | CMD_PG_GET_STATE = 2, |
---|
1233 | 1523 | |
---|
1234 | 1524 | /** |
---|
1235 | | - * @brief get the name string of specified power domain id. |
---|
| 1525 | + * @brief Get the name string of specified power domain id. |
---|
1236 | 1526 | * |
---|
1237 | 1527 | * mrq_response:err is |
---|
1238 | 1528 | * 0: Success |
---|
.. | .. |
---|
1242 | 1532 | |
---|
1243 | 1533 | |
---|
1244 | 1534 | /** |
---|
1245 | | - * @brief get the highest power domain id in the system. Not |
---|
| 1535 | + * @brief Get the highest power domain id in the system. Not |
---|
1246 | 1536 | * all IDs between 0 and max_id are valid IDs. |
---|
1247 | 1537 | * |
---|
1248 | 1538 | * mrq_response:err is |
---|
.. | .. |
---|
1251 | 1541 | */ |
---|
1252 | 1542 | CMD_PG_GET_MAX_ID = 4, |
---|
1253 | 1543 | }; |
---|
1254 | | -/** @} */ |
---|
1255 | 1544 | |
---|
1256 | 1545 | #define MRQ_PG_NAME_MAXLEN 40 |
---|
1257 | 1546 | |
---|
1258 | | -/** |
---|
1259 | | - * @brief possible power domain states in |
---|
1260 | | - * cmd_pg_set_state_request:state and cmd_pg_get_state_response:state. |
---|
1261 | | - * PG_STATE_OFF: power domain is OFF |
---|
1262 | | - * PG_STATE_ON: power domain is ON |
---|
1263 | | - * PG_STATE_RUNNING: power domain is ON and made into directly usable |
---|
1264 | | - * state by turning on the clocks associated with |
---|
1265 | | - * the domain |
---|
1266 | | - */ |
---|
1267 | 1547 | enum pg_states { |
---|
| 1548 | + /** @brief Power domain is OFF */ |
---|
1268 | 1549 | PG_STATE_OFF = 0, |
---|
| 1550 | + /** @brief Power domain is ON */ |
---|
1269 | 1551 | PG_STATE_ON = 1, |
---|
| 1552 | + /** |
---|
| 1553 | + * @brief a legacy state where power domain and the clock |
---|
| 1554 | + * associated to the domain are ON. |
---|
| 1555 | + * This state is only supported in T186, and the use of it is |
---|
| 1556 | + * deprecated. |
---|
| 1557 | + */ |
---|
1270 | 1558 | PG_STATE_RUNNING = 2, |
---|
1271 | 1559 | }; |
---|
1272 | 1560 | |
---|
1273 | 1561 | struct cmd_pg_query_abi_request { |
---|
1274 | | - uint32_t type; /* enum mrq_pg_cmd */ |
---|
1275 | | -} __ABI_PACKED; |
---|
| 1562 | + /** @ref mrq_pg_cmd */ |
---|
| 1563 | + uint32_t type; |
---|
| 1564 | +} BPMP_ABI_PACKED; |
---|
1276 | 1565 | |
---|
1277 | 1566 | struct cmd_pg_set_state_request { |
---|
1278 | | - uint32_t state; /* enum pg_states */ |
---|
1279 | | -} __ABI_PACKED; |
---|
| 1567 | + /** @ref pg_states */ |
---|
| 1568 | + uint32_t state; |
---|
| 1569 | +} BPMP_ABI_PACKED; |
---|
1280 | 1570 | |
---|
| 1571 | +/** |
---|
| 1572 | + * @brief Response data to #MRQ_PG sub command #CMD_PG_GET_STATE |
---|
| 1573 | + */ |
---|
1281 | 1574 | struct cmd_pg_get_state_response { |
---|
1282 | | - uint32_t state; /* enum pg_states */ |
---|
1283 | | -} __ABI_PACKED; |
---|
| 1575 | + /** |
---|
| 1576 | + * @brief The state of the power partition that has been |
---|
| 1577 | + * succesfuly requested by the master earlier using #MRQ_PG |
---|
| 1578 | + * command #CMD_PG_SET_STATE. |
---|
| 1579 | + * |
---|
| 1580 | + * The state may not reflect the physical state of the power |
---|
| 1581 | + * partition if there are some other masters requesting it to |
---|
| 1582 | + * be enabled. |
---|
| 1583 | + * |
---|
| 1584 | + * See @ref pg_states for possible values |
---|
| 1585 | + */ |
---|
| 1586 | + uint32_t state; |
---|
| 1587 | +} BPMP_ABI_PACKED; |
---|
1284 | 1588 | |
---|
1285 | 1589 | struct cmd_pg_get_name_response { |
---|
1286 | 1590 | uint8_t name[MRQ_PG_NAME_MAXLEN]; |
---|
1287 | | -} __ABI_PACKED; |
---|
| 1591 | +} BPMP_ABI_PACKED; |
---|
1288 | 1592 | |
---|
1289 | 1593 | struct cmd_pg_get_max_id_response { |
---|
1290 | 1594 | uint32_t max_id; |
---|
1291 | | -} __ABI_PACKED; |
---|
| 1595 | +} BPMP_ABI_PACKED; |
---|
1292 | 1596 | |
---|
1293 | 1597 | /** |
---|
1294 | | - * @ingroup Powergating |
---|
1295 | | - * @brief request with #MRQ_PG |
---|
| 1598 | + * @brief Request with #MRQ_PG |
---|
1296 | 1599 | * |
---|
1297 | 1600 | * Used by the sender of an #MRQ_PG message to control power |
---|
1298 | 1601 | * partitions. The pg_request is split into several sub-commands. Some |
---|
.. | .. |
---|
1308 | 1611 | * |CMD_PG_GET_MAX_ID | - | |
---|
1309 | 1612 | * |
---|
1310 | 1613 | */ |
---|
1311 | | - |
---|
1312 | 1614 | struct mrq_pg_request { |
---|
1313 | 1615 | uint32_t cmd; |
---|
1314 | 1616 | uint32_t id; |
---|
1315 | 1617 | union { |
---|
1316 | 1618 | struct cmd_pg_query_abi_request query_abi; |
---|
1317 | 1619 | struct cmd_pg_set_state_request set_state; |
---|
1318 | | - } __UNION_ANON; |
---|
1319 | | -} __ABI_PACKED; |
---|
| 1620 | + } BPMP_UNION_ANON; |
---|
| 1621 | +} BPMP_ABI_PACKED; |
---|
1320 | 1622 | |
---|
1321 | 1623 | /** |
---|
1322 | | - * @ingroup Powergating |
---|
1323 | | - * @brief response to MRQ_PG |
---|
| 1624 | + * @brief Response to MRQ_PG |
---|
1324 | 1625 | * |
---|
1325 | 1626 | * Each sub-command supported by @ref mrq_pg_request may return |
---|
1326 | 1627 | * sub-command-specific data. Some do and some do not as indicated in |
---|
.. | .. |
---|
1333 | 1634 | * |CMD_PG_GET_STATE | get_state | |
---|
1334 | 1635 | * |CMD_PG_GET_NAME | get_name | |
---|
1335 | 1636 | * |CMD_PG_GET_MAX_ID | get_max_id | |
---|
1336 | | - * |
---|
1337 | 1637 | */ |
---|
1338 | | - |
---|
1339 | 1638 | struct mrq_pg_response { |
---|
1340 | 1639 | union { |
---|
1341 | 1640 | struct cmd_pg_get_state_response get_state; |
---|
1342 | 1641 | struct cmd_pg_get_name_response get_name; |
---|
1343 | 1642 | struct cmd_pg_get_max_id_response get_max_id; |
---|
1344 | | - } __UNION_ANON; |
---|
1345 | | -} __ABI_PACKED; |
---|
| 1643 | + } BPMP_UNION_ANON; |
---|
| 1644 | +} BPMP_ABI_PACKED; |
---|
| 1645 | + |
---|
| 1646 | +/** @} */ |
---|
1346 | 1647 | |
---|
1347 | 1648 | /** |
---|
1348 | 1649 | * @ingroup MRQ_Codes |
---|
1349 | 1650 | * @def MRQ_THERMAL |
---|
1350 | | - * @brief interact with BPMP thermal framework |
---|
| 1651 | + * @brief Interact with BPMP thermal framework |
---|
1351 | 1652 | * |
---|
1352 | | - * * Platforms: T186 |
---|
| 1653 | + * * Platforms: T186, T194 |
---|
1353 | 1654 | * * Initiators: Any |
---|
1354 | 1655 | * * Targets: Any |
---|
1355 | 1656 | * * Request Payload: TODO |
---|
.. | .. |
---|
1429 | 1730 | */ |
---|
1430 | 1731 | CMD_THERMAL_GET_NUM_ZONES = 3, |
---|
1431 | 1732 | |
---|
| 1733 | + /** |
---|
| 1734 | + * @brief Get the thermtrip of the specified zone. |
---|
| 1735 | + * |
---|
| 1736 | + * Host needs to supply request parameters. |
---|
| 1737 | + * |
---|
| 1738 | + * mrq_response::err is |
---|
| 1739 | + * * 0: Valid zone information returned. |
---|
| 1740 | + * * -#BPMP_EINVAL: Invalid request parameters. |
---|
| 1741 | + * * -#BPMP_ENOENT: No driver registered for thermal zone. |
---|
| 1742 | + * * -#BPMP_ERANGE if thermtrip is invalid or disabled. |
---|
| 1743 | + * * -#BPMP_EFAULT: Problem reading zone information. |
---|
| 1744 | + */ |
---|
| 1745 | + CMD_THERMAL_GET_THERMTRIP = 4, |
---|
| 1746 | + |
---|
1432 | 1747 | /** @brief: number of supported host-to-bpmp commands. May |
---|
1433 | 1748 | * increase in future |
---|
1434 | 1749 | */ |
---|
.. | .. |
---|
1459 | 1774 | */ |
---|
1460 | 1775 | struct cmd_thermal_query_abi_request { |
---|
1461 | 1776 | uint32_t type; |
---|
1462 | | -} __ABI_PACKED; |
---|
| 1777 | +} BPMP_ABI_PACKED; |
---|
1463 | 1778 | |
---|
1464 | 1779 | /* |
---|
1465 | 1780 | * Host->BPMP request data for request type CMD_THERMAL_GET_TEMP |
---|
.. | .. |
---|
1468 | 1783 | */ |
---|
1469 | 1784 | struct cmd_thermal_get_temp_request { |
---|
1470 | 1785 | uint32_t zone; |
---|
1471 | | -} __ABI_PACKED; |
---|
| 1786 | +} BPMP_ABI_PACKED; |
---|
1472 | 1787 | |
---|
1473 | 1788 | /* |
---|
1474 | 1789 | * BPMP->Host reply data for request CMD_THERMAL_GET_TEMP |
---|
.. | .. |
---|
1481 | 1796 | */ |
---|
1482 | 1797 | struct cmd_thermal_get_temp_response { |
---|
1483 | 1798 | int32_t temp; |
---|
1484 | | -} __ABI_PACKED; |
---|
| 1799 | +} BPMP_ABI_PACKED; |
---|
1485 | 1800 | |
---|
1486 | 1801 | /* |
---|
1487 | 1802 | * Host->BPMP request data for request type CMD_THERMAL_SET_TRIP |
---|
.. | .. |
---|
1496 | 1811 | int32_t low; |
---|
1497 | 1812 | int32_t high; |
---|
1498 | 1813 | uint32_t enabled; |
---|
1499 | | -} __ABI_PACKED; |
---|
| 1814 | +} BPMP_ABI_PACKED; |
---|
1500 | 1815 | |
---|
1501 | 1816 | /* |
---|
1502 | 1817 | * BPMP->Host request data for request type CMD_THERMAL_HOST_TRIP_REACHED |
---|
.. | .. |
---|
1505 | 1820 | */ |
---|
1506 | 1821 | struct cmd_thermal_host_trip_reached_request { |
---|
1507 | 1822 | uint32_t zone; |
---|
1508 | | -} __ABI_PACKED; |
---|
| 1823 | +} BPMP_ABI_PACKED; |
---|
1509 | 1824 | |
---|
1510 | 1825 | /* |
---|
1511 | 1826 | * BPMP->Host reply data for request type CMD_THERMAL_GET_NUM_ZONES |
---|
.. | .. |
---|
1515 | 1830 | */ |
---|
1516 | 1831 | struct cmd_thermal_get_num_zones_response { |
---|
1517 | 1832 | uint32_t num; |
---|
1518 | | -} __ABI_PACKED; |
---|
| 1833 | +} BPMP_ABI_PACKED; |
---|
| 1834 | + |
---|
| 1835 | +/* |
---|
| 1836 | + * Host->BPMP request data for request type CMD_THERMAL_GET_THERMTRIP |
---|
| 1837 | + * |
---|
| 1838 | + * zone: Number of thermal zone. |
---|
| 1839 | + */ |
---|
| 1840 | +struct cmd_thermal_get_thermtrip_request { |
---|
| 1841 | + uint32_t zone; |
---|
| 1842 | +} BPMP_ABI_PACKED; |
---|
| 1843 | + |
---|
| 1844 | +/* |
---|
| 1845 | + * BPMP->Host reply data for request CMD_THERMAL_GET_THERMTRIP |
---|
| 1846 | + * |
---|
| 1847 | + * thermtrip: HW shutdown temperature in millicelsius. |
---|
| 1848 | + */ |
---|
| 1849 | +struct cmd_thermal_get_thermtrip_response { |
---|
| 1850 | + int32_t thermtrip; |
---|
| 1851 | +} BPMP_ABI_PACKED; |
---|
1519 | 1852 | |
---|
1520 | 1853 | /* |
---|
1521 | 1854 | * Host->BPMP request data. |
---|
.. | .. |
---|
1531 | 1864 | struct cmd_thermal_query_abi_request query_abi; |
---|
1532 | 1865 | struct cmd_thermal_get_temp_request get_temp; |
---|
1533 | 1866 | struct cmd_thermal_set_trip_request set_trip; |
---|
1534 | | - } __UNION_ANON; |
---|
1535 | | -} __ABI_PACKED; |
---|
| 1867 | + struct cmd_thermal_get_thermtrip_request get_thermtrip; |
---|
| 1868 | + } BPMP_UNION_ANON; |
---|
| 1869 | +} BPMP_ABI_PACKED; |
---|
1536 | 1870 | |
---|
1537 | 1871 | /* |
---|
1538 | 1872 | * BPMP->Host request data. |
---|
.. | .. |
---|
1544 | 1878 | uint32_t type; |
---|
1545 | 1879 | union { |
---|
1546 | 1880 | struct cmd_thermal_host_trip_reached_request host_trip_reached; |
---|
1547 | | - } __UNION_ANON; |
---|
1548 | | -} __ABI_PACKED; |
---|
| 1881 | + } BPMP_UNION_ANON; |
---|
| 1882 | +} BPMP_ABI_PACKED; |
---|
1549 | 1883 | |
---|
1550 | 1884 | /* |
---|
1551 | 1885 | * Data in reply to a Host->BPMP request. |
---|
1552 | 1886 | */ |
---|
1553 | 1887 | union mrq_thermal_bpmp_to_host_response { |
---|
1554 | 1888 | struct cmd_thermal_get_temp_response get_temp; |
---|
| 1889 | + struct cmd_thermal_get_thermtrip_response get_thermtrip; |
---|
1555 | 1890 | struct cmd_thermal_get_num_zones_response get_num_zones; |
---|
1556 | | -} __ABI_PACKED; |
---|
| 1891 | +} BPMP_ABI_PACKED; |
---|
1557 | 1892 | /** @} */ |
---|
1558 | 1893 | |
---|
1559 | 1894 | /** |
---|
.. | .. |
---|
1562 | 1897 | * @brief Query CPU voltage hint data |
---|
1563 | 1898 | * |
---|
1564 | 1899 | * * Platforms: T186 |
---|
| 1900 | + * @cond bpmp_t186 |
---|
1565 | 1901 | * * Initiators: CCPLEX |
---|
1566 | 1902 | * * Targets: BPMP |
---|
1567 | 1903 | * * Request Payload: @ref mrq_cpu_vhint_request |
---|
1568 | 1904 | * * Response Payload: N/A |
---|
1569 | 1905 | * |
---|
1570 | | - * @addtogroup Vhint CPU Voltage hint |
---|
| 1906 | + * @addtogroup Vhint |
---|
1571 | 1907 | * @{ |
---|
1572 | 1908 | */ |
---|
1573 | 1909 | |
---|
1574 | 1910 | /** |
---|
1575 | | - * @brief request with #MRQ_CPU_VHINT |
---|
| 1911 | + * @brief Request with #MRQ_CPU_VHINT |
---|
1576 | 1912 | * |
---|
1577 | 1913 | * Used by #MRQ_CPU_VHINT call by CCPLEX to retrieve voltage hint data |
---|
1578 | 1914 | * from BPMP to memory space pointed by #addr. CCPLEX is responsible |
---|
.. | .. |
---|
1581 | 1917 | */ |
---|
1582 | 1918 | struct mrq_cpu_vhint_request { |
---|
1583 | 1919 | /** @brief IOVA address for the #cpu_vhint_data */ |
---|
1584 | | - uint32_t addr; /* struct cpu_vhint_data * */ |
---|
| 1920 | + uint32_t addr; |
---|
1585 | 1921 | /** @brief ID of the cluster whose data is requested */ |
---|
1586 | | - uint32_t cluster_id; /* enum cluster_id */ |
---|
1587 | | -} __ABI_PACKED; |
---|
| 1922 | + uint32_t cluster_id; |
---|
| 1923 | +} BPMP_ABI_PACKED; |
---|
1588 | 1924 | |
---|
1589 | 1925 | /** |
---|
1590 | | - * @brief description of the CPU v/f relation |
---|
| 1926 | + * @brief Description of the CPU v/f relation |
---|
1591 | 1927 | * |
---|
1592 | | - * Used by #MRQ_CPU_VHINT call to carry data pointed by #addr of |
---|
1593 | | - * struct mrq_cpu_vhint_request |
---|
| 1928 | + * Used by #MRQ_CPU_VHINT call to carry data pointed by |
---|
| 1929 | + * #mrq_cpu_vhint_request::addr |
---|
1594 | 1930 | */ |
---|
1595 | 1931 | struct cpu_vhint_data { |
---|
1596 | 1932 | uint32_t ref_clk_hz; /**< reference frequency in Hz */ |
---|
.. | .. |
---|
1611 | 1947 | uint16_t vindex_div; |
---|
1612 | 1948 | /** reserved for future use */ |
---|
1613 | 1949 | uint16_t reserved[328]; |
---|
1614 | | -} __ABI_PACKED; |
---|
1615 | | - |
---|
| 1950 | +} BPMP_ABI_PACKED; |
---|
| 1951 | +/** @endcond */ |
---|
1616 | 1952 | /** @} */ |
---|
1617 | 1953 | |
---|
1618 | 1954 | /** |
---|
.. | .. |
---|
1620 | 1956 | * @def MRQ_ABI_RATCHET |
---|
1621 | 1957 | * @brief ABI ratchet value query |
---|
1622 | 1958 | * |
---|
1623 | | - * * Platforms: T186 |
---|
| 1959 | + * * Platforms: T186, T194 |
---|
1624 | 1960 | * * Initiators: Any |
---|
1625 | 1961 | * * Targets: BPMP |
---|
1626 | 1962 | * * Request Payload: @ref mrq_abi_ratchet_request |
---|
.. | .. |
---|
1630 | 1966 | */ |
---|
1631 | 1967 | |
---|
1632 | 1968 | /** |
---|
1633 | | - * @brief an ABI compatibility mechanism |
---|
| 1969 | + * @brief An ABI compatibility mechanism |
---|
1634 | 1970 | * |
---|
1635 | 1971 | * BPMP_ABI_RATCHET_VALUE may increase for various reasons in a future |
---|
1636 | 1972 | * revision of this header file. |
---|
.. | .. |
---|
1644 | 1980 | #define BPMP_ABI_RATCHET_VALUE 3 |
---|
1645 | 1981 | |
---|
1646 | 1982 | /** |
---|
1647 | | - * @brief request with #MRQ_ABI_RATCHET. |
---|
| 1983 | + * @brief Request with #MRQ_ABI_RATCHET. |
---|
1648 | 1984 | * |
---|
1649 | 1985 | * #ratchet should be #BPMP_ABI_RATCHET_VALUE from the ABI header |
---|
1650 | 1986 | * against which the requester was compiled. |
---|
.. | .. |
---|
1657 | 1993 | * Otherwise, err shall be 0. |
---|
1658 | 1994 | */ |
---|
1659 | 1995 | struct mrq_abi_ratchet_request { |
---|
1660 | | - /** @brief requester's ratchet value */ |
---|
| 1996 | + /** @brief Requester's ratchet value */ |
---|
1661 | 1997 | uint16_t ratchet; |
---|
1662 | 1998 | }; |
---|
1663 | 1999 | |
---|
1664 | 2000 | /** |
---|
1665 | | - * @brief response to #MRQ_ABI_RATCHET |
---|
| 2001 | + * @brief Response to #MRQ_ABI_RATCHET |
---|
1666 | 2002 | * |
---|
1667 | 2003 | * #ratchet shall be #BPMP_ABI_RATCHET_VALUE from the ABI header |
---|
1668 | 2004 | * against which BPMP firwmare was compiled. |
---|
.. | .. |
---|
1685 | 2021 | /** |
---|
1686 | 2022 | * @ingroup MRQ_Codes |
---|
1687 | 2023 | * @def MRQ_EMC_DVFS_LATENCY |
---|
1688 | | - * @brief query frequency dependent EMC DVFS latency |
---|
| 2024 | + * @brief Query frequency dependent EMC DVFS latency |
---|
1689 | 2025 | * |
---|
1690 | | - * * Platforms: T186 |
---|
| 2026 | + * * Platforms: T186, T194 |
---|
1691 | 2027 | * * Initiators: CCPLEX |
---|
1692 | 2028 | * * Targets: BPMP |
---|
1693 | 2029 | * * Request Payload: N/A |
---|
.. | .. |
---|
1697 | 2033 | */ |
---|
1698 | 2034 | |
---|
1699 | 2035 | /** |
---|
1700 | | - * @brief used by @ref mrq_emc_dvfs_latency_response |
---|
| 2036 | + * @brief Used by @ref mrq_emc_dvfs_latency_response |
---|
1701 | 2037 | */ |
---|
1702 | 2038 | struct emc_dvfs_latency { |
---|
1703 | | - /** @brief EMC frequency in kHz */ |
---|
| 2039 | + /** @brief EMC DVFS node frequency in kHz */ |
---|
1704 | 2040 | uint32_t freq; |
---|
1705 | 2041 | /** @brief EMC DVFS latency in nanoseconds */ |
---|
1706 | 2042 | uint32_t latency; |
---|
1707 | | -} __ABI_PACKED; |
---|
| 2043 | +} BPMP_ABI_PACKED; |
---|
1708 | 2044 | |
---|
1709 | 2045 | #define EMC_DVFS_LATENCY_MAX_SIZE 14 |
---|
1710 | 2046 | /** |
---|
1711 | | - * @brief response to #MRQ_EMC_DVFS_LATENCY |
---|
| 2047 | + * @brief Response to #MRQ_EMC_DVFS_LATENCY |
---|
1712 | 2048 | */ |
---|
1713 | 2049 | struct mrq_emc_dvfs_latency_response { |
---|
1714 | | - /** @brief the number valid entries in #pairs */ |
---|
| 2050 | + /** @brief The number valid entries in #pairs */ |
---|
1715 | 2051 | uint32_t num_pairs; |
---|
1716 | | - /** @brief EMC <frequency, latency> information */ |
---|
| 2052 | + /** @brief EMC DVFS node <frequency, latency> information */ |
---|
1717 | 2053 | struct emc_dvfs_latency pairs[EMC_DVFS_LATENCY_MAX_SIZE]; |
---|
1718 | | -} __ABI_PACKED; |
---|
| 2054 | +} BPMP_ABI_PACKED; |
---|
1719 | 2055 | |
---|
1720 | 2056 | /** @} */ |
---|
1721 | 2057 | |
---|
1722 | 2058 | /** |
---|
1723 | 2059 | * @ingroup MRQ_Codes |
---|
| 2060 | + * @def MRQ_CPU_NDIV_LIMITS |
---|
| 2061 | + * @brief CPU freq. limits in ndiv |
---|
| 2062 | + * |
---|
| 2063 | + * * Platforms: T194 onwards |
---|
| 2064 | + * @cond bpmp_t194 |
---|
| 2065 | + * * Initiators: CCPLEX |
---|
| 2066 | + * * Targets: BPMP |
---|
| 2067 | + * * Request Payload: @ref mrq_cpu_ndiv_limits_request |
---|
| 2068 | + * * Response Payload: @ref mrq_cpu_ndiv_limits_response |
---|
| 2069 | + * @addtogroup CPU |
---|
| 2070 | + * @{ |
---|
| 2071 | + */ |
---|
| 2072 | + |
---|
| 2073 | +/** |
---|
| 2074 | + * @brief Request for ndiv limits of a cluster |
---|
| 2075 | + */ |
---|
| 2076 | +struct mrq_cpu_ndiv_limits_request { |
---|
| 2077 | + /** @brief Enum cluster_id */ |
---|
| 2078 | + uint32_t cluster_id; |
---|
| 2079 | +} BPMP_ABI_PACKED; |
---|
| 2080 | + |
---|
| 2081 | +/** |
---|
| 2082 | + * @brief Response to #MRQ_CPU_NDIV_LIMITS |
---|
| 2083 | + */ |
---|
| 2084 | +struct mrq_cpu_ndiv_limits_response { |
---|
| 2085 | + /** @brief Reference frequency in Hz */ |
---|
| 2086 | + uint32_t ref_clk_hz; |
---|
| 2087 | + /** @brief Post divider value */ |
---|
| 2088 | + uint16_t pdiv; |
---|
| 2089 | + /** @brief Input divider value */ |
---|
| 2090 | + uint16_t mdiv; |
---|
| 2091 | + /** @brief FMAX expressed with max NDIV value */ |
---|
| 2092 | + uint16_t ndiv_max; |
---|
| 2093 | + /** @brief Minimum allowed NDIV value */ |
---|
| 2094 | + uint16_t ndiv_min; |
---|
| 2095 | +} BPMP_ABI_PACKED; |
---|
| 2096 | + |
---|
| 2097 | +/** @} */ |
---|
| 2098 | +/** @endcond */ |
---|
| 2099 | + |
---|
| 2100 | +/** |
---|
| 2101 | + * @ingroup MRQ_Codes |
---|
| 2102 | + * @def MRQ_CPU_AUTO_CC3 |
---|
| 2103 | + * @brief Query CPU cluster auto-CC3 configuration |
---|
| 2104 | + * |
---|
| 2105 | + * * Platforms: T194 onwards |
---|
| 2106 | + * @cond bpmp_t194 |
---|
| 2107 | + * * Initiators: CCPLEX |
---|
| 2108 | + * * Targets: BPMP |
---|
| 2109 | + * * Request Payload: @ref mrq_cpu_auto_cc3_request |
---|
| 2110 | + * * Response Payload: @ref mrq_cpu_auto_cc3_response |
---|
| 2111 | + * @addtogroup CC3 |
---|
| 2112 | + * |
---|
| 2113 | + * Queries from BPMP auto-CC3 configuration (allowed/not allowed) for a |
---|
| 2114 | + * specified cluster. CCPLEX s/w uses this information to override its own |
---|
| 2115 | + * device tree auto-CC3 settings, so that BPMP device tree is a single source of |
---|
| 2116 | + * auto-CC3 platform configuration. |
---|
| 2117 | + * |
---|
| 2118 | + * @{ |
---|
| 2119 | + */ |
---|
| 2120 | + |
---|
| 2121 | +/** |
---|
| 2122 | + * @brief Request for auto-CC3 configuration of a cluster |
---|
| 2123 | + */ |
---|
| 2124 | +struct mrq_cpu_auto_cc3_request { |
---|
| 2125 | + /** @brief Enum cluster_id (logical cluster id, known to CCPLEX s/w) */ |
---|
| 2126 | + uint32_t cluster_id; |
---|
| 2127 | +} BPMP_ABI_PACKED; |
---|
| 2128 | + |
---|
| 2129 | +/** |
---|
| 2130 | + * @brief Response to #MRQ_CPU_AUTO_CC3 |
---|
| 2131 | + */ |
---|
| 2132 | +struct mrq_cpu_auto_cc3_response { |
---|
| 2133 | + /** |
---|
| 2134 | + * @brief auto-CC3 configuration |
---|
| 2135 | + * |
---|
| 2136 | + * - bits[31..10] reserved. |
---|
| 2137 | + * - bits[9..1] cc3 ndiv |
---|
| 2138 | + * - bit [0] if "1" auto-CC3 is allowed, if "0" auto-CC3 is not allowed |
---|
| 2139 | + */ |
---|
| 2140 | + uint32_t auto_cc3_config; |
---|
| 2141 | +} BPMP_ABI_PACKED; |
---|
| 2142 | + |
---|
| 2143 | +/** @} */ |
---|
| 2144 | +/** @endcond */ |
---|
| 2145 | + |
---|
| 2146 | +/** |
---|
| 2147 | + * @ingroup MRQ_Codes |
---|
1724 | 2148 | * @def MRQ_TRACE_ITER |
---|
1725 | | - * @brief manage the trace iterator |
---|
| 2149 | + * @brief Manage the trace iterator |
---|
| 2150 | + * |
---|
| 2151 | + * @deprecated |
---|
1726 | 2152 | * |
---|
1727 | 2153 | * * Platforms: All |
---|
1728 | 2154 | * * Initiators: CCPLEX |
---|
.. | .. |
---|
1735 | 2161 | enum { |
---|
1736 | 2162 | /** @brief (re)start the tracing now. Ignore older events */ |
---|
1737 | 2163 | TRACE_ITER_INIT = 0, |
---|
1738 | | - /** @brief clobber all events in the trace buffer */ |
---|
| 2164 | + /** @brief Clobber all events in the trace buffer */ |
---|
1739 | 2165 | TRACE_ITER_CLEAN = 1 |
---|
1740 | 2166 | }; |
---|
1741 | 2167 | |
---|
1742 | 2168 | /** |
---|
1743 | | - * @brief request with #MRQ_TRACE_ITER |
---|
| 2169 | + * @brief Request with #MRQ_TRACE_ITER |
---|
1744 | 2170 | */ |
---|
1745 | 2171 | struct mrq_trace_iter_request { |
---|
1746 | 2172 | /** @brief TRACE_ITER_INIT or TRACE_ITER_CLEAN */ |
---|
1747 | 2173 | uint32_t cmd; |
---|
1748 | | -} __ABI_PACKED; |
---|
| 2174 | +} BPMP_ABI_PACKED; |
---|
1749 | 2175 | |
---|
1750 | 2176 | /** @} */ |
---|
1751 | 2177 | |
---|
.. | .. |
---|
1821 | 2247 | struct cmd_ringbuf_console_query_abi_req { |
---|
1822 | 2248 | /** @brief Command identifier to be queried */ |
---|
1823 | 2249 | uint32_t cmd; |
---|
1824 | | -} __ABI_PACKED; |
---|
| 2250 | +} BPMP_ABI_PACKED; |
---|
1825 | 2251 | |
---|
1826 | 2252 | /** @private */ |
---|
1827 | 2253 | struct cmd_ringbuf_console_query_abi_resp { |
---|
1828 | | - EMPTY |
---|
1829 | | -} __ABI_PACKED; |
---|
| 2254 | + BPMP_ABI_EMPTY |
---|
| 2255 | +} BPMP_ABI_PACKED; |
---|
1830 | 2256 | |
---|
1831 | 2257 | /** |
---|
1832 | 2258 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1837 | 2263 | * @brief Number of bytes requested to be read from the BPMP TX buffer |
---|
1838 | 2264 | */ |
---|
1839 | 2265 | uint8_t len; |
---|
1840 | | -} __ABI_PACKED; |
---|
| 2266 | +} BPMP_ABI_PACKED; |
---|
1841 | 2267 | |
---|
1842 | 2268 | /** |
---|
1843 | 2269 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1848 | 2274 | uint8_t data[MRQ_RINGBUF_CONSOLE_MAX_READ_LEN]; |
---|
1849 | 2275 | /** @brief Number of bytes in cmd_ringbuf_console_read_resp::data */ |
---|
1850 | 2276 | uint8_t len; |
---|
1851 | | -} __ABI_PACKED; |
---|
| 2277 | +} BPMP_ABI_PACKED; |
---|
1852 | 2278 | |
---|
1853 | 2279 | /** |
---|
1854 | 2280 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1859 | 2285 | uint8_t data[MRQ_RINGBUF_CONSOLE_MAX_WRITE_LEN]; |
---|
1860 | 2286 | /** @brief Number of bytes in cmd_ringbuf_console_write_req::data */ |
---|
1861 | 2287 | uint8_t len; |
---|
1862 | | -} __ABI_PACKED; |
---|
| 2288 | +} BPMP_ABI_PACKED; |
---|
1863 | 2289 | |
---|
1864 | 2290 | /** |
---|
1865 | 2291 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1870 | 2296 | uint32_t space_avail; |
---|
1871 | 2297 | /** @brief Number of bytes that were written to the BPMP RX buffer */ |
---|
1872 | 2298 | uint8_t len; |
---|
1873 | | -} __ABI_PACKED; |
---|
| 2299 | +} BPMP_ABI_PACKED; |
---|
1874 | 2300 | |
---|
1875 | 2301 | /** @private */ |
---|
1876 | 2302 | struct cmd_ringbuf_console_get_fifo_req { |
---|
1877 | | - EMPTY |
---|
1878 | | -} __ABI_PACKED; |
---|
| 2303 | + BPMP_ABI_EMPTY |
---|
| 2304 | +} BPMP_ABI_PACKED; |
---|
1879 | 2305 | |
---|
1880 | 2306 | /** |
---|
1881 | 2307 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1890 | 2316 | uint64_t bpmp_tx_tail_addr; |
---|
1891 | 2317 | /** @brief Length of the BPMP TX buffer */ |
---|
1892 | 2318 | uint32_t bpmp_tx_buf_len; |
---|
1893 | | -} __ABI_PACKED; |
---|
| 2319 | +} BPMP_ABI_PACKED; |
---|
1894 | 2320 | |
---|
1895 | 2321 | /** |
---|
1896 | 2322 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1900 | 2326 | */ |
---|
1901 | 2327 | struct mrq_ringbuf_console_host_to_bpmp_request { |
---|
1902 | 2328 | /** |
---|
1903 | | - * @brief type of request. Values listed in enum |
---|
| 2329 | + * @brief Type of request. Values listed in enum |
---|
1904 | 2330 | * #mrq_ringbuf_console_host_to_bpmp_cmd. |
---|
1905 | 2331 | */ |
---|
1906 | 2332 | uint32_t type; |
---|
.. | .. |
---|
1910 | 2336 | struct cmd_ringbuf_console_read_req read; |
---|
1911 | 2337 | struct cmd_ringbuf_console_write_req write; |
---|
1912 | 2338 | struct cmd_ringbuf_console_get_fifo_req get_fifo; |
---|
1913 | | - } __UNION_ANON; |
---|
1914 | | -} __ABI_PACKED; |
---|
| 2339 | + } BPMP_UNION_ANON; |
---|
| 2340 | +} BPMP_ABI_PACKED; |
---|
1915 | 2341 | |
---|
1916 | 2342 | /** |
---|
1917 | 2343 | * @ingroup RingbufConsole |
---|
.. | .. |
---|
1924 | 2350 | struct cmd_ringbuf_console_read_resp read; |
---|
1925 | 2351 | struct cmd_ringbuf_console_write_resp write; |
---|
1926 | 2352 | struct cmd_ringbuf_console_get_fifo_resp get_fifo; |
---|
1927 | | -} __ABI_PACKED; |
---|
| 2353 | +} BPMP_ABI_PACKED; |
---|
1928 | 2354 | /** @} */ |
---|
1929 | 2355 | |
---|
1930 | | -/* |
---|
1931 | | - * 4. Enumerations |
---|
| 2356 | +/** |
---|
| 2357 | + * @ingroup MRQ_Codes |
---|
| 2358 | + * @def MRQ_STRAP |
---|
| 2359 | + * @brief Set a strap value controlled by BPMP |
---|
| 2360 | + * |
---|
| 2361 | + * * Platforms: T194 onwards |
---|
| 2362 | + * @cond bpmp_t194 |
---|
| 2363 | + * * Initiators: CCPLEX |
---|
| 2364 | + * * Targets: BPMP |
---|
| 2365 | + * * Request Payload: @ref mrq_strap_request |
---|
| 2366 | + * * Response Payload: N/A |
---|
| 2367 | + * @addtogroup Strap |
---|
| 2368 | + * |
---|
| 2369 | + * A strap is an input that is sampled by a hardware unit during the |
---|
| 2370 | + * unit's startup process. The sampled value of a strap affects the |
---|
| 2371 | + * behavior of the unit until the unit is restarted. Many hardware |
---|
| 2372 | + * units sample their straps at the instant that their resets are |
---|
| 2373 | + * deasserted. |
---|
| 2374 | + * |
---|
| 2375 | + * BPMP owns registers which act as straps to various units. It |
---|
| 2376 | + * exposes limited control of those straps via #MRQ_STRAP. |
---|
| 2377 | + * |
---|
| 2378 | + * @{ |
---|
1932 | 2379 | */ |
---|
1933 | | - |
---|
1934 | | -/* |
---|
1935 | | - * 4.1 CPU enumerations |
---|
1936 | | - * |
---|
1937 | | - * See <mach-t186/system-t186.h> |
---|
1938 | | - * |
---|
1939 | | - * 4.2 CPU Cluster enumerations |
---|
1940 | | - * |
---|
1941 | | - * See <mach-t186/system-t186.h> |
---|
1942 | | - * |
---|
1943 | | - * 4.3 System low power state enumerations |
---|
1944 | | - * |
---|
1945 | | - * See <mach-t186/system-t186.h> |
---|
1946 | | - */ |
---|
1947 | | - |
---|
1948 | | -/* |
---|
1949 | | - * 4.4 Clock enumerations |
---|
1950 | | - * |
---|
1951 | | - * For clock enumerations, see <mach-t186/clk-t186.h> |
---|
1952 | | - */ |
---|
1953 | | - |
---|
1954 | | -/* |
---|
1955 | | - * 4.5 Reset enumerations |
---|
1956 | | - * |
---|
1957 | | - * For reset enumerations, see <mach-t186/reset-t186.h> |
---|
1958 | | - */ |
---|
1959 | | - |
---|
1960 | | -/* |
---|
1961 | | - * 4.6 Thermal sensor enumerations |
---|
1962 | | - * |
---|
1963 | | - * For thermal sensor enumerations, see <mach-t186/thermal-t186.h> |
---|
1964 | | - */ |
---|
| 2380 | +enum mrq_strap_cmd { |
---|
| 2381 | + /** @private */ |
---|
| 2382 | + STRAP_RESERVED = 0, |
---|
| 2383 | + /** @brief Set a strap value */ |
---|
| 2384 | + STRAP_SET = 1 |
---|
| 2385 | +}; |
---|
1965 | 2386 | |
---|
1966 | 2387 | /** |
---|
1967 | | - * @defgroup Error_Codes |
---|
| 2388 | + * @brief Request with #MRQ_STRAP |
---|
| 2389 | + */ |
---|
| 2390 | +struct mrq_strap_request { |
---|
| 2391 | + /** @brief @ref mrq_strap_cmd */ |
---|
| 2392 | + uint32_t cmd; |
---|
| 2393 | + /** @brief Strap ID from @ref Strap_Ids */ |
---|
| 2394 | + uint32_t id; |
---|
| 2395 | + /** @brief Desired value for strap (if cmd is #STRAP_SET) */ |
---|
| 2396 | + uint32_t value; |
---|
| 2397 | +} BPMP_ABI_PACKED; |
---|
| 2398 | + |
---|
| 2399 | +/** |
---|
| 2400 | + * @defgroup Strap_Ids Strap Identifiers |
---|
| 2401 | + * @} |
---|
| 2402 | + */ |
---|
| 2403 | +/** @endcond */ |
---|
| 2404 | + |
---|
| 2405 | +/** |
---|
| 2406 | + * @ingroup MRQ_Codes |
---|
| 2407 | + * @def MRQ_UPHY |
---|
| 2408 | + * @brief Perform a UPHY operation |
---|
| 2409 | + * |
---|
| 2410 | + * * Platforms: T194 onwards |
---|
| 2411 | + * @cond bpmp_t194 |
---|
| 2412 | + * * Initiators: CCPLEX |
---|
| 2413 | + * * Targets: BPMP |
---|
| 2414 | + * * Request Payload: @ref mrq_uphy_request |
---|
| 2415 | + * * Response Payload: @ref mrq_uphy_response |
---|
| 2416 | + * |
---|
| 2417 | + * @addtogroup UPHY |
---|
| 2418 | + * @{ |
---|
| 2419 | + */ |
---|
| 2420 | +enum { |
---|
| 2421 | + CMD_UPHY_PCIE_LANE_MARGIN_CONTROL = 1, |
---|
| 2422 | + CMD_UPHY_PCIE_LANE_MARGIN_STATUS = 2, |
---|
| 2423 | + CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT = 3, |
---|
| 2424 | + CMD_UPHY_PCIE_CONTROLLER_STATE = 4, |
---|
| 2425 | + CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF = 5, |
---|
| 2426 | + CMD_UPHY_MAX, |
---|
| 2427 | +}; |
---|
| 2428 | + |
---|
| 2429 | +struct cmd_uphy_margin_control_request { |
---|
| 2430 | + /** @brief Enable margin */ |
---|
| 2431 | + int32_t en; |
---|
| 2432 | + /** @brief Clear the number of error and sections */ |
---|
| 2433 | + int32_t clr; |
---|
| 2434 | + /** @brief Set x offset (1's complement) for left/right margin type (y should be 0) */ |
---|
| 2435 | + uint32_t x; |
---|
| 2436 | + /** @brief Set y offset (1's complement) for left/right margin type (x should be 0) */ |
---|
| 2437 | + uint32_t y; |
---|
| 2438 | + /** @brief Set number of bit blocks for each margin section */ |
---|
| 2439 | + uint32_t nblks; |
---|
| 2440 | +} BPMP_ABI_PACKED; |
---|
| 2441 | + |
---|
| 2442 | +struct cmd_uphy_margin_status_response { |
---|
| 2443 | + /** @brief Number of errors observed */ |
---|
| 2444 | + uint32_t status; |
---|
| 2445 | +} BPMP_ABI_PACKED; |
---|
| 2446 | + |
---|
| 2447 | +struct cmd_uphy_ep_controller_pll_init_request { |
---|
| 2448 | + /** @brief EP controller number, valid: 0, 4, 5 */ |
---|
| 2449 | + uint8_t ep_controller; |
---|
| 2450 | +} BPMP_ABI_PACKED; |
---|
| 2451 | + |
---|
| 2452 | +struct cmd_uphy_pcie_controller_state_request { |
---|
| 2453 | + /** @brief PCIE controller number, valid: 0, 1, 2, 3, 4 */ |
---|
| 2454 | + uint8_t pcie_controller; |
---|
| 2455 | + uint8_t enable; |
---|
| 2456 | +} BPMP_ABI_PACKED; |
---|
| 2457 | + |
---|
| 2458 | +struct cmd_uphy_ep_controller_pll_off_request { |
---|
| 2459 | + /** @brief EP controller number, valid: 0, 4, 5 */ |
---|
| 2460 | + uint8_t ep_controller; |
---|
| 2461 | +} BPMP_ABI_PACKED; |
---|
| 2462 | + |
---|
| 2463 | +/** |
---|
| 2464 | + * @ingroup UPHY |
---|
| 2465 | + * @brief Request with #MRQ_UPHY |
---|
| 2466 | + * |
---|
| 2467 | + * Used by the sender of an #MRQ_UPHY message to control UPHY Lane RX margining. |
---|
| 2468 | + * The uphy_request is split into several sub-commands. Some sub-commands |
---|
| 2469 | + * require no additional data. Others have a sub-command specific payload |
---|
| 2470 | + * |
---|
| 2471 | + * |sub-command |payload | |
---|
| 2472 | + * |------------------------------------ |----------------------------------------| |
---|
| 2473 | + * |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL |uphy_set_margin_control | |
---|
| 2474 | + * |CMD_UPHY_PCIE_LANE_MARGIN_STATUS | | |
---|
| 2475 | + * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT |cmd_uphy_ep_controller_pll_init_request | |
---|
| 2476 | + * |CMD_UPHY_PCIE_CONTROLLER_STATE |cmd_uphy_pcie_controller_state_request | |
---|
| 2477 | + * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF |cmd_uphy_ep_controller_pll_off_request | |
---|
| 2478 | + * |
---|
| 2479 | + */ |
---|
| 2480 | + |
---|
| 2481 | +struct mrq_uphy_request { |
---|
| 2482 | + /** @brief Lane number. */ |
---|
| 2483 | + uint16_t lane; |
---|
| 2484 | + /** @brief Sub-command id. */ |
---|
| 2485 | + uint16_t cmd; |
---|
| 2486 | + |
---|
| 2487 | + union { |
---|
| 2488 | + struct cmd_uphy_margin_control_request uphy_set_margin_control; |
---|
| 2489 | + struct cmd_uphy_ep_controller_pll_init_request ep_ctrlr_pll_init; |
---|
| 2490 | + struct cmd_uphy_pcie_controller_state_request controller_state; |
---|
| 2491 | + struct cmd_uphy_ep_controller_pll_off_request ep_ctrlr_pll_off; |
---|
| 2492 | + } BPMP_UNION_ANON; |
---|
| 2493 | +} BPMP_ABI_PACKED; |
---|
| 2494 | + |
---|
| 2495 | +/** |
---|
| 2496 | + * @ingroup UPHY |
---|
| 2497 | + * @brief Response to MRQ_UPHY |
---|
| 2498 | + * |
---|
| 2499 | + * Each sub-command supported by @ref mrq_uphy_request may return |
---|
| 2500 | + * sub-command-specific data. Some do and some do not as indicated in |
---|
| 2501 | + * the following table |
---|
| 2502 | + * |
---|
| 2503 | + * |sub-command |payload | |
---|
| 2504 | + * |---------------------------- |------------------------| |
---|
| 2505 | + * |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | | |
---|
| 2506 | + * |CMD_UPHY_PCIE_LANE_MARGIN_STATUS |uphy_get_margin_status | |
---|
| 2507 | + * |
---|
| 2508 | + */ |
---|
| 2509 | + |
---|
| 2510 | +struct mrq_uphy_response { |
---|
| 2511 | + union { |
---|
| 2512 | + struct cmd_uphy_margin_status_response uphy_get_margin_status; |
---|
| 2513 | + } BPMP_UNION_ANON; |
---|
| 2514 | +} BPMP_ABI_PACKED; |
---|
| 2515 | + |
---|
| 2516 | +/** @} */ |
---|
| 2517 | +/** @endcond */ |
---|
| 2518 | + |
---|
| 2519 | +/** |
---|
| 2520 | + * @ingroup MRQ_Codes |
---|
| 2521 | + * @def MRQ_FMON |
---|
| 2522 | + * @brief Perform a frequency monitor configuration operations |
---|
| 2523 | + * |
---|
| 2524 | + * * Platforms: T194 onwards |
---|
| 2525 | + * @cond bpmp_t194 |
---|
| 2526 | + * * Initiators: CCPLEX |
---|
| 2527 | + * * Targets: BPMP |
---|
| 2528 | + * * Request Payload: @ref mrq_fmon_request |
---|
| 2529 | + * * Response Payload: @ref mrq_fmon_response |
---|
| 2530 | + * |
---|
| 2531 | + * @addtogroup FMON |
---|
| 2532 | + * @{ |
---|
| 2533 | + */ |
---|
| 2534 | +enum { |
---|
| 2535 | + /** |
---|
| 2536 | + * @brief Clamp FMON configuration to specified rate. |
---|
| 2537 | + * |
---|
| 2538 | + * The monitored clock must be running for clamp to succeed. If |
---|
| 2539 | + * clamped, FMON configuration is preserved when clock rate |
---|
| 2540 | + * and/or state is changed. |
---|
| 2541 | + */ |
---|
| 2542 | + CMD_FMON_GEAR_CLAMP = 1, |
---|
| 2543 | + /** |
---|
| 2544 | + * @brief Release clamped FMON configuration. |
---|
| 2545 | + * |
---|
| 2546 | + * Allow FMON configuration to follow monitored clock rate |
---|
| 2547 | + * and/or state changes. |
---|
| 2548 | + */ |
---|
| 2549 | + CMD_FMON_GEAR_FREE = 2, |
---|
| 2550 | + /** |
---|
| 2551 | + * @brief Return rate FMON is clamped at, or 0 if FMON is not |
---|
| 2552 | + * clamped. |
---|
| 2553 | + * |
---|
| 2554 | + * Inherently racy, since clamp state can be changed |
---|
| 2555 | + * concurrently. Useful for testing. |
---|
| 2556 | + */ |
---|
| 2557 | + CMD_FMON_GEAR_GET = 3, |
---|
| 2558 | + CMD_FMON_NUM, |
---|
| 2559 | +}; |
---|
| 2560 | + |
---|
| 2561 | +struct cmd_fmon_gear_clamp_request { |
---|
| 2562 | + int32_t unused; |
---|
| 2563 | + int64_t rate; |
---|
| 2564 | +} BPMP_ABI_PACKED; |
---|
| 2565 | + |
---|
| 2566 | +/** @private */ |
---|
| 2567 | +struct cmd_fmon_gear_clamp_response { |
---|
| 2568 | + BPMP_ABI_EMPTY |
---|
| 2569 | +} BPMP_ABI_PACKED; |
---|
| 2570 | + |
---|
| 2571 | +/** @private */ |
---|
| 2572 | +struct cmd_fmon_gear_free_request { |
---|
| 2573 | + BPMP_ABI_EMPTY |
---|
| 2574 | +} BPMP_ABI_PACKED; |
---|
| 2575 | + |
---|
| 2576 | +/** @private */ |
---|
| 2577 | +struct cmd_fmon_gear_free_response { |
---|
| 2578 | + BPMP_ABI_EMPTY |
---|
| 2579 | +} BPMP_ABI_PACKED; |
---|
| 2580 | + |
---|
| 2581 | +/** @private */ |
---|
| 2582 | +struct cmd_fmon_gear_get_request { |
---|
| 2583 | + BPMP_ABI_EMPTY |
---|
| 2584 | +} BPMP_ABI_PACKED; |
---|
| 2585 | + |
---|
| 2586 | +struct cmd_fmon_gear_get_response { |
---|
| 2587 | + int64_t rate; |
---|
| 2588 | +} BPMP_ABI_PACKED; |
---|
| 2589 | + |
---|
| 2590 | +/** |
---|
| 2591 | + * @ingroup FMON |
---|
| 2592 | + * @brief Request with #MRQ_FMON |
---|
| 2593 | + * |
---|
| 2594 | + * Used by the sender of an #MRQ_FMON message to configure clock |
---|
| 2595 | + * frequency monitors. The FMON request is split into several |
---|
| 2596 | + * sub-commands. Some sub-commands require no additional data. |
---|
| 2597 | + * Others have a sub-command specific payload |
---|
| 2598 | + * |
---|
| 2599 | + * |sub-command |payload | |
---|
| 2600 | + * |----------------------------|-----------------------| |
---|
| 2601 | + * |CMD_FMON_GEAR_CLAMP |fmon_gear_clamp | |
---|
| 2602 | + * |CMD_FMON_GEAR_FREE |- | |
---|
| 2603 | + * |CMD_FMON_GEAR_GET |- | |
---|
| 2604 | + * |
---|
| 2605 | + */ |
---|
| 2606 | + |
---|
| 2607 | +struct mrq_fmon_request { |
---|
| 2608 | + /** @brief Sub-command and clock id concatenated to 32-bit word. |
---|
| 2609 | + * - bits[31..24] is the sub-cmd. |
---|
| 2610 | + * - bits[23..0] is monitored clock id used to select target |
---|
| 2611 | + * FMON |
---|
| 2612 | + */ |
---|
| 2613 | + uint32_t cmd_and_id; |
---|
| 2614 | + |
---|
| 2615 | + union { |
---|
| 2616 | + struct cmd_fmon_gear_clamp_request fmon_gear_clamp; |
---|
| 2617 | + /** @private */ |
---|
| 2618 | + struct cmd_fmon_gear_free_request fmon_gear_free; |
---|
| 2619 | + /** @private */ |
---|
| 2620 | + struct cmd_fmon_gear_get_request fmon_gear_get; |
---|
| 2621 | + } BPMP_UNION_ANON; |
---|
| 2622 | +} BPMP_ABI_PACKED; |
---|
| 2623 | + |
---|
| 2624 | +/** |
---|
| 2625 | + * @ingroup FMON |
---|
| 2626 | + * @brief Response to MRQ_FMON |
---|
| 2627 | + * |
---|
| 2628 | + * Each sub-command supported by @ref mrq_fmon_request may |
---|
| 2629 | + * return sub-command-specific data as indicated below. |
---|
| 2630 | + * |
---|
| 2631 | + * |sub-command |payload | |
---|
| 2632 | + * |----------------------------|------------------------| |
---|
| 2633 | + * |CMD_FMON_GEAR_CLAMP |- | |
---|
| 2634 | + * |CMD_FMON_GEAR_FREE |- | |
---|
| 2635 | + * |CMD_FMON_GEAR_GET |fmon_gear_get | |
---|
| 2636 | + * |
---|
| 2637 | + */ |
---|
| 2638 | + |
---|
| 2639 | +struct mrq_fmon_response { |
---|
| 2640 | + union { |
---|
| 2641 | + /** @private */ |
---|
| 2642 | + struct cmd_fmon_gear_clamp_response fmon_gear_clamp; |
---|
| 2643 | + /** @private */ |
---|
| 2644 | + struct cmd_fmon_gear_free_response fmon_gear_free; |
---|
| 2645 | + struct cmd_fmon_gear_get_response fmon_gear_get; |
---|
| 2646 | + } BPMP_UNION_ANON; |
---|
| 2647 | +} BPMP_ABI_PACKED; |
---|
| 2648 | + |
---|
| 2649 | +/** @} */ |
---|
| 2650 | +/** @endcond */ |
---|
| 2651 | + |
---|
| 2652 | +/** |
---|
| 2653 | + * @ingroup MRQ_Codes |
---|
| 2654 | + * @def MRQ_EC |
---|
| 2655 | + * @brief Provide status information on faults reported by Error |
---|
| 2656 | + * Collator (EC) to HSM. |
---|
| 2657 | + * |
---|
| 2658 | + * * Platforms: T194 onwards |
---|
| 2659 | + * @cond bpmp_t194 |
---|
| 2660 | + * * Initiators: CCPLEX |
---|
| 2661 | + * * Targets: BPMP |
---|
| 2662 | + * * Request Payload: @ref mrq_ec_request |
---|
| 2663 | + * * Response Payload: @ref mrq_ec_response |
---|
| 2664 | + * |
---|
| 2665 | + * @note This MRQ ABI is under construction, and subject to change |
---|
| 2666 | + * |
---|
| 2667 | + * @addtogroup EC |
---|
| 2668 | + * @{ |
---|
| 2669 | + */ |
---|
| 2670 | +enum { |
---|
| 2671 | + /** |
---|
| 2672 | + * @cond DEPRECATED |
---|
| 2673 | + * @brief Retrieve specified EC status. |
---|
| 2674 | + * |
---|
| 2675 | + * mrq_response::err is 0 if the operation was successful, or @n |
---|
| 2676 | + * -#BPMP_ENODEV if target EC is not owned by BPMP @n |
---|
| 2677 | + * -#BPMP_EACCES if target EC power domain is turned off @n |
---|
| 2678 | + * -#BPMP_EBADCMD if subcommand is not supported |
---|
| 2679 | + * @endcond |
---|
| 2680 | + */ |
---|
| 2681 | + CMD_EC_STATUS_GET = 1, /* deprecated */ |
---|
| 2682 | + |
---|
| 2683 | + /** |
---|
| 2684 | + * @brief Retrieve specified EC extended status (includes error |
---|
| 2685 | + * counter and user values). |
---|
| 2686 | + * |
---|
| 2687 | + * mrq_response::err is 0 if the operation was successful, or @n |
---|
| 2688 | + * -#BPMP_ENODEV if target EC is not owned by BPMP @n |
---|
| 2689 | + * -#BPMP_EACCES if target EC power domain is turned off @n |
---|
| 2690 | + * -#BPMP_EBADCMD if subcommand is not supported |
---|
| 2691 | + */ |
---|
| 2692 | + CMD_EC_STATUS_EX_GET = 2, |
---|
| 2693 | + CMD_EC_NUM, |
---|
| 2694 | +}; |
---|
| 2695 | + |
---|
| 2696 | +/** @brief BPMP ECs error types */ |
---|
| 2697 | +enum bpmp_ec_err_type { |
---|
| 2698 | + /** @brief Parity error on internal data path |
---|
| 2699 | + * |
---|
| 2700 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2701 | + */ |
---|
| 2702 | + EC_ERR_TYPE_PARITY_INTERNAL = 1, |
---|
| 2703 | + |
---|
| 2704 | + /** @brief ECC SEC error on internal data path |
---|
| 2705 | + * |
---|
| 2706 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2707 | + */ |
---|
| 2708 | + EC_ERR_TYPE_ECC_SEC_INTERNAL = 2, |
---|
| 2709 | + |
---|
| 2710 | + /** @brief ECC DED error on internal data path |
---|
| 2711 | + * |
---|
| 2712 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2713 | + */ |
---|
| 2714 | + EC_ERR_TYPE_ECC_DED_INTERNAL = 3, |
---|
| 2715 | + |
---|
| 2716 | + /** @brief Comparator error |
---|
| 2717 | + * |
---|
| 2718 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2719 | + */ |
---|
| 2720 | + EC_ERR_TYPE_COMPARATOR = 4, |
---|
| 2721 | + |
---|
| 2722 | + /** @brief Register parity error |
---|
| 2723 | + * |
---|
| 2724 | + * Error descriptor @ref ec_err_reg_parity_desc. |
---|
| 2725 | + */ |
---|
| 2726 | + EC_ERR_TYPE_REGISTER_PARITY = 5, |
---|
| 2727 | + |
---|
| 2728 | + /** @brief Parity error from on-chip SRAM/FIFO |
---|
| 2729 | + * |
---|
| 2730 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2731 | + */ |
---|
| 2732 | + EC_ERR_TYPE_PARITY_SRAM = 6, |
---|
| 2733 | + |
---|
| 2734 | + /** @brief Clock Monitor error |
---|
| 2735 | + * |
---|
| 2736 | + * Error descriptor @ref ec_err_fmon_desc. |
---|
| 2737 | + */ |
---|
| 2738 | + EC_ERR_TYPE_CLOCK_MONITOR = 9, |
---|
| 2739 | + |
---|
| 2740 | + /** @brief Voltage Monitor error |
---|
| 2741 | + * |
---|
| 2742 | + * Error descriptor @ref ec_err_vmon_desc. |
---|
| 2743 | + */ |
---|
| 2744 | + EC_ERR_TYPE_VOLTAGE_MONITOR = 10, |
---|
| 2745 | + |
---|
| 2746 | + /** @brief SW Correctable error |
---|
| 2747 | + * |
---|
| 2748 | + * Error descriptor @ref ec_err_sw_error_desc. |
---|
| 2749 | + */ |
---|
| 2750 | + EC_ERR_TYPE_SW_CORRECTABLE = 16, |
---|
| 2751 | + |
---|
| 2752 | + /** @brief SW Uncorrectable error |
---|
| 2753 | + * |
---|
| 2754 | + * Error descriptor @ref ec_err_sw_error_desc. |
---|
| 2755 | + */ |
---|
| 2756 | + EC_ERR_TYPE_SW_UNCORRECTABLE = 17, |
---|
| 2757 | + |
---|
| 2758 | + /** @brief Other HW Correctable error |
---|
| 2759 | + * |
---|
| 2760 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2761 | + */ |
---|
| 2762 | + EC_ERR_TYPE_OTHER_HW_CORRECTABLE = 32, |
---|
| 2763 | + |
---|
| 2764 | + /** @brief Other HW Uncorrectable error |
---|
| 2765 | + * |
---|
| 2766 | + * Error descriptor @ref ec_err_simple_desc. |
---|
| 2767 | + */ |
---|
| 2768 | + EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE = 33, |
---|
| 2769 | +}; |
---|
| 2770 | + |
---|
| 2771 | +/** @brief Group of registers with parity error. */ |
---|
| 2772 | +enum ec_registers_group { |
---|
| 2773 | + /** @brief Functional registers group */ |
---|
| 2774 | + EC_ERR_GROUP_FUNC_REG = 0U, |
---|
| 2775 | + /** @brief SCR registers group */ |
---|
| 2776 | + EC_ERR_GROUP_SCR_REG = 1U, |
---|
| 2777 | +}; |
---|
| 2778 | + |
---|
| 2779 | +/** |
---|
| 2780 | + * @defgroup bpmp_ec_status_flags EC Status Flags |
---|
| 2781 | + * @addtogroup bpmp_ec_status_flags |
---|
| 2782 | + * @{ |
---|
| 2783 | + */ |
---|
| 2784 | +/** @brief No EC error found flag */ |
---|
| 2785 | +#define EC_STATUS_FLAG_NO_ERROR 0x0001U |
---|
| 2786 | +/** @brief Last EC error found flag */ |
---|
| 2787 | +#define EC_STATUS_FLAG_LAST_ERROR 0x0002U |
---|
| 2788 | +/** @brief EC latent error flag */ |
---|
| 2789 | +#define EC_STATUS_FLAG_LATENT_ERROR 0x0004U |
---|
| 2790 | +/** @} */ |
---|
| 2791 | + |
---|
| 2792 | +/** |
---|
| 2793 | + * @defgroup bpmp_ec_desc_flags EC Descriptor Flags |
---|
| 2794 | + * @addtogroup bpmp_ec_desc_flags |
---|
| 2795 | + * @{ |
---|
| 2796 | + */ |
---|
| 2797 | +/** @brief EC descriptor error resolved flag */ |
---|
| 2798 | +#define EC_DESC_FLAG_RESOLVED 0x0001U |
---|
| 2799 | +/** @brief EC descriptor failed to retrieve id flag */ |
---|
| 2800 | +#define EC_DESC_FLAG_NO_ID 0x0002U |
---|
| 2801 | +/** @} */ |
---|
| 2802 | + |
---|
| 2803 | +/** |
---|
| 2804 | + * |error type | fmon_clk_id values | |
---|
| 2805 | + * |---------------------------------|---------------------------| |
---|
| 2806 | + * |@ref EC_ERR_TYPE_CLOCK_MONITOR |@ref bpmp_clock_ids | |
---|
| 2807 | + */ |
---|
| 2808 | +struct ec_err_fmon_desc { |
---|
| 2809 | + /** @brief Bitmask of @ref bpmp_ec_desc_flags */ |
---|
| 2810 | + uint16_t desc_flags; |
---|
| 2811 | + /** @brief FMON monitored clock id */ |
---|
| 2812 | + uint16_t fmon_clk_id; |
---|
| 2813 | + /** @brief Bitmask of @ref bpmp_fmon_faults_flags */ |
---|
| 2814 | + uint32_t fmon_faults; |
---|
| 2815 | + /** @brief FMON faults access error */ |
---|
| 2816 | + int32_t fmon_access_error; |
---|
| 2817 | +} BPMP_ABI_PACKED; |
---|
| 2818 | + |
---|
| 2819 | +/** |
---|
| 2820 | + * |error type | vmon_adc_id values | |
---|
| 2821 | + * |---------------------------------|---------------------------| |
---|
| 2822 | + * |@ref EC_ERR_TYPE_VOLTAGE_MONITOR |@ref bpmp_adc_ids | |
---|
| 2823 | + */ |
---|
| 2824 | +struct ec_err_vmon_desc { |
---|
| 2825 | + /** @brief Bitmask of @ref bpmp_ec_desc_flags */ |
---|
| 2826 | + uint16_t desc_flags; |
---|
| 2827 | + /** @brief VMON rail adc id */ |
---|
| 2828 | + uint16_t vmon_adc_id; |
---|
| 2829 | + /** @brief Bitmask of @ref bpmp_vmon_faults_flags */ |
---|
| 2830 | + uint32_t vmon_faults; |
---|
| 2831 | + /** @brief VMON faults access error */ |
---|
| 2832 | + int32_t vmon_access_error; |
---|
| 2833 | +} BPMP_ABI_PACKED; |
---|
| 2834 | + |
---|
| 2835 | +/** |
---|
| 2836 | + * |error type | reg_id values | |
---|
| 2837 | + * |---------------------------------|---------------------------| |
---|
| 2838 | + * |@ref EC_ERR_TYPE_REGISTER_PARITY |@ref bpmp_ec_registers_ids | |
---|
| 2839 | + */ |
---|
| 2840 | +struct ec_err_reg_parity_desc { |
---|
| 2841 | + /** @brief Bitmask of @ref bpmp_ec_desc_flags */ |
---|
| 2842 | + uint16_t desc_flags; |
---|
| 2843 | + /** @brief Register id */ |
---|
| 2844 | + uint16_t reg_id; |
---|
| 2845 | + /** @brief Register group @ref ec_registers_group */ |
---|
| 2846 | + uint16_t reg_group; |
---|
| 2847 | +} BPMP_ABI_PACKED; |
---|
| 2848 | + |
---|
| 2849 | +/** |
---|
| 2850 | + * |error type | err_source_id values | |
---|
| 2851 | + * |--------------------------------- |--------------------------| |
---|
| 2852 | + * |@ref EC_ERR_TYPE_SW_CORRECTABLE | @ref bpmp_ec_ce_swd_ids | |
---|
| 2853 | + * |@ref EC_ERR_TYPE_SW_UNCORRECTABLE | @ref bpmp_ec_ue_swd_ids | |
---|
| 2854 | + */ |
---|
| 2855 | +struct ec_err_sw_error_desc { |
---|
| 2856 | + /** @brief Bitmask of @ref bpmp_ec_desc_flags */ |
---|
| 2857 | + uint16_t desc_flags; |
---|
| 2858 | + /** @brief Error source id */ |
---|
| 2859 | + uint16_t err_source_id; |
---|
| 2860 | + /** @brief Sw error data */ |
---|
| 2861 | + uint32_t sw_error_data; |
---|
| 2862 | +} BPMP_ABI_PACKED; |
---|
| 2863 | + |
---|
| 2864 | +/** |
---|
| 2865 | + * |error type | err_source_id values | |
---|
| 2866 | + * |----------------------------------------|---------------------------| |
---|
| 2867 | + * |@ref EC_ERR_TYPE_PARITY_INTERNAL |@ref bpmp_ec_ipath_ids | |
---|
| 2868 | + * |@ref EC_ERR_TYPE_ECC_SEC_INTERNAL |@ref bpmp_ec_ipath_ids | |
---|
| 2869 | + * |@ref EC_ERR_TYPE_ECC_DED_INTERNAL |@ref bpmp_ec_ipath_ids | |
---|
| 2870 | + * |@ref EC_ERR_TYPE_COMPARATOR |@ref bpmp_ec_comparator_ids| |
---|
| 2871 | + * |@ref EC_ERR_TYPE_PARITY_SRAM |@ref bpmp_clock_ids | |
---|
| 2872 | + * |@ref EC_ERR_TYPE_OTHER_HW_CORRECTABLE |@ref bpmp_ec_misc_hwd_ids | |
---|
| 2873 | + * |@ref EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE |@ref bpmp_ec_misc_hwd_ids | |
---|
| 2874 | + */ |
---|
| 2875 | +struct ec_err_simple_desc { |
---|
| 2876 | + /** @brief Bitmask of @ref bpmp_ec_desc_flags */ |
---|
| 2877 | + uint16_t desc_flags; |
---|
| 2878 | + /** @brief Error source id. Id space depends on error type. */ |
---|
| 2879 | + uint16_t err_source_id; |
---|
| 2880 | +} BPMP_ABI_PACKED; |
---|
| 2881 | + |
---|
| 2882 | +/** @brief Union of EC error descriptors */ |
---|
| 2883 | +union ec_err_desc { |
---|
| 2884 | + struct ec_err_fmon_desc fmon_desc; |
---|
| 2885 | + struct ec_err_vmon_desc vmon_desc; |
---|
| 2886 | + struct ec_err_reg_parity_desc reg_parity_desc; |
---|
| 2887 | + struct ec_err_sw_error_desc sw_error_desc; |
---|
| 2888 | + struct ec_err_simple_desc simple_desc; |
---|
| 2889 | +} BPMP_ABI_PACKED; |
---|
| 2890 | + |
---|
| 2891 | +struct cmd_ec_status_get_request { |
---|
| 2892 | + /** @brief HSM error line number that identifies target EC. */ |
---|
| 2893 | + uint32_t ec_hsm_id; |
---|
| 2894 | +} BPMP_ABI_PACKED; |
---|
| 2895 | + |
---|
| 2896 | +/** EC status maximum number of descriptors */ |
---|
| 2897 | +#define EC_ERR_STATUS_DESC_MAX_NUM 4U |
---|
| 2898 | + |
---|
| 2899 | +/** |
---|
| 2900 | + * @cond DEPRECATED |
---|
| 2901 | + */ |
---|
| 2902 | +struct cmd_ec_status_get_response { |
---|
| 2903 | + /** @brief Target EC id (the same id received with request). */ |
---|
| 2904 | + uint32_t ec_hsm_id; |
---|
| 2905 | + /** |
---|
| 2906 | + * @brief Bitmask of @ref bpmp_ec_status_flags |
---|
| 2907 | + * |
---|
| 2908 | + * If NO_ERROR flag is set, error_ fields should be ignored |
---|
| 2909 | + */ |
---|
| 2910 | + uint32_t ec_status_flags; |
---|
| 2911 | + /** @brief Found EC error index. */ |
---|
| 2912 | + uint32_t error_idx; |
---|
| 2913 | + /** @brief Found EC error type @ref bpmp_ec_err_type. */ |
---|
| 2914 | + uint32_t error_type; |
---|
| 2915 | + /** @brief Number of returned EC error descriptors */ |
---|
| 2916 | + uint32_t error_desc_num; |
---|
| 2917 | + /** @brief EC error descriptors */ |
---|
| 2918 | + union ec_err_desc error_descs[EC_ERR_STATUS_DESC_MAX_NUM]; |
---|
| 2919 | +} BPMP_ABI_PACKED; |
---|
| 2920 | +/** @endcond */ |
---|
| 2921 | + |
---|
| 2922 | +struct cmd_ec_status_ex_get_response { |
---|
| 2923 | + /** @brief Target EC id (the same id received with request). */ |
---|
| 2924 | + uint32_t ec_hsm_id; |
---|
| 2925 | + /** |
---|
| 2926 | + * @brief Bitmask of @ref bpmp_ec_status_flags |
---|
| 2927 | + * |
---|
| 2928 | + * If NO_ERROR flag is set, error_ fields should be ignored |
---|
| 2929 | + */ |
---|
| 2930 | + uint32_t ec_status_flags; |
---|
| 2931 | + /** @brief Found EC error index. */ |
---|
| 2932 | + uint32_t error_idx; |
---|
| 2933 | + /** @brief Found EC error type @ref bpmp_ec_err_type. */ |
---|
| 2934 | + uint32_t error_type; |
---|
| 2935 | + /** @brief Found EC mission error counter value */ |
---|
| 2936 | + uint32_t error_counter; |
---|
| 2937 | + /** @brief Found EC mission error user value */ |
---|
| 2938 | + uint32_t error_uval; |
---|
| 2939 | + /** @brief Reserved entry */ |
---|
| 2940 | + uint32_t reserved; |
---|
| 2941 | + /** @brief Number of returned EC error descriptors */ |
---|
| 2942 | + uint32_t error_desc_num; |
---|
| 2943 | + /** @brief EC error descriptors */ |
---|
| 2944 | + union ec_err_desc error_descs[EC_ERR_STATUS_DESC_MAX_NUM]; |
---|
| 2945 | +} BPMP_ABI_PACKED; |
---|
| 2946 | + |
---|
| 2947 | +/** |
---|
| 2948 | + * @ingroup EC |
---|
| 2949 | + * @brief Request with #MRQ_EC |
---|
| 2950 | + * |
---|
| 2951 | + * Used by the sender of an #MRQ_EC message to access ECs owned |
---|
| 2952 | + * by BPMP. |
---|
| 2953 | + * |
---|
| 2954 | + * @cond DEPRECATED |
---|
| 2955 | + * |sub-command |payload | |
---|
| 2956 | + * |----------------------------|-----------------------| |
---|
| 2957 | + * |@ref CMD_EC_STATUS_GET |ec_status_get | |
---|
| 2958 | + * @endcond |
---|
| 2959 | + * |
---|
| 2960 | + * |sub-command |payload | |
---|
| 2961 | + * |----------------------------|-----------------------| |
---|
| 2962 | + * |@ref CMD_EC_STATUS_EX_GET |ec_status_get | |
---|
| 2963 | + * |
---|
| 2964 | + */ |
---|
| 2965 | + |
---|
| 2966 | +struct mrq_ec_request { |
---|
| 2967 | + /** @brief Sub-command id. */ |
---|
| 2968 | + uint32_t cmd_id; |
---|
| 2969 | + |
---|
| 2970 | + union { |
---|
| 2971 | + struct cmd_ec_status_get_request ec_status_get; |
---|
| 2972 | + } BPMP_UNION_ANON; |
---|
| 2973 | +} BPMP_ABI_PACKED; |
---|
| 2974 | + |
---|
| 2975 | +/** |
---|
| 2976 | + * @ingroup EC |
---|
| 2977 | + * @brief Response to MRQ_EC |
---|
| 2978 | + * |
---|
| 2979 | + * Each sub-command supported by @ref mrq_ec_request may return |
---|
| 2980 | + * sub-command-specific data as indicated below. |
---|
| 2981 | + * |
---|
| 2982 | + * @cond DEPRECATED |
---|
| 2983 | + * |sub-command |payload | |
---|
| 2984 | + * |----------------------------|------------------------| |
---|
| 2985 | + * |@ref CMD_EC_STATUS_GET |ec_status_get | |
---|
| 2986 | + * @endcond |
---|
| 2987 | + * |
---|
| 2988 | + * |sub-command |payload | |
---|
| 2989 | + * |----------------------------|------------------------| |
---|
| 2990 | + * |@ref CMD_EC_STATUS_EX_GET |ec_status_ex_get | |
---|
| 2991 | + * |
---|
| 2992 | + */ |
---|
| 2993 | + |
---|
| 2994 | +struct mrq_ec_response { |
---|
| 2995 | + union { |
---|
| 2996 | + /** |
---|
| 2997 | + * @cond DEPRECATED |
---|
| 2998 | + */ |
---|
| 2999 | + struct cmd_ec_status_get_response ec_status_get; |
---|
| 3000 | + /** @endcond */ |
---|
| 3001 | + struct cmd_ec_status_ex_get_response ec_status_ex_get; |
---|
| 3002 | + } BPMP_UNION_ANON; |
---|
| 3003 | +} BPMP_ABI_PACKED; |
---|
| 3004 | + |
---|
| 3005 | +/** @} */ |
---|
| 3006 | +/** @endcond */ |
---|
| 3007 | + |
---|
| 3008 | +/** |
---|
| 3009 | + * @addtogroup Error_Codes |
---|
1968 | 3010 | * Negative values for mrq_response::err generally indicate some |
---|
1969 | 3011 | * error. The ABI defines the following error codes. Negating these |
---|
1970 | 3012 | * defines is an exercise left to the user. |
---|
1971 | 3013 | * @{ |
---|
1972 | 3014 | */ |
---|
| 3015 | + |
---|
| 3016 | +/** @brief Operation not permitted */ |
---|
| 3017 | +#define BPMP_EPERM 1 |
---|
1973 | 3018 | /** @brief No such file or directory */ |
---|
1974 | 3019 | #define BPMP_ENOENT 2 |
---|
1975 | 3020 | /** @brief No MRQ handler */ |
---|
.. | .. |
---|
1978 | 3023 | #define BPMP_EIO 5 |
---|
1979 | 3024 | /** @brief Bad sub-MRQ command */ |
---|
1980 | 3025 | #define BPMP_EBADCMD 6 |
---|
| 3026 | +/** @brief Resource temporarily unavailable */ |
---|
| 3027 | +#define BPMP_EAGAIN 11 |
---|
1981 | 3028 | /** @brief Not enough memory */ |
---|
1982 | 3029 | #define BPMP_ENOMEM 12 |
---|
1983 | 3030 | /** @brief Permission denied */ |
---|
1984 | 3031 | #define BPMP_EACCES 13 |
---|
1985 | 3032 | /** @brief Bad address */ |
---|
1986 | 3033 | #define BPMP_EFAULT 14 |
---|
| 3034 | +/** @brief Resource busy */ |
---|
| 3035 | +#define BPMP_EBUSY 16 |
---|
1987 | 3036 | /** @brief No such device */ |
---|
1988 | 3037 | #define BPMP_ENODEV 19 |
---|
1989 | 3038 | /** @brief Argument is a directory */ |
---|
.. | .. |
---|
1994 | 3043 | #define BPMP_ETIMEDOUT 23 |
---|
1995 | 3044 | /** @brief Out of range */ |
---|
1996 | 3045 | #define BPMP_ERANGE 34 |
---|
| 3046 | +/** @brief Function not implemented */ |
---|
| 3047 | +#define BPMP_ENOSYS 38 |
---|
| 3048 | +/** @brief Invalid slot */ |
---|
| 3049 | +#define BPMP_EBADSLT 57 |
---|
| 3050 | +/** @brief Not supported */ |
---|
| 3051 | +#define BPMP_ENOTSUP 134 |
---|
| 3052 | +/** @brief No such device or address */ |
---|
| 3053 | +#define BPMP_ENXIO 140 |
---|
| 3054 | + |
---|
1997 | 3055 | /** @} */ |
---|
1998 | | -/** @} */ |
---|
| 3056 | + |
---|
| 3057 | +#if defined(BPMP_ABI_CHECKS) |
---|
| 3058 | +#include "bpmp_abi_checks.h" |
---|
| 3059 | +#endif |
---|
| 3060 | + |
---|
1999 | 3061 | #endif |
---|