[PATCH 4/6] firmware: tegra: bpmp: Add the Memory Bandwidth Throttler ABI definitions

From: Aniruddha Rao

Date: Mon Jun 15 2026 - 04:44:13 EST


Different workloads can place different memory-bandwidth demands on the
system. Tegra410 provides Memory Bandwidth Throttler (MBWT) controls for
PCIe and GPU connected over chip-to-chip link (Nv-Clink) traffic on the
path to DRAM so software can query and program those bandwidth caps.

The MBWT controls are not exposed through ordinary host MMIO and are
accessible only through BPMP firmware requests.

Add the ABI definitions for the MBWT message request (MRQ), including
the MRQ ID, sub-command IDs, and request/response payloads needed to
issue the MBWT control requests defined by BPMP firmware.

Signed-off-by: Aniruddha Rao <anrao@xxxxxxxxxx>
---
include/soc/tegra/bpmp-abi.h | 161 ++++++++++++++++++++++++++++++++++-
1 file changed, 160 insertions(+), 1 deletion(-)

diff --git a/include/soc/tegra/bpmp-abi.h b/include/soc/tegra/bpmp-abi.h
index 5c64b3e02211..0660b1d669ef 100644
--- a/include/soc/tegra/bpmp-abi.h
+++ b/include/soc/tegra/bpmp-abi.h
@@ -587,12 +587,13 @@ struct mrq_response {
#define MRQ_HWPM 93U
#define MRQ_DVFS 94U
#define MRQ_PPP_PROFILE 95U
+#define MRQ_SOCHUB_MBWT 96U

/**
* @brief Maximum MRQ code to be sent by CPU software to
* BPMP. Subject to change in future
*/
-#define MAX_CPU_MRQ_ID 95U
+#define MAX_CPU_MRQ_ID 96U

/** @} */

@@ -6686,6 +6687,164 @@ struct mrq_ppp_profile_response {
/** @} PPP */
/** @endcond */

+/** @cond (bpmp_tb500)
+ * @ingroup MRQ_Codes
+ * @def MRQ_SOCHUB_MBWT
+ * @brief Configure per-virtual-channel bandwidth caps for a bandwidth group using
+ * Memory Bandwidth Throttler (MBWT).
+ *
+ * * Initiators: Any
+ * * Targets: BPMP
+ * * Request Payload: @ref mrq_sochub_mbwt_request
+ * * Response Payload: @ref mrq_sochub_mbwt_response
+ *
+ * @addtogroup SOCHUB_MBWT
+ * @{
+ */
+
+/**
+ * @brief Sub-command identifiers for #MRQ_SOCHUB_MBWT.
+ */
+enum mrq_sochub_mbwt_cmd {
+ /**
+ * @brief Check whether the BPMP-FW supports the specified
+ * #MRQ_SOCHUB_MBWT sub-command.
+ *
+ * mrq_response::err is 0 if the specified request is
+ * supported and -#BPMP_ENODEV otherwise.
+ */
+ CMD_SOCHUB_MBWT_QUERY_ABI = 0,
+ /**
+ * @brief Get bandwidth cap for a virtual channel
+ *
+ * mrq_response::err is defined as:
+ *
+ * | Value | Description |
+ * |----------------|------------------------------------------------|
+ * | 0 | Success |
+ * | -#BPMP_ENOTSUP | #MRQ_SOCHUB_MBWT is not supported by BPMP-FW. |
+ * | -#BPMP_EINVAL | Invalid request parameters. |
+ * | -#BPMP_EIO | Failed to retrieve the bandwidth. |
+ */
+ CMD_SOCHUB_MBWT_GET_BW = 1,
+ /**
+ * @brief Set bandwidth cap for a virtual channel.
+ *
+ * mrq_response::err is defined as:
+ *
+ * | Value | Description |
+ * |----------------|------------------------------------------------|
+ * | 0 | Success |
+ * | -#BPMP_ENOTSUP | #MRQ_SOCHUB_MBWT is not supported by BPMP-FW. |
+ * | -#BPMP_EINVAL | Invalid request parameters. |
+ * | -#BPMP_EIO | Failed to set the bandwidth. |
+ */
+ CMD_SOCHUB_MBWT_SET_BW = 2,
+};
+
+/**
+ * @brief Request data for #MRQ_SOCHUB_MBWT sub-command
+ * #CMD_SOCHUB_MBWT_QUERY_ABI
+ */
+struct cmd_sochub_mbwt_query_abi_req {
+ /** @brief Sub-command identifier from @ref mrq_sochub_mbwt_cmd */
+ uint32_t cmd_code;
+} BPMP_ABI_PACKED;
+
+/**
+ * @brief Request data for #MRQ_SOCHUB_MBWT sub-command
+ * #CMD_SOCHUB_MBWT_GET_BW
+ */
+struct cmd_sochub_mbwt_get_bw_req {
+ /**
+ * @brief Instance ID for the bandwidth group
+ *
+ * Valid range is [0, 5]
+ */
+ uint32_t instance;
+ /**
+ * @brief Type of the virtual channel/traffic
+ *
+ * Valid values:
+ *
+ * * Value 0: PCIe read
+ * * Value 1: PCIe write
+ * * Value 2: GPU connected over the chip-to-chip link (Nv-Clink)
+ */
+ uint32_t vc_type;
+} BPMP_ABI_PACKED;
+
+/**
+ * @brief Request data for #MRQ_SOCHUB_MBWT sub-command
+ * #CMD_SOCHUB_MBWT_SET_BW
+ */
+struct cmd_sochub_mbwt_set_bw_req {
+ /**
+ * @brief Instance ID for the bandwidth group
+ *
+ * Valid range is [0, 5]
+ */
+ uint32_t instance;
+ /**
+ * @brief Type of the virtual channel/traffic
+ *
+ * Valid values:
+ *
+ * * Value 0: PCIe read
+ * * Value 1: PCIe write
+ * * Value 2: GPU connected over the chip-to-chip link (Nv-Clink)
+ */
+ uint32_t vc_type;
+ /** @brief Bandwidth cap in GB/s */
+ uint32_t bw;
+} BPMP_ABI_PACKED;
+
+/**
+ * @brief Response data for #MRQ_SOCHUB_MBWT sub-command
+ * #CMD_SOCHUB_MBWT_GET_BW
+ */
+struct cmd_sochub_mbwt_get_bw_resp {
+ /** @brief Bandwidth cap in GB/s */
+ uint32_t bw;
+} BPMP_ABI_PACKED;
+
+/**
+ * @brief Request payload for the #MRQ_SOCHUB_MBWT -command
+ *
+ * | Sub-command | Request payload |
+ * |-------------------------------|----------------------------------------|
+ * | #CMD_SOCHUB_MBWT_QUERY_ABI | #cmd_sochub_mbwt_query_abi_req |
+ * | #CMD_SOCHUB_MBWT_GET_BW | #cmd_sochub_mbwt_get_bw_req |
+ * | #CMD_SOCHUB_MBWT_SET_BW | #cmd_sochub_mbwt_set_bw_req |
+ */
+struct mrq_sochub_mbwt_request {
+ /** @brief Sub-command ID from @ref mrq_sochub_mbwt_cmd. */
+ uint32_t cmd;
+ union {
+ struct cmd_sochub_mbwt_query_abi_req query_abi;
+ struct cmd_sochub_mbwt_get_bw_req get_bw;
+ struct cmd_sochub_mbwt_set_bw_req set_bw;
+ } BPMP_UNION_ANON;
+} BPMP_ABI_PACKED;
+
+/**
+ * @brief Response payload for the #MRQ_SOCHUB_MBWT -command.
+ *
+ * | Sub-command | Response payload |
+ * |-------------------------------|----------------------------------------|
+ * | #CMD_SOCHUB_MBWT_QUERY_ABI | - |
+ * | #CMD_SOCHUB_MBWT_GET_BW | #cmd_sochub_mbwt_get_bw_resp |
+ * | #CMD_SOCHUB_MBWT_SET_BW | - |
+ */
+struct mrq_sochub_mbwt_response {
+ union {
+ struct cmd_sochub_mbwt_get_bw_resp get_bw;
+ } BPMP_UNION_ANON;
+} BPMP_ABI_PACKED;
+
+/** @} SOCHUB_MBWT */
+/** @endcond */
+
/**
* @addtogroup Error_Codes
* Negative values for mrq_response::err generally indicate some
--
2.43.0