1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2014-2022, NVIDIA CORPORATION. All rights reserved.
9 #if defined(LK) || defined(BPMP_ABI_HAVE_STDC)
14 #ifndef BPMP_ABI_PACKED
16 #define BPMP_ABI_PACKED __ABI_PACKED
18 #define BPMP_ABI_PACKED __attribute__((packed))
22 #ifdef NO_GCC_EXTENSIONS
23 #define BPMP_ABI_EMPTY char empty;
24 #define BPMP_ABI_EMPTY_ARRAY 1
26 #define BPMP_ABI_EMPTY
27 #define BPMP_ABI_EMPTY_ARRAY 0
30 #ifndef BPMP_UNION_ANON
32 #define BPMP_UNION_ANON __UNION_ANON
34 #define BPMP_UNION_ANON
43 * @defgroup MRQ MRQ Messages
44 * @brief Messages sent to/from BPMP via IPC
46 * @defgroup MRQ_Format Message Format
47 * @defgroup MRQ_Codes Message Request (MRQ) Codes
48 * @defgroup MRQ_Payloads Message Payloads
49 * @defgroup Error_Codes Error Codes
54 * @addtogroup MRQ_Format
56 * The CPU requests the BPMP to perform a particular service by
57 * sending it an IVC frame containing a single MRQ message. An MRQ
58 * message consists of a @ref mrq_request followed by a payload whose
59 * format depends on mrq_request::mrq.
61 * The BPMP processes the data and replies with an IVC frame (on the
62 * same IVC channel) containing and MRQ response. An MRQ response
63 * consists of a @ref mrq_response followed by a payload whose format
64 * depends on the associated mrq_request::mrq.
66 * A well-defined subset of the MRQ messages that the CPU sends to the
67 * BPMP can lead to BPMP eventually sending an MRQ message to the
68 * CPU. For example, when the CPU uses an #MRQ_THERMAL message to set
69 * a thermal trip point, the BPMP may eventually send a single
70 * #MRQ_THERMAL message of its own to the CPU indicating that the trip
71 * point has been crossed.
77 * Request an answer from the peer.
78 * This should be set in mrq_request::flags for all requests targetted
79 * at BPMP. For requests originating in BPMP, this flag is optional except
80 * for messages targeting MCE, for which the field must be set.
81 * When this flag is not set, the remote peer must not send a response
84 #define BPMP_MAIL_DO_ACK (1U << 0U)
88 * Ring the sender's doorbell when responding. This should be set unless
89 * the sender wants to poll the underlying communications layer directly.
91 * An optional direction that can be specified in mrq_request::flags.
93 #define BPMP_MAIL_RING_DB (1U << 1U)
99 #define BPMP_MAIL_CRC_PRESENT (1U << 2U)
102 * @ingroup MRQ_Format
103 * @brief Header for an MRQ message
105 * Provides the MRQ number for the MRQ message: #mrq. The remainder of
106 * the MRQ message is a payload (immediately following the
107 * mrq_request) whose format depends on mrq.
110 /** @brief MRQ number of the request */
114 * @brief 32bit word containing a number of fields as follows:
119 * uint8_t payload_length;
123 * **options** directions to the receiver and indicates CRC presence.
125 * #BPMP_MAIL_DO_ACK and #BPMP_MAIL_RING_DB see documentation of respective options.
126 * #BPMP_MAIL_CRC_PRESENT is supported on T234 and later platforms. It indicates the
127 * crc16, xid and length fields are present when set.
128 * Some platform configurations, especially when targeted to applications requiring
129 * functional safety, mandate this option being set or otherwise will respond with
130 * -BPMP_EBADMSG and ignore the request.
132 * **xid** is a transaction ID.
134 * Only used when #BPMP_MAIL_CRC_PRESENT is set.
136 * **payload_length** of the message expressed in bytes without the size of this header.
137 * See table below for minimum accepted payload lengths for each MRQ.
138 * Note: For DMCE communication, this field expresses the length as a multiple of 4 bytes
141 * Only used when #BPMP_MAIL_CRC_PRESENT is set.
143 * | MRQ | CMD | minimum payload length
144 * | -------------------- | ------------------------------------ | ------------------------------------------ |
146 * | MRQ_THREADED_PING | | 4 |
147 * | MRQ_RESET | any | 8 |
148 * | MRQ_I2C | | 12 + cmd_i2c_xfer_request.data_size |
149 * | MRQ_CLK | CMD_CLK_GET_RATE | 4 |
150 * | MRQ_CLK | CMD_CLK_SET_RATE | 16 |
151 * | MRQ_CLK | CMD_CLK_ROUND_RATE | 16 |
152 * | MRQ_CLK | CMD_CLK_GET_PARENT | 4 |
153 * | MRQ_CLK | CMD_CLK_SET_PARENT | 8 |
154 * | MRQ_CLK | CMD_CLK_ENABLE | 4 |
155 * | MRQ_CLK | CMD_CLK_DISABLE | 4 |
156 * | MRQ_CLK | CMD_CLK_IS_ENABLED | 4 |
157 * | MRQ_CLK | CMD_CLK_GET_ALL_INFO | 4 |
158 * | MRQ_CLK | CMD_CLK_GET_MAX_CLK_ID | 4 |
159 * | MRQ_CLK | CMD_CLK_GET_FMAX_AT_VMIN | 4 |
160 * | MRQ_QUERY_ABI | | 4 |
161 * | MRQ_PG | CMD_PG_QUERY_ABI | 12 |
162 * | MRQ_PG | CMD_PG_SET_STATE | 12 |
163 * | MRQ_PG | CMD_PG_GET_STATE | 8 |
164 * | MRQ_PG | CMD_PG_GET_NAME | 8 |
165 * | MRQ_PG | CMD_PG_GET_MAX_ID | 8 |
166 * | MRQ_THERMAL | CMD_THERMAL_QUERY_ABI | 8 |
167 * | MRQ_THERMAL | CMD_THERMAL_GET_TEMP | 8 |
168 * | MRQ_THERMAL | CMD_THERMAL_SET_TRIP | 20 |
169 * | MRQ_THERMAL | CMD_THERMAL_GET_NUM_ZONES | 4 |
170 * | MRQ_THERMAL | CMD_THERMAL_GET_THERMTRIP | 8 |
171 * | MRQ_CPU_VHINT | | 8 |
172 * | MRQ_ABI_RATCHET | | 2 |
173 * | MRQ_EMC_DVFS_LATENCY | | 8 |
174 * | MRQ_EMC_DVFS_EMCHUB | | 8 |
175 * | MRQ_EMC_DISP_RFL | | 4 |
176 * | MRQ_BWMGR | CMD_BWMGR_QUERY_ABI | 8 |
177 * | MRQ_BWMGR | CMD_BWMGR_CALC_RATE | 8 + 8 * bwmgr_rate_req.num_iso_clients |
178 * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_QUERY_ABI | 8 |
179 * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_CALCULATE_LA | 16 |
180 * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_SET_LA | 16 |
181 * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_GET_MAX_BW | 8 |
182 * | MRQ_CPU_NDIV_LIMITS | | 4 |
183 * | MRQ_CPU_AUTO_CC3 | | 4 |
184 * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 |
185 * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_READ | 5 |
186 * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len |
187 * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_GET_FIFO | 4 |
188 * | MRQ_STRAP | STRAP_SET | 12 |
189 * | MRQ_UPHY | CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 |
190 * | MRQ_UPHY | CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 |
191 * | MRQ_UPHY | CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 |
192 * | MRQ_UPHY | CMD_UPHY_PCIE_CONTROLLER_STATE | 6 |
193 * | MRQ_UPHY | CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 |
194 * | MRQ_FMON | CMD_FMON_GEAR_CLAMP | 16 |
195 * | MRQ_FMON | CMD_FMON_GEAR_FREE | 4 |
196 * | MRQ_FMON | CMD_FMON_GEAR_GET | 4 |
197 * | MRQ_FMON | CMD_FMON_FAULT_STS_GET | 8 |
198 * | MRQ_EC | CMD_EC_STATUS_EX_GET | 12 |
199 * | MRQ_QUERY_FW_TAG | | 0 |
200 * | MRQ_DEBUG | CMD_DEBUG_OPEN_RO | 4 + length of cmd_debug_fopen_request.name |
201 * | MRQ_DEBUG | CMD_DEBUG_OPEN_WO | 4 + length of cmd_debug_fopen_request.name |
202 * | MRQ_DEBUG | CMD_DEBUG_READ | 8 |
203 * | MRQ_DEBUG | CMD_DEBUG_WRITE | 12 + cmd_debug_fwrite_request.datalen |
204 * | MRQ_DEBUG | CMD_DEBUG_CLOSE | 8 |
205 * | MRQ_TELEMETRY | | 8 |
206 * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_QUERY_ABI | 8 |
207 * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_SET | 20 |
208 * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_GET | 16 |
209 * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_CURR_CAP | 8 |
210 * | MRQ_GEARS | | 0 |
211 * | MRQ_BWMGR_INT | CMD_BWMGR_INT_QUERY_ABI | 8 |
212 * | MRQ_BWMGR_INT | CMD_BWMGR_INT_CALC_AND_SET | 16 |
213 * | MRQ_BWMGR_INT | CMD_BWMGR_INT_CAP_SET | 8 |
214 * | MRQ_OC_STATUS | | 0 |
218 * CRC16 using polynomial x^16 + x^14 + x^12 + x^11 + x^8 + x^5 + x^4 + x^2 + 1
219 * and initialization value 0x4657. The CRC is calculated over all bytes of the message
220 * including this header. However the crc16 field is considered to be set to 0 when
221 * calculating the CRC. Only used when #BPMP_MAIL_CRC_PRESENT is set. If
222 * #BPMP_MAIL_CRC_PRESENT is set and this field does not match the CRC as
223 * calculated by BPMP, -BPMP_EBADMSG will be returned and the request will
224 * be ignored. See code snippet below on how to calculate the CRC.
227 * uint16_t calc_crc_digest(uint16_t crc, uint8_t *data, size_t size)
229 * for (size_t i = 0; i < size; i++) {
230 * crc ^= data[i] << 8;
231 * for (size_t j = 0; j < 8; j++) {
232 * if ((crc & 0x8000) == 0x8000) {
233 * crc = (crc << 1) ^ 0xAC9A;
242 * uint16_t calc_crc(uint8_t *data, size_t size)
244 * return calc_crc_digest(0x4657, data, size);
252 * @ingroup MRQ_Format
253 * @brief Header for an MRQ response
255 * Provides an error code for the associated MRQ message. The
256 * remainder of the MRQ response is a payload (immediately following
257 * the mrq_response) whose format depends on the associated
260 struct mrq_response
{
261 /** @brief Error code for the MRQ request itself */
265 * @brief 32bit word containing a number of fields as follows:
270 * uint8_t payload_length;
274 * **options** indicates CRC presence.
276 * #BPMP_MAIL_CRC_PRESENT is supported on T234 and later platforms and
277 * indicates the crc16 related fields are present when set.
279 * **xid** is the transaction ID as sent by the requestor.
281 * **length** of the message expressed in bytes without the size of this header.
282 * Note: For DMCE communication, this field expresses the length as a multiple of 4 bytes
287 * CRC16 using polynomial x^16 + x^14 + x^12 + x^11 + x^8 + x^5 + x^4 + x^2 + 1
288 * and initialization value 0x4657. The CRC is calculated over all bytes of the message
289 * including this header. However the crc16 field is considered to be set to 0 when
290 * calculating the CRC. Only used when #BPMP_MAIL_CRC_PRESENT is set.
296 * @ingroup MRQ_Format
297 * Minimum needed size for an IPC message buffer
299 #define MSG_MIN_SZ 128U
301 * @ingroup MRQ_Format
302 * Minimum size guaranteed for data in an IPC message buffer
304 #define MSG_DATA_MIN_SZ 120U
308 * @name Legal MRQ codes
309 * These are the legal values for mrq_request::mrq
314 #define MRQ_QUERY_TAG 1U
315 #define MRQ_THREADED_PING 9U
316 #define MRQ_DEBUGFS 19U
317 #define MRQ_RESET 20U
320 #define MRQ_QUERY_ABI 23U
321 #define MRQ_THERMAL 27U
322 #define MRQ_CPU_VHINT 28U
323 #define MRQ_ABI_RATCHET 29U
324 #define MRQ_EMC_DVFS_LATENCY 31U
325 #define MRQ_RINGBUF_CONSOLE 65U
327 #define MRQ_CPU_NDIV_LIMITS 67U
328 #define MRQ_STRAP 68U
330 #define MRQ_CPU_AUTO_CC3 70U
331 #define MRQ_QUERY_FW_TAG 71U
334 #define MRQ_DEBUG 75U
335 #define MRQ_EMC_DVFS_EMCHUB 76U
336 #define MRQ_BWMGR 77U
337 #define MRQ_ISO_CLIENT 78U
338 #define MRQ_EMC_DISP_RFL 79U
339 #define MRQ_TELEMETRY 80U
340 #define MRQ_PWR_LIMIT 81U
341 #define MRQ_GEARS 82U
342 #define MRQ_BWMGR_INT 83U
343 #define MRQ_OC_STATUS 84U
345 /** @cond DEPRECATED */
346 #define MRQ_RESERVED_2 2U
347 #define MRQ_RESERVED_3 3U
348 #define MRQ_RESERVED_4 4U
349 #define MRQ_RESERVED_5 5U
350 #define MRQ_RESERVED_6 6U
351 #define MRQ_RESERVED_7 7U
352 #define MRQ_RESERVED_8 8U
353 #define MRQ_RESERVED_10 10U
354 #define MRQ_RESERVED_11 11U
355 #define MRQ_RESERVED_12 12U
356 #define MRQ_RESERVED_13 13U
357 #define MRQ_RESERVED_14 14U
358 #define MRQ_RESERVED_15 15U
359 #define MRQ_RESERVED_16 16U
360 #define MRQ_RESERVED_17 17U
361 #define MRQ_RESERVED_18 18U
362 #define MRQ_RESERVED_24 24U
363 #define MRQ_RESERVED_25 25U
364 #define MRQ_RESERVED_26 26U
365 #define MRQ_RESERVED_30 30U
366 #define MRQ_RESERVED_64 64U
367 #define MRQ_RESERVED_74 74U
368 /** @endcond DEPRECATED */
374 * @brief Maximum MRQ code to be sent by CPU software to
375 * BPMP. Subject to change in future
377 #define MAX_CPU_MRQ_ID 84U
380 * @addtogroup MRQ_Payloads
382 * @defgroup Ping Ping
383 * @defgroup Query_Tag Query Tag
384 * @defgroup Module Loadable Modules
385 * @defgroup Trace Trace
386 * @defgroup Debugfs Debug File System
387 * @defgroup Reset Reset
389 * @defgroup Clocks Clocks
390 * @defgroup ABI_info ABI Info
391 * @defgroup Powergating Power Gating
392 * @defgroup Thermal Thermal
393 * @defgroup OC_status OC status
394 * @defgroup Vhint CPU Voltage hint
396 * @defgroup BWMGR BWMGR
397 * @defgroup ISO_CLIENT ISO_CLIENT
398 * @defgroup CPU NDIV Limits
399 * @defgroup RingbufConsole Ring Buffer Console
400 * @defgroup Strap Straps
401 * @defgroup UPHY UPHY
402 * @defgroup CC3 Auto-CC3
403 * @defgroup FMON FMON
405 * @defgroup Telemetry Telemetry
406 * @defgroup Pwrlimit PWR_LIMIT
407 * @defgroup Gears Gears
408 * @defgroup BWMGR_INT Bandwidth Manager Integrated
415 * @brief A simple ping
420 * * Request Payload: @ref mrq_ping_request
421 * * Response Payload: @ref mrq_ping_response
424 * @def MRQ_THREADED_PING
425 * @brief A deeper ping
430 * * Request Payload: @ref mrq_ping_request
431 * * Response Payload: @ref mrq_ping_response
433 * Behavior is equivalent to a simple #MRQ_PING except that BPMP
434 * responds from a thread context (providing a slightly more robust
441 * @brief Request with #MRQ_PING
443 * Used by the sender of an #MRQ_PING message to request a pong from
444 * recipient. The response from the recipient is computed based on
447 struct mrq_ping_request
{
448 /** @brief Arbitrarily chosen value */
454 * @brief Response to #MRQ_PING
456 * Sent in response to an #MRQ_PING message. #reply should be the
457 * mrq_ping_request challenge left shifted by 1 with the carry-bit
461 struct mrq_ping_response
{
462 /** @brief Response to the MRQ_PING challege */
469 * @brief Query BPMP firmware's tag (i.e. unique identifer)
471 * @deprecated Use #MRQ_QUERY_FW_TAG instead.
474 * * Initiators: CCPLEX
476 * * Request Payload: @ref mrq_query_tag_request
477 * * Response Payload: N/A
483 * @brief Request with #MRQ_QUERY_TAG
485 * @deprecated This structure will be removed in future version.
486 * Use MRQ_QUERY_FW_TAG instead.
488 struct mrq_query_tag_request
{
489 /** @brief Base address to store the firmware tag */
496 * @def MRQ_QUERY_FW_TAG
497 * @brief Query BPMP firmware's tag (i.e. unique identifier)
502 * * Request Payload: N/A
503 * * Response Payload: @ref mrq_query_fw_tag_response
509 * @brief Response to #MRQ_QUERY_FW_TAG
511 * Sent in response to #MRQ_QUERY_FW_TAG message. #tag contains the unique
512 * identifier for the version of firmware issuing the reply.
515 struct mrq_query_fw_tag_response
{
516 /** @brief Array to store tag information */
521 struct mrq_threaded_ping_request
{
526 struct mrq_threaded_ping_response
{
533 * @brief Interact with BPMP's debugfs file nodes
535 * @deprecated use MRQ_DEBUG instead.
537 * * Platforms: T186, T194
540 * * Request Payload: @ref mrq_debugfs_request
541 * * Response Payload: @ref mrq_debugfs_response
545 * @addtogroup Debugfs
548 * The BPMP firmware implements a pseudo-filesystem called
549 * debugfs. Any driver within the firmware may register with debugfs
550 * to expose an arbitrary set of "files" in the filesystem. When
551 * software on the CPU writes to a debugfs file, debugfs passes the
552 * written data to a callback provided by the driver. When software on
553 * the CPU reads a debugfs file, debugfs queries the driver for the
554 * data to return to the CPU. The intention of the debugfs filesystem
555 * is to provide information useful for debugging the system at
558 * @note The files exposed via debugfs are not part of the
559 * BPMP firmware's ABI. debugfs files may be added or removed in any
560 * given version of the firmware. Typically the semantics of a debugfs
561 * file are consistent from version to version but even that is not
567 /** @ingroup Debugfs */
568 enum mrq_debugfs_commands
{
569 /** @brief Perform read */
570 CMD_DEBUGFS_READ
= 1,
571 /** @brief Perform write */
572 CMD_DEBUGFS_WRITE
= 2,
573 /** @brief Perform dumping directory */
574 CMD_DEBUGFS_DUMPDIR
= 3,
575 /** @brief Not a command */
581 * @brief Parameters for CMD_DEBUGFS_READ/WRITE command
583 struct cmd_debugfs_fileop_request
{
584 /** @brief Physical address pointing at filename */
586 /** @brief Length in bytes of filename buffer */
588 /** @brief Physical address pointing to data buffer */
590 /** @brief Length in bytes of data buffer */
596 * @brief Parameters for CMD_DEBUGFS_READ/WRITE command
598 struct cmd_debugfs_dumpdir_request
{
599 /** @brief Physical address pointing to data buffer */
601 /** @brief Length in bytes of data buffer */
607 * @brief Response data for CMD_DEBUGFS_READ/WRITE command
609 struct cmd_debugfs_fileop_response
{
610 /** @brief Always 0 */
612 /** @brief Number of bytes read from or written to data buffer */
618 * @brief Response data for CMD_DEBUGFS_DUMPDIR command
620 struct cmd_debugfs_dumpdir_response
{
621 /** @brief Always 0 */
623 /** @brief Number of bytes read from or written to data buffer */
629 * @brief Request with #MRQ_DEBUGFS.
631 * The sender of an MRQ_DEBUGFS message uses #cmd to specify a debugfs
632 * command to execute. Legal commands are the values of @ref
633 * mrq_debugfs_commands. Each command requires a specific additional
637 * |-------------------|-------|
638 * |CMD_DEBUGFS_READ |fop |
639 * |CMD_DEBUGFS_WRITE |fop |
640 * |CMD_DEBUGFS_DUMPDIR|dumpdir|
642 struct mrq_debugfs_request
{
643 /** @brief Sub-command (@ref mrq_debugfs_commands) */
646 struct cmd_debugfs_fileop_request fop
;
647 struct cmd_debugfs_dumpdir_request dumpdir
;
654 struct mrq_debugfs_response
{
655 /** @brief Always 0 */
658 /** @brief Response data for CMD_DEBUGFS_READ OR
659 * CMD_DEBUGFS_WRITE command
661 struct cmd_debugfs_fileop_response fop
;
662 /** @brief Response data for CMD_DEBUGFS_DUMPDIR command */
663 struct cmd_debugfs_dumpdir_response dumpdir
;
668 * @addtogroup Debugfs
671 #define DEBUGFS_S_ISDIR (1 << 9)
672 #define DEBUGFS_S_IRUSR (1 << 8)
673 #define DEBUGFS_S_IWUSR (1 << 7)
679 * @brief Interact with BPMP's debugfs file nodes. Use message payload
680 * for exchanging data. This is functionally equivalent to
681 * @ref MRQ_DEBUGFS. But the way in which data is exchanged is different.
682 * When software running on CPU tries to read a debugfs file,
683 * the file path and read data will be stored in message payload.
684 * Since the message payload size is limited, a debugfs file
685 * transaction might require multiple frames of data exchanged
686 * between BPMP and CPU until the transaction completes.
691 * * Request Payload: @ref mrq_debug_request
692 * * Response Payload: @ref mrq_debug_response
695 /** @ingroup Debugfs */
696 enum mrq_debug_commands
{
697 /** @brief Open required file for read operation */
698 CMD_DEBUG_OPEN_RO
= 0,
699 /** @brief Open required file for write operation */
700 CMD_DEBUG_OPEN_WO
= 1,
701 /** @brief Perform read */
703 /** @brief Perform write */
705 /** @brief Close file */
707 /** @brief Not a command */
713 * @brief Maximum number of files that can be open at a given time
715 #define DEBUG_MAX_OPEN_FILES 1
719 * @brief Maximum size of null-terminated file name string in bytes.
720 * Value is derived from memory available in message payload while
721 * using @ref cmd_debug_fopen_request
722 * Value 4 corresponds to size of @ref mrq_debug_commands
723 * in @ref mrq_debug_request.
724 * 120 - 4 dbg_cmd(32bit) = 116
726 #define DEBUG_FNAME_MAX_SZ (MSG_DATA_MIN_SZ - 4)
730 * @brief Parameters for CMD_DEBUG_OPEN command
732 struct cmd_debug_fopen_request
{
733 /** @brief File name - Null-terminated string with maximum
734 * length @ref DEBUG_FNAME_MAX_SZ
736 char name
[DEBUG_FNAME_MAX_SZ
];
741 * @brief Response data for CMD_DEBUG_OPEN_RO/WO command
743 struct cmd_debug_fopen_response
{
744 /** @brief Identifier for file access */
746 /** @brief Data length. File data size for READ command.
747 * Maximum allowed length for WRITE command
754 * @brief Parameters for CMD_DEBUG_READ command
756 struct cmd_debug_fread_request
{
757 /** @brief File access identifier received in response
758 * to CMD_DEBUG_OPEN_RO request
765 * @brief Maximum size of read data in bytes.
766 * Value is derived from memory available in message payload while
767 * using @ref cmd_debug_fread_response.
769 #define DEBUG_READ_MAX_SZ (MSG_DATA_MIN_SZ - 4)
773 * @brief Response data for CMD_DEBUG_READ command
775 struct cmd_debug_fread_response
{
776 /** @brief Size of data provided in this response in bytes */
778 /** @brief File data from seek position */
779 char data
[DEBUG_READ_MAX_SZ
];
784 * @brief Maximum size of write data in bytes.
785 * Value is derived from memory available in message payload while
786 * using @ref cmd_debug_fwrite_request.
788 #define DEBUG_WRITE_MAX_SZ (MSG_DATA_MIN_SZ - 12)
792 * @brief Parameters for CMD_DEBUG_WRITE command
794 struct cmd_debug_fwrite_request
{
795 /** @brief File access identifier received in response
796 * to CMD_DEBUG_OPEN_RO request
799 /** @brief Size of write data in bytes */
801 /** @brief Data to be written */
802 char data
[DEBUG_WRITE_MAX_SZ
];
807 * @brief Parameters for CMD_DEBUG_CLOSE command
809 struct cmd_debug_fclose_request
{
810 /** @brief File access identifier received in response
811 * to CMD_DEBUG_OPEN_RO request
818 * @brief Request with #MRQ_DEBUG.
820 * The sender of an MRQ_DEBUG message uses #cmd to specify a debugfs
821 * command to execute. Legal commands are the values of @ref
822 * mrq_debug_commands. Each command requires a specific additional
826 * |-------------------|-------|
827 * |CMD_DEBUG_OPEN_RO |fop |
828 * |CMD_DEBUG_OPEN_WO |fop |
829 * |CMD_DEBUG_READ |frd |
830 * |CMD_DEBUG_WRITE |fwr |
831 * |CMD_DEBUG_CLOSE |fcl |
833 struct mrq_debug_request
{
834 /** @brief Sub-command (@ref mrq_debug_commands) */
837 /** @brief Request payload for CMD_DEBUG_OPEN_RO/WO command */
838 struct cmd_debug_fopen_request fop
;
839 /** @brief Request payload for CMD_DEBUG_READ command */
840 struct cmd_debug_fread_request frd
;
841 /** @brief Request payload for CMD_DEBUG_WRITE command */
842 struct cmd_debug_fwrite_request fwr
;
843 /** @brief Request payload for CMD_DEBUG_CLOSE command */
844 struct cmd_debug_fclose_request fcl
;
851 struct mrq_debug_response
{
853 /** @brief Response data for CMD_DEBUG_OPEN_RO/WO command */
854 struct cmd_debug_fopen_response fop
;
855 /** @brief Response data for CMD_DEBUG_READ command */
856 struct cmd_debug_fread_response frd
;
863 * @brief Reset an IP block
865 * * Platforms: T186, T194
868 * * Request Payload: @ref mrq_reset_request
869 * * Response Payload: @ref mrq_reset_response
875 enum mrq_reset_commands
{
877 * @brief Assert module reset
879 * mrq_response::err is 0 if the operation was successful, or @n
880 * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n
881 * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n
882 * -#BPMP_ENOTSUP if target domain h/w state does not allow reset
884 CMD_RESET_ASSERT
= 1,
886 * @brief Deassert module reset
888 * mrq_response::err is 0 if the operation was successful, or @n
889 * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n
890 * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n
891 * -#BPMP_ENOTSUP if target domain h/w state does not allow reset
893 CMD_RESET_DEASSERT
= 2,
895 * @brief Assert and deassert the module reset
897 * mrq_response::err is 0 if the operation was successful, or @n
898 * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n
899 * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n
900 * -#BPMP_ENOTSUP if target domain h/w state does not allow reset
902 CMD_RESET_MODULE
= 3,
904 * @brief Get the highest reset ID
906 * mrq_response::err is 0 if the operation was successful, or @n
907 * -#BPMP_ENODEV if no reset domains are supported (number of IDs is 0)
909 CMD_RESET_GET_MAX_ID
= 4,
911 /** @brief Not part of ABI and subject to change */
916 * @brief Request with MRQ_RESET
918 * Used by the sender of an #MRQ_RESET message to request BPMP to
919 * assert or or deassert a given reset line.
921 struct mrq_reset_request
{
922 /** @brief Reset action to perform (@ref mrq_reset_commands) */
924 /** @brief Id of the reset to affected */
929 * @brief Response for MRQ_RESET sub-command CMD_RESET_GET_MAX_ID. When
930 * this sub-command is not supported, firmware will return -BPMP_EBADCMD
931 * in mrq_response::err.
933 struct cmd_reset_get_max_id_response
{
934 /** @brief Max reset id */
939 * @brief Response with MRQ_RESET
941 * Each sub-command supported by @ref mrq_reset_request may return
942 * sub-command-specific data. Some do and some do not as indicated
943 * in the following table
945 * | sub-command | payload |
946 * |----------------------|------------------|
947 * | CMD_RESET_ASSERT | - |
948 * | CMD_RESET_DEASSERT | - |
949 * | CMD_RESET_MODULE | - |
950 * | CMD_RESET_GET_MAX_ID | reset_get_max_id |
952 struct mrq_reset_response
{
954 struct cmd_reset_get_max_id_response reset_get_max_id
;
963 * @brief Issue an i2c transaction
965 * * Platforms: T186, T194
968 * * Request Payload: @ref mrq_i2c_request
969 * * Response Payload: @ref mrq_i2c_response
974 #define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12U)
975 #define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4U)
977 #define SERIALI2C_TEN 0x0010U
978 #define SERIALI2C_RD 0x0001U
979 #define SERIALI2C_STOP 0x8000U
980 #define SERIALI2C_NOSTART 0x4000U
981 #define SERIALI2C_REV_DIR_ADDR 0x2000U
982 #define SERIALI2C_IGNORE_NAK 0x1000U
983 #define SERIALI2C_NO_RD_ACK 0x0800U
984 #define SERIALI2C_RECV_LEN 0x0400U
991 * @brief Serializable i2c request
993 * Instances of this structure are packed (little-endian) into
994 * cmd_i2c_xfer_request::data_buf. Each instance represents a single
995 * transaction (or a portion of a transaction with repeated starts) on
998 * Because these structures are packed, some instances are likely to
999 * be misaligned. Additionally because #data is variable length, it is
1000 * not possible to iterate through a serialized list of these
1001 * structures without inspecting #len in each instance. It may be
1002 * easier to serialize or deserialize cmd_i2c_xfer_request::data_buf
1003 * manually rather than using this structure definition.
1005 struct serial_i2c_request
{
1006 /** @brief I2C slave address */
1008 /** @brief Bitmask of SERIALI2C_ flags */
1010 /** @brief Length of I2C transaction in bytes */
1012 /** @brief For write transactions only, #len bytes of data */
1017 * @brief Trigger one or more i2c transactions
1019 struct cmd_i2c_xfer_request
{
1021 * @brief Tegra PWR_I2C bus identifier
1023 * @cond (bpmp_t234 || bpmp_t239 || bpmp_t194)
1025 * @endcond (bpmp_t234 || bpmp_t239 || bpmp_t194)
1028 * @endcond bpmp_th500
1033 /** @brief Count of valid bytes in #data_buf*/
1036 /** @brief Serialized packed instances of @ref serial_i2c_request*/
1037 uint8_t data_buf
[TEGRA_I2C_IPC_MAX_IN_BUF_SIZE
];
1041 * @brief Container for data read from the i2c bus
1043 * Processing an cmd_i2c_xfer_request::data_buf causes BPMP to execute
1044 * zero or more I2C reads. The data read from the bus is serialized
1047 struct cmd_i2c_xfer_response
{
1048 /** @brief Count of valid bytes in #data_buf*/
1050 /** @brief I2c read data */
1051 uint8_t data_buf
[TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE
];
1055 * @brief Request with #MRQ_I2C
1057 struct mrq_i2c_request
{
1058 /** @brief Always CMD_I2C_XFER (i.e. 1) */
1060 /** @brief Parameters of the transfer request */
1061 struct cmd_i2c_xfer_request xfer
;
1065 * @brief Response to #MRQ_I2C
1067 * mrq_response:err is
1069 * -#BPMP_EBADCMD: if mrq_i2c_request::cmd is other than 1
1070 * -#BPMP_EINVAL: if cmd_i2c_xfer_request does not contain correctly formatted request
1071 * -#BPMP_ENODEV: if cmd_i2c_xfer_request::bus_id is not supported by BPMP
1072 * -#BPMP_EACCES: if i2c transaction is not allowed due to firewall rules
1073 * -#BPMP_ETIMEDOUT: if i2c transaction times out
1074 * -#BPMP_ENXIO: if i2c slave device does not reply with ACK to the transaction
1075 * -#BPMP_EAGAIN: if ARB_LOST condition is detected by the i2c controller
1076 * -#BPMP_EIO: any other i2c controller error code than NO_ACK or ARB_LOST
1078 struct mrq_i2c_response
{
1079 struct cmd_i2c_xfer_response xfer
;
1085 * @ingroup MRQ_Codes
1087 * @brief Perform a clock operation
1089 * * Platforms: T186, T194
1092 * * Request Payload: @ref mrq_clk_request
1093 * * Response Payload: @ref mrq_clk_response
1095 * @addtogroup Clocks
1099 CMD_CLK_GET_RATE
= 1,
1100 CMD_CLK_SET_RATE
= 2,
1101 CMD_CLK_ROUND_RATE
= 3,
1102 CMD_CLK_GET_PARENT
= 4,
1103 CMD_CLK_SET_PARENT
= 5,
1104 CMD_CLK_IS_ENABLED
= 6,
1106 CMD_CLK_DISABLE
= 8,
1107 /** @cond DEPRECATED */
1108 CMD_CLK_PROPERTIES
= 9,
1109 CMD_CLK_POSSIBLE_PARENTS
= 10,
1110 CMD_CLK_NUM_POSSIBLE_PARENTS
= 11,
1111 CMD_CLK_GET_POSSIBLE_PARENT
= 12,
1112 CMD_CLK_RESET_REFCOUNTS
= 13,
1113 /** @endcond DEPRECATED */
1114 CMD_CLK_GET_ALL_INFO
= 14,
1115 CMD_CLK_GET_MAX_CLK_ID
= 15,
1116 CMD_CLK_GET_FMAX_AT_VMIN
= 16,
1120 #define BPMP_CLK_HAS_MUX (1U << 0U)
1121 #define BPMP_CLK_HAS_SET_RATE (1U << 1U)
1122 #define BPMP_CLK_IS_ROOT (1U << 2U)
1123 #define BPMP_CLK_IS_VAR_ROOT (1U << 3U)
1125 * @brief Protection against rate and parent changes
1127 * #MRQ_CLK command #CMD_CLK_SET_RATE or #MRQ_CLK command #CMD_CLK_SET_PARENT will return
1130 #define BPMP_CLK_RATE_PARENT_CHANGE_DENIED (1U << 30)
1133 * @brief Protection against state changes
1135 * #MRQ_CLK command #CMD_CLK_ENABLE or #MRQ_CLK command #CMD_CLK_DISABLE will return
1138 #define BPMP_CLK_STATE_CHANGE_DENIED (1U << 31)
1140 #define MRQ_CLK_NAME_MAXLEN 40U
1141 #define MRQ_CLK_MAX_PARENTS 16U
1144 struct cmd_clk_get_rate_request
{
1148 struct cmd_clk_get_rate_response
{
1152 struct cmd_clk_set_rate_request
{
1157 struct cmd_clk_set_rate_response
{
1161 struct cmd_clk_round_rate_request
{
1166 struct cmd_clk_round_rate_response
{
1171 struct cmd_clk_get_parent_request
{
1175 struct cmd_clk_get_parent_response
{
1179 struct cmd_clk_set_parent_request
{
1183 struct cmd_clk_set_parent_response
{
1188 struct cmd_clk_is_enabled_request
{
1193 * @brief Response data to #MRQ_CLK sub-command CMD_CLK_IS_ENABLED
1195 struct cmd_clk_is_enabled_response
{
1197 * @brief The state of the clock that has been successfully
1198 * requested with CMD_CLK_ENABLE or CMD_CLK_DISABLE by the
1199 * master invoking the command earlier.
1201 * The state may not reflect the physical state of the clock
1202 * if there are some other masters requesting it to be
1205 * Value 0 is disabled, all other values indicate enabled.
1211 struct cmd_clk_enable_request
{
1216 struct cmd_clk_enable_response
{
1221 struct cmd_clk_disable_request
{
1226 struct cmd_clk_disable_response
{
1230 /** @cond DEPRECATED */
1232 struct cmd_clk_properties_request
{
1236 /** @todo flags need to be spelled out here */
1237 struct cmd_clk_properties_response
{
1242 struct cmd_clk_possible_parents_request
{
1246 struct cmd_clk_possible_parents_response
{
1247 uint8_t num_parents
;
1248 uint8_t reserved
[3];
1249 uint32_t parent_id
[MRQ_CLK_MAX_PARENTS
];
1253 struct cmd_clk_num_possible_parents_request
{
1257 struct cmd_clk_num_possible_parents_response
{
1258 uint8_t num_parents
;
1261 struct cmd_clk_get_possible_parent_request
{
1265 struct cmd_clk_get_possible_parent_response
{
1268 /** @endcond DEPRECATED */
1271 struct cmd_clk_get_all_info_request
{
1275 struct cmd_clk_get_all_info_response
{
1278 uint32_t parents
[MRQ_CLK_MAX_PARENTS
];
1279 uint8_t num_parents
;
1280 uint8_t name
[MRQ_CLK_NAME_MAXLEN
];
1284 struct cmd_clk_get_max_clk_id_request
{
1288 struct cmd_clk_get_max_clk_id_response
{
1293 struct cmd_clk_get_fmax_at_vmin_request
{
1297 struct cmd_clk_get_fmax_at_vmin_response
{
1304 * @brief Request with #MRQ_CLK
1306 * Used by the sender of an #MRQ_CLK message to control clocks. The
1307 * clk_request is split into several sub-commands. Some sub-commands
1308 * require no additional data. Others have a sub-command specific
1311 * |sub-command |payload |
1312 * |----------------------------|-----------------------|
1313 * |CMD_CLK_GET_RATE |- |
1314 * |CMD_CLK_SET_RATE |clk_set_rate |
1315 * |CMD_CLK_ROUND_RATE |clk_round_rate |
1316 * |CMD_CLK_GET_PARENT |- |
1317 * |CMD_CLK_SET_PARENT |clk_set_parent |
1318 * |CMD_CLK_IS_ENABLED |- |
1319 * |CMD_CLK_ENABLE |- |
1320 * |CMD_CLK_DISABLE |- |
1321 * |CMD_CLK_GET_ALL_INFO |- |
1322 * |CMD_CLK_GET_MAX_CLK_ID |- |
1323 * |CMD_CLK_GET_FMAX_AT_VMIN |-
1328 /** @cond DEPRECATED
1330 * Older versions of firmware also supported following sub-commands:
1331 * |CMD_CLK_PROPERTIES |- |
1332 * |CMD_CLK_POSSIBLE_PARENTS |- |
1333 * |CMD_CLK_NUM_POSSIBLE_PARENTS|- |
1334 * |CMD_CLK_GET_POSSIBLE_PARENT |clk_get_possible_parent|
1335 * |CMD_CLK_RESET_REFCOUNTS |- |
1337 * @endcond DEPRECATED */
1339 struct mrq_clk_request
{
1340 /** @brief Sub-command and clock id concatenated to 32-bit word.
1341 * - bits[31..24] is the sub-cmd.
1342 * - bits[23..0] is the clock id
1344 uint32_t cmd_and_id
;
1348 struct cmd_clk_get_rate_request clk_get_rate
;
1349 struct cmd_clk_set_rate_request clk_set_rate
;
1350 struct cmd_clk_round_rate_request clk_round_rate
;
1352 struct cmd_clk_get_parent_request clk_get_parent
;
1353 struct cmd_clk_set_parent_request clk_set_parent
;
1355 struct cmd_clk_enable_request clk_enable
;
1357 struct cmd_clk_disable_request clk_disable
;
1359 struct cmd_clk_is_enabled_request clk_is_enabled
;
1360 /** @cond DEPRECATED */
1362 struct cmd_clk_properties_request clk_properties
;
1364 struct cmd_clk_possible_parents_request clk_possible_parents
;
1366 struct cmd_clk_num_possible_parents_request clk_num_possible_parents
;
1367 struct cmd_clk_get_possible_parent_request clk_get_possible_parent
;
1368 /** @endcond DEPRECATED */
1370 struct cmd_clk_get_all_info_request clk_get_all_info
;
1372 struct cmd_clk_get_max_clk_id_request clk_get_max_clk_id
;
1374 struct cmd_clk_get_fmax_at_vmin_request clk_get_fmax_at_vmin
;
1380 * @brief Response to MRQ_CLK
1382 * Each sub-command supported by @ref mrq_clk_request may return
1383 * sub-command-specific data. Some do and some do not as indicated in
1384 * the following table
1386 * |sub-command |payload |
1387 * |----------------------------|------------------------|
1388 * |CMD_CLK_GET_RATE |clk_get_rate |
1389 * |CMD_CLK_SET_RATE |clk_set_rate |
1390 * |CMD_CLK_ROUND_RATE |clk_round_rate |
1391 * |CMD_CLK_GET_PARENT |clk_get_parent |
1392 * |CMD_CLK_SET_PARENT |clk_set_parent |
1393 * |CMD_CLK_IS_ENABLED |clk_is_enabled |
1394 * |CMD_CLK_ENABLE |- |
1395 * |CMD_CLK_DISABLE |- |
1396 * |CMD_CLK_GET_ALL_INFO |clk_get_all_info |
1397 * |CMD_CLK_GET_MAX_CLK_ID |clk_get_max_id |
1398 * |CMD_CLK_GET_FMAX_AT_VMIN |clk_get_fmax_at_vmin |
1402 /** @cond DEPRECATED
1404 * Older versions of firmware also supported following sub-commands:
1405 * |CMD_CLK_PROPERTIES |clk_properties |
1406 * |CMD_CLK_POSSIBLE_PARENTS |clk_possible_parents |
1407 * |CMD_CLK_NUM_POSSIBLE_PARENTS|clk_num_possible_parents|
1408 * |CMD_CLK_GET_POSSIBLE_PARENT |clk_get_possible_parents|
1409 * |CMD_CLK_RESET_REFCOUNTS |- |
1411 * @endcond DEPRECATED */
1413 struct mrq_clk_response
{
1415 struct cmd_clk_get_rate_response clk_get_rate
;
1416 struct cmd_clk_set_rate_response clk_set_rate
;
1417 struct cmd_clk_round_rate_response clk_round_rate
;
1418 struct cmd_clk_get_parent_response clk_get_parent
;
1419 struct cmd_clk_set_parent_response clk_set_parent
;
1421 struct cmd_clk_enable_response clk_enable
;
1423 struct cmd_clk_disable_response clk_disable
;
1424 struct cmd_clk_is_enabled_response clk_is_enabled
;
1425 /** @cond DEPRECATED */
1426 struct cmd_clk_properties_response clk_properties
;
1427 struct cmd_clk_possible_parents_response clk_possible_parents
;
1428 struct cmd_clk_num_possible_parents_response clk_num_possible_parents
;
1429 struct cmd_clk_get_possible_parent_response clk_get_possible_parent
;
1430 /** @endcond DEPRECATED */
1431 struct cmd_clk_get_all_info_response clk_get_all_info
;
1432 struct cmd_clk_get_max_clk_id_response clk_get_max_clk_id
;
1433 struct cmd_clk_get_fmax_at_vmin_response clk_get_fmax_at_vmin
;
1440 * @ingroup MRQ_Codes
1441 * @def MRQ_QUERY_ABI
1442 * @brief Check if an MRQ is implemented
1446 * * Targets: Any except DMCE
1447 * * Request Payload: @ref mrq_query_abi_request
1448 * * Response Payload: @ref mrq_query_abi_response
1453 * @brief Request with MRQ_QUERY_ABI
1455 * Used by #MRQ_QUERY_ABI call to check if MRQ code #mrq is supported
1458 struct mrq_query_abi_request
{
1459 /** @brief MRQ code to query */
1465 * @brief Response to MRQ_QUERY_ABI
1467 * @note mrq_response::err of 0 indicates that the query was
1468 * successful, not that the MRQ itself is supported!
1470 struct mrq_query_abi_response
{
1471 /** @brief 0 if queried MRQ is supported. Else, -#BPMP_ENODEV */
1477 * @ingroup MRQ_Codes
1479 * @brief Control power-gating state of a partition. In contrast to
1480 * MRQ_PG_UPDATE_STATE, operations that change the power partition
1481 * state are NOT reference counted
1483 * @cond (bpmp_t194 || bpmp_t186)
1484 * @note On T194 and earlier BPMP-FW forcefully turns off some partitions as
1485 * part of SC7 entry because their state cannot be adequately restored on exit.
1486 * Therefore, it is recommended to power off all domains via MRQ_PG prior to SC7
1488 * See @ref bpmp_pdomain_ids for further detail.
1489 * @endcond (bpmp_t194 || bpmp_t186)
1491 * * Platforms: T186, T194
1494 * * Request Payload: @ref mrq_pg_request
1495 * * Response Payload: @ref mrq_pg_response
1497 * @addtogroup Powergating
1502 * @brief Check whether the BPMP driver supports the specified
1505 * mrq_response::err is 0 if the specified request is
1506 * supported and -#BPMP_ENODEV otherwise.
1508 CMD_PG_QUERY_ABI
= 0,
1511 * @brief Set the current state of specified power domain. The
1512 * possible values for power domains are defined in enum
1515 * mrq_response:err is
1517 * -#BPMP_EINVAL: Invalid request parameters
1519 CMD_PG_SET_STATE
= 1,
1522 * @brief Get the current state of specified power domain. The
1523 * possible values for power domains are defined in enum
1526 * mrq_response:err is
1528 * -#BPMP_EINVAL: Invalid request parameters
1530 CMD_PG_GET_STATE
= 2,
1533 * @brief Get the name string of specified power domain id.
1535 * mrq_response:err is
1537 * -#BPMP_EINVAL: Invalid request parameters
1539 CMD_PG_GET_NAME
= 3,
1543 * @brief Get the highest power domain id in the system. Not
1544 * all IDs between 0 and max_id are valid IDs.
1546 * mrq_response:err is
1548 * -#BPMP_EINVAL: Invalid request parameters
1550 CMD_PG_GET_MAX_ID
= 4,
1553 #define MRQ_PG_NAME_MAXLEN 40
1556 /** @brief Power domain is OFF */
1558 /** @brief Power domain is ON */
1561 * @brief a legacy state where power domain and the clock
1562 * associated to the domain are ON.
1563 * This state is only supported in T186, and the use of it is
1566 PG_STATE_RUNNING
= 2,
1569 struct cmd_pg_query_abi_request
{
1570 /** @ref mrq_pg_cmd */
1574 struct cmd_pg_set_state_request
{
1575 /** @ref pg_states */
1580 * @brief Response data to #MRQ_PG sub command #CMD_PG_GET_STATE
1582 struct cmd_pg_get_state_response
{
1584 * @brief The state of the power partition that has been
1585 * succesfuly requested by the master earlier using #MRQ_PG
1586 * command #CMD_PG_SET_STATE.
1588 * The state may not reflect the physical state of the power
1589 * partition if there are some other masters requesting it to
1592 * See @ref pg_states for possible values
1597 struct cmd_pg_get_name_response
{
1598 uint8_t name
[MRQ_PG_NAME_MAXLEN
];
1601 struct cmd_pg_get_max_id_response
{
1606 * @brief Request with #MRQ_PG
1608 * Used by the sender of an #MRQ_PG message to control power
1609 * partitions. The pg_request is split into several sub-commands. Some
1610 * sub-commands require no additional data. Others have a sub-command
1613 * |sub-command |payload |
1614 * |----------------------------|-----------------------|
1615 * |CMD_PG_QUERY_ABI | query_abi |
1616 * |CMD_PG_SET_STATE | set_state |
1617 * |CMD_PG_GET_STATE | - |
1618 * |CMD_PG_GET_NAME | - |
1619 * |CMD_PG_GET_MAX_ID | - |
1622 struct mrq_pg_request
{
1626 struct cmd_pg_query_abi_request query_abi
;
1627 struct cmd_pg_set_state_request set_state
;
1632 * @brief Response to MRQ_PG
1634 * Each sub-command supported by @ref mrq_pg_request may return
1635 * sub-command-specific data. Some do and some do not as indicated in
1636 * the following table
1638 * |sub-command |payload |
1639 * |----------------------------|-----------------------|
1640 * |CMD_PG_QUERY_ABI | - |
1641 * |CMD_PG_SET_STATE | - |
1642 * |CMD_PG_GET_STATE | get_state |
1643 * |CMD_PG_GET_NAME | get_name |
1644 * |CMD_PG_GET_MAX_ID | get_max_id |
1646 struct mrq_pg_response
{
1648 struct cmd_pg_get_state_response get_state
;
1649 struct cmd_pg_get_name_response get_name
;
1650 struct cmd_pg_get_max_id_response get_max_id
;
1654 /** @} Powergating */
1657 * @ingroup MRQ_Codes
1659 * @brief Interact with BPMP thermal framework
1661 * * Platforms: T186, T194
1664 * * Request Payload: TODO
1665 * * Response Payload: TODO
1667 * @addtogroup Thermal
1669 * The BPMP firmware includes a thermal framework. Drivers within the
1670 * bpmp firmware register with the framework to provide thermal
1671 * zones. Each thermal zone corresponds to an entity whose temperature
1672 * can be measured. The framework also has a notion of trip points. A
1673 * trip point consists of a thermal zone id, a temperature, and a
1674 * callback routine. The framework invokes the callback when the zone
1675 * hits the indicated temperature. The BPMP firmware uses this thermal
1676 * framework interally to implement various temperature-dependent
1679 * Software on the CPU can use #MRQ_THERMAL (with payload @ref
1680 * mrq_thermal_host_to_bpmp_request) to interact with the BPMP thermal
1681 * framework. The CPU must It can query the number of supported zones,
1682 * query zone temperatures, and set trip points.
1684 * When a trip point set by the CPU gets crossed, BPMP firmware issues
1685 * an IPC to the CPU having mrq_request::mrq = #MRQ_THERMAL and a
1686 * payload of @ref mrq_thermal_bpmp_to_host_request.
1689 enum mrq_thermal_host_to_bpmp_cmd
{
1691 * @brief Check whether the BPMP driver supports the specified
1694 * Host needs to supply request parameters.
1696 * mrq_response::err is 0 if the specified request is
1697 * supported and -#BPMP_ENODEV otherwise.
1699 CMD_THERMAL_QUERY_ABI
= 0,
1702 * @brief Get the current temperature of the specified zone.
1704 * Host needs to supply request parameters.
1706 * mrq_response::err is
1707 * * 0: Temperature query succeeded.
1708 * * -#BPMP_EINVAL: Invalid request parameters.
1709 * * -#BPMP_ENOENT: No driver registered for thermal zone..
1710 * * -#BPMP_EFAULT: Problem reading temperature measurement.
1712 CMD_THERMAL_GET_TEMP
= 1,
1715 * @brief Enable or disable and set the lower and upper
1716 * thermal limits for a thermal trip point. Each zone has
1719 * Host needs to supply request parameters. Once the
1720 * temperature hits a trip point, the BPMP will send a message
1721 * to the CPU having MRQ=MRQ_THERMAL and
1722 * type=CMD_THERMAL_HOST_TRIP_REACHED
1724 * mrq_response::err is
1725 * * 0: Trip successfully set.
1726 * * -#BPMP_EINVAL: Invalid request parameters.
1727 * * -#BPMP_ENOENT: No driver registered for thermal zone.
1728 * * -#BPMP_EFAULT: Problem setting trip point.
1730 CMD_THERMAL_SET_TRIP
= 2,
1733 * @brief Get the number of supported thermal zones.
1735 * No request parameters required.
1737 * mrq_response::err is always 0, indicating success.
1739 CMD_THERMAL_GET_NUM_ZONES
= 3,
1742 * @brief Get the thermtrip of the specified zone.
1744 * Host needs to supply request parameters.
1746 * mrq_response::err is
1747 * * 0: Valid zone information returned.
1748 * * -#BPMP_EINVAL: Invalid request parameters.
1749 * * -#BPMP_ENOENT: No driver registered for thermal zone.
1750 * * -#BPMP_ERANGE if thermtrip is invalid or disabled.
1751 * * -#BPMP_EFAULT: Problem reading zone information.
1753 CMD_THERMAL_GET_THERMTRIP
= 4,
1755 /** @brief: number of supported host-to-bpmp commands. May
1756 * increase in future
1758 CMD_THERMAL_HOST_TO_BPMP_NUM
1761 enum mrq_thermal_bpmp_to_host_cmd
{
1763 * @brief Indication that the temperature for a zone has
1764 * exceeded the range indicated in the thermal trip point
1767 * BPMP needs to supply request parameters. Host only needs to
1770 CMD_THERMAL_HOST_TRIP_REACHED
= 100,
1772 /** @brief: number of supported bpmp-to-host commands. May
1773 * increase in future
1775 CMD_THERMAL_BPMP_TO_HOST_NUM
1779 * Host->BPMP request data for request type CMD_THERMAL_QUERY_ABI
1781 * zone: Request type for which to check existence.
1783 struct cmd_thermal_query_abi_request
{
1788 * Host->BPMP request data for request type CMD_THERMAL_GET_TEMP
1790 * zone: Number of thermal zone.
1792 struct cmd_thermal_get_temp_request
{
1797 * BPMP->Host reply data for request CMD_THERMAL_GET_TEMP
1799 * error: 0 if request succeeded.
1800 * -BPMP_EINVAL if request parameters were invalid.
1801 * -BPMP_ENOENT if no driver was registered for the specified thermal zone.
1802 * -BPMP_EFAULT for other thermal zone driver errors.
1803 * temp: Current temperature in millicelsius.
1805 struct cmd_thermal_get_temp_response
{
1810 * Host->BPMP request data for request type CMD_THERMAL_SET_TRIP
1812 * zone: Number of thermal zone.
1813 * low: Temperature of lower trip point in millicelsius
1814 * high: Temperature of upper trip point in millicelsius
1815 * enabled: 1 to enable trip point, 0 to disable trip point
1817 struct cmd_thermal_set_trip_request
{
1825 * BPMP->Host request data for request type CMD_THERMAL_HOST_TRIP_REACHED
1827 * zone: Number of thermal zone where trip point was reached.
1829 struct cmd_thermal_host_trip_reached_request
{
1834 * BPMP->Host reply data for request type CMD_THERMAL_GET_NUM_ZONES
1836 * num: Number of supported thermal zones. The thermal zones are indexed
1837 * starting from zero.
1839 struct cmd_thermal_get_num_zones_response
{
1844 * Host->BPMP request data for request type CMD_THERMAL_GET_THERMTRIP
1846 * zone: Number of thermal zone.
1848 struct cmd_thermal_get_thermtrip_request
{
1853 * BPMP->Host reply data for request CMD_THERMAL_GET_THERMTRIP
1855 * thermtrip: HW shutdown temperature in millicelsius.
1857 struct cmd_thermal_get_thermtrip_response
{
1862 * Host->BPMP request data.
1864 * Reply type is union mrq_thermal_bpmp_to_host_response.
1866 * type: Type of request. Values listed in enum mrq_thermal_type.
1867 * data: Request type specific parameters.
1869 struct mrq_thermal_host_to_bpmp_request
{
1872 struct cmd_thermal_query_abi_request query_abi
;
1873 struct cmd_thermal_get_temp_request get_temp
;
1874 struct cmd_thermal_set_trip_request set_trip
;
1875 struct cmd_thermal_get_thermtrip_request get_thermtrip
;
1880 * BPMP->Host request data.
1882 * type: Type of request. Values listed in enum mrq_thermal_type.
1883 * data: Request type specific parameters.
1885 struct mrq_thermal_bpmp_to_host_request
{
1888 struct cmd_thermal_host_trip_reached_request host_trip_reached
;
1893 * Data in reply to a Host->BPMP request.
1895 union mrq_thermal_bpmp_to_host_response
{
1896 struct cmd_thermal_get_temp_response get_temp
;
1897 struct cmd_thermal_get_thermtrip_response get_thermtrip
;
1898 struct cmd_thermal_get_num_zones_response get_num_zones
;
1904 * @ingroup MRQ_Codes
1905 * @def MRQ_OC_STATUS
1906 * @brief Query over current status
1910 * * Initiators: CCPLEX
1912 * * Request Payload: N/A
1913 * * Response Payload: @ref mrq_oc_status_response
1915 * @addtogroup OC_status
1919 #define OC_STATUS_MAX_SIZE 24U
1922 * @brief Response to #MRQ_OC_STATUS
1924 * throt_en: Value for each OC alarm where zero signifies throttle is
1925 * disabled, and non-zero throttle is enabled.
1926 * event_cnt: Total number of OC events for each OC alarm.
1928 * mrq_response::err is 0 if the operation was successful and
1929 * -#BPMP_ENODEV otherwise.
1931 struct mrq_oc_status_response
{
1932 uint8_t throt_en
[OC_STATUS_MAX_SIZE
];
1933 uint32_t event_cnt
[OC_STATUS_MAX_SIZE
];
1937 /** @endcond bpmp_t234 */
1940 * @ingroup MRQ_Codes
1941 * @def MRQ_CPU_VHINT
1942 * @brief Query CPU voltage hint data
1946 * * Initiators: CCPLEX
1948 * * Request Payload: @ref mrq_cpu_vhint_request
1949 * * Response Payload: N/A
1956 * @brief Request with #MRQ_CPU_VHINT
1958 * Used by #MRQ_CPU_VHINT call by CCPLEX to retrieve voltage hint data
1959 * from BPMP to memory space pointed by #addr. CCPLEX is responsible
1960 * to allocate sizeof(cpu_vhint_data) sized block of memory and
1961 * appropriately map it for BPMP before sending the request.
1963 struct mrq_cpu_vhint_request
{
1964 /** @brief IOVA address for the #cpu_vhint_data */
1966 /** @brief ID of the cluster whose data is requested */
1967 uint32_t cluster_id
;
1971 * @brief Description of the CPU v/f relation
1973 * Used by #MRQ_CPU_VHINT call to carry data pointed by
1974 * #mrq_cpu_vhint_request::addr
1976 struct cpu_vhint_data
{
1977 uint32_t ref_clk_hz
; /**< reference frequency in Hz */
1978 uint16_t pdiv
; /**< post divider value */
1979 uint16_t mdiv
; /**< input divider value */
1980 uint16_t ndiv_max
; /**< fMAX expressed with max NDIV value */
1981 /** table of ndiv values as a function of vINDEX (voltage index) */
1983 /** minimum allowed NDIV value */
1985 /** minimum allowed voltage hint value (as in vINDEX) */
1987 /** maximum allowed voltage hint value (as in vINDEX) */
1989 /** post-multiplier for vindex value */
1990 uint16_t vindex_mult
;
1991 /** post-divider for vindex value */
1992 uint16_t vindex_div
;
1993 /** reserved for future use */
1994 uint16_t reserved
[328];
1998 /** @endcond bpmp_t186 */
2001 * @ingroup MRQ_Codes
2002 * @def MRQ_ABI_RATCHET
2003 * @brief ABI ratchet value query
2005 * * Platforms: T186, T194
2008 * * Request Payload: @ref mrq_abi_ratchet_request
2009 * * Response Payload: @ref mrq_abi_ratchet_response
2010 * @addtogroup ABI_info
2015 * @brief An ABI compatibility mechanism
2017 * BPMP_ABI_RATCHET_VALUE may increase for various reasons in a future
2018 * revision of this header file.
2019 * 1. That future revision deprecates some MRQ
2020 * 2. That future revision introduces a breaking change to an existing
2022 * 3. A bug is discovered in an existing implementation of the BPMP-FW
2023 * (or possibly one of its clients) which warrants deprecating that
2026 #define BPMP_ABI_RATCHET_VALUE 3
2029 * @brief Request with #MRQ_ABI_RATCHET.
2031 * #ratchet should be #BPMP_ABI_RATCHET_VALUE from the ABI header
2032 * against which the requester was compiled.
2034 * If ratchet is less than BPMP's #BPMP_ABI_RATCHET_VALUE, BPMP may
2035 * reply with mrq_response::err = -#BPMP_ERANGE to indicate that
2036 * BPMP-FW cannot interoperate correctly with the requester. Requester
2037 * should cease further communication with BPMP.
2039 * Otherwise, err shall be 0.
2041 struct mrq_abi_ratchet_request
{
2042 /** @brief Requester's ratchet value */
2047 * @brief Response to #MRQ_ABI_RATCHET
2049 * #ratchet shall be #BPMP_ABI_RATCHET_VALUE from the ABI header
2050 * against which BPMP firwmare was compiled.
2052 * If #ratchet is less than the requester's #BPMP_ABI_RATCHET_VALUE,
2053 * the requster must either interoperate with BPMP according to an ABI
2054 * header version with BPMP_ABI_RATCHET_VALUE = ratchet or cease
2055 * communication with BPMP.
2057 * If mrq_response::err is 0 and ratchet is greater than or equal to the
2058 * requester's BPMP_ABI_RATCHET_VALUE, the requester should continue
2061 struct mrq_abi_ratchet_response
{
2062 /** @brief BPMP's ratchet value */
2069 * @ingroup MRQ_Codes
2070 * @def MRQ_EMC_DVFS_LATENCY
2071 * @brief Query frequency dependent EMC DVFS latency
2073 * * Platforms: T186, T194, T234
2074 * * Initiators: CCPLEX
2076 * * Request Payload: N/A
2077 * * Response Payload: @ref mrq_emc_dvfs_latency_response
2083 * @brief Used by @ref mrq_emc_dvfs_latency_response
2085 struct emc_dvfs_latency
{
2086 /** @brief EMC DVFS node frequency in kHz */
2088 /** @brief EMC DVFS latency in nanoseconds */
2092 #define EMC_DVFS_LATENCY_MAX_SIZE 14
2094 * @brief Response to #MRQ_EMC_DVFS_LATENCY
2096 struct mrq_emc_dvfs_latency_response
{
2097 /** @brief The number valid entries in #pairs */
2099 /** @brief EMC DVFS node <frequency, latency> information */
2100 struct emc_dvfs_latency pairs
[EMC_DVFS_LATENCY_MAX_SIZE
];
2106 * @ingroup MRQ_Codes
2107 * @def MRQ_EMC_DVFS_EMCHUB
2108 * @brief Query EMC HUB frequencies
2110 * * Platforms: T234 onwards
2111 * @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)
2112 * * Initiators: CCPLEX
2114 * * Request Payload: N/A
2115 * * Response Payload: @ref mrq_emc_dvfs_emchub_response
2121 * @brief Used by @ref mrq_emc_dvfs_emchub_response
2123 struct emc_dvfs_emchub
{
2124 /** @brief EMC DVFS node frequency in kHz */
2126 /** @brief EMC HUB frequency in kHz */
2130 #define EMC_DVFS_EMCHUB_MAX_SIZE EMC_DVFS_LATENCY_MAX_SIZE
2132 * @brief Response to #MRQ_EMC_DVFS_EMCHUB
2134 struct mrq_emc_dvfs_emchub_response
{
2135 /** @brief The number valid entries in #pairs */
2137 /** @brief EMC DVFS node <frequency, hub frequency> information */
2138 struct emc_dvfs_emchub pairs
[EMC_DVFS_EMCHUB_MAX_SIZE
];
2142 /** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */
2145 * @ingroup MRQ_Codes
2146 * @def MRQ_EMC_DISP_RFL
2147 * @brief Set EMC display RFL handshake mode of operations
2149 * * Platforms: T234 onwards
2150 * @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)
2151 * * Initiators: CCPLEX
2153 * * Request Payload: @ref mrq_emc_disp_rfl_request
2154 * * Response Payload: N/A
2160 enum mrq_emc_disp_rfl_mode
{
2161 /** @brief EMC display RFL handshake disabled */
2162 EMC_DISP_RFL_MODE_DISABLED
= 0,
2163 /** @brief EMC display RFL handshake enabled */
2164 EMC_DISP_RFL_MODE_ENABLED
= 1,
2169 * @brief Request with #MRQ_EMC_DISP_RFL
2171 * Used by the sender of an #MRQ_EMC_DISP_RFL message to
2172 * request the mode of EMC display RFL handshake.
2174 * mrq_response::err is
2175 * * 0: RFL mode is set successfully
2176 * * -#BPMP_EINVAL: invalid mode requested
2177 * * -#BPMP_ENOSYS: RFL handshake is not supported
2178 * * -#BPMP_EACCES: Permission denied
2179 * * -#BPMP_ENODEV: if disp rfl mrq is not supported by BPMP-FW
2181 struct mrq_emc_disp_rfl_request
{
2182 /** @brief EMC display RFL mode (@ref mrq_emc_disp_rfl_mode) */
2187 /** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */
2190 * @ingroup MRQ_Codes
2192 * @brief bwmgr requests
2194 * * Platforms: T234 onwards
2195 * @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)
2196 * * Initiators: CCPLEX
2198 * * Request Payload: @ref mrq_bwmgr_request
2199 * * Response Payload: @ref mrq_bwmgr_response
2206 enum mrq_bwmgr_cmd
{
2208 * @brief Check whether the BPMP driver supports the specified
2211 * mrq_response::err is 0 if the specified request is
2212 * supported and -#BPMP_ENODEV otherwise.
2214 CMD_BWMGR_QUERY_ABI
= 0,
2217 * @brief Determine dram rate to satisfy iso/niso bw requests
2219 * mrq_response::err is
2220 * * 0: calc_rate succeeded.
2221 * * -#BPMP_EINVAL: Invalid request parameters.
2222 * * -#BPMP_ENOTSUP: Requested bw is not available.
2224 CMD_BWMGR_CALC_RATE
= 1
2228 * request data for request type CMD_BWMGR_QUERY_ABI
2230 * type: Request type for which to check existence.
2232 struct cmd_bwmgr_query_abi_request
{
2237 * @brief Used by @ref cmd_bwmgr_calc_rate_request
2240 /* @brief bwmgr client ID @ref bpmp_bwmgr_ids */
2242 /* @brief bw in kBps requested by client */
2246 #define MAX_ISO_CLIENTS 13U
2248 * request data for request type CMD_BWMGR_CALC_RATE
2250 struct cmd_bwmgr_calc_rate_request
{
2251 /* @brief total bw in kBps requested by all niso clients */
2252 uint32_t sum_niso_bw
;
2253 /* @brief The number of iso clients */
2254 uint32_t num_iso_clients
;
2255 /* @brief iso_req <id, iso_bw> information */
2256 struct iso_req isobw_reqs
[MAX_ISO_CLIENTS
];
2260 * response data for request type CMD_BWMGR_CALC_RATE
2262 * iso_rate_min: min dram data clk rate in kHz to satisfy all iso bw reqs
2263 * total_rate_min: min dram data clk rate in kHz to satisfy all bw reqs
2265 struct cmd_bwmgr_calc_rate_response
{
2266 uint32_t iso_rate_min
;
2267 uint32_t total_rate_min
;
2271 * @brief Request with #MRQ_BWMGR
2274 * |sub-command |payload |
2275 * |----------------------------|------------------------------|
2276 * |CMD_BWMGR_QUERY_ABI | cmd_bwmgr_query_abi_request |
2277 * |CMD_BWMGR_CALC_RATE | cmd_bwmgr_calc_rate_request |
2280 struct mrq_bwmgr_request
{
2283 struct cmd_bwmgr_query_abi_request query_abi
;
2284 struct cmd_bwmgr_calc_rate_request bwmgr_rate_req
;
2289 * @brief Response to MRQ_BWMGR
2291 * |sub-command |payload |
2292 * |----------------------------|------------------------------|
2293 * |CMD_BWMGR_CALC_RATE | cmd_bwmgr_calc_rate_response |
2295 struct mrq_bwmgr_response
{
2297 struct cmd_bwmgr_calc_rate_response bwmgr_rate_resp
;
2302 /** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */
2305 * @ingroup MRQ_Codes
2306 * @def MRQ_BWMGR_INT
2307 * @brief bpmp-integrated bwmgr requests
2309 * * Platforms: T234 onwards
2310 * @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)
2311 * * Initiators: CCPLEX
2313 * * Request Payload: @ref mrq_bwmgr_int_request
2314 * * Response Payload: @ref mrq_bwmgr_int_response
2316 * @addtogroup BWMGR_INT
2320 enum mrq_bwmgr_int_cmd
{
2322 * @brief Check whether the BPMP-FW supports the specified
2325 * mrq_response::err is 0 if the specified request is
2326 * supported and -#BPMP_ENODEV otherwise.
2328 CMD_BWMGR_INT_QUERY_ABI
= 1,
2331 * @brief Determine and set dram rate to satisfy iso/niso bw request
2333 * mrq_response::err is
2334 * * 0: request succeeded.
2335 * * -#BPMP_EINVAL: Invalid request parameters.
2336 * set_frequency in @ref cmd_bwmgr_int_calc_and_set_response
2338 * * -#BPMP_ENOTSUP: Requested bw is not available.
2339 * set_frequency in @ref cmd_bwmgr_int_calc_and_set_response
2340 * will be current dram-clk rate.
2342 CMD_BWMGR_INT_CALC_AND_SET
= 2,
2345 * @brief Set a max DRAM frequency for the bandwidth-manager
2347 * mrq_response::err is
2348 * * 0: request succeeded.
2349 * * -#BPMP_ENOTSUP: Requested cap frequency is not possible.
2351 CMD_BWMGR_INT_CAP_SET
= 3
2355 * request structure for request type CMD_BWMGR_QUERY_ABI
2357 * type: Request type for which to check existence.
2359 struct cmd_bwmgr_int_query_abi_request
{
2360 /* @brief request type determined by @ref mrq_bwmgr_int_cmd */
2365 * @defgroup bwmgr_int_unit_type BWMGR_INT floor unit-types
2366 * @addtogroup bwmgr_int_unit_type
2369 /** @brief kilobytes per second unit-type */
2370 #define BWMGR_INT_UNIT_KBPS 0U
2371 /** @brief kilohertz unit-type */
2372 #define BWMGR_INT_UNIT_KHZ 1U
2374 /** @} bwmgr_int_unit_type */
2377 * request data for request type CMD_BWMGR_INT_CALC_AND_SET
2379 struct cmd_bwmgr_int_calc_and_set_request
{
2380 /* @brief bwmgr client ID @ref bpmp_bwmgr_ids */
2382 /* @brief average niso bw usage in kBps requested by client. */
2385 * @brief average iso bw usage in kBps requested by client.
2386 * Value is ignored if client is niso. Determined by client_id.
2390 * @brief memory clock floor requested by client.
2391 * Unit determined by floor_unit.
2395 * @brief toggle to determine the unit-type of floor value.
2396 * See @ref bwmgr_int_unit_type definitions for unit-type mappings.
2401 struct cmd_bwmgr_int_cap_set_request
{
2402 /* @brief requested cap frequency in Hz. */
2407 * response data for request type CMD_BWMGR_CALC_AND_SET
2409 struct cmd_bwmgr_int_calc_and_set_response
{
2410 /* @brief current set memory clock frequency in Hz */
2415 * @brief Request with #MRQ_BWMGR_INT
2418 * |sub-command |payload |
2419 * |----------------------------|-----------------------------------|
2420 * |CMD_BWMGR_INT_QUERY_ABI | cmd_bwmgr_int_query_abi_request |
2421 * |CMD_BWMGR_INT_CALC_AND_SET | cmd_bwmgr_int_calc_and_set_request|
2422 * |CMD_BWMGR_INT_CAP_SET | cmd_bwmgr_int_cap_set_request |
2425 struct mrq_bwmgr_int_request
{
2428 struct cmd_bwmgr_int_query_abi_request query_abi
;
2429 struct cmd_bwmgr_int_calc_and_set_request bwmgr_calc_set_req
;
2430 struct cmd_bwmgr_int_cap_set_request bwmgr_cap_set_req
;
2435 * @brief Response to MRQ_BWMGR_INT
2437 * |sub-command |payload |
2438 * |----------------------------|---------------------------------------|
2439 * |CMD_BWMGR_INT_CALC_AND_SET | cmd_bwmgr_int_calc_and_set_response |
2441 struct mrq_bwmgr_int_response
{
2443 struct cmd_bwmgr_int_calc_and_set_response bwmgr_calc_set_resp
;
2448 /** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */
2451 * @ingroup MRQ_Codes
2452 * @def MRQ_ISO_CLIENT
2453 * @brief ISO client requests
2455 * * Platforms: T234 onwards
2456 * @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)
2457 * * Initiators: CCPLEX
2459 * * Request Payload: @ref mrq_iso_client_request
2460 * * Response Payload: @ref mrq_iso_client_response
2462 * @addtogroup ISO_CLIENT
2466 enum mrq_iso_client_cmd
{
2468 * @brief Check whether the BPMP driver supports the specified
2471 * mrq_response::err is 0 if the specified request is
2472 * supported and -#BPMP_ENODEV otherwise.
2474 CMD_ISO_CLIENT_QUERY_ABI
= 0,
2477 * @brief check for legal LA for the iso client. Without programming
2478 * LA MC registers, calculate and ensure that legal LA is possible for
2479 * iso bw requested by the ISO client.
2481 * mrq_response::err is
2482 * * 0: check la succeeded.
2483 * * -#BPMP_EINVAL: Invalid request parameters.
2484 * * -#BPMP_EFAULT: Legal LA is not possible for client requested iso_bw
2486 CMD_ISO_CLIENT_CALCULATE_LA
= 1,
2489 * @brief set LA for the iso client. Calculate and program the LA/PTSA
2490 * MC registers corresponding to the client making bw request
2492 * mrq_response::err is
2493 * * 0: set la succeeded.
2494 * * -#BPMP_EINVAL: Invalid request parameters.
2495 * * -#BPMP_EFAULT: Failed to calculate or program MC registers.
2497 CMD_ISO_CLIENT_SET_LA
= 2,
2500 * @brief Get max possible bw for iso client
2502 * mrq_response::err is
2503 * * 0: get_max_bw succeeded.
2504 * * -#BPMP_EINVAL: Invalid request parameters.
2506 CMD_ISO_CLIENT_GET_MAX_BW
= 3
2510 * request data for request type CMD_ISO_CLIENT_QUERY_ABI
2512 * type: Request type for which to check existence.
2514 struct cmd_iso_client_query_abi_request
{
2519 * request data for request type CMD_ISO_CLIENT_CALCULATE_LA
2521 * id: client ID in @ref bpmp_bwmgr_ids
2522 * bw: bw requested in kBps by client ID.
2523 * init_bw_floor: initial dram_bw_floor in kBps passed by client ID.
2524 * ISO client will perform mempool allocation and DVFS buffering based
2525 * on this dram_bw_floor.
2527 struct cmd_iso_client_calculate_la_request
{
2530 uint32_t init_bw_floor
;
2534 * request data for request type CMD_ISO_CLIENT_SET_LA
2536 * id: client ID in @ref bpmp_bwmgr_ids
2537 * bw: bw requested in kBps by client ID.
2538 * final_bw_floor: final dram_bw_floor in kBps.
2539 * Sometimes the initial dram_bw_floor passed by ISO client may need to be
2540 * updated by considering higher dram freq's. This is the final dram_bw_floor
2541 * used to calculate and program MC registers.
2543 struct cmd_iso_client_set_la_request
{
2546 uint32_t final_bw_floor
;
2550 * request data for request type CMD_ISO_CLIENT_GET_MAX_BW
2552 * id: client ID in @ref bpmp_bwmgr_ids
2554 struct cmd_iso_client_get_max_bw_request
{
2559 * response data for request type CMD_ISO_CLIENT_CALCULATE_LA
2561 * la_rate_floor: minimum dram_rate_floor in kHz at which a legal la is possible
2562 * iso_client_only_rate: Minimum dram freq in kHz required to satisfy this clients
2563 * iso bw request, assuming all other iso clients are inactive
2565 struct cmd_iso_client_calculate_la_response
{
2566 uint32_t la_rate_floor
;
2567 uint32_t iso_client_only_rate
;
2571 * @brief Used by @ref cmd_iso_client_get_max_bw_response
2574 /* @brief dram frequency in kHz */
2576 /* @brief max possible iso-bw in kBps */
2580 #define ISO_MAX_BW_MAX_SIZE 14U
2582 * response data for request type CMD_ISO_CLIENT_GET_MAX_BW
2584 struct cmd_iso_client_get_max_bw_response
{
2585 /* @brief The number valid entries in iso_max_bw pairs */
2587 /* @brief max ISOBW <dram freq, max bw> information */
2588 struct iso_max_bw pairs
[ISO_MAX_BW_MAX_SIZE
];
2592 * @brief Request with #MRQ_ISO_CLIENT
2594 * Used by the sender of an #MRQ_ISO_CLIENT message.
2596 * |sub-command |payload |
2597 * |------------------------------------ |----------------------------------------|
2598 * |CMD_ISO_CLIENT_QUERY_ABI |cmd_iso_client_query_abi_request |
2599 * |CMD_ISO_CLIENT_CALCULATE_LA |cmd_iso_client_calculate_la_request |
2600 * |CMD_ISO_CLIENT_SET_LA |cmd_iso_client_set_la_request |
2601 * |CMD_ISO_CLIENT_GET_MAX_BW |cmd_iso_client_get_max_bw_request |
2605 struct mrq_iso_client_request
{
2606 /* Type of request. Values listed in enum mrq_iso_client_cmd */
2609 struct cmd_iso_client_query_abi_request query_abi
;
2610 struct cmd_iso_client_calculate_la_request calculate_la_req
;
2611 struct cmd_iso_client_set_la_request set_la_req
;
2612 struct cmd_iso_client_get_max_bw_request max_isobw_req
;
2617 * @brief Response to MRQ_ISO_CLIENT
2619 * Each sub-command supported by @ref mrq_iso_client_request may return
2620 * sub-command-specific data. Some do and some do not as indicated in
2621 * the following table
2623 * |sub-command |payload |
2624 * |---------------------------- |------------------------------------|
2625 * |CMD_ISO_CLIENT_CALCULATE_LA |cmd_iso_client_calculate_la_response|
2626 * |CMD_ISO_CLIENT_SET_LA |N/A |
2627 * |CMD_ISO_CLIENT_GET_MAX_BW |cmd_iso_client_get_max_bw_response |
2631 struct mrq_iso_client_response
{
2633 struct cmd_iso_client_calculate_la_response calculate_la_resp
;
2634 struct cmd_iso_client_get_max_bw_response max_isobw_resp
;
2638 /** @} ISO_CLIENT */
2639 /** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */
2642 * @ingroup MRQ_Codes
2643 * @def MRQ_CPU_NDIV_LIMITS
2644 * @brief CPU freq. limits in ndiv
2646 * * Platforms: T194 onwards
2647 * @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)
2648 * * Initiators: CCPLEX
2650 * * Request Payload: @ref mrq_cpu_ndiv_limits_request
2651 * * Response Payload: @ref mrq_cpu_ndiv_limits_response
2657 * @brief Request for ndiv limits of a cluster
2659 struct mrq_cpu_ndiv_limits_request
{
2660 /** @brief Enum cluster_id */
2661 uint32_t cluster_id
;
2665 * @brief Response to #MRQ_CPU_NDIV_LIMITS
2667 struct mrq_cpu_ndiv_limits_response
{
2668 /** @brief Reference frequency in Hz */
2669 uint32_t ref_clk_hz
;
2670 /** @brief Post divider value */
2672 /** @brief Input divider value */
2674 /** @brief FMAX expressed with max NDIV value */
2676 /** @brief Minimum allowed NDIV value */
2681 /** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500) */
2684 * @ingroup MRQ_Codes
2685 * @def MRQ_CPU_AUTO_CC3
2686 * @brief Query CPU cluster auto-CC3 configuration
2690 * * Initiators: CCPLEX
2692 * * Request Payload: @ref mrq_cpu_auto_cc3_request
2693 * * Response Payload: @ref mrq_cpu_auto_cc3_response
2696 * Queries from BPMP auto-CC3 configuration (allowed/not allowed) for a
2697 * specified cluster. CCPLEX s/w uses this information to override its own
2698 * device tree auto-CC3 settings, so that BPMP device tree is a single source of
2699 * auto-CC3 platform configuration.
2705 * @brief Request for auto-CC3 configuration of a cluster
2707 struct mrq_cpu_auto_cc3_request
{
2708 /** @brief Enum cluster_id (logical cluster id, known to CCPLEX s/w) */
2709 uint32_t cluster_id
;
2713 * @brief Response to #MRQ_CPU_AUTO_CC3
2715 struct mrq_cpu_auto_cc3_response
{
2717 * @brief auto-CC3 configuration
2719 * - bits[31..10] reserved.
2720 * - bits[9..1] cc3 ndiv
2721 * - bit [0] if "1" auto-CC3 is allowed, if "0" auto-CC3 is not allowed
2723 uint32_t auto_cc3_config
;
2727 /** @endcond bpmp_t194 */
2730 * @ingroup MRQ_Codes
2731 * @def MRQ_RINGBUF_CONSOLE
2732 * @brief A ring buffer debug console for BPMP
2733 * @addtogroup RingbufConsole
2735 * The ring buffer debug console aims to be a substitute for the UART debug
2736 * console. The debug console is implemented with two ring buffers in the
2737 * BPMP-FW, the RX (receive) and TX (transmit) buffers. Characters can be read
2738 * and written to the buffers by the host via the MRQ interface.
2744 * @brief Maximum number of bytes transferred in a single write command to the
2747 * This is determined by the number of free bytes in the message struct,
2748 * rounded down to a multiple of four.
2750 #define MRQ_RINGBUF_CONSOLE_MAX_WRITE_LEN 112
2753 * @brief Maximum number of bytes transferred in a single read command to the
2756 * This is determined by the number of free bytes in the message struct,
2757 * rounded down to a multiple of four.
2759 #define MRQ_RINGBUF_CONSOLE_MAX_READ_LEN 116
2761 enum mrq_ringbuf_console_host_to_bpmp_cmd
{
2763 * @brief Check whether the BPMP driver supports the specified request
2766 * mrq_response::err is 0 if the specified request is supported and
2767 * -#BPMP_ENODEV otherwise
2769 CMD_RINGBUF_CONSOLE_QUERY_ABI
= 0,
2771 * @brief Perform a read operation on the BPMP TX buffer
2773 * mrq_response::err is 0
2775 CMD_RINGBUF_CONSOLE_READ
= 1,
2777 * @brief Perform a write operation on the BPMP RX buffer
2779 * mrq_response::err is 0 if the operation was successful and
2780 * -#BPMP_ENODEV otherwise
2782 CMD_RINGBUF_CONSOLE_WRITE
= 2,
2784 * @brief Get the length of the buffer and the physical addresses of
2785 * the buffer data and the head and tail counters
2787 * mrq_response::err is 0 if the operation was successful and
2788 * -#BPMP_ENODEV otherwise
2790 CMD_RINGBUF_CONSOLE_GET_FIFO
= 3,
2794 * @ingroup RingbufConsole
2795 * @brief Host->BPMP request data for request type
2796 * #CMD_RINGBUF_CONSOLE_QUERY_ABI
2798 struct cmd_ringbuf_console_query_abi_req
{
2799 /** @brief Command identifier to be queried */
2804 struct cmd_ringbuf_console_query_abi_resp
{
2809 * @ingroup RingbufConsole
2810 * @brief Host->BPMP request data for request type #CMD_RINGBUF_CONSOLE_READ
2812 struct cmd_ringbuf_console_read_req
{
2814 * @brief Number of bytes requested to be read from the BPMP TX buffer
2820 * @ingroup RingbufConsole
2821 * @brief BPMP->Host response data for request type #CMD_RINGBUF_CONSOLE_READ
2823 struct cmd_ringbuf_console_read_resp
{
2824 /** @brief The actual data read from the BPMP TX buffer */
2825 uint8_t data
[MRQ_RINGBUF_CONSOLE_MAX_READ_LEN
];
2826 /** @brief Number of bytes in cmd_ringbuf_console_read_resp::data */
2831 * @ingroup RingbufConsole
2832 * @brief Host->BPMP request data for request type #CMD_RINGBUF_CONSOLE_WRITE
2834 struct cmd_ringbuf_console_write_req
{
2835 /** @brief The actual data to be written to the BPMP RX buffer */
2836 uint8_t data
[MRQ_RINGBUF_CONSOLE_MAX_WRITE_LEN
];
2837 /** @brief Number of bytes in cmd_ringbuf_console_write_req::data */
2842 * @ingroup RingbufConsole
2843 * @brief BPMP->Host response data for request type #CMD_RINGBUF_CONSOLE_WRITE
2845 struct cmd_ringbuf_console_write_resp
{
2846 /** @brief Number of bytes of available space in the BPMP RX buffer */
2847 uint32_t space_avail
;
2848 /** @brief Number of bytes that were written to the BPMP RX buffer */
2853 struct cmd_ringbuf_console_get_fifo_req
{
2858 * @ingroup RingbufConsole
2859 * @brief BPMP->Host reply data for request type #CMD_RINGBUF_CONSOLE_GET_FIFO
2861 struct cmd_ringbuf_console_get_fifo_resp
{
2862 /** @brief Physical address of the BPMP TX buffer */
2863 uint64_t bpmp_tx_buf_addr
;
2864 /** @brief Physical address of the BPMP TX buffer head counter */
2865 uint64_t bpmp_tx_head_addr
;
2866 /** @brief Physical address of the BPMP TX buffer tail counter */
2867 uint64_t bpmp_tx_tail_addr
;
2868 /** @brief Length of the BPMP TX buffer */
2869 uint32_t bpmp_tx_buf_len
;
2873 * @ingroup RingbufConsole
2874 * @brief Host->BPMP request data.
2876 * Reply type is union #mrq_ringbuf_console_bpmp_to_host_response .
2878 struct mrq_ringbuf_console_host_to_bpmp_request
{
2880 * @brief Type of request. Values listed in enum
2881 * #mrq_ringbuf_console_host_to_bpmp_cmd.
2884 /** @brief request type specific parameters. */
2886 struct cmd_ringbuf_console_query_abi_req query_abi
;
2887 struct cmd_ringbuf_console_read_req read
;
2888 struct cmd_ringbuf_console_write_req write
;
2889 struct cmd_ringbuf_console_get_fifo_req get_fifo
;
2894 * @ingroup RingbufConsole
2895 * @brief Host->BPMP reply data
2897 * In response to struct #mrq_ringbuf_console_host_to_bpmp_request.
2899 union mrq_ringbuf_console_bpmp_to_host_response
{
2900 struct cmd_ringbuf_console_query_abi_resp query_abi
;
2901 struct cmd_ringbuf_console_read_resp read
;
2902 struct cmd_ringbuf_console_write_resp write
;
2903 struct cmd_ringbuf_console_get_fifo_resp get_fifo
;
2906 /** @} RingbufConsole */
2909 * @ingroup MRQ_Codes
2911 * @brief Set a strap value controlled by BPMP
2913 * * Platforms: T194 onwards
2914 * @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)
2915 * * Initiators: CCPLEX
2917 * * Request Payload: @ref mrq_strap_request
2918 * * Response Payload: N/A
2921 * A strap is an input that is sampled by a hardware unit during the
2922 * unit's startup process. The sampled value of a strap affects the
2923 * behavior of the unit until the unit is restarted. Many hardware
2924 * units sample their straps at the instant that their resets are
2927 * BPMP owns registers which act as straps to various units. It
2928 * exposes limited control of those straps via #MRQ_STRAP.
2932 enum mrq_strap_cmd
{
2935 /** @brief Set a strap value */
2940 * @brief Request with #MRQ_STRAP
2942 struct mrq_strap_request
{
2943 /** @brief @ref mrq_strap_cmd */
2945 /** @brief Strap ID from @ref Strap_Identifiers */
2947 /** @brief Desired value for strap (if cmd is #STRAP_SET) */
2952 /** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500) */
2955 * @ingroup MRQ_Codes
2957 * @brief Perform a UPHY operation
2959 * * Platforms: T194 onwards
2960 * @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)
2961 * * Initiators: CCPLEX
2963 * * Request Payload: @ref mrq_uphy_request
2964 * * Response Payload: @ref mrq_uphy_response
2970 CMD_UPHY_PCIE_LANE_MARGIN_CONTROL
= 1,
2971 CMD_UPHY_PCIE_LANE_MARGIN_STATUS
= 2,
2972 CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT
= 3,
2973 CMD_UPHY_PCIE_CONTROLLER_STATE
= 4,
2974 CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF
= 5,
2975 CMD_UPHY_DISPLAY_PORT_INIT
= 6,
2976 CMD_UPHY_DISPLAY_PORT_OFF
= 7,
2977 CMD_UPHY_XUSB_DYN_LANES_RESTORE
= 8,
2981 struct cmd_uphy_margin_control_request
{
2982 /** @brief Enable margin */
2984 /** @brief Clear the number of error and sections */
2986 /** @brief Set x offset (1's complement) for left/right margin type (y should be 0) */
2988 /** @brief Set y offset (1's complement) for left/right margin type (x should be 0) */
2990 /** @brief Set number of bit blocks for each margin section */
2994 struct cmd_uphy_margin_status_response
{
2995 /** @brief Number of errors observed */
2999 struct cmd_uphy_ep_controller_pll_init_request
{
3000 /** @brief EP controller number, T194 valid: 0, 4, 5; T234 valid: 5, 6, 7, 10; T239 valid: 0 */
3001 uint8_t ep_controller
;
3004 struct cmd_uphy_pcie_controller_state_request
{
3005 /** @brief PCIE controller number, T194 valid: 0-4; T234 valid: 0-10; T239 valid: 0-3 */
3006 uint8_t pcie_controller
;
3010 struct cmd_uphy_ep_controller_pll_off_request
{
3011 /** @brief EP controller number, T194 valid: 0, 4, 5; T234 valid: 5, 6, 7, 10; T239 valid: 0 */
3012 uint8_t ep_controller
;
3015 struct cmd_uphy_display_port_init_request
{
3016 /** @brief DisplayPort link rate, T239 valid: 1620, 2700, 5400, 8100, 2160, 2430, 3240, 4320, 6750 */
3018 /** @brief 1: lane 0; 2: lane 1; 3: lane 0 and 1 */
3019 uint16_t lanes_bitmap
;
3022 struct cmd_uphy_xusb_dyn_lanes_restore_request
{
3023 /** @brief 1: lane 0; 2: lane 1; 3: lane 0 and 1 */
3024 uint16_t lanes_bitmap
;
3029 * @brief Request with #MRQ_UPHY
3031 * Used by the sender of an #MRQ_UPHY message to control UPHY.
3032 * The uphy_request is split into several sub-commands. CMD_UPHY_PCIE_LANE_MARGIN_STATUS
3033 * requires no additional data. Others have a sub-command specific payload. Below table
3034 * shows sub-commands with their corresponding payload data.
3036 * |sub-command |payload |
3037 * |------------------------------------ |----------------------------------------|
3038 * |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL |uphy_set_margin_control |
3039 * |CMD_UPHY_PCIE_LANE_MARGIN_STATUS | |
3040 * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT |cmd_uphy_ep_controller_pll_init_request |
3041 * |CMD_UPHY_PCIE_CONTROLLER_STATE |cmd_uphy_pcie_controller_state_request |
3042 * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF |cmd_uphy_ep_controller_pll_off_request |
3043 * |CMD_UPHY_PCIE_DISPLAY_PORT_INIT |cmd_uphy_display_port_init_request |
3044 * |CMD_UPHY_PCIE_DISPLAY_PORT_OFF | |
3045 * |CMD_UPHY_XUSB_DYN_LANES_RESTORE |cmd_uphy_xusb_dyn_lanes_restore_request |
3049 struct mrq_uphy_request
{
3050 /** @brief Lane number. */
3052 /** @brief Sub-command id. */
3056 struct cmd_uphy_margin_control_request uphy_set_margin_control
;
3057 struct cmd_uphy_ep_controller_pll_init_request ep_ctrlr_pll_init
;
3058 struct cmd_uphy_pcie_controller_state_request controller_state
;
3059 struct cmd_uphy_ep_controller_pll_off_request ep_ctrlr_pll_off
;
3060 struct cmd_uphy_display_port_init_request display_port_init
;
3061 struct cmd_uphy_xusb_dyn_lanes_restore_request xusb_dyn_lanes_restore
;
3067 * @brief Response to MRQ_UPHY
3069 * Each sub-command supported by @ref mrq_uphy_request may return
3070 * sub-command-specific data. Some do and some do not as indicated in
3071 * the following table
3073 * |sub-command |payload |
3074 * |---------------------------- |------------------------|
3075 * |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | |
3076 * |CMD_UPHY_PCIE_LANE_MARGIN_STATUS |uphy_get_margin_status |
3080 struct mrq_uphy_response
{
3082 struct cmd_uphy_margin_status_response uphy_get_margin_status
;
3087 /** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500) */
3090 * @ingroup MRQ_Codes
3092 * @brief Perform a frequency monitor configuration operations
3094 * * Platforms: T194 onwards
3095 * @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)
3096 * * Initiators: CCPLEX
3098 * * Request Payload: @ref mrq_fmon_request
3099 * * Response Payload: @ref mrq_fmon_response
3100 * @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)
3104 * @cond (bpmp_t194 || bpmp_t234)
3108 * @brief Clamp FMON configuration to specified rate.
3110 * The monitored clock must be running for clamp to succeed. If
3111 * clamped, FMON configuration is preserved when clock rate
3112 * and/or state is changed.
3114 * mrq_response::err is 0 if the operation was successful, or @n
3115 * -#BPMP_EACCES: FMON access error @n
3116 * -#BPMP_EBADCMD if subcommand is not supported @n
3117 * -#BPMP_EBADSLT: clamp FMON on cluster with auto-CC3 enabled @n
3118 * -#BPMP_EBUSY: fmon is already clamped at different rate @n
3119 * -#BPMP_EFAULT: self-diagnostic error @n
3120 * -#BPMP_EINVAL: invalid FMON configuration @n
3121 * -#BPMP_EOPNOTSUPP: not in production mode @n
3122 * -#BPMP_ENODEV: invalid clk_id @n
3123 * -#BPMP_ENOENT: no calibration data, uninitialized @n
3124 * -#BPMP_ENOTSUP: avfs config not set @n
3125 * -#BPMP_ENOSYS: clamp FMON on cluster clock w/ no NAFLL @n
3126 * -#BPMP_ETIMEDOUT: operation timed out @n
3128 CMD_FMON_GEAR_CLAMP
= 1,
3130 * @brief Release clamped FMON configuration.
3132 * Allow FMON configuration to follow monitored clock rate
3133 * and/or state changes.
3135 * mrq_response::err is 0 if the operation was successful, or @n
3136 * -#BPMP_EBADCMD if subcommand is not supported @n
3137 * -#BPMP_ENODEV: invalid clk_id @n
3138 * -#BPMP_ENOENT: no calibration data, uninitialized @n
3139 * -#BPMP_ENOTSUP: avfs config not set @n
3140 * -#BPMP_EOPNOTSUPP: not in production mode @n
3142 CMD_FMON_GEAR_FREE
= 2,
3144 * @brief Return rate FMON is clamped at, or 0 if FMON is not
3147 * Inherently racy, since clamp state can be changed
3148 * concurrently. Useful for testing.
3150 * mrq_response::err is 0 if the operation was successful, or @n
3151 * -#BPMP_EBADCMD if subcommand is not supported @n
3152 * -#BPMP_ENODEV: invalid clk_id @n
3153 * -#BPMP_ENOENT: no calibration data, uninitialized @n
3154 * -#BPMP_ENOTSUP: avfs config not set @n
3155 * -#BPMP_EOPNOTSUPP: not in production mode @n
3157 CMD_FMON_GEAR_GET
= 3,
3159 * @brief Return current status of FMON faults detected by FMON
3160 * h/w or s/w since last invocation of this command.
3161 * Clears fault status.
3163 * mrq_response::err is 0 if the operation was successful, or @n
3164 * -#BPMP_EBADCMD if subcommand is not supported @n
3165 * -#BPMP_EINVAL: invalid fault type @n
3166 * -#BPMP_ENODEV: invalid clk_id @n
3167 * -#BPMP_ENOENT: no calibration data, uninitialized @n
3168 * -#BPMP_ENOTSUP: avfs config not set @n
3169 * -#BPMP_EOPNOTSUPP: not in production mode @n
3171 CMD_FMON_FAULT_STS_GET
= 4,
3176 * Kept for backward compatibility
3178 #define CMD_FMON_NUM 4
3180 /** @endcond DEPRECATED */
3183 * @defgroup fmon_fault_type FMON fault type
3184 * @addtogroup fmon_fault_type
3187 /** @brief All detected FMON faults (h/w or s/w) */
3188 #define FMON_FAULT_TYPE_ALL 0U
3189 /** @brief FMON faults detected by h/w */
3190 #define FMON_FAULT_TYPE_HW 1U
3191 /** @brief FMON faults detected by s/w */
3192 #define FMON_FAULT_TYPE_SW 2U
3194 /** @} fmon_fault_type */
3197 struct cmd_fmon_gear_clamp_request
{
3203 struct cmd_fmon_gear_clamp_response
{
3208 struct cmd_fmon_gear_free_request
{
3213 struct cmd_fmon_gear_free_response
{
3218 struct cmd_fmon_gear_get_request
{
3222 struct cmd_fmon_gear_get_response
{
3226 struct cmd_fmon_fault_sts_get_request
{
3227 uint32_t fault_type
; /**< @ref fmon_fault_type */
3230 struct cmd_fmon_fault_sts_get_response
{
3236 * @brief Request with #MRQ_FMON
3238 * Used by the sender of an #MRQ_FMON message to configure clock
3239 * frequency monitors. The FMON request is split into several
3240 * sub-commands. Some sub-commands require no additional data.
3241 * Others have a sub-command specific payload
3243 * |sub-command |payload |
3244 * |----------------------------|-----------------------|
3245 * |CMD_FMON_GEAR_CLAMP |fmon_gear_clamp |
3246 * |CMD_FMON_GEAR_FREE |- |
3247 * |CMD_FMON_GEAR_GET |- |
3248 * |CMD_FMON_FAULT_STS_GET |fmon_fault_sts_get |
3251 struct mrq_fmon_request
{
3252 /** @brief Sub-command and clock id concatenated to 32-bit word.
3253 * - bits[31..24] is the sub-cmd.
3254 * - bits[23..0] is monitored clock id used to select target
3257 uint32_t cmd_and_id
;
3260 struct cmd_fmon_gear_clamp_request fmon_gear_clamp
;
3262 struct cmd_fmon_gear_free_request fmon_gear_free
;
3264 struct cmd_fmon_gear_get_request fmon_gear_get
;
3265 struct cmd_fmon_fault_sts_get_request fmon_fault_sts_get
;
3271 * @brief Response to MRQ_FMON
3273 * Each sub-command supported by @ref mrq_fmon_request may
3274 * return sub-command-specific data as indicated below.
3276 * |sub-command |payload |
3277 * |----------------------------|------------------------|
3278 * |CMD_FMON_GEAR_CLAMP |- |
3279 * |CMD_FMON_GEAR_FREE |- |
3280 * |CMD_FMON_GEAR_GET |fmon_gear_get |
3281 * |CMD_FMON_FAULT_STS_GET |fmon_fault_sts_get |
3285 struct mrq_fmon_response
{
3288 struct cmd_fmon_gear_clamp_response fmon_gear_clamp
;
3290 struct cmd_fmon_gear_free_response fmon_gear_free
;
3291 struct cmd_fmon_gear_get_response fmon_gear_get
;
3292 struct cmd_fmon_fault_sts_get_response fmon_fault_sts_get
;
3296 /** @endcond (bpmp_t194 || bpmp_t234) */
3300 * @ingroup MRQ_Codes
3302 * @brief Provide status information on faults reported by Error
3303 * Collator (EC) to HSM.
3307 * * Initiators: CCPLEX
3309 * * Request Payload: @ref mrq_ec_request
3310 * * Response Payload: @ref mrq_ec_response
3312 * @note This MRQ ABI is under construction, and subject to change
3314 * @endcond bpmp_t194
3322 * @brief Retrieve specified EC status.
3324 * mrq_response::err is 0 if the operation was successful, or @n
3325 * -#BPMP_ENODEV if target EC is not owned by BPMP @n
3326 * -#BPMP_EACCES if target EC power domain is turned off @n
3327 * -#BPMP_EBADCMD if subcommand is not supported
3328 * @endcond DEPRECATED
3330 CMD_EC_STATUS_GET
= 1, /* deprecated */
3333 * @brief Retrieve specified EC extended status (includes error
3334 * counter and user values).
3336 * mrq_response::err is 0 if the operation was successful, or @n
3337 * -#BPMP_ENODEV if target EC is not owned by BPMP @n
3338 * -#BPMP_EACCES if target EC power domain is turned off @n
3339 * -#BPMP_EBADCMD if subcommand is not supported
3341 CMD_EC_STATUS_EX_GET
= 2,
3345 /** @brief BPMP ECs error types */
3346 enum bpmp_ec_err_type
{
3347 /** @brief Parity error on internal data path
3349 * Error descriptor @ref ec_err_simple_desc.
3351 EC_ERR_TYPE_PARITY_INTERNAL
= 1,
3353 /** @brief ECC SEC error on internal data path
3355 * Error descriptor @ref ec_err_simple_desc.
3357 EC_ERR_TYPE_ECC_SEC_INTERNAL
= 2,
3359 /** @brief ECC DED error on internal data path
3361 * Error descriptor @ref ec_err_simple_desc.
3363 EC_ERR_TYPE_ECC_DED_INTERNAL
= 3,
3365 /** @brief Comparator error
3367 * Error descriptor @ref ec_err_simple_desc.
3369 EC_ERR_TYPE_COMPARATOR
= 4,
3371 /** @brief Register parity error
3373 * Error descriptor @ref ec_err_reg_parity_desc.
3375 EC_ERR_TYPE_REGISTER_PARITY
= 5,
3377 /** @brief Parity error from on-chip SRAM/FIFO
3379 * Error descriptor @ref ec_err_simple_desc.
3381 EC_ERR_TYPE_PARITY_SRAM
= 6,
3383 /** @brief Clock Monitor error
3385 * Error descriptor @ref ec_err_fmon_desc.
3387 EC_ERR_TYPE_CLOCK_MONITOR
= 9,
3389 /** @brief Voltage Monitor error
3391 * Error descriptor @ref ec_err_vmon_desc.
3393 EC_ERR_TYPE_VOLTAGE_MONITOR
= 10,
3395 /** @brief SW Correctable error
3397 * Error descriptor @ref ec_err_sw_error_desc.
3399 EC_ERR_TYPE_SW_CORRECTABLE
= 16,
3401 /** @brief SW Uncorrectable error
3403 * Error descriptor @ref ec_err_sw_error_desc.
3405 EC_ERR_TYPE_SW_UNCORRECTABLE
= 17,
3407 /** @brief Other HW Correctable error
3409 * Error descriptor @ref ec_err_simple_desc.
3411 EC_ERR_TYPE_OTHER_HW_CORRECTABLE
= 32,
3413 /** @brief Other HW Uncorrectable error
3415 * Error descriptor @ref ec_err_simple_desc.
3417 EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE
= 33,
3420 /** @brief Group of registers with parity error. */
3421 enum ec_registers_group
{
3422 /** @brief Functional registers group */
3423 EC_ERR_GROUP_FUNC_REG
= 0U,
3424 /** @brief SCR registers group */
3425 EC_ERR_GROUP_SCR_REG
= 1U,
3429 * @defgroup bpmp_ec_status_flags EC Status Flags
3430 * @addtogroup bpmp_ec_status_flags
3433 /** @brief No EC error found flag */
3434 #define EC_STATUS_FLAG_NO_ERROR 0x0001U
3435 /** @brief Last EC error found flag */
3436 #define EC_STATUS_FLAG_LAST_ERROR 0x0002U
3437 /** @brief EC latent error flag */
3438 #define EC_STATUS_FLAG_LATENT_ERROR 0x0004U
3440 /** @} bpmp_ec_status_flags */
3443 * @defgroup bpmp_ec_desc_flags EC Descriptor Flags
3444 * @addtogroup bpmp_ec_desc_flags
3447 /** @brief EC descriptor error resolved flag */
3448 #define EC_DESC_FLAG_RESOLVED 0x0001U
3449 /** @brief EC descriptor failed to retrieve id flag */
3450 #define EC_DESC_FLAG_NO_ID 0x0002U
3452 /** @} bpmp_ec_desc_flags */
3455 * |error type | fmon_clk_id values |
3456 * |---------------------------------|---------------------------|
3457 * |@ref EC_ERR_TYPE_CLOCK_MONITOR |@ref bpmp_clock_ids |
3459 struct ec_err_fmon_desc
{
3460 /** @brief Bitmask of @ref bpmp_ec_desc_flags */
3461 uint16_t desc_flags
;
3462 /** @brief FMON monitored clock id */
3463 uint16_t fmon_clk_id
;
3465 * @brief Bitmask of fault flags
3467 * @ref bpmp_fmon_faults_flags
3469 uint32_t fmon_faults
;
3470 /** @brief FMON faults access error */
3471 int32_t fmon_access_error
;
3475 * | error type | vmon_adc_id values |
3476 * |---------------------------------|---------------------------|
3477 * |@ref EC_ERR_TYPE_VOLTAGE_MONITOR |@ref bpmp_adc_ids |
3479 struct ec_err_vmon_desc
{
3480 /** @brief Bitmask of @ref bpmp_ec_desc_flags */
3481 uint16_t desc_flags
;
3482 /** @brief VMON rail adc id */
3483 uint16_t vmon_adc_id
;
3484 /** @brief Bitmask of bpmp_vmon_faults_flags */
3485 uint32_t vmon_faults
;
3486 /** @brief VMON faults access error */
3487 int32_t vmon_access_error
;
3491 * |error type | reg_id values |
3492 * |---------------------------------|-----------------------|
3493 * |@ref EC_ERR_TYPE_REGISTER_PARITY | bpmp_ec_registers_ids |
3495 struct ec_err_reg_parity_desc
{
3496 /** @brief Bitmask of @ref bpmp_ec_desc_flags */
3497 uint16_t desc_flags
;
3498 /** @brief Register id */
3500 /** @brief Register group @ref ec_registers_group */
3505 * |error type | err_source_id values |
3506 * |--------------------------------- |----------------------|
3507 * |@ref EC_ERR_TYPE_SW_CORRECTABLE | bpmp_ec_ce_swd_ids |
3508 * |@ref EC_ERR_TYPE_SW_UNCORRECTABLE | bpmp_ec_ue_swd_ids |
3510 struct ec_err_sw_error_desc
{
3511 /** @brief Bitmask of @ref bpmp_ec_desc_flags */
3512 uint16_t desc_flags
;
3513 /** @brief Error source id */
3514 uint16_t err_source_id
;
3515 /** @brief Sw error data */
3516 uint32_t sw_error_data
;
3520 * |error type | err_source_id values |
3521 * |----------------------------------------|------------------------|
3522 * |@ref EC_ERR_TYPE_PARITY_INTERNAL | bpmp_ec_ipath_ids |
3523 * |@ref EC_ERR_TYPE_ECC_SEC_INTERNAL | bpmp_ec_ipath_ids |
3524 * |@ref EC_ERR_TYPE_ECC_DED_INTERNAL | bpmp_ec_ipath_ids |
3525 * |@ref EC_ERR_TYPE_COMPARATOR | bpmp_ec_comparator_ids|
3526 * |@ref EC_ERR_TYPE_OTHER_HW_CORRECTABLE | bpmp_ec_misc_hwd_ids |
3527 * |@ref EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE | bpmp_ec_misc_hwd_ids |
3528 * |@ref EC_ERR_TYPE_PARITY_SRAM | bpmp_clock_ids |
3530 struct ec_err_simple_desc
{
3531 /** @brief Bitmask of @ref bpmp_ec_desc_flags */
3532 uint16_t desc_flags
;
3533 /** @brief Error source id. Id space depends on error type. */
3534 uint16_t err_source_id
;
3537 /** @brief Union of EC error descriptors */
3539 struct ec_err_fmon_desc fmon_desc
;
3540 struct ec_err_vmon_desc vmon_desc
;
3541 struct ec_err_reg_parity_desc reg_parity_desc
;
3542 struct ec_err_sw_error_desc sw_error_desc
;
3543 struct ec_err_simple_desc simple_desc
;
3546 struct cmd_ec_status_get_request
{
3547 /** @brief HSM error line number that identifies target EC. */
3551 /** EC status maximum number of descriptors */
3552 #define EC_ERR_STATUS_DESC_MAX_NUM 4U
3557 struct cmd_ec_status_get_response
{
3558 /** @brief Target EC id (the same id received with request). */
3561 * @brief Bitmask of @ref bpmp_ec_status_flags
3563 * If NO_ERROR flag is set, error_ fields should be ignored
3565 uint32_t ec_status_flags
;
3566 /** @brief Found EC error index. */
3568 /** @brief Found EC error type @ref bpmp_ec_err_type. */
3569 uint32_t error_type
;
3570 /** @brief Number of returned EC error descriptors */
3571 uint32_t error_desc_num
;
3572 /** @brief EC error descriptors */
3573 union ec_err_desc error_descs
[EC_ERR_STATUS_DESC_MAX_NUM
];
3575 /** @endcond DEPRECATED */
3577 struct cmd_ec_status_ex_get_response
{
3578 /** @brief Target EC id (the same id received with request). */
3581 * @brief Bitmask of @ref bpmp_ec_status_flags
3583 * If NO_ERROR flag is set, error_ fields should be ignored
3585 uint32_t ec_status_flags
;
3586 /** @brief Found EC error index. */
3588 /** @brief Found EC error type @ref bpmp_ec_err_type. */
3589 uint32_t error_type
;
3590 /** @brief Found EC mission error counter value */
3591 uint32_t error_counter
;
3592 /** @brief Found EC mission error user value */
3593 uint32_t error_uval
;
3594 /** @brief Reserved entry */
3596 /** @brief Number of returned EC error descriptors */
3597 uint32_t error_desc_num
;
3598 /** @brief EC error descriptors */
3599 union ec_err_desc error_descs
[EC_ERR_STATUS_DESC_MAX_NUM
];
3604 * @brief Request with #MRQ_EC
3606 * Used by the sender of an #MRQ_EC message to access ECs owned
3610 * |sub-command |payload |
3611 * |----------------------------|-----------------------|
3612 * |@ref CMD_EC_STATUS_GET |ec_status_get |
3613 * @endcond DEPRECATED
3615 * |sub-command |payload |
3616 * |----------------------------|-----------------------|
3617 * |@ref CMD_EC_STATUS_EX_GET |ec_status_get |
3621 struct mrq_ec_request
{
3622 /** @brief Sub-command id. */
3626 struct cmd_ec_status_get_request ec_status_get
;
3632 * @brief Response to MRQ_EC
3634 * Each sub-command supported by @ref mrq_ec_request may return
3635 * sub-command-specific data as indicated below.
3638 * |sub-command |payload |
3639 * |----------------------------|------------------------|
3640 * |@ref CMD_EC_STATUS_GET |ec_status_get |
3641 * @endcond DEPRECATED
3643 * |sub-command |payload |
3644 * |----------------------------|------------------------|
3645 * |@ref CMD_EC_STATUS_EX_GET |ec_status_ex_get |
3649 struct mrq_ec_response
{
3654 struct cmd_ec_status_get_response ec_status_get
;
3655 /** @endcond DEPRECATED */
3656 struct cmd_ec_status_ex_get_response ec_status_ex_get
;
3660 /** @endcond bpmp_t194 */
3664 * @ingroup MRQ_Codes
3665 * @def MRQ_TELEMETRY
3666 * @brief Get address of memory buffer refreshed with recently sampled
3669 * * Platforms: TH500 onwards
3671 * * Initiators: CCPLEX
3673 * * Request Payload: N/A
3674 * * Response Payload: @ref mrq_telemetry_response
3675 * @addtogroup Telemetry
3680 * @brief Response to #MRQ_TELEMETRY
3682 * mrq_response::err is
3683 * * 0: Telemetry data is available at returned address
3684 * * -#BPMP_EACCES: MRQ master is not allowed to request buffer refresh
3685 * * -#BPMP_ENAVAIL: Telemetry buffer cannot be refreshed via this MRQ channel
3686 * * -#BPMP_ENOTSUP: Telemetry buffer is not supported by BPMP-FW
3687 * * -#BPMP_ENODEV: Telemetry mrq is not supported by BPMP-FW
3689 struct mrq_telemetry_response
{
3690 /** @brief Physical address of telemetry data buffer */
3691 uint64_t data_buf_addr
; /**< see @ref bpmp_telemetry_layout */
3695 /** @endcond bpmp_th500 */
3698 * @ingroup MRQ_Codes
3699 * @def MRQ_PWR_LIMIT
3700 * @brief Control power limits.
3702 * * Platforms: TH500 onwards
3706 * * Request Payload: @ref mrq_pwr_limit_request
3707 * * Response Payload: @ref mrq_pwr_limit_response
3709 * @addtogroup Pwrlimit
3712 enum mrq_pwr_limit_cmd
{
3714 * @brief Check whether the BPMP-FW supports the specified
3717 * mrq_response::err is 0 if the specified request is
3718 * supported and -#BPMP_ENODEV otherwise.
3720 CMD_PWR_LIMIT_QUERY_ABI
= 0,
3723 * @brief Set power limit
3725 * mrq_response:err is
3727 * * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW
3728 * * -#BPMP_ENAVAIL: Invalid request parameters
3729 * * -#BPMP_EACCES: Request is not accepted
3731 CMD_PWR_LIMIT_SET
= 1,
3734 * @brief Get power limit setting
3736 * mrq_response:err is
3738 * * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW
3739 * * -#BPMP_ENAVAIL: Invalid request parameters
3741 CMD_PWR_LIMIT_GET
= 2,
3744 * @brief Get current power cap
3746 * mrq_response:err is
3748 * * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW
3749 * * -#BPMP_ENAVAIL: Invalid request parameters
3751 CMD_PWR_LIMIT_CURR_CAP
= 3,
3755 * @defgroup bpmp_pwr_limit_type PWR_LIMIT TYPEs
3758 /** @brief Limit value specifies traget cap */
3759 #define PWR_LIMIT_TYPE_TARGET_CAP 0U
3760 /** @brief Limit value specifies maximum possible target cap */
3761 #define PWR_LIMIT_TYPE_BOUND_MAX 1U
3762 /** @brief Limit value specifies minimum possible target cap */
3763 #define PWR_LIMIT_TYPE_BOUND_MIN 2U
3764 /** @brief Number of limit types supported by mrq interface */
3765 #define PWR_LIMIT_TYPE_NUM 3U
3767 /** @} bpmp_pwr_limit_type */
3770 * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_QUERY_ABI
3772 struct cmd_pwr_limit_query_abi_request
{
3773 uint32_t cmd_code
; /**< @ref mrq_pwr_limit_cmd */
3777 * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_SET
3779 * Set specified limit of specified type from specified source. The success of
3780 * the request means that specified value is accepted as input to arbitration
3781 * with other sources settings for the same limit of the same type. Zero limit
3782 * is ignored by the arbitration (i.e., indicates "no limit set").
3784 struct cmd_pwr_limit_set_request
{
3785 uint32_t limit_id
; /**< @ref bpmp_pwr_limit_id */
3786 uint32_t limit_src
; /**< @ref bpmp_pwr_limit_src */
3787 uint32_t limit_type
; /**< @ref bpmp_pwr_limit_type */
3788 uint32_t limit_setting
;
3792 * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_GET
3794 * Get previously set from specified source specified limit value of specified
3797 struct cmd_pwr_limit_get_request
{
3798 uint32_t limit_id
; /**< @ref bpmp_pwr_limit_id */
3799 uint32_t limit_src
; /**< @ref bpmp_pwr_limit_src */
3800 uint32_t limit_type
; /**< @ref bpmp_pwr_limit_type */
3804 * @brief Response data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_GET
3806 struct cmd_pwr_limit_get_response
{
3807 uint32_t limit_setting
;
3811 * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_CURR_CAP
3813 * For specified limit get current power cap aggregated from all sources.
3815 struct cmd_pwr_limit_curr_cap_request
{
3816 uint32_t limit_id
; /**< @ref bpmp_pwr_limit_id */
3820 * @brief Response data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_CURR_CAP
3822 struct cmd_pwr_limit_curr_cap_response
{
3827 * @brief Request with #MRQ_PWR_LIMIT
3829 * |sub-command |payload |
3830 * |----------------------------|---------------------------------|
3831 * |CMD_PWR_LIMIT_QUERY_ABI | cmd_pwr_limit_query_abi_request |
3832 * |CMD_PWR_LIMIT_SET | cmd_pwr_limit_set_request |
3833 * |CMD_PWR_LIMIT_GET | cmd_pwr_limit_get_request |
3834 * |CMD_PWR_LIMIT_CURR_CAP | cmd_pwr_limit_curr_cap_request |
3836 struct mrq_pwr_limit_request
{
3839 struct cmd_pwr_limit_query_abi_request pwr_limit_query_abi_req
;
3840 struct cmd_pwr_limit_set_request pwr_limit_set_req
;
3841 struct cmd_pwr_limit_get_request pwr_limit_get_req
;
3842 struct cmd_pwr_limit_curr_cap_request pwr_limit_curr_cap_req
;
3847 * @brief Response to MRQ_PWR_LIMIT
3849 * |sub-command |payload |
3850 * |----------------------------|---------------------------------|
3851 * |CMD_PWR_LIMIT_QUERY_ABI | - |
3852 * |CMD_PWR_LIMIT_SET | - |
3853 * |CMD_PWR_LIMIT_GET | cmd_pwr_limit_get_response |
3854 * |CMD_PWR_LIMIT_CURR_CAP | cmd_pwr_limit_curr_cap_response |
3856 struct mrq_pwr_limit_response
{
3858 struct cmd_pwr_limit_get_response pwr_limit_get_rsp
;
3859 struct cmd_pwr_limit_curr_cap_response pwr_limit_curr_cap_rsp
;
3864 /** @endcond bpmp_th500 */
3868 * @ingroup MRQ_Codes
3870 * @brief Get thresholds for NDIV offset switching
3872 * * Platforms: TH500 onwards
3874 * * Initiators: CCPLEX
3876 * * Request Payload: N/A
3877 * * Response Payload: @ref mrq_gears_response
3883 * @brief Response to #MRQ_GEARS
3885 * Used by the sender of an #MRQ_GEARS message to request thresholds
3886 * for NDIV offset switching.
3888 * The mrq_gears_response::ncpu array defines four thresholds in units
3889 * of number of online CPUS to be used for choosing between five different
3890 * NDIV offset settings for CCPLEX cluster NAFLLs
3892 * 1. If number of online CPUs < ncpu[0] use offset0
3893 * 2. If number of online CPUs < ncpu[1] use offset1
3894 * 3. If number of online CPUs < ncpu[2] use offset2
3895 * 4. If number of online CPUs < ncpu[3] use offset3
3896 * 5. If number of online CPUs >= ncpu[3] disable offsetting
3898 * For TH500 mrq_gears_response::ncpu array has four valid entries.
3900 * mrq_response::err is
3901 * * 0: gears defined and response data valid
3902 * * -#BPMP_ENODEV: MRQ is not supported by BPMP-FW
3903 * * -#BPMP_EACCES: Operation not permitted for the MRQ master
3904 * * -#BPMP_ENAVAIL: NDIV offsetting is disabled
3906 struct mrq_gears_response
{
3907 /** @brief number of online CPUs for each gear */
3912 /** @endcond bpmp_th500 */
3915 * @addtogroup Error_Codes
3916 * Negative values for mrq_response::err generally indicate some
3917 * error. The ABI defines the following error codes. Negating these
3918 * defines is an exercise left to the user.
3922 /** @brief Operation not permitted */
3923 #define BPMP_EPERM 1
3924 /** @brief No such file or directory */
3925 #define BPMP_ENOENT 2
3926 /** @brief No MRQ handler */
3927 #define BPMP_ENOHANDLER 3
3928 /** @brief I/O error */
3930 /** @brief Bad sub-MRQ command */
3931 #define BPMP_EBADCMD 6
3932 /** @brief Resource temporarily unavailable */
3933 #define BPMP_EAGAIN 11
3934 /** @brief Not enough memory */
3935 #define BPMP_ENOMEM 12
3936 /** @brief Permission denied */
3937 #define BPMP_EACCES 13
3938 /** @brief Bad address */
3939 #define BPMP_EFAULT 14
3940 /** @brief Resource busy */
3941 #define BPMP_EBUSY 16
3942 /** @brief No such device */
3943 #define BPMP_ENODEV 19
3944 /** @brief Argument is a directory */
3945 #define BPMP_EISDIR 21
3946 /** @brief Invalid argument */
3947 #define BPMP_EINVAL 22
3948 /** @brief Timeout during operation */
3949 #define BPMP_ETIMEDOUT 23
3950 /** @brief Out of range */
3951 #define BPMP_ERANGE 34
3952 /** @brief Function not implemented */
3953 #define BPMP_ENOSYS 38
3954 /** @brief Invalid slot */
3955 #define BPMP_EBADSLT 57
3956 /** @brief Invalid message */
3957 #define BPMP_EBADMSG 77
3958 /** @brief Operation not supported */
3959 #define BPMP_EOPNOTSUPP 95
3960 /** @brief Targeted resource not available */
3961 #define BPMP_ENAVAIL 119
3962 /** @brief Not supported */
3963 #define BPMP_ENOTSUP 134
3964 /** @brief No such device or address */
3965 #define BPMP_ENXIO 140
3967 /** @} Error_Codes */
3969 #if defined(BPMP_ABI_CHECKS)
3970 #include "bpmp_abi_checks.h"