/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (c) 2014-2022, NVIDIA CORPORATION. All rights reserved.3*/45#ifndef ABI_BPMP_ABI_H6#define ABI_BPMP_ABI_H78#if defined(LK) || defined(BPMP_ABI_HAVE_STDC)9#include <stddef.h>10#include <stdint.h>11#endif1213#ifndef BPMP_ABI_PACKED14#ifdef __ABI_PACKED15#define BPMP_ABI_PACKED __ABI_PACKED16#else17#define BPMP_ABI_PACKED __attribute__((packed))18#endif19#endif2021#ifdef NO_GCC_EXTENSIONS22#define BPMP_ABI_EMPTY char empty;23#define BPMP_ABI_EMPTY_ARRAY 124#else25#define BPMP_ABI_EMPTY26#define BPMP_ABI_EMPTY_ARRAY 027#endif2829#ifndef BPMP_UNION_ANON30#ifdef __UNION_ANON31#define BPMP_UNION_ANON __UNION_ANON32#else33#define BPMP_UNION_ANON34#endif35#endif3637/**38* @file39*/4041/**42* @defgroup MRQ MRQ Messages43* @brief Messages sent to/from BPMP via IPC44* @{45* @defgroup MRQ_Format Message Format46* @defgroup MRQ_Codes Message Request (MRQ) Codes47* @defgroup MRQ_Payloads Message Payloads48* @defgroup Error_Codes Error Codes49* @}50*/5152/**53* @addtogroup MRQ_Format54* @{55* The CPU requests the BPMP to perform a particular service by56* sending it an IVC frame containing a single MRQ message. An MRQ57* message consists of a @ref mrq_request followed by a payload whose58* format depends on mrq_request::mrq.59*60* The BPMP processes the data and replies with an IVC frame (on the61* same IVC channel) containing and MRQ response. An MRQ response62* consists of a @ref mrq_response followed by a payload whose format63* depends on the associated mrq_request::mrq.64*65* A well-defined subset of the MRQ messages that the CPU sends to the66* BPMP can lead to BPMP eventually sending an MRQ message to the67* CPU. For example, when the CPU uses an #MRQ_THERMAL message to set68* a thermal trip point, the BPMP may eventually send a single69* #MRQ_THERMAL message of its own to the CPU indicating that the trip70* point has been crossed.71* @}72*/7374/**75* @ingroup MRQ_Format76* Request an answer from the peer.77* This should be set in mrq_request::flags for all requests targetted78* at BPMP. For requests originating in BPMP, this flag is optional except79* for messages targeting MCE, for which the field must be set.80* When this flag is not set, the remote peer must not send a response81* back.82*/83#define BPMP_MAIL_DO_ACK (1U << 0U)8485/**86* @ingroup MRQ_Format87* Ring the sender's doorbell when responding. This should be set unless88* the sender wants to poll the underlying communications layer directly.89*90* An optional direction that can be specified in mrq_request::flags.91*/92#define BPMP_MAIL_RING_DB (1U << 1U)9394/**95* @ingroup MRQ_Format96* CRC present97*/98#define BPMP_MAIL_CRC_PRESENT (1U << 2U)99100/**101* @ingroup MRQ_Format102* @brief Header for an MRQ message103*104* Provides the MRQ number for the MRQ message: #mrq. The remainder of105* the MRQ message is a payload (immediately following the106* mrq_request) whose format depends on mrq.107*/108struct mrq_request {109/** @brief MRQ number of the request */110uint32_t mrq;111112/**113* @brief 32bit word containing a number of fields as follows:114*115* struct {116* uint8_t options:4;117* uint8_t xid:4;118* uint8_t payload_length;119* uint16_t crc16;120* };121*122* **options** directions to the receiver and indicates CRC presence.123*124* #BPMP_MAIL_DO_ACK and #BPMP_MAIL_RING_DB see documentation of respective options.125* #BPMP_MAIL_CRC_PRESENT is supported on T234 and later platforms. It indicates the126* crc16, xid and length fields are present when set.127* Some platform configurations, especially when targeted to applications requiring128* functional safety, mandate this option being set or otherwise will respond with129* -BPMP_EBADMSG and ignore the request.130*131* **xid** is a transaction ID.132*133* Only used when #BPMP_MAIL_CRC_PRESENT is set.134*135* **payload_length** of the message expressed in bytes without the size of this header.136* See table below for minimum accepted payload lengths for each MRQ.137* Note: For DMCE communication, this field expresses the length as a multiple of 4 bytes138* rather than bytes.139*140* Only used when #BPMP_MAIL_CRC_PRESENT is set.141*142* | MRQ | CMD | minimum payload length143* | -------------------- | ------------------------------------ | ------------------------------------------ |144* | MRQ_PING | | 4 |145* | MRQ_THREADED_PING | | 4 |146* | MRQ_RESET | any | 8 |147* | MRQ_I2C | | 12 + cmd_i2c_xfer_request.data_size |148* | MRQ_CLK | CMD_CLK_GET_RATE | 4 |149* | MRQ_CLK | CMD_CLK_SET_RATE | 16 |150* | MRQ_CLK | CMD_CLK_ROUND_RATE | 16 |151* | MRQ_CLK | CMD_CLK_GET_PARENT | 4 |152* | MRQ_CLK | CMD_CLK_SET_PARENT | 8 |153* | MRQ_CLK | CMD_CLK_ENABLE | 4 |154* | MRQ_CLK | CMD_CLK_DISABLE | 4 |155* | MRQ_CLK | CMD_CLK_IS_ENABLED | 4 |156* | MRQ_CLK | CMD_CLK_GET_ALL_INFO | 4 |157* | MRQ_CLK | CMD_CLK_GET_MAX_CLK_ID | 4 |158* | MRQ_CLK | CMD_CLK_GET_FMAX_AT_VMIN | 4 |159* | MRQ_QUERY_ABI | | 4 |160* | MRQ_PG | CMD_PG_QUERY_ABI | 12 |161* | MRQ_PG | CMD_PG_SET_STATE | 12 |162* | MRQ_PG | CMD_PG_GET_STATE | 8 |163* | MRQ_PG | CMD_PG_GET_NAME | 8 |164* | MRQ_PG | CMD_PG_GET_MAX_ID | 8 |165* | MRQ_THERMAL | CMD_THERMAL_QUERY_ABI | 8 |166* | MRQ_THERMAL | CMD_THERMAL_GET_TEMP | 8 |167* | MRQ_THERMAL | CMD_THERMAL_SET_TRIP | 20 |168* | MRQ_THERMAL | CMD_THERMAL_GET_NUM_ZONES | 4 |169* | MRQ_THERMAL | CMD_THERMAL_GET_THERMTRIP | 8 |170* | MRQ_CPU_VHINT | | 8 |171* | MRQ_ABI_RATCHET | | 2 |172* | MRQ_EMC_DVFS_LATENCY | | 8 |173* | MRQ_EMC_DVFS_EMCHUB | | 8 |174* | MRQ_EMC_DISP_RFL | | 4 |175* | MRQ_BWMGR | CMD_BWMGR_QUERY_ABI | 8 |176* | MRQ_BWMGR | CMD_BWMGR_CALC_RATE | 8 + 8 * bwmgr_rate_req.num_iso_clients |177* | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_QUERY_ABI | 8 |178* | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_CALCULATE_LA | 16 |179* | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_SET_LA | 16 |180* | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_GET_MAX_BW | 8 |181* | MRQ_CPU_NDIV_LIMITS | | 4 |182* | MRQ_CPU_AUTO_CC3 | | 4 |183* | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 |184* | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_READ | 5 |185* | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len |186* | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_GET_FIFO | 4 |187* | MRQ_STRAP | STRAP_SET | 12 |188* | MRQ_UPHY | CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 |189* | MRQ_UPHY | CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 |190* | MRQ_UPHY | CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 |191* | MRQ_UPHY | CMD_UPHY_PCIE_CONTROLLER_STATE | 6 |192* | MRQ_UPHY | CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 |193* | MRQ_FMON | CMD_FMON_GEAR_CLAMP | 16 |194* | MRQ_FMON | CMD_FMON_GEAR_FREE | 4 |195* | MRQ_FMON | CMD_FMON_GEAR_GET | 4 |196* | MRQ_FMON | CMD_FMON_FAULT_STS_GET | 8 |197* | MRQ_EC | CMD_EC_STATUS_EX_GET | 12 |198* | MRQ_QUERY_FW_TAG | | 0 |199* | MRQ_DEBUG | CMD_DEBUG_OPEN_RO | 4 + length of cmd_debug_fopen_request.name |200* | MRQ_DEBUG | CMD_DEBUG_OPEN_WO | 4 + length of cmd_debug_fopen_request.name |201* | MRQ_DEBUG | CMD_DEBUG_READ | 8 |202* | MRQ_DEBUG | CMD_DEBUG_WRITE | 12 + cmd_debug_fwrite_request.datalen |203* | MRQ_DEBUG | CMD_DEBUG_CLOSE | 8 |204* | MRQ_TELEMETRY | | 8 |205* | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_QUERY_ABI | 8 |206* | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_SET | 20 |207* | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_GET | 16 |208* | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_CURR_CAP | 8 |209* | MRQ_GEARS | | 0 |210* | MRQ_BWMGR_INT | CMD_BWMGR_INT_QUERY_ABI | 8 |211* | MRQ_BWMGR_INT | CMD_BWMGR_INT_CALC_AND_SET | 16 |212* | MRQ_BWMGR_INT | CMD_BWMGR_INT_CAP_SET | 8 |213* | MRQ_OC_STATUS | | 0 |214*215* **crc16**216*217* CRC16 using polynomial x^16 + x^14 + x^12 + x^11 + x^8 + x^5 + x^4 + x^2 + 1218* and initialization value 0x4657. The CRC is calculated over all bytes of the message219* including this header. However the crc16 field is considered to be set to 0 when220* calculating the CRC. Only used when #BPMP_MAIL_CRC_PRESENT is set. If221* #BPMP_MAIL_CRC_PRESENT is set and this field does not match the CRC as222* calculated by BPMP, -BPMP_EBADMSG will be returned and the request will223* be ignored. See code snippet below on how to calculate the CRC.224*225* @code226* uint16_t calc_crc_digest(uint16_t crc, uint8_t *data, size_t size)227* {228* for (size_t i = 0; i < size; i++) {229* crc ^= data[i] << 8;230* for (size_t j = 0; j < 8; j++) {231* if ((crc & 0x8000) == 0x8000) {232* crc = (crc << 1) ^ 0xAC9A;233* } else {234* crc = (crc << 1);235* }236* }237* }238* return crc;239* }240*241* uint16_t calc_crc(uint8_t *data, size_t size)242* {243* return calc_crc_digest(0x4657, data, size);244* }245* @endcode246*/247uint32_t flags;248} BPMP_ABI_PACKED;249250/**251* @ingroup MRQ_Format252* @brief Header for an MRQ response253*254* Provides an error code for the associated MRQ message. The255* remainder of the MRQ response is a payload (immediately following256* the mrq_response) whose format depends on the associated257* mrq_request::mrq258*/259struct mrq_response {260/** @brief Error code for the MRQ request itself */261int32_t err;262263/**264* @brief 32bit word containing a number of fields as follows:265*266* struct {267* uint8_t options:4;268* uint8_t xid:4;269* uint8_t payload_length;270* uint16_t crc16;271* };272*273* **options** indicates CRC presence.274*275* #BPMP_MAIL_CRC_PRESENT is supported on T234 and later platforms and276* indicates the crc16 related fields are present when set.277*278* **xid** is the transaction ID as sent by the requestor.279*280* **length** of the message expressed in bytes without the size of this header.281* Note: For DMCE communication, this field expresses the length as a multiple of 4 bytes282* rather than bytes.283*284* **crc16**285*286* CRC16 using polynomial x^16 + x^14 + x^12 + x^11 + x^8 + x^5 + x^4 + x^2 + 1287* and initialization value 0x4657. The CRC is calculated over all bytes of the message288* including this header. However the crc16 field is considered to be set to 0 when289* calculating the CRC. Only used when #BPMP_MAIL_CRC_PRESENT is set.290*/291uint32_t flags;292} BPMP_ABI_PACKED;293294/**295* @ingroup MRQ_Format296* Minimum needed size for an IPC message buffer297*/298#define MSG_MIN_SZ 128U299/**300* @ingroup MRQ_Format301* Minimum size guaranteed for data in an IPC message buffer302*/303#define MSG_DATA_MIN_SZ 120U304305/**306* @ingroup MRQ_Codes307* @name Legal MRQ codes308* These are the legal values for mrq_request::mrq309* @{310*/311312#define MRQ_PING 0U313#define MRQ_QUERY_TAG 1U314#define MRQ_THREADED_PING 9U315#define MRQ_DEBUGFS 19U316#define MRQ_RESET 20U317#define MRQ_I2C 21U318#define MRQ_CLK 22U319#define MRQ_QUERY_ABI 23U320#define MRQ_THERMAL 27U321#define MRQ_CPU_VHINT 28U322#define MRQ_ABI_RATCHET 29U323#define MRQ_EMC_DVFS_LATENCY 31U324#define MRQ_RINGBUF_CONSOLE 65U325#define MRQ_PG 66U326#define MRQ_CPU_NDIV_LIMITS 67U327#define MRQ_STRAP 68U328#define MRQ_UPHY 69U329#define MRQ_CPU_AUTO_CC3 70U330#define MRQ_QUERY_FW_TAG 71U331#define MRQ_FMON 72U332#define MRQ_EC 73U333#define MRQ_DEBUG 75U334#define MRQ_EMC_DVFS_EMCHUB 76U335#define MRQ_BWMGR 77U336#define MRQ_ISO_CLIENT 78U337#define MRQ_EMC_DISP_RFL 79U338#define MRQ_TELEMETRY 80U339#define MRQ_PWR_LIMIT 81U340#define MRQ_GEARS 82U341#define MRQ_BWMGR_INT 83U342#define MRQ_OC_STATUS 84U343344/** @cond DEPRECATED */345#define MRQ_RESERVED_2 2U346#define MRQ_RESERVED_3 3U347#define MRQ_RESERVED_4 4U348#define MRQ_RESERVED_5 5U349#define MRQ_RESERVED_6 6U350#define MRQ_RESERVED_7 7U351#define MRQ_RESERVED_8 8U352#define MRQ_RESERVED_10 10U353#define MRQ_RESERVED_11 11U354#define MRQ_RESERVED_12 12U355#define MRQ_RESERVED_13 13U356#define MRQ_RESERVED_14 14U357#define MRQ_RESERVED_15 15U358#define MRQ_RESERVED_16 16U359#define MRQ_RESERVED_17 17U360#define MRQ_RESERVED_18 18U361#define MRQ_RESERVED_24 24U362#define MRQ_RESERVED_25 25U363#define MRQ_RESERVED_26 26U364#define MRQ_RESERVED_30 30U365#define MRQ_RESERVED_64 64U366#define MRQ_RESERVED_74 74U367/** @endcond DEPRECATED */368369/** @} */370371/**372* @ingroup MRQ_Codes373* @brief Maximum MRQ code to be sent by CPU software to374* BPMP. Subject to change in future375*/376#define MAX_CPU_MRQ_ID 84U377378/**379* @addtogroup MRQ_Payloads380* @{381* @defgroup Ping Ping382* @defgroup Query_Tag Query Tag383* @defgroup Module Loadable Modules384* @defgroup Trace Trace385* @defgroup Debugfs Debug File System386* @defgroup Reset Reset387* @defgroup I2C I2C388* @defgroup Clocks Clocks389* @defgroup ABI_info ABI Info390* @defgroup Powergating Power Gating391* @defgroup Thermal Thermal392* @defgroup OC_status OC status393* @defgroup Vhint CPU Voltage hint394* @defgroup EMC EMC395* @defgroup BWMGR BWMGR396* @defgroup ISO_CLIENT ISO_CLIENT397* @defgroup CPU NDIV Limits398* @defgroup RingbufConsole Ring Buffer Console399* @defgroup Strap Straps400* @defgroup UPHY UPHY401* @defgroup CC3 Auto-CC3402* @defgroup FMON FMON403* @defgroup EC EC404* @defgroup Telemetry Telemetry405* @defgroup Pwrlimit PWR_LIMIT406* @defgroup Gears Gears407* @defgroup BWMGR_INT Bandwidth Manager Integrated408* @} MRQ_Payloads409*/410411/**412* @ingroup MRQ_Codes413* @def MRQ_PING414* @brief A simple ping415*416* * Platforms: All417* * Initiators: Any418* * Targets: Any419* * Request Payload: @ref mrq_ping_request420* * Response Payload: @ref mrq_ping_response421*422* @ingroup MRQ_Codes423* @def MRQ_THREADED_PING424* @brief A deeper ping425*426* * Platforms: All427* * Initiators: Any428* * Targets: BPMP429* * Request Payload: @ref mrq_ping_request430* * Response Payload: @ref mrq_ping_response431*432* Behavior is equivalent to a simple #MRQ_PING except that BPMP433* responds from a thread context (providing a slightly more robust434* sign of life).435*436*/437438/**439* @ingroup Ping440* @brief Request with #MRQ_PING441*442* Used by the sender of an #MRQ_PING message to request a pong from443* recipient. The response from the recipient is computed based on444* #challenge.445*/446struct mrq_ping_request {447/** @brief Arbitrarily chosen value */448uint32_t challenge;449} BPMP_ABI_PACKED;450451/**452* @ingroup Ping453* @brief Response to #MRQ_PING454*455* Sent in response to an #MRQ_PING message. #reply should be the456* mrq_ping_request challenge left shifted by 1 with the carry-bit457* dropped.458*459*/460struct mrq_ping_response {461/** @brief Response to the MRQ_PING challege */462uint32_t reply;463} BPMP_ABI_PACKED;464465/**466* @ingroup MRQ_Codes467* @def MRQ_QUERY_TAG468* @brief Query BPMP firmware's tag (i.e. unique identifer)469*470* @deprecated Use #MRQ_QUERY_FW_TAG instead.471*472* * Platforms: All473* * Initiators: CCPLEX474* * Targets: BPMP475* * Request Payload: @ref mrq_query_tag_request476* * Response Payload: N/A477*478*/479480/**481* @ingroup Query_Tag482* @brief Request with #MRQ_QUERY_TAG483*484* @deprecated This structure will be removed in future version.485* Use MRQ_QUERY_FW_TAG instead.486*/487struct mrq_query_tag_request {488/** @brief Base address to store the firmware tag */489uint32_t addr;490} BPMP_ABI_PACKED;491492493/**494* @ingroup MRQ_Codes495* @def MRQ_QUERY_FW_TAG496* @brief Query BPMP firmware's tag (i.e. unique identifier)497*498* * Platforms: All499* * Initiators: Any500* * Targets: BPMP501* * Request Payload: N/A502* * Response Payload: @ref mrq_query_fw_tag_response503*504*/505506/**507* @ingroup Query_Tag508* @brief Response to #MRQ_QUERY_FW_TAG509*510* Sent in response to #MRQ_QUERY_FW_TAG message. #tag contains the unique511* identifier for the version of firmware issuing the reply.512*513*/514struct mrq_query_fw_tag_response {515/** @brief Array to store tag information */516uint8_t tag[32];517} BPMP_ABI_PACKED;518519/** @private */520struct mrq_threaded_ping_request {521uint32_t challenge;522} BPMP_ABI_PACKED;523524/** @private */525struct mrq_threaded_ping_response {526uint32_t reply;527} BPMP_ABI_PACKED;528529/**530* @ingroup MRQ_Codes531* @def MRQ_DEBUGFS532* @brief Interact with BPMP's debugfs file nodes533*534* @deprecated use MRQ_DEBUG instead.535*536* * Platforms: T186, T194537* * Initiators: Any538* * Targets: BPMP539* * Request Payload: @ref mrq_debugfs_request540* * Response Payload: @ref mrq_debugfs_response541*/542543/**544* @addtogroup Debugfs545* @{546*547* The BPMP firmware implements a pseudo-filesystem called548* debugfs. Any driver within the firmware may register with debugfs549* to expose an arbitrary set of "files" in the filesystem. When550* software on the CPU writes to a debugfs file, debugfs passes the551* written data to a callback provided by the driver. When software on552* the CPU reads a debugfs file, debugfs queries the driver for the553* data to return to the CPU. The intention of the debugfs filesystem554* is to provide information useful for debugging the system at555* runtime.556*557* @note The files exposed via debugfs are not part of the558* BPMP firmware's ABI. debugfs files may be added or removed in any559* given version of the firmware. Typically the semantics of a debugfs560* file are consistent from version to version but even that is not561* guaranteed.562*563* @}564*/565566/** @ingroup Debugfs */567enum mrq_debugfs_commands {568/** @brief Perform read */569CMD_DEBUGFS_READ = 1,570/** @brief Perform write */571CMD_DEBUGFS_WRITE = 2,572/** @brief Perform dumping directory */573CMD_DEBUGFS_DUMPDIR = 3,574/** @brief Not a command */575CMD_DEBUGFS_MAX576};577578/**579* @ingroup Debugfs580* @brief Parameters for CMD_DEBUGFS_READ/WRITE command581*/582struct cmd_debugfs_fileop_request {583/** @brief Physical address pointing at filename */584uint32_t fnameaddr;585/** @brief Length in bytes of filename buffer */586uint32_t fnamelen;587/** @brief Physical address pointing to data buffer */588uint32_t dataaddr;589/** @brief Length in bytes of data buffer */590uint32_t datalen;591} BPMP_ABI_PACKED;592593/**594* @ingroup Debugfs595* @brief Parameters for CMD_DEBUGFS_READ/WRITE command596*/597struct cmd_debugfs_dumpdir_request {598/** @brief Physical address pointing to data buffer */599uint32_t dataaddr;600/** @brief Length in bytes of data buffer */601uint32_t datalen;602} BPMP_ABI_PACKED;603604/**605* @ingroup Debugfs606* @brief Response data for CMD_DEBUGFS_READ/WRITE command607*/608struct cmd_debugfs_fileop_response {609/** @brief Always 0 */610uint32_t reserved;611/** @brief Number of bytes read from or written to data buffer */612uint32_t nbytes;613} BPMP_ABI_PACKED;614615/**616* @ingroup Debugfs617* @brief Response data for CMD_DEBUGFS_DUMPDIR command618*/619struct cmd_debugfs_dumpdir_response {620/** @brief Always 0 */621uint32_t reserved;622/** @brief Number of bytes read from or written to data buffer */623uint32_t nbytes;624} BPMP_ABI_PACKED;625626/**627* @ingroup Debugfs628* @brief Request with #MRQ_DEBUGFS.629*630* The sender of an MRQ_DEBUGFS message uses #cmd to specify a debugfs631* command to execute. Legal commands are the values of @ref632* mrq_debugfs_commands. Each command requires a specific additional633* payload of data.634*635* |command |payload|636* |-------------------|-------|637* |CMD_DEBUGFS_READ |fop |638* |CMD_DEBUGFS_WRITE |fop |639* |CMD_DEBUGFS_DUMPDIR|dumpdir|640*/641struct mrq_debugfs_request {642/** @brief Sub-command (@ref mrq_debugfs_commands) */643uint32_t cmd;644union {645struct cmd_debugfs_fileop_request fop;646struct cmd_debugfs_dumpdir_request dumpdir;647} BPMP_UNION_ANON;648} BPMP_ABI_PACKED;649650/**651* @ingroup Debugfs652*/653struct mrq_debugfs_response {654/** @brief Always 0 */655int32_t reserved;656union {657/** @brief Response data for CMD_DEBUGFS_READ OR658* CMD_DEBUGFS_WRITE command659*/660struct cmd_debugfs_fileop_response fop;661/** @brief Response data for CMD_DEBUGFS_DUMPDIR command */662struct cmd_debugfs_dumpdir_response dumpdir;663} BPMP_UNION_ANON;664} BPMP_ABI_PACKED;665666/**667* @addtogroup Debugfs668* @{669*/670#define DEBUGFS_S_ISDIR (1 << 9)671#define DEBUGFS_S_IRUSR (1 << 8)672#define DEBUGFS_S_IWUSR (1 << 7)673/** @} Debugfs */674675/**676* @ingroup MRQ_Codes677* @def MRQ_DEBUG678* @brief Interact with BPMP's debugfs file nodes. Use message payload679* for exchanging data. This is functionally equivalent to680* @ref MRQ_DEBUGFS. But the way in which data is exchanged is different.681* When software running on CPU tries to read a debugfs file,682* the file path and read data will be stored in message payload.683* Since the message payload size is limited, a debugfs file684* transaction might require multiple frames of data exchanged685* between BPMP and CPU until the transaction completes.686*687* * Platforms: T194688* * Initiators: Any689* * Targets: BPMP690* * Request Payload: @ref mrq_debug_request691* * Response Payload: @ref mrq_debug_response692*/693694/** @ingroup Debugfs */695enum mrq_debug_commands {696/** @brief Open required file for read operation */697CMD_DEBUG_OPEN_RO = 0,698/** @brief Open required file for write operation */699CMD_DEBUG_OPEN_WO = 1,700/** @brief Perform read */701CMD_DEBUG_READ = 2,702/** @brief Perform write */703CMD_DEBUG_WRITE = 3,704/** @brief Close file */705CMD_DEBUG_CLOSE = 4,706/** @brief Not a command */707CMD_DEBUG_MAX708};709710/**711* @ingroup Debugfs712* @brief Maximum number of files that can be open at a given time713*/714#define DEBUG_MAX_OPEN_FILES 1715716/**717* @ingroup Debugfs718* @brief Maximum size of null-terminated file name string in bytes.719* Value is derived from memory available in message payload while720* using @ref cmd_debug_fopen_request721* Value 4 corresponds to size of @ref mrq_debug_commands722* in @ref mrq_debug_request.723* 120 - 4 dbg_cmd(32bit) = 116724*/725#define DEBUG_FNAME_MAX_SZ (MSG_DATA_MIN_SZ - 4)726727/**728* @ingroup Debugfs729* @brief Parameters for CMD_DEBUG_OPEN command730*/731struct cmd_debug_fopen_request {732/** @brief File name - Null-terminated string with maximum733* length @ref DEBUG_FNAME_MAX_SZ734*/735char name[DEBUG_FNAME_MAX_SZ];736} BPMP_ABI_PACKED;737738/**739* @ingroup Debugfs740* @brief Response data for CMD_DEBUG_OPEN_RO/WO command741*/742struct cmd_debug_fopen_response {743/** @brief Identifier for file access */744uint32_t fd;745/** @brief Data length. File data size for READ command.746* Maximum allowed length for WRITE command747*/748uint32_t datalen;749} BPMP_ABI_PACKED;750751/**752* @ingroup Debugfs753* @brief Parameters for CMD_DEBUG_READ command754*/755struct cmd_debug_fread_request {756/** @brief File access identifier received in response757* to CMD_DEBUG_OPEN_RO request758*/759uint32_t fd;760} BPMP_ABI_PACKED;761762/**763* @ingroup Debugfs764* @brief Maximum size of read data in bytes.765* Value is derived from memory available in message payload while766* using @ref cmd_debug_fread_response.767*/768#define DEBUG_READ_MAX_SZ (MSG_DATA_MIN_SZ - 4)769770/**771* @ingroup Debugfs772* @brief Response data for CMD_DEBUG_READ command773*/774struct cmd_debug_fread_response {775/** @brief Size of data provided in this response in bytes */776uint32_t readlen;777/** @brief File data from seek position */778char data[DEBUG_READ_MAX_SZ];779} BPMP_ABI_PACKED;780781/**782* @ingroup Debugfs783* @brief Maximum size of write data in bytes.784* Value is derived from memory available in message payload while785* using @ref cmd_debug_fwrite_request.786*/787#define DEBUG_WRITE_MAX_SZ (MSG_DATA_MIN_SZ - 12)788789/**790* @ingroup Debugfs791* @brief Parameters for CMD_DEBUG_WRITE command792*/793struct cmd_debug_fwrite_request {794/** @brief File access identifier received in response795* to CMD_DEBUG_OPEN_RO request796*/797uint32_t fd;798/** @brief Size of write data in bytes */799uint32_t datalen;800/** @brief Data to be written */801char data[DEBUG_WRITE_MAX_SZ];802} BPMP_ABI_PACKED;803804/**805* @ingroup Debugfs806* @brief Parameters for CMD_DEBUG_CLOSE command807*/808struct cmd_debug_fclose_request {809/** @brief File access identifier received in response810* to CMD_DEBUG_OPEN_RO request811*/812uint32_t fd;813} BPMP_ABI_PACKED;814815/**816* @ingroup Debugfs817* @brief Request with #MRQ_DEBUG.818*819* The sender of an MRQ_DEBUG message uses #cmd to specify a debugfs820* command to execute. Legal commands are the values of @ref821* mrq_debug_commands. Each command requires a specific additional822* payload of data.823*824* |command |payload|825* |-------------------|-------|826* |CMD_DEBUG_OPEN_RO |fop |827* |CMD_DEBUG_OPEN_WO |fop |828* |CMD_DEBUG_READ |frd |829* |CMD_DEBUG_WRITE |fwr |830* |CMD_DEBUG_CLOSE |fcl |831*/832struct mrq_debug_request {833/** @brief Sub-command (@ref mrq_debug_commands) */834uint32_t cmd;835union {836/** @brief Request payload for CMD_DEBUG_OPEN_RO/WO command */837struct cmd_debug_fopen_request fop;838/** @brief Request payload for CMD_DEBUG_READ command */839struct cmd_debug_fread_request frd;840/** @brief Request payload for CMD_DEBUG_WRITE command */841struct cmd_debug_fwrite_request fwr;842/** @brief Request payload for CMD_DEBUG_CLOSE command */843struct cmd_debug_fclose_request fcl;844} BPMP_UNION_ANON;845} BPMP_ABI_PACKED;846847/**848* @ingroup Debugfs849*/850struct mrq_debug_response {851union {852/** @brief Response data for CMD_DEBUG_OPEN_RO/WO command */853struct cmd_debug_fopen_response fop;854/** @brief Response data for CMD_DEBUG_READ command */855struct cmd_debug_fread_response frd;856} BPMP_UNION_ANON;857} BPMP_ABI_PACKED;858859/**860* @ingroup MRQ_Codes861* @def MRQ_RESET862* @brief Reset an IP block863*864* * Platforms: T186, T194865* * Initiators: Any866* * Targets: BPMP867* * Request Payload: @ref mrq_reset_request868* * Response Payload: @ref mrq_reset_response869*870* @addtogroup Reset871* @{872*/873874enum mrq_reset_commands {875/**876* @brief Assert module reset877*878* mrq_response::err is 0 if the operation was successful, or @n879* -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n880* -#BPMP_EACCES if mrq master is not an owner of target domain reset @n881* -#BPMP_ENOTSUP if target domain h/w state does not allow reset882*/883CMD_RESET_ASSERT = 1,884/**885* @brief Deassert module reset886*887* mrq_response::err is 0 if the operation was successful, or @n888* -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n889* -#BPMP_EACCES if mrq master is not an owner of target domain reset @n890* -#BPMP_ENOTSUP if target domain h/w state does not allow reset891*/892CMD_RESET_DEASSERT = 2,893/**894* @brief Assert and deassert the module reset895*896* mrq_response::err is 0 if the operation was successful, or @n897* -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n898* -#BPMP_EACCES if mrq master is not an owner of target domain reset @n899* -#BPMP_ENOTSUP if target domain h/w state does not allow reset900*/901CMD_RESET_MODULE = 3,902/**903* @brief Get the highest reset ID904*905* mrq_response::err is 0 if the operation was successful, or @n906* -#BPMP_ENODEV if no reset domains are supported (number of IDs is 0)907*/908CMD_RESET_GET_MAX_ID = 4,909910/** @brief Not part of ABI and subject to change */911CMD_RESET_MAX,912};913914/**915* @brief Request with MRQ_RESET916*917* Used by the sender of an #MRQ_RESET message to request BPMP to918* assert or or deassert a given reset line.919*/920struct mrq_reset_request {921/** @brief Reset action to perform (@ref mrq_reset_commands) */922uint32_t cmd;923/** @brief Id of the reset to affected */924uint32_t reset_id;925} BPMP_ABI_PACKED;926927/**928* @brief Response for MRQ_RESET sub-command CMD_RESET_GET_MAX_ID. When929* this sub-command is not supported, firmware will return -BPMP_EBADCMD930* in mrq_response::err.931*/932struct cmd_reset_get_max_id_response {933/** @brief Max reset id */934uint32_t max_id;935} BPMP_ABI_PACKED;936937/**938* @brief Response with MRQ_RESET939*940* Each sub-command supported by @ref mrq_reset_request may return941* sub-command-specific data. Some do and some do not as indicated942* in the following table943*944* | sub-command | payload |945* |----------------------|------------------|946* | CMD_RESET_ASSERT | - |947* | CMD_RESET_DEASSERT | - |948* | CMD_RESET_MODULE | - |949* | CMD_RESET_GET_MAX_ID | reset_get_max_id |950*/951struct mrq_reset_response {952union {953struct cmd_reset_get_max_id_response reset_get_max_id;954} BPMP_UNION_ANON;955} BPMP_ABI_PACKED;956957/** @} Reset */958959/**960* @ingroup MRQ_Codes961* @def MRQ_I2C962* @brief Issue an i2c transaction963*964* * Platforms: T186, T194965* * Initiators: Any966* * Targets: BPMP967* * Request Payload: @ref mrq_i2c_request968* * Response Payload: @ref mrq_i2c_response969*970* @addtogroup I2C971* @{972*/973#define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12U)974#define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4U)975976#define SERIALI2C_TEN 0x0010U977#define SERIALI2C_RD 0x0001U978#define SERIALI2C_STOP 0x8000U979#define SERIALI2C_NOSTART 0x4000U980#define SERIALI2C_REV_DIR_ADDR 0x2000U981#define SERIALI2C_IGNORE_NAK 0x1000U982#define SERIALI2C_NO_RD_ACK 0x0800U983#define SERIALI2C_RECV_LEN 0x0400U984985enum {986CMD_I2C_XFER = 1987};988989/**990* @brief Serializable i2c request991*992* Instances of this structure are packed (little-endian) into993* cmd_i2c_xfer_request::data_buf. Each instance represents a single994* transaction (or a portion of a transaction with repeated starts) on995* an i2c bus.996*997* Because these structures are packed, some instances are likely to998* be misaligned. Additionally because #data is variable length, it is999* not possible to iterate through a serialized list of these1000* structures without inspecting #len in each instance. It may be1001* easier to serialize or deserialize cmd_i2c_xfer_request::data_buf1002* manually rather than using this structure definition.1003*/1004struct serial_i2c_request {1005/** @brief I2C slave address */1006uint16_t addr;1007/** @brief Bitmask of SERIALI2C_ flags */1008uint16_t flags;1009/** @brief Length of I2C transaction in bytes */1010uint16_t len;1011/** @brief For write transactions only, #len bytes of data */1012uint8_t data[];1013} BPMP_ABI_PACKED;10141015/**1016* @brief Trigger one or more i2c transactions1017*/1018struct cmd_i2c_xfer_request {1019/**1020* @brief Tegra PWR_I2C bus identifier1021*1022* @cond (bpmp_t234 || bpmp_t239 || bpmp_t194)1023* Must be set to 5.1024* @endcond (bpmp_t234 || bpmp_t239 || bpmp_t194)1025* @cond bpmp_th5001026* Must be set to 1.1027* @endcond bpmp_th5001028*1029*/1030uint32_t bus_id;10311032/** @brief Count of valid bytes in #data_buf*/1033uint32_t data_size;10341035/** @brief Serialized packed instances of @ref serial_i2c_request*/1036uint8_t data_buf[TEGRA_I2C_IPC_MAX_IN_BUF_SIZE];1037} BPMP_ABI_PACKED;10381039/**1040* @brief Container for data read from the i2c bus1041*1042* Processing an cmd_i2c_xfer_request::data_buf causes BPMP to execute1043* zero or more I2C reads. The data read from the bus is serialized1044* into #data_buf.1045*/1046struct cmd_i2c_xfer_response {1047/** @brief Count of valid bytes in #data_buf*/1048uint32_t data_size;1049/** @brief I2c read data */1050uint8_t data_buf[TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE];1051} BPMP_ABI_PACKED;10521053/**1054* @brief Request with #MRQ_I2C1055*/1056struct mrq_i2c_request {1057/** @brief Always CMD_I2C_XFER (i.e. 1) */1058uint32_t cmd;1059/** @brief Parameters of the transfer request */1060struct cmd_i2c_xfer_request xfer;1061} BPMP_ABI_PACKED;10621063/**1064* @brief Response to #MRQ_I2C1065*1066* mrq_response:err is1067* 0: Success1068* -#BPMP_EBADCMD: if mrq_i2c_request::cmd is other than 11069* -#BPMP_EINVAL: if cmd_i2c_xfer_request does not contain correctly formatted request1070* -#BPMP_ENODEV: if cmd_i2c_xfer_request::bus_id is not supported by BPMP1071* -#BPMP_EACCES: if i2c transaction is not allowed due to firewall rules1072* -#BPMP_ETIMEDOUT: if i2c transaction times out1073* -#BPMP_ENXIO: if i2c slave device does not reply with ACK to the transaction1074* -#BPMP_EAGAIN: if ARB_LOST condition is detected by the i2c controller1075* -#BPMP_EIO: any other i2c controller error code than NO_ACK or ARB_LOST1076*/1077struct mrq_i2c_response {1078struct cmd_i2c_xfer_response xfer;1079} BPMP_ABI_PACKED;10801081/** @} I2C */10821083/**1084* @ingroup MRQ_Codes1085* @def MRQ_CLK1086* @brief Perform a clock operation1087*1088* * Platforms: T186, T1941089* * Initiators: Any1090* * Targets: BPMP1091* * Request Payload: @ref mrq_clk_request1092* * Response Payload: @ref mrq_clk_response1093*1094* @addtogroup Clocks1095* @{1096*/1097enum {1098CMD_CLK_GET_RATE = 1,1099CMD_CLK_SET_RATE = 2,1100CMD_CLK_ROUND_RATE = 3,1101CMD_CLK_GET_PARENT = 4,1102CMD_CLK_SET_PARENT = 5,1103CMD_CLK_IS_ENABLED = 6,1104CMD_CLK_ENABLE = 7,1105CMD_CLK_DISABLE = 8,1106/** @cond DEPRECATED */1107CMD_CLK_PROPERTIES = 9,1108CMD_CLK_POSSIBLE_PARENTS = 10,1109CMD_CLK_NUM_POSSIBLE_PARENTS = 11,1110CMD_CLK_GET_POSSIBLE_PARENT = 12,1111CMD_CLK_RESET_REFCOUNTS = 13,1112/** @endcond DEPRECATED */1113CMD_CLK_GET_ALL_INFO = 14,1114CMD_CLK_GET_MAX_CLK_ID = 15,1115CMD_CLK_GET_FMAX_AT_VMIN = 16,1116CMD_CLK_MAX,1117};11181119#define BPMP_CLK_HAS_MUX (1U << 0U)1120#define BPMP_CLK_HAS_SET_RATE (1U << 1U)1121#define BPMP_CLK_IS_ROOT (1U << 2U)1122#define BPMP_CLK_IS_VAR_ROOT (1U << 3U)1123/**1124* @brief Protection against rate and parent changes1125*1126* #MRQ_CLK command #CMD_CLK_SET_RATE or #MRQ_CLK command #CMD_CLK_SET_PARENT will return1127* -#BPMP_EACCES.1128*/1129#define BPMP_CLK_RATE_PARENT_CHANGE_DENIED (1U << 30)11301131/**1132* @brief Protection against state changes1133*1134* #MRQ_CLK command #CMD_CLK_ENABLE or #MRQ_CLK command #CMD_CLK_DISABLE will return1135* -#BPMP_EACCES.1136*/1137#define BPMP_CLK_STATE_CHANGE_DENIED (1U << 31)11381139#define MRQ_CLK_NAME_MAXLEN 40U1140#define MRQ_CLK_MAX_PARENTS 16U11411142/** @private */1143struct cmd_clk_get_rate_request {1144BPMP_ABI_EMPTY1145} BPMP_ABI_PACKED;11461147struct cmd_clk_get_rate_response {1148int64_t rate;1149} BPMP_ABI_PACKED;11501151struct cmd_clk_set_rate_request {1152int32_t unused;1153int64_t rate;1154} BPMP_ABI_PACKED;11551156struct cmd_clk_set_rate_response {1157int64_t rate;1158} BPMP_ABI_PACKED;11591160struct cmd_clk_round_rate_request {1161int32_t unused;1162int64_t rate;1163} BPMP_ABI_PACKED;11641165struct cmd_clk_round_rate_response {1166int64_t rate;1167} BPMP_ABI_PACKED;11681169/** @private */1170struct cmd_clk_get_parent_request {1171BPMP_ABI_EMPTY1172} BPMP_ABI_PACKED;11731174struct cmd_clk_get_parent_response {1175uint32_t parent_id;1176} BPMP_ABI_PACKED;11771178struct cmd_clk_set_parent_request {1179uint32_t parent_id;1180} BPMP_ABI_PACKED;11811182struct cmd_clk_set_parent_response {1183uint32_t parent_id;1184} BPMP_ABI_PACKED;11851186/** @private */1187struct cmd_clk_is_enabled_request {1188BPMP_ABI_EMPTY1189} BPMP_ABI_PACKED;11901191/**1192* @brief Response data to #MRQ_CLK sub-command CMD_CLK_IS_ENABLED1193*/1194struct cmd_clk_is_enabled_response {1195/**1196* @brief The state of the clock that has been successfully1197* requested with CMD_CLK_ENABLE or CMD_CLK_DISABLE by the1198* master invoking the command earlier.1199*1200* The state may not reflect the physical state of the clock1201* if there are some other masters requesting it to be1202* enabled.1203*1204* Value 0 is disabled, all other values indicate enabled.1205*/1206int32_t state;1207} BPMP_ABI_PACKED;12081209/** @private */1210struct cmd_clk_enable_request {1211BPMP_ABI_EMPTY1212} BPMP_ABI_PACKED;12131214/** @private */1215struct cmd_clk_enable_response {1216BPMP_ABI_EMPTY1217} BPMP_ABI_PACKED;12181219/** @private */1220struct cmd_clk_disable_request {1221BPMP_ABI_EMPTY1222} BPMP_ABI_PACKED;12231224/** @private */1225struct cmd_clk_disable_response {1226BPMP_ABI_EMPTY1227} BPMP_ABI_PACKED;12281229/** @cond DEPRECATED */1230/** @private */1231struct cmd_clk_properties_request {1232BPMP_ABI_EMPTY1233} BPMP_ABI_PACKED;12341235/** @todo flags need to be spelled out here */1236struct cmd_clk_properties_response {1237uint32_t flags;1238} BPMP_ABI_PACKED;12391240/** @private */1241struct cmd_clk_possible_parents_request {1242BPMP_ABI_EMPTY1243} BPMP_ABI_PACKED;12441245struct cmd_clk_possible_parents_response {1246uint8_t num_parents;1247uint8_t reserved[3];1248uint32_t parent_id[MRQ_CLK_MAX_PARENTS];1249} BPMP_ABI_PACKED;12501251/** @private */1252struct cmd_clk_num_possible_parents_request {1253BPMP_ABI_EMPTY1254} BPMP_ABI_PACKED;12551256struct cmd_clk_num_possible_parents_response {1257uint8_t num_parents;1258} BPMP_ABI_PACKED;12591260struct cmd_clk_get_possible_parent_request {1261uint8_t parent_idx;1262} BPMP_ABI_PACKED;12631264struct cmd_clk_get_possible_parent_response {1265uint32_t parent_id;1266} BPMP_ABI_PACKED;1267/** @endcond DEPRECATED */12681269/** @private */1270struct cmd_clk_get_all_info_request {1271BPMP_ABI_EMPTY1272} BPMP_ABI_PACKED;12731274struct cmd_clk_get_all_info_response {1275uint32_t flags;1276uint32_t parent;1277uint32_t parents[MRQ_CLK_MAX_PARENTS];1278uint8_t num_parents;1279uint8_t name[MRQ_CLK_NAME_MAXLEN];1280} BPMP_ABI_PACKED;12811282/** @private */1283struct cmd_clk_get_max_clk_id_request {1284BPMP_ABI_EMPTY1285} BPMP_ABI_PACKED;12861287struct cmd_clk_get_max_clk_id_response {1288uint32_t max_id;1289} BPMP_ABI_PACKED;12901291/** @private */1292struct cmd_clk_get_fmax_at_vmin_request {1293BPMP_ABI_EMPTY1294} BPMP_ABI_PACKED;12951296struct cmd_clk_get_fmax_at_vmin_response {1297int64_t rate;1298} BPMP_ABI_PACKED;129913001301/**1302* @ingroup Clocks1303* @brief Request with #MRQ_CLK1304*1305* Used by the sender of an #MRQ_CLK message to control clocks. The1306* clk_request is split into several sub-commands. Some sub-commands1307* require no additional data. Others have a sub-command specific1308* payload1309*1310* |sub-command |payload |1311* |----------------------------|-----------------------|1312* |CMD_CLK_GET_RATE |- |1313* |CMD_CLK_SET_RATE |clk_set_rate |1314* |CMD_CLK_ROUND_RATE |clk_round_rate |1315* |CMD_CLK_GET_PARENT |- |1316* |CMD_CLK_SET_PARENT |clk_set_parent |1317* |CMD_CLK_IS_ENABLED |- |1318* |CMD_CLK_ENABLE |- |1319* |CMD_CLK_DISABLE |- |1320* |CMD_CLK_GET_ALL_INFO |- |1321* |CMD_CLK_GET_MAX_CLK_ID |- |1322* |CMD_CLK_GET_FMAX_AT_VMIN |-1323* |1324*1325*/13261327/** @cond DEPRECATED1328*1329* Older versions of firmware also supported following sub-commands:1330* |CMD_CLK_PROPERTIES |- |1331* |CMD_CLK_POSSIBLE_PARENTS |- |1332* |CMD_CLK_NUM_POSSIBLE_PARENTS|- |1333* |CMD_CLK_GET_POSSIBLE_PARENT |clk_get_possible_parent|1334* |CMD_CLK_RESET_REFCOUNTS |- |1335*1336* @endcond DEPRECATED */13371338struct mrq_clk_request {1339/** @brief Sub-command and clock id concatenated to 32-bit word.1340* - bits[31..24] is the sub-cmd.1341* - bits[23..0] is the clock id1342*/1343uint32_t cmd_and_id;13441345union {1346/** @private */1347struct cmd_clk_get_rate_request clk_get_rate;1348struct cmd_clk_set_rate_request clk_set_rate;1349struct cmd_clk_round_rate_request clk_round_rate;1350/** @private */1351struct cmd_clk_get_parent_request clk_get_parent;1352struct cmd_clk_set_parent_request clk_set_parent;1353/** @private */1354struct cmd_clk_enable_request clk_enable;1355/** @private */1356struct cmd_clk_disable_request clk_disable;1357/** @private */1358struct cmd_clk_is_enabled_request clk_is_enabled;1359/** @cond DEPRECATED */1360/** @private */1361struct cmd_clk_properties_request clk_properties;1362/** @private */1363struct cmd_clk_possible_parents_request clk_possible_parents;1364/** @private */1365struct cmd_clk_num_possible_parents_request clk_num_possible_parents;1366struct cmd_clk_get_possible_parent_request clk_get_possible_parent;1367/** @endcond DEPRECATED */1368/** @private */1369struct cmd_clk_get_all_info_request clk_get_all_info;1370/** @private */1371struct cmd_clk_get_max_clk_id_request clk_get_max_clk_id;1372/** @private */1373struct cmd_clk_get_fmax_at_vmin_request clk_get_fmax_at_vmin;1374} BPMP_UNION_ANON;1375} BPMP_ABI_PACKED;13761377/**1378* @ingroup Clocks1379* @brief Response to MRQ_CLK1380*1381* Each sub-command supported by @ref mrq_clk_request may return1382* sub-command-specific data. Some do and some do not as indicated in1383* the following table1384*1385* |sub-command |payload |1386* |----------------------------|------------------------|1387* |CMD_CLK_GET_RATE |clk_get_rate |1388* |CMD_CLK_SET_RATE |clk_set_rate |1389* |CMD_CLK_ROUND_RATE |clk_round_rate |1390* |CMD_CLK_GET_PARENT |clk_get_parent |1391* |CMD_CLK_SET_PARENT |clk_set_parent |1392* |CMD_CLK_IS_ENABLED |clk_is_enabled |1393* |CMD_CLK_ENABLE |- |1394* |CMD_CLK_DISABLE |- |1395* |CMD_CLK_GET_ALL_INFO |clk_get_all_info |1396* |CMD_CLK_GET_MAX_CLK_ID |clk_get_max_id |1397* |CMD_CLK_GET_FMAX_AT_VMIN |clk_get_fmax_at_vmin |1398*1399*/14001401/** @cond DEPRECATED1402*1403* Older versions of firmware also supported following sub-commands:1404* |CMD_CLK_PROPERTIES |clk_properties |1405* |CMD_CLK_POSSIBLE_PARENTS |clk_possible_parents |1406* |CMD_CLK_NUM_POSSIBLE_PARENTS|clk_num_possible_parents|1407* |CMD_CLK_GET_POSSIBLE_PARENT |clk_get_possible_parents|1408* |CMD_CLK_RESET_REFCOUNTS |- |1409*1410* @endcond DEPRECATED */14111412struct mrq_clk_response {1413union {1414struct cmd_clk_get_rate_response clk_get_rate;1415struct cmd_clk_set_rate_response clk_set_rate;1416struct cmd_clk_round_rate_response clk_round_rate;1417struct cmd_clk_get_parent_response clk_get_parent;1418struct cmd_clk_set_parent_response clk_set_parent;1419/** @private */1420struct cmd_clk_enable_response clk_enable;1421/** @private */1422struct cmd_clk_disable_response clk_disable;1423struct cmd_clk_is_enabled_response clk_is_enabled;1424/** @cond DEPRECATED */1425struct cmd_clk_properties_response clk_properties;1426struct cmd_clk_possible_parents_response clk_possible_parents;1427struct cmd_clk_num_possible_parents_response clk_num_possible_parents;1428struct cmd_clk_get_possible_parent_response clk_get_possible_parent;1429/** @endcond DEPRECATED */1430struct cmd_clk_get_all_info_response clk_get_all_info;1431struct cmd_clk_get_max_clk_id_response clk_get_max_clk_id;1432struct cmd_clk_get_fmax_at_vmin_response clk_get_fmax_at_vmin;1433} BPMP_UNION_ANON;1434} BPMP_ABI_PACKED;14351436/** @} Clocks */14371438/**1439* @ingroup MRQ_Codes1440* @def MRQ_QUERY_ABI1441* @brief Check if an MRQ is implemented1442*1443* * Platforms: All1444* * Initiators: Any1445* * Targets: Any except DMCE1446* * Request Payload: @ref mrq_query_abi_request1447* * Response Payload: @ref mrq_query_abi_response1448*/14491450/**1451* @ingroup ABI_info1452* @brief Request with MRQ_QUERY_ABI1453*1454* Used by #MRQ_QUERY_ABI call to check if MRQ code #mrq is supported1455* by the recipient.1456*/1457struct mrq_query_abi_request {1458/** @brief MRQ code to query */1459uint32_t mrq;1460} BPMP_ABI_PACKED;14611462/**1463* @ingroup ABI_info1464* @brief Response to MRQ_QUERY_ABI1465*1466* @note mrq_response::err of 0 indicates that the query was1467* successful, not that the MRQ itself is supported!1468*/1469struct mrq_query_abi_response {1470/** @brief 0 if queried MRQ is supported. Else, -#BPMP_ENODEV */1471int32_t status;1472} BPMP_ABI_PACKED;14731474/**1475*1476* @ingroup MRQ_Codes1477* @def MRQ_PG1478* @brief Control power-gating state of a partition. In contrast to1479* MRQ_PG_UPDATE_STATE, operations that change the power partition1480* state are NOT reference counted1481*1482* @cond (bpmp_t194 || bpmp_t186)1483* @note On T194 and earlier BPMP-FW forcefully turns off some partitions as1484* part of SC7 entry because their state cannot be adequately restored on exit.1485* Therefore, it is recommended to power off all domains via MRQ_PG prior to SC71486* entry.1487* See @ref bpmp_pdomain_ids for further detail.1488* @endcond (bpmp_t194 || bpmp_t186)1489*1490* * Platforms: T186, T1941491* * Initiators: Any1492* * Targets: BPMP1493* * Request Payload: @ref mrq_pg_request1494* * Response Payload: @ref mrq_pg_response1495*1496* @addtogroup Powergating1497* @{1498*/1499enum mrq_pg_cmd {1500/**1501* @brief Check whether the BPMP driver supports the specified1502* request type1503*1504* mrq_response::err is 0 if the specified request is1505* supported and -#BPMP_ENODEV otherwise.1506*/1507CMD_PG_QUERY_ABI = 0,15081509/**1510* @brief Set the current state of specified power domain. The1511* possible values for power domains are defined in enum1512* pg_states1513*1514* mrq_response:err is1515* 0: Success1516* -#BPMP_EINVAL: Invalid request parameters1517*/1518CMD_PG_SET_STATE = 1,15191520/**1521* @brief Get the current state of specified power domain. The1522* possible values for power domains are defined in enum1523* pg_states1524*1525* mrq_response:err is1526* 0: Success1527* -#BPMP_EINVAL: Invalid request parameters1528*/1529CMD_PG_GET_STATE = 2,15301531/**1532* @brief Get the name string of specified power domain id.1533*1534* mrq_response:err is1535* 0: Success1536* -#BPMP_EINVAL: Invalid request parameters1537*/1538CMD_PG_GET_NAME = 3,153915401541/**1542* @brief Get the highest power domain id in the system. Not1543* all IDs between 0 and max_id are valid IDs.1544*1545* mrq_response:err is1546* 0: Success1547* -#BPMP_EINVAL: Invalid request parameters1548*/1549CMD_PG_GET_MAX_ID = 4,1550};15511552#define MRQ_PG_NAME_MAXLEN 4015531554enum pg_states {1555/** @brief Power domain is OFF */1556PG_STATE_OFF = 0,1557/** @brief Power domain is ON */1558PG_STATE_ON = 1,1559/**1560* @brief a legacy state where power domain and the clock1561* associated to the domain are ON.1562* This state is only supported in T186, and the use of it is1563* deprecated.1564*/1565PG_STATE_RUNNING = 2,1566};15671568struct cmd_pg_query_abi_request {1569/** @ref mrq_pg_cmd */1570uint32_t type;1571} BPMP_ABI_PACKED;15721573struct cmd_pg_set_state_request {1574/** @ref pg_states */1575uint32_t state;1576} BPMP_ABI_PACKED;15771578/**1579* @brief Response data to #MRQ_PG sub command #CMD_PG_GET_STATE1580*/1581struct cmd_pg_get_state_response {1582/**1583* @brief The state of the power partition that has been1584* succesfuly requested by the master earlier using #MRQ_PG1585* command #CMD_PG_SET_STATE.1586*1587* The state may not reflect the physical state of the power1588* partition if there are some other masters requesting it to1589* be enabled.1590*1591* See @ref pg_states for possible values1592*/1593uint32_t state;1594} BPMP_ABI_PACKED;15951596struct cmd_pg_get_name_response {1597uint8_t name[MRQ_PG_NAME_MAXLEN];1598} BPMP_ABI_PACKED;15991600struct cmd_pg_get_max_id_response {1601uint32_t max_id;1602} BPMP_ABI_PACKED;16031604/**1605* @brief Request with #MRQ_PG1606*1607* Used by the sender of an #MRQ_PG message to control power1608* partitions. The pg_request is split into several sub-commands. Some1609* sub-commands require no additional data. Others have a sub-command1610* specific payload1611*1612* |sub-command |payload |1613* |----------------------------|-----------------------|1614* |CMD_PG_QUERY_ABI | query_abi |1615* |CMD_PG_SET_STATE | set_state |1616* |CMD_PG_GET_STATE | - |1617* |CMD_PG_GET_NAME | - |1618* |CMD_PG_GET_MAX_ID | - |1619*1620*/1621struct mrq_pg_request {1622uint32_t cmd;1623uint32_t id;1624union {1625struct cmd_pg_query_abi_request query_abi;1626struct cmd_pg_set_state_request set_state;1627} BPMP_UNION_ANON;1628} BPMP_ABI_PACKED;16291630/**1631* @brief Response to MRQ_PG1632*1633* Each sub-command supported by @ref mrq_pg_request may return1634* sub-command-specific data. Some do and some do not as indicated in1635* the following table1636*1637* |sub-command |payload |1638* |----------------------------|-----------------------|1639* |CMD_PG_QUERY_ABI | - |1640* |CMD_PG_SET_STATE | - |1641* |CMD_PG_GET_STATE | get_state |1642* |CMD_PG_GET_NAME | get_name |1643* |CMD_PG_GET_MAX_ID | get_max_id |1644*/1645struct mrq_pg_response {1646union {1647struct cmd_pg_get_state_response get_state;1648struct cmd_pg_get_name_response get_name;1649struct cmd_pg_get_max_id_response get_max_id;1650} BPMP_UNION_ANON;1651} BPMP_ABI_PACKED;16521653/** @} Powergating */16541655/**1656* @ingroup MRQ_Codes1657* @def MRQ_THERMAL1658* @brief Interact with BPMP thermal framework1659*1660* * Platforms: T186, T1941661* * Initiators: Any1662* * Targets: Any1663* * Request Payload: TODO1664* * Response Payload: TODO1665*1666* @addtogroup Thermal1667*1668* The BPMP firmware includes a thermal framework. Drivers within the1669* bpmp firmware register with the framework to provide thermal1670* zones. Each thermal zone corresponds to an entity whose temperature1671* can be measured. The framework also has a notion of trip points. A1672* trip point consists of a thermal zone id, a temperature, and a1673* callback routine. The framework invokes the callback when the zone1674* hits the indicated temperature. The BPMP firmware uses this thermal1675* framework interally to implement various temperature-dependent1676* functions.1677*1678* Software on the CPU can use #MRQ_THERMAL (with payload @ref1679* mrq_thermal_host_to_bpmp_request) to interact with the BPMP thermal1680* framework. The CPU must It can query the number of supported zones,1681* query zone temperatures, and set trip points.1682*1683* When a trip point set by the CPU gets crossed, BPMP firmware issues1684* an IPC to the CPU having mrq_request::mrq = #MRQ_THERMAL and a1685* payload of @ref mrq_thermal_bpmp_to_host_request.1686* @{1687*/1688enum mrq_thermal_host_to_bpmp_cmd {1689/**1690* @brief Check whether the BPMP driver supports the specified1691* request type.1692*1693* Host needs to supply request parameters.1694*1695* mrq_response::err is 0 if the specified request is1696* supported and -#BPMP_ENODEV otherwise.1697*/1698CMD_THERMAL_QUERY_ABI = 0,16991700/**1701* @brief Get the current temperature of the specified zone.1702*1703* Host needs to supply request parameters.1704*1705* mrq_response::err is1706* * 0: Temperature query succeeded.1707* * -#BPMP_EINVAL: Invalid request parameters.1708* * -#BPMP_ENOENT: No driver registered for thermal zone..1709* * -#BPMP_EFAULT: Problem reading temperature measurement.1710*/1711CMD_THERMAL_GET_TEMP = 1,17121713/**1714* @brief Enable or disable and set the lower and upper1715* thermal limits for a thermal trip point. Each zone has1716* one trip point.1717*1718* Host needs to supply request parameters. Once the1719* temperature hits a trip point, the BPMP will send a message1720* to the CPU having MRQ=MRQ_THERMAL and1721* type=CMD_THERMAL_HOST_TRIP_REACHED1722*1723* mrq_response::err is1724* * 0: Trip successfully set.1725* * -#BPMP_EINVAL: Invalid request parameters.1726* * -#BPMP_ENOENT: No driver registered for thermal zone.1727* * -#BPMP_EFAULT: Problem setting trip point.1728*/1729CMD_THERMAL_SET_TRIP = 2,17301731/**1732* @brief Get the number of supported thermal zones.1733*1734* No request parameters required.1735*1736* mrq_response::err is always 0, indicating success.1737*/1738CMD_THERMAL_GET_NUM_ZONES = 3,17391740/**1741* @brief Get the thermtrip of the specified zone.1742*1743* Host needs to supply request parameters.1744*1745* mrq_response::err is1746* * 0: Valid zone information returned.1747* * -#BPMP_EINVAL: Invalid request parameters.1748* * -#BPMP_ENOENT: No driver registered for thermal zone.1749* * -#BPMP_ERANGE if thermtrip is invalid or disabled.1750* * -#BPMP_EFAULT: Problem reading zone information.1751*/1752CMD_THERMAL_GET_THERMTRIP = 4,17531754/** @brief: number of supported host-to-bpmp commands. May1755* increase in future1756*/1757CMD_THERMAL_HOST_TO_BPMP_NUM1758};17591760enum mrq_thermal_bpmp_to_host_cmd {1761/**1762* @brief Indication that the temperature for a zone has1763* exceeded the range indicated in the thermal trip point1764* for the zone.1765*1766* BPMP needs to supply request parameters. Host only needs to1767* acknowledge.1768*/1769CMD_THERMAL_HOST_TRIP_REACHED = 100,17701771/** @brief: number of supported bpmp-to-host commands. May1772* increase in future1773*/1774CMD_THERMAL_BPMP_TO_HOST_NUM1775};17761777/*1778* Host->BPMP request data for request type CMD_THERMAL_QUERY_ABI1779*1780* zone: Request type for which to check existence.1781*/1782struct cmd_thermal_query_abi_request {1783uint32_t type;1784} BPMP_ABI_PACKED;17851786/*1787* Host->BPMP request data for request type CMD_THERMAL_GET_TEMP1788*1789* zone: Number of thermal zone.1790*/1791struct cmd_thermal_get_temp_request {1792uint32_t zone;1793} BPMP_ABI_PACKED;17941795/*1796* BPMP->Host reply data for request CMD_THERMAL_GET_TEMP1797*1798* error: 0 if request succeeded.1799* -BPMP_EINVAL if request parameters were invalid.1800* -BPMP_ENOENT if no driver was registered for the specified thermal zone.1801* -BPMP_EFAULT for other thermal zone driver errors.1802* temp: Current temperature in millicelsius.1803*/1804struct cmd_thermal_get_temp_response {1805int32_t temp;1806} BPMP_ABI_PACKED;18071808/*1809* Host->BPMP request data for request type CMD_THERMAL_SET_TRIP1810*1811* zone: Number of thermal zone.1812* low: Temperature of lower trip point in millicelsius1813* high: Temperature of upper trip point in millicelsius1814* enabled: 1 to enable trip point, 0 to disable trip point1815*/1816struct cmd_thermal_set_trip_request {1817uint32_t zone;1818int32_t low;1819int32_t high;1820uint32_t enabled;1821} BPMP_ABI_PACKED;18221823/*1824* BPMP->Host request data for request type CMD_THERMAL_HOST_TRIP_REACHED1825*1826* zone: Number of thermal zone where trip point was reached.1827*/1828struct cmd_thermal_host_trip_reached_request {1829uint32_t zone;1830} BPMP_ABI_PACKED;18311832/*1833* BPMP->Host reply data for request type CMD_THERMAL_GET_NUM_ZONES1834*1835* num: Number of supported thermal zones. The thermal zones are indexed1836* starting from zero.1837*/1838struct cmd_thermal_get_num_zones_response {1839uint32_t num;1840} BPMP_ABI_PACKED;18411842/*1843* Host->BPMP request data for request type CMD_THERMAL_GET_THERMTRIP1844*1845* zone: Number of thermal zone.1846*/1847struct cmd_thermal_get_thermtrip_request {1848uint32_t zone;1849} BPMP_ABI_PACKED;18501851/*1852* BPMP->Host reply data for request CMD_THERMAL_GET_THERMTRIP1853*1854* thermtrip: HW shutdown temperature in millicelsius.1855*/1856struct cmd_thermal_get_thermtrip_response {1857int32_t thermtrip;1858} BPMP_ABI_PACKED;18591860/*1861* Host->BPMP request data.1862*1863* Reply type is union mrq_thermal_bpmp_to_host_response.1864*1865* type: Type of request. Values listed in enum mrq_thermal_type.1866* data: Request type specific parameters.1867*/1868struct mrq_thermal_host_to_bpmp_request {1869uint32_t type;1870union {1871struct cmd_thermal_query_abi_request query_abi;1872struct cmd_thermal_get_temp_request get_temp;1873struct cmd_thermal_set_trip_request set_trip;1874struct cmd_thermal_get_thermtrip_request get_thermtrip;1875} BPMP_UNION_ANON;1876} BPMP_ABI_PACKED;18771878/*1879* BPMP->Host request data.1880*1881* type: Type of request. Values listed in enum mrq_thermal_type.1882* data: Request type specific parameters.1883*/1884struct mrq_thermal_bpmp_to_host_request {1885uint32_t type;1886union {1887struct cmd_thermal_host_trip_reached_request host_trip_reached;1888} BPMP_UNION_ANON;1889} BPMP_ABI_PACKED;18901891/*1892* Data in reply to a Host->BPMP request.1893*/1894union mrq_thermal_bpmp_to_host_response {1895struct cmd_thermal_get_temp_response get_temp;1896struct cmd_thermal_get_thermtrip_response get_thermtrip;1897struct cmd_thermal_get_num_zones_response get_num_zones;1898} BPMP_ABI_PACKED;18991900/** @} Thermal */19011902/**1903* @ingroup MRQ_Codes1904* @def MRQ_OC_STATUS1905* @brief Query over current status1906*1907* * Platforms: T2341908* @cond bpmp_t2341909* * Initiators: CCPLEX1910* * Targets: BPMP1911* * Request Payload: N/A1912* * Response Payload: @ref mrq_oc_status_response1913*1914* @addtogroup OC_status1915* @{1916*/19171918#define OC_STATUS_MAX_SIZE 24U19191920/*1921* @brief Response to #MRQ_OC_STATUS1922*1923* throt_en: Value for each OC alarm where zero signifies throttle is1924* disabled, and non-zero throttle is enabled.1925* event_cnt: Total number of OC events for each OC alarm.1926*1927* mrq_response::err is 0 if the operation was successful and1928* -#BPMP_ENODEV otherwise.1929*/1930struct mrq_oc_status_response {1931uint8_t throt_en[OC_STATUS_MAX_SIZE];1932uint32_t event_cnt[OC_STATUS_MAX_SIZE];1933} BPMP_ABI_PACKED;19341935/** @} OC_status */1936/** @endcond bpmp_t234 */19371938/**1939* @ingroup MRQ_Codes1940* @def MRQ_CPU_VHINT1941* @brief Query CPU voltage hint data1942*1943* * Platforms: T1861944* @cond bpmp_t1861945* * Initiators: CCPLEX1946* * Targets: BPMP1947* * Request Payload: @ref mrq_cpu_vhint_request1948* * Response Payload: N/A1949*1950* @addtogroup Vhint1951* @{1952*/19531954/**1955* @brief Request with #MRQ_CPU_VHINT1956*1957* Used by #MRQ_CPU_VHINT call by CCPLEX to retrieve voltage hint data1958* from BPMP to memory space pointed by #addr. CCPLEX is responsible1959* to allocate sizeof(cpu_vhint_data) sized block of memory and1960* appropriately map it for BPMP before sending the request.1961*/1962struct mrq_cpu_vhint_request {1963/** @brief IOVA address for the #cpu_vhint_data */1964uint32_t addr;1965/** @brief ID of the cluster whose data is requested */1966uint32_t cluster_id;1967} BPMP_ABI_PACKED;19681969/**1970* @brief Description of the CPU v/f relation1971*1972* Used by #MRQ_CPU_VHINT call to carry data pointed by1973* #mrq_cpu_vhint_request::addr1974*/1975struct cpu_vhint_data {1976uint32_t ref_clk_hz; /**< reference frequency in Hz */1977uint16_t pdiv; /**< post divider value */1978uint16_t mdiv; /**< input divider value */1979uint16_t ndiv_max; /**< fMAX expressed with max NDIV value */1980/** table of ndiv values as a function of vINDEX (voltage index) */1981uint16_t ndiv[80];1982/** minimum allowed NDIV value */1983uint16_t ndiv_min;1984/** minimum allowed voltage hint value (as in vINDEX) */1985uint16_t vfloor;1986/** maximum allowed voltage hint value (as in vINDEX) */1987uint16_t vceil;1988/** post-multiplier for vindex value */1989uint16_t vindex_mult;1990/** post-divider for vindex value */1991uint16_t vindex_div;1992/** reserved for future use */1993uint16_t reserved[328];1994} BPMP_ABI_PACKED;19951996/** @} Vhint */1997/** @endcond bpmp_t186 */19981999/**2000* @ingroup MRQ_Codes2001* @def MRQ_ABI_RATCHET2002* @brief ABI ratchet value query2003*2004* * Platforms: T186, T1942005* * Initiators: Any2006* * Targets: BPMP2007* * Request Payload: @ref mrq_abi_ratchet_request2008* * Response Payload: @ref mrq_abi_ratchet_response2009* @addtogroup ABI_info2010* @{2011*/20122013/**2014* @brief An ABI compatibility mechanism2015*2016* BPMP_ABI_RATCHET_VALUE may increase for various reasons in a future2017* revision of this header file.2018* 1. That future revision deprecates some MRQ2019* 2. That future revision introduces a breaking change to an existing2020* MRQ or2021* 3. A bug is discovered in an existing implementation of the BPMP-FW2022* (or possibly one of its clients) which warrants deprecating that2023* implementation.2024*/2025#define BPMP_ABI_RATCHET_VALUE 320262027/**2028* @brief Request with #MRQ_ABI_RATCHET.2029*2030* #ratchet should be #BPMP_ABI_RATCHET_VALUE from the ABI header2031* against which the requester was compiled.2032*2033* If ratchet is less than BPMP's #BPMP_ABI_RATCHET_VALUE, BPMP may2034* reply with mrq_response::err = -#BPMP_ERANGE to indicate that2035* BPMP-FW cannot interoperate correctly with the requester. Requester2036* should cease further communication with BPMP.2037*2038* Otherwise, err shall be 0.2039*/2040struct mrq_abi_ratchet_request {2041/** @brief Requester's ratchet value */2042uint16_t ratchet;2043};20442045/**2046* @brief Response to #MRQ_ABI_RATCHET2047*2048* #ratchet shall be #BPMP_ABI_RATCHET_VALUE from the ABI header2049* against which BPMP firwmare was compiled.2050*2051* If #ratchet is less than the requester's #BPMP_ABI_RATCHET_VALUE,2052* the requster must either interoperate with BPMP according to an ABI2053* header version with BPMP_ABI_RATCHET_VALUE = ratchet or cease2054* communication with BPMP.2055*2056* If mrq_response::err is 0 and ratchet is greater than or equal to the2057* requester's BPMP_ABI_RATCHET_VALUE, the requester should continue2058* normal operation.2059*/2060struct mrq_abi_ratchet_response {2061/** @brief BPMP's ratchet value */2062uint16_t ratchet;2063};20642065/** @} ABI_info */20662067/**2068* @ingroup MRQ_Codes2069* @def MRQ_EMC_DVFS_LATENCY2070* @brief Query frequency dependent EMC DVFS latency2071*2072* * Platforms: T186, T194, T2342073* * Initiators: CCPLEX2074* * Targets: BPMP2075* * Request Payload: N/A2076* * Response Payload: @ref mrq_emc_dvfs_latency_response2077* @addtogroup EMC2078* @{2079*/20802081/**2082* @brief Used by @ref mrq_emc_dvfs_latency_response2083*/2084struct emc_dvfs_latency {2085/** @brief EMC DVFS node frequency in kHz */2086uint32_t freq;2087/** @brief EMC DVFS latency in nanoseconds */2088uint32_t latency;2089} BPMP_ABI_PACKED;20902091#define EMC_DVFS_LATENCY_MAX_SIZE 142092/**2093* @brief Response to #MRQ_EMC_DVFS_LATENCY2094*/2095struct mrq_emc_dvfs_latency_response {2096/** @brief The number valid entries in #pairs */2097uint32_t num_pairs;2098/** @brief EMC DVFS node <frequency, latency> information */2099struct emc_dvfs_latency pairs[EMC_DVFS_LATENCY_MAX_SIZE];2100} BPMP_ABI_PACKED;21012102/** @} EMC */21032104/**2105* @ingroup MRQ_Codes2106* @def MRQ_EMC_DVFS_EMCHUB2107* @brief Query EMC HUB frequencies2108*2109* * Platforms: T234 onwards2110* @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)2111* * Initiators: CCPLEX2112* * Targets: BPMP2113* * Request Payload: N/A2114* * Response Payload: @ref mrq_emc_dvfs_emchub_response2115* @addtogroup EMC2116* @{2117*/21182119/**2120* @brief Used by @ref mrq_emc_dvfs_emchub_response2121*/2122struct emc_dvfs_emchub {2123/** @brief EMC DVFS node frequency in kHz */2124uint32_t freq;2125/** @brief EMC HUB frequency in kHz */2126uint32_t hub_freq;2127} BPMP_ABI_PACKED;21282129#define EMC_DVFS_EMCHUB_MAX_SIZE EMC_DVFS_LATENCY_MAX_SIZE2130/**2131* @brief Response to #MRQ_EMC_DVFS_EMCHUB2132*/2133struct mrq_emc_dvfs_emchub_response {2134/** @brief The number valid entries in #pairs */2135uint32_t num_pairs;2136/** @brief EMC DVFS node <frequency, hub frequency> information */2137struct emc_dvfs_emchub pairs[EMC_DVFS_EMCHUB_MAX_SIZE];2138} BPMP_ABI_PACKED;21392140/** @} EMC */2141/** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */21422143/**2144* @ingroup MRQ_Codes2145* @def MRQ_EMC_DISP_RFL2146* @brief Set EMC display RFL handshake mode of operations2147*2148* * Platforms: T234 onwards2149* @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)2150* * Initiators: CCPLEX2151* * Targets: BPMP2152* * Request Payload: @ref mrq_emc_disp_rfl_request2153* * Response Payload: N/A2154*2155* @addtogroup EMC2156* @{2157*/21582159enum mrq_emc_disp_rfl_mode {2160/** @brief EMC display RFL handshake disabled */2161EMC_DISP_RFL_MODE_DISABLED = 0,2162/** @brief EMC display RFL handshake enabled */2163EMC_DISP_RFL_MODE_ENABLED = 1,2164};21652166/**2167* @ingroup EMC2168* @brief Request with #MRQ_EMC_DISP_RFL2169*2170* Used by the sender of an #MRQ_EMC_DISP_RFL message to2171* request the mode of EMC display RFL handshake.2172*2173* mrq_response::err is2174* * 0: RFL mode is set successfully2175* * -#BPMP_EINVAL: invalid mode requested2176* * -#BPMP_ENOSYS: RFL handshake is not supported2177* * -#BPMP_EACCES: Permission denied2178* * -#BPMP_ENODEV: if disp rfl mrq is not supported by BPMP-FW2179*/2180struct mrq_emc_disp_rfl_request {2181/** @brief EMC display RFL mode (@ref mrq_emc_disp_rfl_mode) */2182uint32_t mode;2183} BPMP_ABI_PACKED;21842185/** @} EMC */2186/** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */21872188/**2189* @ingroup MRQ_Codes2190* @def MRQ_BWMGR2191* @brief bwmgr requests2192*2193* * Platforms: T234 onwards2194* @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)2195* * Initiators: CCPLEX2196* * Targets: BPMP2197* * Request Payload: @ref mrq_bwmgr_request2198* * Response Payload: @ref mrq_bwmgr_response2199*2200* @addtogroup BWMGR2201*2202* @{2203*/22042205enum mrq_bwmgr_cmd {2206/**2207* @brief Check whether the BPMP driver supports the specified2208* request type2209*2210* mrq_response::err is 0 if the specified request is2211* supported and -#BPMP_ENODEV otherwise.2212*/2213CMD_BWMGR_QUERY_ABI = 0,22142215/**2216* @brief Determine dram rate to satisfy iso/niso bw requests2217*2218* mrq_response::err is2219* * 0: calc_rate succeeded.2220* * -#BPMP_EINVAL: Invalid request parameters.2221* * -#BPMP_ENOTSUP: Requested bw is not available.2222*/2223CMD_BWMGR_CALC_RATE = 12224};22252226/*2227* request data for request type CMD_BWMGR_QUERY_ABI2228*2229* type: Request type for which to check existence.2230*/2231struct cmd_bwmgr_query_abi_request {2232uint32_t type;2233} BPMP_ABI_PACKED;22342235/**2236* @brief Used by @ref cmd_bwmgr_calc_rate_request2237*/2238struct iso_req {2239/* @brief bwmgr client ID @ref bpmp_bwmgr_ids */2240uint32_t id;2241/* @brief bw in kBps requested by client */2242uint32_t iso_bw;2243} BPMP_ABI_PACKED;22442245#define MAX_ISO_CLIENTS 13U2246/*2247* request data for request type CMD_BWMGR_CALC_RATE2248*/2249struct cmd_bwmgr_calc_rate_request {2250/* @brief total bw in kBps requested by all niso clients */2251uint32_t sum_niso_bw;2252/* @brief The number of iso clients */2253uint32_t num_iso_clients;2254/* @brief iso_req <id, iso_bw> information */2255struct iso_req isobw_reqs[MAX_ISO_CLIENTS];2256} BPMP_ABI_PACKED;22572258/*2259* response data for request type CMD_BWMGR_CALC_RATE2260*2261* iso_rate_min: min dram data clk rate in kHz to satisfy all iso bw reqs2262* total_rate_min: min dram data clk rate in kHz to satisfy all bw reqs2263*/2264struct cmd_bwmgr_calc_rate_response {2265uint32_t iso_rate_min;2266uint32_t total_rate_min;2267} BPMP_ABI_PACKED;22682269/*2270* @brief Request with #MRQ_BWMGR2271*2272*2273* |sub-command |payload |2274* |----------------------------|------------------------------|2275* |CMD_BWMGR_QUERY_ABI | cmd_bwmgr_query_abi_request |2276* |CMD_BWMGR_CALC_RATE | cmd_bwmgr_calc_rate_request |2277*2278*/2279struct mrq_bwmgr_request {2280uint32_t cmd;2281union {2282struct cmd_bwmgr_query_abi_request query_abi;2283struct cmd_bwmgr_calc_rate_request bwmgr_rate_req;2284} BPMP_UNION_ANON;2285} BPMP_ABI_PACKED;22862287/*2288* @brief Response to MRQ_BWMGR2289*2290* |sub-command |payload |2291* |----------------------------|------------------------------|2292* |CMD_BWMGR_CALC_RATE | cmd_bwmgr_calc_rate_response |2293*/2294struct mrq_bwmgr_response {2295union {2296struct cmd_bwmgr_calc_rate_response bwmgr_rate_resp;2297} BPMP_UNION_ANON;2298} BPMP_ABI_PACKED;22992300/** @} BWMGR */2301/** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */23022303/**2304* @ingroup MRQ_Codes2305* @def MRQ_BWMGR_INT2306* @brief bpmp-integrated bwmgr requests2307*2308* * Platforms: T234 onwards2309* @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)2310* * Initiators: CCPLEX2311* * Targets: BPMP2312* * Request Payload: @ref mrq_bwmgr_int_request2313* * Response Payload: @ref mrq_bwmgr_int_response2314*2315* @addtogroup BWMGR_INT2316* @{2317*/23182319enum mrq_bwmgr_int_cmd {2320/**2321* @brief Check whether the BPMP-FW supports the specified2322* request type2323*2324* mrq_response::err is 0 if the specified request is2325* supported and -#BPMP_ENODEV otherwise.2326*/2327CMD_BWMGR_INT_QUERY_ABI = 1,23282329/**2330* @brief Determine and set dram rate to satisfy iso/niso bw request2331*2332* mrq_response::err is2333* * 0: request succeeded.2334* * -#BPMP_EINVAL: Invalid request parameters.2335* set_frequency in @ref cmd_bwmgr_int_calc_and_set_response2336* will not be set.2337* * -#BPMP_ENOTSUP: Requested bw is not available.2338* set_frequency in @ref cmd_bwmgr_int_calc_and_set_response2339* will be current dram-clk rate.2340*/2341CMD_BWMGR_INT_CALC_AND_SET = 2,23422343/**2344* @brief Set a max DRAM frequency for the bandwidth-manager2345*2346* mrq_response::err is2347* * 0: request succeeded.2348* * -#BPMP_ENOTSUP: Requested cap frequency is not possible.2349*/2350CMD_BWMGR_INT_CAP_SET = 32351};23522353/*2354* request structure for request type CMD_BWMGR_QUERY_ABI2355*2356* type: Request type for which to check existence.2357*/2358struct cmd_bwmgr_int_query_abi_request {2359/* @brief request type determined by @ref mrq_bwmgr_int_cmd */2360uint32_t type;2361} BPMP_ABI_PACKED;23622363/**2364* @defgroup bwmgr_int_unit_type BWMGR_INT floor unit-types2365* @addtogroup bwmgr_int_unit_type2366* @{2367*/2368/** @brief kilobytes per second unit-type */2369#define BWMGR_INT_UNIT_KBPS 0U2370/** @brief kilohertz unit-type */2371#define BWMGR_INT_UNIT_KHZ 1U23722373/** @} bwmgr_int_unit_type */23742375/*2376* request data for request type CMD_BWMGR_INT_CALC_AND_SET2377*/2378struct cmd_bwmgr_int_calc_and_set_request {2379/* @brief bwmgr client ID @ref bpmp_bwmgr_ids */2380uint32_t client_id;2381/* @brief average niso bw usage in kBps requested by client. */2382uint32_t niso_bw;2383/*2384* @brief average iso bw usage in kBps requested by client.2385* Value is ignored if client is niso. Determined by client_id.2386*/2387uint32_t iso_bw;2388/*2389* @brief memory clock floor requested by client.2390* Unit determined by floor_unit.2391*/2392uint32_t mc_floor;2393/*2394* @brief toggle to determine the unit-type of floor value.2395* See @ref bwmgr_int_unit_type definitions for unit-type mappings.2396*/2397uint8_t floor_unit;2398} BPMP_ABI_PACKED;23992400struct cmd_bwmgr_int_cap_set_request {2401/* @brief requested cap frequency in Hz. */2402uint64_t rate;2403} BPMP_ABI_PACKED;24042405/*2406* response data for request type CMD_BWMGR_CALC_AND_SET2407*/2408struct cmd_bwmgr_int_calc_and_set_response {2409/* @brief current set memory clock frequency in Hz */2410uint64_t rate;2411} BPMP_ABI_PACKED;24122413/*2414* @brief Request with #MRQ_BWMGR_INT2415*2416*2417* |sub-command |payload |2418* |----------------------------|-----------------------------------|2419* |CMD_BWMGR_INT_QUERY_ABI | cmd_bwmgr_int_query_abi_request |2420* |CMD_BWMGR_INT_CALC_AND_SET | cmd_bwmgr_int_calc_and_set_request|2421* |CMD_BWMGR_INT_CAP_SET | cmd_bwmgr_int_cap_set_request |2422*2423*/2424struct mrq_bwmgr_int_request {2425uint32_t cmd;2426union {2427struct cmd_bwmgr_int_query_abi_request query_abi;2428struct cmd_bwmgr_int_calc_and_set_request bwmgr_calc_set_req;2429struct cmd_bwmgr_int_cap_set_request bwmgr_cap_set_req;2430} BPMP_UNION_ANON;2431} BPMP_ABI_PACKED;24322433/*2434* @brief Response to MRQ_BWMGR_INT2435*2436* |sub-command |payload |2437* |----------------------------|---------------------------------------|2438* |CMD_BWMGR_INT_CALC_AND_SET | cmd_bwmgr_int_calc_and_set_response |2439*/2440struct mrq_bwmgr_int_response {2441union {2442struct cmd_bwmgr_int_calc_and_set_response bwmgr_calc_set_resp;2443} BPMP_UNION_ANON;2444} BPMP_ABI_PACKED;24452446/** @} BWMGR_INT */2447/** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */24482449/**2450* @ingroup MRQ_Codes2451* @def MRQ_ISO_CLIENT2452* @brief ISO client requests2453*2454* * Platforms: T234 onwards2455* @cond (bpmp_t234 || bpmp_t239 || bpmp_th500)2456* * Initiators: CCPLEX2457* * Targets: BPMP2458* * Request Payload: @ref mrq_iso_client_request2459* * Response Payload: @ref mrq_iso_client_response2460*2461* @addtogroup ISO_CLIENT2462* @{2463*/24642465enum mrq_iso_client_cmd {2466/**2467* @brief Check whether the BPMP driver supports the specified2468* request type2469*2470* mrq_response::err is 0 if the specified request is2471* supported and -#BPMP_ENODEV otherwise.2472*/2473CMD_ISO_CLIENT_QUERY_ABI = 0,24742475/*2476* @brief check for legal LA for the iso client. Without programming2477* LA MC registers, calculate and ensure that legal LA is possible for2478* iso bw requested by the ISO client.2479*2480* mrq_response::err is2481* * 0: check la succeeded.2482* * -#BPMP_EINVAL: Invalid request parameters.2483* * -#BPMP_EFAULT: Legal LA is not possible for client requested iso_bw2484*/2485CMD_ISO_CLIENT_CALCULATE_LA = 1,24862487/*2488* @brief set LA for the iso client. Calculate and program the LA/PTSA2489* MC registers corresponding to the client making bw request2490*2491* mrq_response::err is2492* * 0: set la succeeded.2493* * -#BPMP_EINVAL: Invalid request parameters.2494* * -#BPMP_EFAULT: Failed to calculate or program MC registers.2495*/2496CMD_ISO_CLIENT_SET_LA = 2,24972498/*2499* @brief Get max possible bw for iso client2500*2501* mrq_response::err is2502* * 0: get_max_bw succeeded.2503* * -#BPMP_EINVAL: Invalid request parameters.2504*/2505CMD_ISO_CLIENT_GET_MAX_BW = 32506};25072508/*2509* request data for request type CMD_ISO_CLIENT_QUERY_ABI2510*2511* type: Request type for which to check existence.2512*/2513struct cmd_iso_client_query_abi_request {2514uint32_t type;2515} BPMP_ABI_PACKED;25162517/*2518* request data for request type CMD_ISO_CLIENT_CALCULATE_LA2519*2520* id: client ID in @ref bpmp_bwmgr_ids2521* bw: bw requested in kBps by client ID.2522* init_bw_floor: initial dram_bw_floor in kBps passed by client ID.2523* ISO client will perform mempool allocation and DVFS buffering based2524* on this dram_bw_floor.2525*/2526struct cmd_iso_client_calculate_la_request {2527uint32_t id;2528uint32_t bw;2529uint32_t init_bw_floor;2530} BPMP_ABI_PACKED;25312532/*2533* request data for request type CMD_ISO_CLIENT_SET_LA2534*2535* id: client ID in @ref bpmp_bwmgr_ids2536* bw: bw requested in kBps by client ID.2537* final_bw_floor: final dram_bw_floor in kBps.2538* Sometimes the initial dram_bw_floor passed by ISO client may need to be2539* updated by considering higher dram freq's. This is the final dram_bw_floor2540* used to calculate and program MC registers.2541*/2542struct cmd_iso_client_set_la_request {2543uint32_t id;2544uint32_t bw;2545uint32_t final_bw_floor;2546} BPMP_ABI_PACKED;25472548/*2549* request data for request type CMD_ISO_CLIENT_GET_MAX_BW2550*2551* id: client ID in @ref bpmp_bwmgr_ids2552*/2553struct cmd_iso_client_get_max_bw_request {2554uint32_t id;2555} BPMP_ABI_PACKED;25562557/*2558* response data for request type CMD_ISO_CLIENT_CALCULATE_LA2559*2560* la_rate_floor: minimum dram_rate_floor in kHz at which a legal la is possible2561* iso_client_only_rate: Minimum dram freq in kHz required to satisfy this clients2562* iso bw request, assuming all other iso clients are inactive2563*/2564struct cmd_iso_client_calculate_la_response {2565uint32_t la_rate_floor;2566uint32_t iso_client_only_rate;2567} BPMP_ABI_PACKED;25682569/**2570* @brief Used by @ref cmd_iso_client_get_max_bw_response2571*/2572struct iso_max_bw {2573/* @brief dram frequency in kHz */2574uint32_t freq;2575/* @brief max possible iso-bw in kBps */2576uint32_t iso_bw;2577} BPMP_ABI_PACKED;25782579#define ISO_MAX_BW_MAX_SIZE 14U2580/*2581* response data for request type CMD_ISO_CLIENT_GET_MAX_BW2582*/2583struct cmd_iso_client_get_max_bw_response {2584/* @brief The number valid entries in iso_max_bw pairs */2585uint32_t num_pairs;2586/* @brief max ISOBW <dram freq, max bw> information */2587struct iso_max_bw pairs[ISO_MAX_BW_MAX_SIZE];2588} BPMP_ABI_PACKED;25892590/**2591* @brief Request with #MRQ_ISO_CLIENT2592*2593* Used by the sender of an #MRQ_ISO_CLIENT message.2594*2595* |sub-command |payload |2596* |------------------------------------ |----------------------------------------|2597* |CMD_ISO_CLIENT_QUERY_ABI |cmd_iso_client_query_abi_request |2598* |CMD_ISO_CLIENT_CALCULATE_LA |cmd_iso_client_calculate_la_request |2599* |CMD_ISO_CLIENT_SET_LA |cmd_iso_client_set_la_request |2600* |CMD_ISO_CLIENT_GET_MAX_BW |cmd_iso_client_get_max_bw_request |2601*2602*/26032604struct mrq_iso_client_request {2605/* Type of request. Values listed in enum mrq_iso_client_cmd */2606uint32_t cmd;2607union {2608struct cmd_iso_client_query_abi_request query_abi;2609struct cmd_iso_client_calculate_la_request calculate_la_req;2610struct cmd_iso_client_set_la_request set_la_req;2611struct cmd_iso_client_get_max_bw_request max_isobw_req;2612} BPMP_UNION_ANON;2613} BPMP_ABI_PACKED;26142615/**2616* @brief Response to MRQ_ISO_CLIENT2617*2618* Each sub-command supported by @ref mrq_iso_client_request may return2619* sub-command-specific data. Some do and some do not as indicated in2620* the following table2621*2622* |sub-command |payload |2623* |---------------------------- |------------------------------------|2624* |CMD_ISO_CLIENT_CALCULATE_LA |cmd_iso_client_calculate_la_response|2625* |CMD_ISO_CLIENT_SET_LA |N/A |2626* |CMD_ISO_CLIENT_GET_MAX_BW |cmd_iso_client_get_max_bw_response |2627*2628*/26292630struct mrq_iso_client_response {2631union {2632struct cmd_iso_client_calculate_la_response calculate_la_resp;2633struct cmd_iso_client_get_max_bw_response max_isobw_resp;2634} BPMP_UNION_ANON;2635} BPMP_ABI_PACKED;26362637/** @} ISO_CLIENT */2638/** @endcond (bpmp_t234 || bpmp_t239 || bpmp_th500) */26392640/**2641* @ingroup MRQ_Codes2642* @def MRQ_CPU_NDIV_LIMITS2643* @brief CPU freq. limits in ndiv2644*2645* * Platforms: T194 onwards2646* @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)2647* * Initiators: CCPLEX2648* * Targets: BPMP2649* * Request Payload: @ref mrq_cpu_ndiv_limits_request2650* * Response Payload: @ref mrq_cpu_ndiv_limits_response2651* @addtogroup CPU2652* @{2653*/26542655/**2656* @brief Request for ndiv limits of a cluster2657*/2658struct mrq_cpu_ndiv_limits_request {2659/** @brief Enum cluster_id */2660uint32_t cluster_id;2661} BPMP_ABI_PACKED;26622663/**2664* @brief Response to #MRQ_CPU_NDIV_LIMITS2665*/2666struct mrq_cpu_ndiv_limits_response {2667/** @brief Reference frequency in Hz */2668uint32_t ref_clk_hz;2669/** @brief Post divider value */2670uint16_t pdiv;2671/** @brief Input divider value */2672uint16_t mdiv;2673/** @brief FMAX expressed with max NDIV value */2674uint16_t ndiv_max;2675/** @brief Minimum allowed NDIV value */2676uint16_t ndiv_min;2677} BPMP_ABI_PACKED;26782679/** @} CPU */2680/** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500) */26812682/**2683* @ingroup MRQ_Codes2684* @def MRQ_CPU_AUTO_CC32685* @brief Query CPU cluster auto-CC3 configuration2686*2687* * Platforms: T1942688* @cond bpmp_t1942689* * Initiators: CCPLEX2690* * Targets: BPMP2691* * Request Payload: @ref mrq_cpu_auto_cc3_request2692* * Response Payload: @ref mrq_cpu_auto_cc3_response2693* @addtogroup CC32694*2695* Queries from BPMP auto-CC3 configuration (allowed/not allowed) for a2696* specified cluster. CCPLEX s/w uses this information to override its own2697* device tree auto-CC3 settings, so that BPMP device tree is a single source of2698* auto-CC3 platform configuration.2699*2700* @{2701*/27022703/**2704* @brief Request for auto-CC3 configuration of a cluster2705*/2706struct mrq_cpu_auto_cc3_request {2707/** @brief Enum cluster_id (logical cluster id, known to CCPLEX s/w) */2708uint32_t cluster_id;2709} BPMP_ABI_PACKED;27102711/**2712* @brief Response to #MRQ_CPU_AUTO_CC32713*/2714struct mrq_cpu_auto_cc3_response {2715/**2716* @brief auto-CC3 configuration2717*2718* - bits[31..10] reserved.2719* - bits[9..1] cc3 ndiv2720* - bit [0] if "1" auto-CC3 is allowed, if "0" auto-CC3 is not allowed2721*/2722uint32_t auto_cc3_config;2723} BPMP_ABI_PACKED;27242725/** @} CC3 */2726/** @endcond bpmp_t194 */27272728/**2729* @ingroup MRQ_Codes2730* @def MRQ_RINGBUF_CONSOLE2731* @brief A ring buffer debug console for BPMP2732* @addtogroup RingbufConsole2733*2734* The ring buffer debug console aims to be a substitute for the UART debug2735* console. The debug console is implemented with two ring buffers in the2736* BPMP-FW, the RX (receive) and TX (transmit) buffers. Characters can be read2737* and written to the buffers by the host via the MRQ interface.2738*2739* @{2740*/27412742/**2743* @brief Maximum number of bytes transferred in a single write command to the2744* BPMP2745*2746* This is determined by the number of free bytes in the message struct,2747* rounded down to a multiple of four.2748*/2749#define MRQ_RINGBUF_CONSOLE_MAX_WRITE_LEN 11227502751/**2752* @brief Maximum number of bytes transferred in a single read command to the2753* BPMP2754*2755* This is determined by the number of free bytes in the message struct,2756* rounded down to a multiple of four.2757*/2758#define MRQ_RINGBUF_CONSOLE_MAX_READ_LEN 11627592760enum mrq_ringbuf_console_host_to_bpmp_cmd {2761/**2762* @brief Check whether the BPMP driver supports the specified request2763* type2764*2765* mrq_response::err is 0 if the specified request is supported and2766* -#BPMP_ENODEV otherwise2767*/2768CMD_RINGBUF_CONSOLE_QUERY_ABI = 0,2769/**2770* @brief Perform a read operation on the BPMP TX buffer2771*2772* mrq_response::err is 02773*/2774CMD_RINGBUF_CONSOLE_READ = 1,2775/**2776* @brief Perform a write operation on the BPMP RX buffer2777*2778* mrq_response::err is 0 if the operation was successful and2779* -#BPMP_ENODEV otherwise2780*/2781CMD_RINGBUF_CONSOLE_WRITE = 2,2782/**2783* @brief Get the length of the buffer and the physical addresses of2784* the buffer data and the head and tail counters2785*2786* mrq_response::err is 0 if the operation was successful and2787* -#BPMP_ENODEV otherwise2788*/2789CMD_RINGBUF_CONSOLE_GET_FIFO = 3,2790};27912792/**2793* @ingroup RingbufConsole2794* @brief Host->BPMP request data for request type2795* #CMD_RINGBUF_CONSOLE_QUERY_ABI2796*/2797struct cmd_ringbuf_console_query_abi_req {2798/** @brief Command identifier to be queried */2799uint32_t cmd;2800} BPMP_ABI_PACKED;28012802/** @private */2803struct cmd_ringbuf_console_query_abi_resp {2804BPMP_ABI_EMPTY2805} BPMP_ABI_PACKED;28062807/**2808* @ingroup RingbufConsole2809* @brief Host->BPMP request data for request type #CMD_RINGBUF_CONSOLE_READ2810*/2811struct cmd_ringbuf_console_read_req {2812/**2813* @brief Number of bytes requested to be read from the BPMP TX buffer2814*/2815uint8_t len;2816} BPMP_ABI_PACKED;28172818/**2819* @ingroup RingbufConsole2820* @brief BPMP->Host response data for request type #CMD_RINGBUF_CONSOLE_READ2821*/2822struct cmd_ringbuf_console_read_resp {2823/** @brief The actual data read from the BPMP TX buffer */2824uint8_t data[MRQ_RINGBUF_CONSOLE_MAX_READ_LEN];2825/** @brief Number of bytes in cmd_ringbuf_console_read_resp::data */2826uint8_t len;2827} BPMP_ABI_PACKED;28282829/**2830* @ingroup RingbufConsole2831* @brief Host->BPMP request data for request type #CMD_RINGBUF_CONSOLE_WRITE2832*/2833struct cmd_ringbuf_console_write_req {2834/** @brief The actual data to be written to the BPMP RX buffer */2835uint8_t data[MRQ_RINGBUF_CONSOLE_MAX_WRITE_LEN];2836/** @brief Number of bytes in cmd_ringbuf_console_write_req::data */2837uint8_t len;2838} BPMP_ABI_PACKED;28392840/**2841* @ingroup RingbufConsole2842* @brief BPMP->Host response data for request type #CMD_RINGBUF_CONSOLE_WRITE2843*/2844struct cmd_ringbuf_console_write_resp {2845/** @brief Number of bytes of available space in the BPMP RX buffer */2846uint32_t space_avail;2847/** @brief Number of bytes that were written to the BPMP RX buffer */2848uint8_t len;2849} BPMP_ABI_PACKED;28502851/** @private */2852struct cmd_ringbuf_console_get_fifo_req {2853BPMP_ABI_EMPTY2854} BPMP_ABI_PACKED;28552856/**2857* @ingroup RingbufConsole2858* @brief BPMP->Host reply data for request type #CMD_RINGBUF_CONSOLE_GET_FIFO2859*/2860struct cmd_ringbuf_console_get_fifo_resp {2861/** @brief Physical address of the BPMP TX buffer */2862uint64_t bpmp_tx_buf_addr;2863/** @brief Physical address of the BPMP TX buffer head counter */2864uint64_t bpmp_tx_head_addr;2865/** @brief Physical address of the BPMP TX buffer tail counter */2866uint64_t bpmp_tx_tail_addr;2867/** @brief Length of the BPMP TX buffer */2868uint32_t bpmp_tx_buf_len;2869} BPMP_ABI_PACKED;28702871/**2872* @ingroup RingbufConsole2873* @brief Host->BPMP request data.2874*2875* Reply type is union #mrq_ringbuf_console_bpmp_to_host_response .2876*/2877struct mrq_ringbuf_console_host_to_bpmp_request {2878/**2879* @brief Type of request. Values listed in enum2880* #mrq_ringbuf_console_host_to_bpmp_cmd.2881*/2882uint32_t type;2883/** @brief request type specific parameters. */2884union {2885struct cmd_ringbuf_console_query_abi_req query_abi;2886struct cmd_ringbuf_console_read_req read;2887struct cmd_ringbuf_console_write_req write;2888struct cmd_ringbuf_console_get_fifo_req get_fifo;2889} BPMP_UNION_ANON;2890} BPMP_ABI_PACKED;28912892/**2893* @ingroup RingbufConsole2894* @brief Host->BPMP reply data2895*2896* In response to struct #mrq_ringbuf_console_host_to_bpmp_request.2897*/2898union mrq_ringbuf_console_bpmp_to_host_response {2899struct cmd_ringbuf_console_query_abi_resp query_abi;2900struct cmd_ringbuf_console_read_resp read;2901struct cmd_ringbuf_console_write_resp write;2902struct cmd_ringbuf_console_get_fifo_resp get_fifo;2903} BPMP_ABI_PACKED;29042905/** @} RingbufConsole */29062907/**2908* @ingroup MRQ_Codes2909* @def MRQ_STRAP2910* @brief Set a strap value controlled by BPMP2911*2912* * Platforms: T194 onwards2913* @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)2914* * Initiators: CCPLEX2915* * Targets: BPMP2916* * Request Payload: @ref mrq_strap_request2917* * Response Payload: N/A2918* @addtogroup Strap2919*2920* A strap is an input that is sampled by a hardware unit during the2921* unit's startup process. The sampled value of a strap affects the2922* behavior of the unit until the unit is restarted. Many hardware2923* units sample their straps at the instant that their resets are2924* deasserted.2925*2926* BPMP owns registers which act as straps to various units. It2927* exposes limited control of those straps via #MRQ_STRAP.2928*2929* @{2930*/2931enum mrq_strap_cmd {2932/** @private */2933STRAP_RESERVED = 0,2934/** @brief Set a strap value */2935STRAP_SET = 12936};29372938/**2939* @brief Request with #MRQ_STRAP2940*/2941struct mrq_strap_request {2942/** @brief @ref mrq_strap_cmd */2943uint32_t cmd;2944/** @brief Strap ID from @ref Strap_Identifiers */2945uint32_t id;2946/** @brief Desired value for strap (if cmd is #STRAP_SET) */2947uint32_t value;2948} BPMP_ABI_PACKED;29492950/** @} Strap */2951/** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500) */29522953/**2954* @ingroup MRQ_Codes2955* @def MRQ_UPHY2956* @brief Perform a UPHY operation2957*2958* * Platforms: T194 onwards2959* @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)2960* * Initiators: CCPLEX2961* * Targets: BPMP2962* * Request Payload: @ref mrq_uphy_request2963* * Response Payload: @ref mrq_uphy_response2964*2965* @addtogroup UPHY2966* @{2967*/2968enum {2969CMD_UPHY_PCIE_LANE_MARGIN_CONTROL = 1,2970CMD_UPHY_PCIE_LANE_MARGIN_STATUS = 2,2971CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT = 3,2972CMD_UPHY_PCIE_CONTROLLER_STATE = 4,2973CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF = 5,2974CMD_UPHY_DISPLAY_PORT_INIT = 6,2975CMD_UPHY_DISPLAY_PORT_OFF = 7,2976CMD_UPHY_XUSB_DYN_LANES_RESTORE = 8,2977CMD_UPHY_MAX,2978};29792980struct cmd_uphy_margin_control_request {2981/** @brief Enable margin */2982int32_t en;2983/** @brief Clear the number of error and sections */2984int32_t clr;2985/** @brief Set x offset (1's complement) for left/right margin type (y should be 0) */2986uint32_t x;2987/** @brief Set y offset (1's complement) for left/right margin type (x should be 0) */2988uint32_t y;2989/** @brief Set number of bit blocks for each margin section */2990uint32_t nblks;2991} BPMP_ABI_PACKED;29922993struct cmd_uphy_margin_status_response {2994/** @brief Number of errors observed */2995uint32_t status;2996} BPMP_ABI_PACKED;29972998struct cmd_uphy_ep_controller_pll_init_request {2999/** @brief EP controller number, T194 valid: 0, 4, 5; T234 valid: 5, 6, 7, 10; T239 valid: 0 */3000uint8_t ep_controller;3001} BPMP_ABI_PACKED;30023003struct cmd_uphy_pcie_controller_state_request {3004/** @brief PCIE controller number, T194 valid: 0-4; T234 valid: 0-10; T239 valid: 0-3 */3005uint8_t pcie_controller;3006uint8_t enable;3007} BPMP_ABI_PACKED;30083009struct cmd_uphy_ep_controller_pll_off_request {3010/** @brief EP controller number, T194 valid: 0, 4, 5; T234 valid: 5, 6, 7, 10; T239 valid: 0 */3011uint8_t ep_controller;3012} BPMP_ABI_PACKED;30133014struct cmd_uphy_display_port_init_request {3015/** @brief DisplayPort link rate, T239 valid: 1620, 2700, 5400, 8100, 2160, 2430, 3240, 4320, 6750 */3016uint16_t link_rate;3017/** @brief 1: lane 0; 2: lane 1; 3: lane 0 and 1 */3018uint16_t lanes_bitmap;3019} BPMP_ABI_PACKED;30203021struct cmd_uphy_xusb_dyn_lanes_restore_request {3022/** @brief 1: lane 0; 2: lane 1; 3: lane 0 and 1 */3023uint16_t lanes_bitmap;3024} BPMP_ABI_PACKED;30253026/**3027* @ingroup UPHY3028* @brief Request with #MRQ_UPHY3029*3030* Used by the sender of an #MRQ_UPHY message to control UPHY.3031* The uphy_request is split into several sub-commands. CMD_UPHY_PCIE_LANE_MARGIN_STATUS3032* requires no additional data. Others have a sub-command specific payload. Below table3033* shows sub-commands with their corresponding payload data.3034*3035* |sub-command |payload |3036* |------------------------------------ |----------------------------------------|3037* |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL |uphy_set_margin_control |3038* |CMD_UPHY_PCIE_LANE_MARGIN_STATUS | |3039* |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT |cmd_uphy_ep_controller_pll_init_request |3040* |CMD_UPHY_PCIE_CONTROLLER_STATE |cmd_uphy_pcie_controller_state_request |3041* |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF |cmd_uphy_ep_controller_pll_off_request |3042* |CMD_UPHY_PCIE_DISPLAY_PORT_INIT |cmd_uphy_display_port_init_request |3043* |CMD_UPHY_PCIE_DISPLAY_PORT_OFF | |3044* |CMD_UPHY_XUSB_DYN_LANES_RESTORE |cmd_uphy_xusb_dyn_lanes_restore_request |3045*3046*/30473048struct mrq_uphy_request {3049/** @brief Lane number. */3050uint16_t lane;3051/** @brief Sub-command id. */3052uint16_t cmd;30533054union {3055struct cmd_uphy_margin_control_request uphy_set_margin_control;3056struct cmd_uphy_ep_controller_pll_init_request ep_ctrlr_pll_init;3057struct cmd_uphy_pcie_controller_state_request controller_state;3058struct cmd_uphy_ep_controller_pll_off_request ep_ctrlr_pll_off;3059struct cmd_uphy_display_port_init_request display_port_init;3060struct cmd_uphy_xusb_dyn_lanes_restore_request xusb_dyn_lanes_restore;3061} BPMP_UNION_ANON;3062} BPMP_ABI_PACKED;30633064/**3065* @ingroup UPHY3066* @brief Response to MRQ_UPHY3067*3068* Each sub-command supported by @ref mrq_uphy_request may return3069* sub-command-specific data. Some do and some do not as indicated in3070* the following table3071*3072* |sub-command |payload |3073* |---------------------------- |------------------------|3074* |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | |3075* |CMD_UPHY_PCIE_LANE_MARGIN_STATUS |uphy_get_margin_status |3076*3077*/30783079struct mrq_uphy_response {3080union {3081struct cmd_uphy_margin_status_response uphy_get_margin_status;3082} BPMP_UNION_ANON;3083} BPMP_ABI_PACKED;30843085/** @} UPHY */3086/** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500) */30873088/**3089* @ingroup MRQ_Codes3090* @def MRQ_FMON3091* @brief Perform a frequency monitor configuration operations3092*3093* * Platforms: T194 onwards3094* @cond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)3095* * Initiators: CCPLEX3096* * Targets: BPMP3097* * Request Payload: @ref mrq_fmon_request3098* * Response Payload: @ref mrq_fmon_response3099* @endcond (bpmp_t194 || bpmp_t234 || bpmp_t239 || bpmp_th500)3100*3101* @addtogroup FMON3102* @{3103* @cond (bpmp_t194 || bpmp_t234)3104*/3105enum {3106/**3107* @brief Clamp FMON configuration to specified rate.3108*3109* The monitored clock must be running for clamp to succeed. If3110* clamped, FMON configuration is preserved when clock rate3111* and/or state is changed.3112*3113* mrq_response::err is 0 if the operation was successful, or @n3114* -#BPMP_EACCES: FMON access error @n3115* -#BPMP_EBADCMD if subcommand is not supported @n3116* -#BPMP_EBADSLT: clamp FMON on cluster with auto-CC3 enabled @n3117* -#BPMP_EBUSY: fmon is already clamped at different rate @n3118* -#BPMP_EFAULT: self-diagnostic error @n3119* -#BPMP_EINVAL: invalid FMON configuration @n3120* -#BPMP_EOPNOTSUPP: not in production mode @n3121* -#BPMP_ENODEV: invalid clk_id @n3122* -#BPMP_ENOENT: no calibration data, uninitialized @n3123* -#BPMP_ENOTSUP: avfs config not set @n3124* -#BPMP_ENOSYS: clamp FMON on cluster clock w/ no NAFLL @n3125* -#BPMP_ETIMEDOUT: operation timed out @n3126*/3127CMD_FMON_GEAR_CLAMP = 1,3128/**3129* @brief Release clamped FMON configuration.3130*3131* Allow FMON configuration to follow monitored clock rate3132* and/or state changes.3133*3134* mrq_response::err is 0 if the operation was successful, or @n3135* -#BPMP_EBADCMD if subcommand is not supported @n3136* -#BPMP_ENODEV: invalid clk_id @n3137* -#BPMP_ENOENT: no calibration data, uninitialized @n3138* -#BPMP_ENOTSUP: avfs config not set @n3139* -#BPMP_EOPNOTSUPP: not in production mode @n3140*/3141CMD_FMON_GEAR_FREE = 2,3142/**3143* @brief Return rate FMON is clamped at, or 0 if FMON is not3144* clamped.3145*3146* Inherently racy, since clamp state can be changed3147* concurrently. Useful for testing.3148*3149* mrq_response::err is 0 if the operation was successful, or @n3150* -#BPMP_EBADCMD if subcommand is not supported @n3151* -#BPMP_ENODEV: invalid clk_id @n3152* -#BPMP_ENOENT: no calibration data, uninitialized @n3153* -#BPMP_ENOTSUP: avfs config not set @n3154* -#BPMP_EOPNOTSUPP: not in production mode @n3155*/3156CMD_FMON_GEAR_GET = 3,3157/**3158* @brief Return current status of FMON faults detected by FMON3159* h/w or s/w since last invocation of this command.3160* Clears fault status.3161*3162* mrq_response::err is 0 if the operation was successful, or @n3163* -#BPMP_EBADCMD if subcommand is not supported @n3164* -#BPMP_EINVAL: invalid fault type @n3165* -#BPMP_ENODEV: invalid clk_id @n3166* -#BPMP_ENOENT: no calibration data, uninitialized @n3167* -#BPMP_ENOTSUP: avfs config not set @n3168* -#BPMP_EOPNOTSUPP: not in production mode @n3169*/3170CMD_FMON_FAULT_STS_GET = 4,3171};31723173/**3174* @cond DEPRECATED3175* Kept for backward compatibility3176*/3177#define CMD_FMON_NUM 431783179/** @endcond DEPRECATED */31803181/**3182* @defgroup fmon_fault_type FMON fault type3183* @addtogroup fmon_fault_type3184* @{3185*/3186/** @brief All detected FMON faults (h/w or s/w) */3187#define FMON_FAULT_TYPE_ALL 0U3188/** @brief FMON faults detected by h/w */3189#define FMON_FAULT_TYPE_HW 1U3190/** @brief FMON faults detected by s/w */3191#define FMON_FAULT_TYPE_SW 2U31923193/** @} fmon_fault_type */319431953196struct cmd_fmon_gear_clamp_request {3197int32_t unused;3198int64_t rate;3199} BPMP_ABI_PACKED;32003201/** @private */3202struct cmd_fmon_gear_clamp_response {3203BPMP_ABI_EMPTY3204} BPMP_ABI_PACKED;32053206/** @private */3207struct cmd_fmon_gear_free_request {3208BPMP_ABI_EMPTY3209} BPMP_ABI_PACKED;32103211/** @private */3212struct cmd_fmon_gear_free_response {3213BPMP_ABI_EMPTY3214} BPMP_ABI_PACKED;32153216/** @private */3217struct cmd_fmon_gear_get_request {3218BPMP_ABI_EMPTY3219} BPMP_ABI_PACKED;32203221struct cmd_fmon_gear_get_response {3222int64_t rate;3223} BPMP_ABI_PACKED;32243225struct cmd_fmon_fault_sts_get_request {3226uint32_t fault_type; /**< @ref fmon_fault_type */3227} BPMP_ABI_PACKED;32283229struct cmd_fmon_fault_sts_get_response {3230uint32_t fault_sts;3231} BPMP_ABI_PACKED;32323233/**3234* @ingroup FMON3235* @brief Request with #MRQ_FMON3236*3237* Used by the sender of an #MRQ_FMON message to configure clock3238* frequency monitors. The FMON request is split into several3239* sub-commands. Some sub-commands require no additional data.3240* Others have a sub-command specific payload3241*3242* |sub-command |payload |3243* |----------------------------|-----------------------|3244* |CMD_FMON_GEAR_CLAMP |fmon_gear_clamp |3245* |CMD_FMON_GEAR_FREE |- |3246* |CMD_FMON_GEAR_GET |- |3247* |CMD_FMON_FAULT_STS_GET |fmon_fault_sts_get |3248*3249*/3250struct mrq_fmon_request {3251/** @brief Sub-command and clock id concatenated to 32-bit word.3252* - bits[31..24] is the sub-cmd.3253* - bits[23..0] is monitored clock id used to select target3254* FMON3255*/3256uint32_t cmd_and_id;32573258union {3259struct cmd_fmon_gear_clamp_request fmon_gear_clamp;3260/** @private */3261struct cmd_fmon_gear_free_request fmon_gear_free;3262/** @private */3263struct cmd_fmon_gear_get_request fmon_gear_get;3264struct cmd_fmon_fault_sts_get_request fmon_fault_sts_get;3265} BPMP_UNION_ANON;3266} BPMP_ABI_PACKED;32673268/**3269* @ingroup FMON3270* @brief Response to MRQ_FMON3271*3272* Each sub-command supported by @ref mrq_fmon_request may3273* return sub-command-specific data as indicated below.3274*3275* |sub-command |payload |3276* |----------------------------|------------------------|3277* |CMD_FMON_GEAR_CLAMP |- |3278* |CMD_FMON_GEAR_FREE |- |3279* |CMD_FMON_GEAR_GET |fmon_gear_get |3280* |CMD_FMON_FAULT_STS_GET |fmon_fault_sts_get |3281*3282*/32833284struct mrq_fmon_response {3285union {3286/** @private */3287struct cmd_fmon_gear_clamp_response fmon_gear_clamp;3288/** @private */3289struct cmd_fmon_gear_free_response fmon_gear_free;3290struct cmd_fmon_gear_get_response fmon_gear_get;3291struct cmd_fmon_fault_sts_get_response fmon_fault_sts_get;3292} BPMP_UNION_ANON;3293} BPMP_ABI_PACKED;32943295/** @endcond (bpmp_t194 || bpmp_t234) */3296/** @} FMON */32973298/**3299* @ingroup MRQ_Codes3300* @def MRQ_EC3301* @brief Provide status information on faults reported by Error3302* Collator (EC) to HSM.3303*3304* * Platforms: T1943305* @cond bpmp_t1943306* * Initiators: CCPLEX3307* * Targets: BPMP3308* * Request Payload: @ref mrq_ec_request3309* * Response Payload: @ref mrq_ec_response3310*3311* @note This MRQ ABI is under construction, and subject to change3312*3313* @endcond bpmp_t1943314* @addtogroup EC3315* @{3316* @cond bpmp_t1943317*/3318enum {3319/**3320* @cond DEPRECATED3321* @brief Retrieve specified EC status.3322*3323* mrq_response::err is 0 if the operation was successful, or @n3324* -#BPMP_ENODEV if target EC is not owned by BPMP @n3325* -#BPMP_EACCES if target EC power domain is turned off @n3326* -#BPMP_EBADCMD if subcommand is not supported3327* @endcond DEPRECATED3328*/3329CMD_EC_STATUS_GET = 1, /* deprecated */33303331/**3332* @brief Retrieve specified EC extended status (includes error3333* counter and user values).3334*3335* mrq_response::err is 0 if the operation was successful, or @n3336* -#BPMP_ENODEV if target EC is not owned by BPMP @n3337* -#BPMP_EACCES if target EC power domain is turned off @n3338* -#BPMP_EBADCMD if subcommand is not supported3339*/3340CMD_EC_STATUS_EX_GET = 2,3341CMD_EC_NUM,3342};33433344/** @brief BPMP ECs error types */3345enum bpmp_ec_err_type {3346/** @brief Parity error on internal data path3347*3348* Error descriptor @ref ec_err_simple_desc.3349*/3350EC_ERR_TYPE_PARITY_INTERNAL = 1,33513352/** @brief ECC SEC error on internal data path3353*3354* Error descriptor @ref ec_err_simple_desc.3355*/3356EC_ERR_TYPE_ECC_SEC_INTERNAL = 2,33573358/** @brief ECC DED error on internal data path3359*3360* Error descriptor @ref ec_err_simple_desc.3361*/3362EC_ERR_TYPE_ECC_DED_INTERNAL = 3,33633364/** @brief Comparator error3365*3366* Error descriptor @ref ec_err_simple_desc.3367*/3368EC_ERR_TYPE_COMPARATOR = 4,33693370/** @brief Register parity error3371*3372* Error descriptor @ref ec_err_reg_parity_desc.3373*/3374EC_ERR_TYPE_REGISTER_PARITY = 5,33753376/** @brief Parity error from on-chip SRAM/FIFO3377*3378* Error descriptor @ref ec_err_simple_desc.3379*/3380EC_ERR_TYPE_PARITY_SRAM = 6,33813382/** @brief Clock Monitor error3383*3384* Error descriptor @ref ec_err_fmon_desc.3385*/3386EC_ERR_TYPE_CLOCK_MONITOR = 9,33873388/** @brief Voltage Monitor error3389*3390* Error descriptor @ref ec_err_vmon_desc.3391*/3392EC_ERR_TYPE_VOLTAGE_MONITOR = 10,33933394/** @brief SW Correctable error3395*3396* Error descriptor @ref ec_err_sw_error_desc.3397*/3398EC_ERR_TYPE_SW_CORRECTABLE = 16,33993400/** @brief SW Uncorrectable error3401*3402* Error descriptor @ref ec_err_sw_error_desc.3403*/3404EC_ERR_TYPE_SW_UNCORRECTABLE = 17,34053406/** @brief Other HW Correctable error3407*3408* Error descriptor @ref ec_err_simple_desc.3409*/3410EC_ERR_TYPE_OTHER_HW_CORRECTABLE = 32,34113412/** @brief Other HW Uncorrectable error3413*3414* Error descriptor @ref ec_err_simple_desc.3415*/3416EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE = 33,3417};34183419/** @brief Group of registers with parity error. */3420enum ec_registers_group {3421/** @brief Functional registers group */3422EC_ERR_GROUP_FUNC_REG = 0U,3423/** @brief SCR registers group */3424EC_ERR_GROUP_SCR_REG = 1U,3425};34263427/**3428* @defgroup bpmp_ec_status_flags EC Status Flags3429* @addtogroup bpmp_ec_status_flags3430* @{3431*/3432/** @brief No EC error found flag */3433#define EC_STATUS_FLAG_NO_ERROR 0x0001U3434/** @brief Last EC error found flag */3435#define EC_STATUS_FLAG_LAST_ERROR 0x0002U3436/** @brief EC latent error flag */3437#define EC_STATUS_FLAG_LATENT_ERROR 0x0004U34383439/** @} bpmp_ec_status_flags */34403441/**3442* @defgroup bpmp_ec_desc_flags EC Descriptor Flags3443* @addtogroup bpmp_ec_desc_flags3444* @{3445*/3446/** @brief EC descriptor error resolved flag */3447#define EC_DESC_FLAG_RESOLVED 0x0001U3448/** @brief EC descriptor failed to retrieve id flag */3449#define EC_DESC_FLAG_NO_ID 0x0002U34503451/** @} bpmp_ec_desc_flags */34523453/**3454* |error type | fmon_clk_id values |3455* |---------------------------------|---------------------------|3456* |@ref EC_ERR_TYPE_CLOCK_MONITOR |@ref bpmp_clock_ids |3457*/3458struct ec_err_fmon_desc {3459/** @brief Bitmask of @ref bpmp_ec_desc_flags */3460uint16_t desc_flags;3461/** @brief FMON monitored clock id */3462uint16_t fmon_clk_id;3463/**3464* @brief Bitmask of fault flags3465*3466* @ref bpmp_fmon_faults_flags3467*/3468uint32_t fmon_faults;3469/** @brief FMON faults access error */3470int32_t fmon_access_error;3471} BPMP_ABI_PACKED;34723473/**3474* | error type | vmon_adc_id values |3475* |---------------------------------|---------------------------|3476* |@ref EC_ERR_TYPE_VOLTAGE_MONITOR |@ref bpmp_adc_ids |3477*/3478struct ec_err_vmon_desc {3479/** @brief Bitmask of @ref bpmp_ec_desc_flags */3480uint16_t desc_flags;3481/** @brief VMON rail adc id */3482uint16_t vmon_adc_id;3483/** @brief Bitmask of bpmp_vmon_faults_flags */3484uint32_t vmon_faults;3485/** @brief VMON faults access error */3486int32_t vmon_access_error;3487} BPMP_ABI_PACKED;34883489/**3490* |error type | reg_id values |3491* |---------------------------------|-----------------------|3492* |@ref EC_ERR_TYPE_REGISTER_PARITY | bpmp_ec_registers_ids |3493*/3494struct ec_err_reg_parity_desc {3495/** @brief Bitmask of @ref bpmp_ec_desc_flags */3496uint16_t desc_flags;3497/** @brief Register id */3498uint16_t reg_id;3499/** @brief Register group @ref ec_registers_group */3500uint16_t reg_group;3501} BPMP_ABI_PACKED;35023503/**3504* |error type | err_source_id values |3505* |--------------------------------- |----------------------|3506* |@ref EC_ERR_TYPE_SW_CORRECTABLE | bpmp_ec_ce_swd_ids |3507* |@ref EC_ERR_TYPE_SW_UNCORRECTABLE | bpmp_ec_ue_swd_ids |3508*/3509struct ec_err_sw_error_desc {3510/** @brief Bitmask of @ref bpmp_ec_desc_flags */3511uint16_t desc_flags;3512/** @brief Error source id */3513uint16_t err_source_id;3514/** @brief Sw error data */3515uint32_t sw_error_data;3516} BPMP_ABI_PACKED;35173518/**3519* |error type | err_source_id values |3520* |----------------------------------------|------------------------|3521* |@ref EC_ERR_TYPE_PARITY_INTERNAL | bpmp_ec_ipath_ids |3522* |@ref EC_ERR_TYPE_ECC_SEC_INTERNAL | bpmp_ec_ipath_ids |3523* |@ref EC_ERR_TYPE_ECC_DED_INTERNAL | bpmp_ec_ipath_ids |3524* |@ref EC_ERR_TYPE_COMPARATOR | bpmp_ec_comparator_ids|3525* |@ref EC_ERR_TYPE_OTHER_HW_CORRECTABLE | bpmp_ec_misc_hwd_ids |3526* |@ref EC_ERR_TYPE_OTHER_HW_UNCORRECTABLE | bpmp_ec_misc_hwd_ids |3527* |@ref EC_ERR_TYPE_PARITY_SRAM | bpmp_clock_ids |3528*/3529struct ec_err_simple_desc {3530/** @brief Bitmask of @ref bpmp_ec_desc_flags */3531uint16_t desc_flags;3532/** @brief Error source id. Id space depends on error type. */3533uint16_t err_source_id;3534} BPMP_ABI_PACKED;35353536/** @brief Union of EC error descriptors */3537union ec_err_desc {3538struct ec_err_fmon_desc fmon_desc;3539struct ec_err_vmon_desc vmon_desc;3540struct ec_err_reg_parity_desc reg_parity_desc;3541struct ec_err_sw_error_desc sw_error_desc;3542struct ec_err_simple_desc simple_desc;3543} BPMP_ABI_PACKED;35443545struct cmd_ec_status_get_request {3546/** @brief HSM error line number that identifies target EC. */3547uint32_t ec_hsm_id;3548} BPMP_ABI_PACKED;35493550/** EC status maximum number of descriptors */3551#define EC_ERR_STATUS_DESC_MAX_NUM 4U35523553/**3554* @cond DEPRECATED3555*/3556struct cmd_ec_status_get_response {3557/** @brief Target EC id (the same id received with request). */3558uint32_t ec_hsm_id;3559/**3560* @brief Bitmask of @ref bpmp_ec_status_flags3561*3562* If NO_ERROR flag is set, error_ fields should be ignored3563*/3564uint32_t ec_status_flags;3565/** @brief Found EC error index. */3566uint32_t error_idx;3567/** @brief Found EC error type @ref bpmp_ec_err_type. */3568uint32_t error_type;3569/** @brief Number of returned EC error descriptors */3570uint32_t error_desc_num;3571/** @brief EC error descriptors */3572union ec_err_desc error_descs[EC_ERR_STATUS_DESC_MAX_NUM];3573} BPMP_ABI_PACKED;3574/** @endcond DEPRECATED */35753576struct cmd_ec_status_ex_get_response {3577/** @brief Target EC id (the same id received with request). */3578uint32_t ec_hsm_id;3579/**3580* @brief Bitmask of @ref bpmp_ec_status_flags3581*3582* If NO_ERROR flag is set, error_ fields should be ignored3583*/3584uint32_t ec_status_flags;3585/** @brief Found EC error index. */3586uint32_t error_idx;3587/** @brief Found EC error type @ref bpmp_ec_err_type. */3588uint32_t error_type;3589/** @brief Found EC mission error counter value */3590uint32_t error_counter;3591/** @brief Found EC mission error user value */3592uint32_t error_uval;3593/** @brief Reserved entry */3594uint32_t reserved;3595/** @brief Number of returned EC error descriptors */3596uint32_t error_desc_num;3597/** @brief EC error descriptors */3598union ec_err_desc error_descs[EC_ERR_STATUS_DESC_MAX_NUM];3599} BPMP_ABI_PACKED;36003601/**3602* @ingroup EC3603* @brief Request with #MRQ_EC3604*3605* Used by the sender of an #MRQ_EC message to access ECs owned3606* by BPMP.3607*3608* @cond DEPRECATED3609* |sub-command |payload |3610* |----------------------------|-----------------------|3611* |@ref CMD_EC_STATUS_GET |ec_status_get |3612* @endcond DEPRECATED3613*3614* |sub-command |payload |3615* |----------------------------|-----------------------|3616* |@ref CMD_EC_STATUS_EX_GET |ec_status_get |3617*3618*/36193620struct mrq_ec_request {3621/** @brief Sub-command id. */3622uint32_t cmd_id;36233624union {3625struct cmd_ec_status_get_request ec_status_get;3626} BPMP_UNION_ANON;3627} BPMP_ABI_PACKED;36283629/**3630* @ingroup EC3631* @brief Response to MRQ_EC3632*3633* Each sub-command supported by @ref mrq_ec_request may return3634* sub-command-specific data as indicated below.3635*3636* @cond DEPRECATED3637* |sub-command |payload |3638* |----------------------------|------------------------|3639* |@ref CMD_EC_STATUS_GET |ec_status_get |3640* @endcond DEPRECATED3641*3642* |sub-command |payload |3643* |----------------------------|------------------------|3644* |@ref CMD_EC_STATUS_EX_GET |ec_status_ex_get |3645*3646*/36473648struct mrq_ec_response {3649union {3650/**3651* @cond DEPRECATED3652*/3653struct cmd_ec_status_get_response ec_status_get;3654/** @endcond DEPRECATED */3655struct cmd_ec_status_ex_get_response ec_status_ex_get;3656} BPMP_UNION_ANON;3657} BPMP_ABI_PACKED;36583659/** @endcond bpmp_t194 */3660/** @} EC */36613662/**3663* @ingroup MRQ_Codes3664* @def MRQ_TELEMETRY3665* @brief Get address of memory buffer refreshed with recently sampled3666* telemetry data3667*3668* * Platforms: TH500 onwards3669* @cond bpmp_th5003670* * Initiators: CCPLEX3671* * Targets: BPMP3672* * Request Payload: N/A3673* * Response Payload: @ref mrq_telemetry_response3674* @addtogroup Telemetry3675* @{3676*/36773678/**3679* @brief Response to #MRQ_TELEMETRY3680*3681* mrq_response::err is3682* * 0: Telemetry data is available at returned address3683* * -#BPMP_EACCES: MRQ master is not allowed to request buffer refresh3684* * -#BPMP_ENAVAIL: Telemetry buffer cannot be refreshed via this MRQ channel3685* * -#BPMP_ENOTSUP: Telemetry buffer is not supported by BPMP-FW3686* * -#BPMP_ENODEV: Telemetry mrq is not supported by BPMP-FW3687*/3688struct mrq_telemetry_response {3689/** @brief Physical address of telemetry data buffer */3690uint64_t data_buf_addr; /**< see @ref bpmp_telemetry_layout */3691} BPMP_ABI_PACKED;36923693/** @} Telemetry */3694/** @endcond bpmp_th500 */36953696/**3697* @ingroup MRQ_Codes3698* @def MRQ_PWR_LIMIT3699* @brief Control power limits.3700*3701* * Platforms: TH500 onwards3702* @cond bpmp_th5003703* * Initiators: Any3704* * Targets: BPMP3705* * Request Payload: @ref mrq_pwr_limit_request3706* * Response Payload: @ref mrq_pwr_limit_response3707*3708* @addtogroup Pwrlimit3709* @{3710*/3711enum mrq_pwr_limit_cmd {3712/**3713* @brief Check whether the BPMP-FW supports the specified3714* command3715*3716* mrq_response::err is 0 if the specified request is3717* supported and -#BPMP_ENODEV otherwise.3718*/3719CMD_PWR_LIMIT_QUERY_ABI = 0,37203721/**3722* @brief Set power limit3723*3724* mrq_response:err is3725* * 0: Success3726* * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW3727* * -#BPMP_ENAVAIL: Invalid request parameters3728* * -#BPMP_EACCES: Request is not accepted3729*/3730CMD_PWR_LIMIT_SET = 1,37313732/**3733* @brief Get power limit setting3734*3735* mrq_response:err is3736* * 0: Success3737* * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW3738* * -#BPMP_ENAVAIL: Invalid request parameters3739*/3740CMD_PWR_LIMIT_GET = 2,37413742/**3743* @brief Get current power cap3744*3745* mrq_response:err is3746* * 0: Success3747* * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW3748* * -#BPMP_ENAVAIL: Invalid request parameters3749*/3750CMD_PWR_LIMIT_CURR_CAP = 3,3751};37523753/**3754* @defgroup bpmp_pwr_limit_type PWR_LIMIT TYPEs3755* @{3756*/3757/** @brief Limit value specifies target cap */3758#define PWR_LIMIT_TYPE_TARGET_CAP 0U3759/** @brief Limit value specifies maximum possible target cap */3760#define PWR_LIMIT_TYPE_BOUND_MAX 1U3761/** @brief Limit value specifies minimum possible target cap */3762#define PWR_LIMIT_TYPE_BOUND_MIN 2U3763/** @brief Number of limit types supported by mrq interface */3764#define PWR_LIMIT_TYPE_NUM 3U37653766/** @} bpmp_pwr_limit_type */37673768/**3769* @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_QUERY_ABI3770*/3771struct cmd_pwr_limit_query_abi_request {3772uint32_t cmd_code; /**< @ref mrq_pwr_limit_cmd */3773} BPMP_ABI_PACKED;37743775/**3776* @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_SET3777*3778* Set specified limit of specified type from specified source. The success of3779* the request means that specified value is accepted as input to arbitration3780* with other sources settings for the same limit of the same type. Zero limit3781* is ignored by the arbitration (i.e., indicates "no limit set").3782*/3783struct cmd_pwr_limit_set_request {3784uint32_t limit_id; /**< @ref bpmp_pwr_limit_id */3785uint32_t limit_src; /**< @ref bpmp_pwr_limit_src */3786uint32_t limit_type; /**< @ref bpmp_pwr_limit_type */3787uint32_t limit_setting;3788} BPMP_ABI_PACKED;37893790/**3791* @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_GET3792*3793* Get previously set from specified source specified limit value of specified3794* type.3795*/3796struct cmd_pwr_limit_get_request {3797uint32_t limit_id; /**< @ref bpmp_pwr_limit_id */3798uint32_t limit_src; /**< @ref bpmp_pwr_limit_src */3799uint32_t limit_type; /**< @ref bpmp_pwr_limit_type */3800} BPMP_ABI_PACKED;38013802/**3803* @brief Response data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_GET3804*/3805struct cmd_pwr_limit_get_response {3806uint32_t limit_setting;3807} BPMP_ABI_PACKED;38083809/**3810* @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_CURR_CAP3811*3812* For specified limit get current power cap aggregated from all sources.3813*/3814struct cmd_pwr_limit_curr_cap_request {3815uint32_t limit_id; /**< @ref bpmp_pwr_limit_id */3816} BPMP_ABI_PACKED;38173818/**3819* @brief Response data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_CURR_CAP3820*/3821struct cmd_pwr_limit_curr_cap_response {3822uint32_t curr_cap;3823} BPMP_ABI_PACKED;38243825/**3826* @brief Request with #MRQ_PWR_LIMIT3827*3828* |sub-command |payload |3829* |----------------------------|---------------------------------|3830* |CMD_PWR_LIMIT_QUERY_ABI | cmd_pwr_limit_query_abi_request |3831* |CMD_PWR_LIMIT_SET | cmd_pwr_limit_set_request |3832* |CMD_PWR_LIMIT_GET | cmd_pwr_limit_get_request |3833* |CMD_PWR_LIMIT_CURR_CAP | cmd_pwr_limit_curr_cap_request |3834*/3835struct mrq_pwr_limit_request {3836uint32_t cmd;3837union {3838struct cmd_pwr_limit_query_abi_request pwr_limit_query_abi_req;3839struct cmd_pwr_limit_set_request pwr_limit_set_req;3840struct cmd_pwr_limit_get_request pwr_limit_get_req;3841struct cmd_pwr_limit_curr_cap_request pwr_limit_curr_cap_req;3842} BPMP_UNION_ANON;3843} BPMP_ABI_PACKED;38443845/**3846* @brief Response to MRQ_PWR_LIMIT3847*3848* |sub-command |payload |3849* |----------------------------|---------------------------------|3850* |CMD_PWR_LIMIT_QUERY_ABI | - |3851* |CMD_PWR_LIMIT_SET | - |3852* |CMD_PWR_LIMIT_GET | cmd_pwr_limit_get_response |3853* |CMD_PWR_LIMIT_CURR_CAP | cmd_pwr_limit_curr_cap_response |3854*/3855struct mrq_pwr_limit_response {3856union {3857struct cmd_pwr_limit_get_response pwr_limit_get_rsp;3858struct cmd_pwr_limit_curr_cap_response pwr_limit_curr_cap_rsp;3859} BPMP_UNION_ANON;3860} BPMP_ABI_PACKED;38613862/** @} PwrLimit */3863/** @endcond bpmp_th500 */386438653866/**3867* @ingroup MRQ_Codes3868* @def MRQ_GEARS3869* @brief Get thresholds for NDIV offset switching3870*3871* * Platforms: TH500 onwards3872* @cond bpmp_th5003873* * Initiators: CCPLEX3874* * Targets: BPMP3875* * Request Payload: N/A3876* * Response Payload: @ref mrq_gears_response3877* @addtogroup Gears3878* @{3879*/38803881/**3882* @brief Response to #MRQ_GEARS3883*3884* Used by the sender of an #MRQ_GEARS message to request thresholds3885* for NDIV offset switching.3886*3887* The mrq_gears_response::ncpu array defines four thresholds in units3888* of number of online CPUS to be used for choosing between five different3889* NDIV offset settings for CCPLEX cluster NAFLLs3890*3891* 1. If number of online CPUs < ncpu[0] use offset03892* 2. If number of online CPUs < ncpu[1] use offset13893* 3. If number of online CPUs < ncpu[2] use offset23894* 4. If number of online CPUs < ncpu[3] use offset33895* 5. If number of online CPUs >= ncpu[3] disable offsetting3896*3897* For TH500 mrq_gears_response::ncpu array has four valid entries.3898*3899* mrq_response::err is3900* * 0: gears defined and response data valid3901* * -#BPMP_ENODEV: MRQ is not supported by BPMP-FW3902* * -#BPMP_EACCES: Operation not permitted for the MRQ master3903* * -#BPMP_ENAVAIL: NDIV offsetting is disabled3904*/3905struct mrq_gears_response {3906/** @brief number of online CPUs for each gear */3907uint32_t ncpu[16];3908} BPMP_ABI_PACKED;39093910/** @} Gears */3911/** @endcond bpmp_th500 */39123913/**3914* @addtogroup Error_Codes3915* Negative values for mrq_response::err generally indicate some3916* error. The ABI defines the following error codes. Negating these3917* defines is an exercise left to the user.3918* @{3919*/39203921/** @brief Operation not permitted */3922#define BPMP_EPERM 13923/** @brief No such file or directory */3924#define BPMP_ENOENT 23925/** @brief No MRQ handler */3926#define BPMP_ENOHANDLER 33927/** @brief I/O error */3928#define BPMP_EIO 53929/** @brief Bad sub-MRQ command */3930#define BPMP_EBADCMD 63931/** @brief Resource temporarily unavailable */3932#define BPMP_EAGAIN 113933/** @brief Not enough memory */3934#define BPMP_ENOMEM 123935/** @brief Permission denied */3936#define BPMP_EACCES 133937/** @brief Bad address */3938#define BPMP_EFAULT 143939/** @brief Resource busy */3940#define BPMP_EBUSY 163941/** @brief No such device */3942#define BPMP_ENODEV 193943/** @brief Argument is a directory */3944#define BPMP_EISDIR 213945/** @brief Invalid argument */3946#define BPMP_EINVAL 223947/** @brief Timeout during operation */3948#define BPMP_ETIMEDOUT 233949/** @brief Out of range */3950#define BPMP_ERANGE 343951/** @brief Function not implemented */3952#define BPMP_ENOSYS 383953/** @brief Invalid slot */3954#define BPMP_EBADSLT 573955/** @brief Invalid message */3956#define BPMP_EBADMSG 773957/** @brief Operation not supported */3958#define BPMP_EOPNOTSUPP 953959/** @brief Targeted resource not available */3960#define BPMP_ENAVAIL 1193961/** @brief Not supported */3962#define BPMP_ENOTSUP 1343963/** @brief No such device or address */3964#define BPMP_ENXIO 14039653966/** @} Error_Codes */39673968#if defined(BPMP_ABI_CHECKS)3969#include "bpmp_abi_checks.h"3970#endif39713972#endif397339743975