Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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