Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

soc/tegra: Update BPMP ABI header

This update primarily adds various new commands and MRQs for Tegra264,
but also contains a few new annotations and fixes.

Signed-off-by: Thierry Reding <treding@nvidia.com>

+3673 -896
+3673 -896
include/soc/tegra/bpmp-abi.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 1 + /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 2 /* 3 - * Copyright (c) 2014-2022, NVIDIA CORPORATION. All rights reserved. 3 + * Copyright (c) 2014-2025, NVIDIA CORPORATION. All rights reserved. 4 4 */ 5 5 6 6 #ifndef ABI_BPMP_ABI_H ··· 74 74 75 75 /** 76 76 * @ingroup MRQ_Format 77 + * 77 78 * Request an answer from the peer. 78 79 * This should be set in mrq_request::flags for all requests targetted 79 80 * at BPMP. For requests originating in BPMP, this flag is optional except ··· 86 85 87 86 /** 88 87 * @ingroup MRQ_Format 88 + * 89 89 * Ring the sender's doorbell when responding. This should be set unless 90 90 * the sender wants to poll the underlying communications layer directly. 91 91 * ··· 96 94 97 95 /** 98 96 * @ingroup MRQ_Format 99 - * CRC present 97 + * 98 + * This is set in mrq_request::flags for requests that have CRC present and 99 + * correspondingly in mrq_response::flags for responses that have CRC present. 100 100 */ 101 101 #define BPMP_MAIL_CRC_PRESENT (1U << 2U) 102 102 ··· 131 127 * crc16, xid and length fields are present when set. 132 128 * Some platform configurations, especially when targeted to applications requiring 133 129 * functional safety, mandate this option being set or otherwise will respond with 134 - * -BPMP_EBADMSG and ignore the request. 130 + * -#BPMP_EBADMSG and ignore the request. 135 131 * 136 132 * **xid** is a transaction ID. 137 133 * 138 134 * Only used when #BPMP_MAIL_CRC_PRESENT is set. 139 135 * 140 136 * **payload_length** of the message expressed in bytes without the size of this header. 141 - * See table below for minimum accepted payload lengths for each MRQ. 142 - * Note: For DMCE communication, this field expresses the length as a multiple of 4 bytes 143 - * rather than bytes. 137 + * See tables below for minimum accepted payload lengths for each MRQ. 144 138 * 145 139 * Only used when #BPMP_MAIL_CRC_PRESENT is set. 146 140 * 147 - * | MRQ | CMD | minimum payload length 148 - * | -------------------- | ------------------------------------ | ------------------------------------------ | 149 - * | MRQ_PING | | 4 | 150 - * | MRQ_THREADED_PING | | 4 | 151 - * | MRQ_RESET | any | 8 | 152 - * | MRQ_I2C | | 12 + cmd_i2c_xfer_request.data_size | 153 - * | MRQ_CLK | CMD_CLK_GET_RATE | 4 | 154 - * | MRQ_CLK | CMD_CLK_SET_RATE | 16 | 155 - * | MRQ_CLK | CMD_CLK_ROUND_RATE | 16 | 156 - * | MRQ_CLK | CMD_CLK_GET_PARENT | 4 | 157 - * | MRQ_CLK | CMD_CLK_SET_PARENT | 8 | 158 - * | MRQ_CLK | CMD_CLK_ENABLE | 4 | 159 - * | MRQ_CLK | CMD_CLK_DISABLE | 4 | 160 - * | MRQ_CLK | CMD_CLK_IS_ENABLED | 4 | 161 - * | MRQ_CLK | CMD_CLK_GET_ALL_INFO | 4 | 162 - * | MRQ_CLK | CMD_CLK_GET_MAX_CLK_ID | 4 | 163 - * | MRQ_CLK | CMD_CLK_GET_FMAX_AT_VMIN | 4 | 164 - * | MRQ_QUERY_ABI | | 4 | 165 - * | MRQ_PG | CMD_PG_QUERY_ABI | 12 | 166 - * | MRQ_PG | CMD_PG_SET_STATE | 12 | 167 - * | MRQ_PG | CMD_PG_GET_STATE | 8 | 168 - * | MRQ_PG | CMD_PG_GET_NAME | 8 | 169 - * | MRQ_PG | CMD_PG_GET_MAX_ID | 8 | 170 - * | MRQ_THERMAL | CMD_THERMAL_QUERY_ABI | 8 | 171 - * | MRQ_THERMAL | CMD_THERMAL_GET_TEMP | 8 | 172 - * | MRQ_THERMAL | CMD_THERMAL_SET_TRIP | 20 | 173 - * | MRQ_THERMAL | CMD_THERMAL_GET_NUM_ZONES | 4 | 174 - * | MRQ_THERMAL | CMD_THERMAL_GET_THERMTRIP | 8 | 175 - * | MRQ_CPU_VHINT | | 8 | 176 - * | MRQ_ABI_RATCHET | | 2 | 177 - * | MRQ_EMC_DVFS_LATENCY | | 8 | 178 - * | MRQ_EMC_DVFS_EMCHUB | | 8 | 179 - * | MRQ_EMC_DISP_RFL | | 4 | 180 - * | MRQ_BWMGR | CMD_BWMGR_QUERY_ABI | 8 | 181 - * | MRQ_BWMGR | CMD_BWMGR_CALC_RATE | 8 + 8 * bwmgr_rate_req.num_iso_clients | 182 - * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_QUERY_ABI | 8 | 183 - * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_CALCULATE_LA | 16 | 184 - * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_SET_LA | 16 | 185 - * | MRQ_ISO_CLIENT | CMD_ISO_CLIENT_GET_MAX_BW | 8 | 186 - * | MRQ_CPU_NDIV_LIMITS | | 4 | 187 - * | MRQ_CPU_AUTO_CC3 | | 4 | 188 - * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 | 189 - * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_READ | 5 | 190 - * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len | 191 - * | MRQ_RINGBUF_CONSOLE | CMD_RINGBUF_CONSOLE_GET_FIFO | 4 | 192 - * | MRQ_STRAP | STRAP_SET | 12 | 193 - * | MRQ_UPHY | CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 | 194 - * | MRQ_UPHY | CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 | 195 - * | MRQ_UPHY | CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 | 196 - * | MRQ_UPHY | CMD_UPHY_PCIE_CONTROLLER_STATE | 6 | 197 - * | MRQ_UPHY | CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 | 198 - * | MRQ_FMON | CMD_FMON_GEAR_CLAMP | 16 | 199 - * | MRQ_FMON | CMD_FMON_GEAR_FREE | 4 | 200 - * | MRQ_FMON | CMD_FMON_GEAR_GET | 4 | 201 - * | MRQ_FMON | CMD_FMON_FAULT_STS_GET | 8 | 202 - * | MRQ_EC | CMD_EC_STATUS_EX_GET | 12 | 203 - * | MRQ_QUERY_FW_TAG | | 0 | 204 - * | MRQ_DEBUG | CMD_DEBUG_OPEN_RO | 4 + length of cmd_debug_fopen_request.name | 205 - * | MRQ_DEBUG | CMD_DEBUG_OPEN_WO | 4 + length of cmd_debug_fopen_request.name | 206 - * | MRQ_DEBUG | CMD_DEBUG_READ | 8 | 207 - * | MRQ_DEBUG | CMD_DEBUG_WRITE | 12 + cmd_debug_fwrite_request.datalen | 208 - * | MRQ_DEBUG | CMD_DEBUG_CLOSE | 8 | 209 - * | MRQ_TELEMETRY | | 8 | 210 - * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_QUERY_ABI | 8 | 211 - * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_SET | 20 | 212 - * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_GET | 16 | 213 - * | MRQ_PWR_LIMIT | CMD_PWR_LIMIT_CURR_CAP | 8 | 214 - * | MRQ_GEARS | | 0 | 215 - * | MRQ_BWMGR_INT | CMD_BWMGR_INT_QUERY_ABI | 8 | 216 - * | MRQ_BWMGR_INT | CMD_BWMGR_INT_CALC_AND_SET | 16 | 217 - * | MRQ_BWMGR_INT | CMD_BWMGR_INT_CAP_SET | 8 | 218 - * | MRQ_OC_STATUS | | 0 | 141 + * | MRQ | Sub-command | Minimum payload length 142 + * | --------------------- | ------------------------------------ | ------------------------------------------------------- | 143 + * | #MRQ_PING | - | 4 | 144 + * | #MRQ_THREADED_PING | - | 4 | 145 + * | #MRQ_RESET | any | 8 | 146 + * | #MRQ_I2C | - | 12 + cmd_i2c_xfer_request.data_size | 147 + * | #MRQ_CLK | #CMD_CLK_GET_RATE | 4 | 148 + * | #MRQ_CLK | #CMD_CLK_SET_RATE | 16 | 149 + * | #MRQ_CLK | #CMD_CLK_ROUND_RATE | 16 | 150 + * | #MRQ_CLK | #CMD_CLK_GET_PARENT | 4 | 151 + * | #MRQ_CLK | #CMD_CLK_SET_PARENT | 8 | 152 + * | #MRQ_CLK | #CMD_CLK_ENABLE | 4 | 153 + * | #MRQ_CLK | #CMD_CLK_DISABLE | 4 | 154 + * | #MRQ_CLK | #CMD_CLK_IS_ENABLED | 4 | 155 + * | #MRQ_CLK | #CMD_CLK_GET_ALL_INFO | 4 | 156 + * | #MRQ_CLK | #CMD_CLK_GET_MAX_CLK_ID | 4 | 157 + * | #MRQ_CLK | #CMD_CLK_GET_FMAX_AT_VMIN | 4 | 158 + * | #MRQ_QUERY_ABI | - | 4 | 159 + * | #MRQ_PG | #CMD_PG_QUERY_ABI | 12 | 160 + * | #MRQ_PG | #CMD_PG_SET_STATE | 12 | 161 + * | #MRQ_PG | #CMD_PG_GET_STATE | 8 | 162 + * | #MRQ_PG | #CMD_PG_GET_NAME | 8 | 163 + * | #MRQ_PG | #CMD_PG_GET_MAX_ID | 8 | 164 + * | #MRQ_THERMAL | #CMD_THERMAL_QUERY_ABI | 8 | 165 + * | #MRQ_THERMAL | #CMD_THERMAL_GET_TEMP | 8 | 166 + * | #MRQ_THERMAL | #CMD_THERMAL_GET_NUM_ZONES | 4 | 167 + * | #MRQ_THERMAL | #CMD_THERMAL_GET_THERMTRIP | 8 | 168 + * | #MRQ_ABI_RATCHET | - | 2 | 169 + * | #MRQ_EMC_DVFS_LATENCY | - | 8 | 170 + * | #MRQ_QUERY_FW_TAG | - | 0 | 171 + * | #MRQ_DEBUG | #CMD_DEBUG_OPEN_RO | 4 + length of cmd_debug_fopen_request.name | 172 + * | #MRQ_DEBUG | #CMD_DEBUG_OPEN_WO | 4 + length of cmd_debug_fopen_request.name | 173 + * | #MRQ_DEBUG | #CMD_DEBUG_READ | 8 | 174 + * | #MRQ_DEBUG | #CMD_DEBUG_WRITE | 12 + cmd_debug_fwrite_request.datalen | 175 + * | #MRQ_DEBUG | #CMD_DEBUG_CLOSE | 8 | 176 + * 177 + * @cond (bpmp_t186) 178 + * The following additional MRQ is supported on T186 -platform: 179 + * 180 + * | MRQ | Sub-command | Minimum payload length | 181 + * | --------------------- | ------------------------------------- | ------------------------------------- | 182 + * | #MRQ_CPU_VHINT | - | 8 | 183 + * | #MRQ_THERMAL | #CMD_THERMAL_SET_TRIP | 20 | 184 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 | 185 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_READ | 5 | 186 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len | 187 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_GET_FIFO | 4 | 188 + * @endcond 189 + * 190 + * @cond (bpmp_t194) 191 + * The following additional MRQs are supported on T194 -platform: 192 + * 193 + * | MRQ | Sub-command | Minimum payload length | 194 + * | --------------------- | ------------------------------------- | ------------------------------------- | 195 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 196 + * | #MRQ_STRAP | #STRAP_SET | 12 | 197 + * | #MRQ_CPU_AUTO_CC3 | - | 4 | 198 + * | #MRQ_EC | #CMD_EC_STATUS_EX_GET | 12 | 199 + * | #MRQ_FMON | #CMD_FMON_GEAR_CLAMP | 16 | 200 + * | #MRQ_FMON | #CMD_FMON_GEAR_FREE | 4 | 201 + * | #MRQ_FMON | #CMD_FMON_GEAR_GET | 4 | 202 + * | #MRQ_FMON | #CMD_FMON_FAULT_STS_GET | 8 | 203 + * | #MRQ_THERMAL | #CMD_THERMAL_SET_TRIP | 20 | 204 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 | 205 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_READ | 5 | 206 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len | 207 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_GET_FIFO | 4 | 208 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 | 209 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 | 210 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 | 211 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_CONTROLLER_STATE | 6 | 212 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 | 213 + * @endcond 214 + * 215 + * @cond (bpmp_safe && bpmp_t234) 216 + * The following additional MRQ is supported on functional-safety 217 + * builds for the T234 platform: 218 + * 219 + * | MRQ | Sub-command | Minimum payload length | 220 + * | --------------------- | ------------------------------------- | ------------------------------------- | 221 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 222 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 | 223 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_READ | 5 | 224 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len | 225 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_GET_FIFO | 4 | 226 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 | 227 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 | 228 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 | 229 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_CONTROLLER_STATE | 6 | 230 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 | 231 + * | #MRQ_FMON | #CMD_FMON_GEAR_CLAMP | 16 | 232 + * | #MRQ_FMON | #CMD_FMON_GEAR_FREE | 4 | 233 + * | #MRQ_FMON | #CMD_FMON_GEAR_GET | 4 | 234 + * | #MRQ_FMON | #CMD_FMON_FAULT_STS_GET | 8 | 235 + * | #MRQ_EMC_DVFS_EMCHUB | - | 8 | 236 + * | #MRQ_EMC_DISP_RFL | - | 4 | 237 + * 238 + * @endcond 239 + * 240 + * @cond (!bpmp_safe && bpmp_t234) 241 + * 242 + * The following additional MRQs are supported on non-functional-safety 243 + * builds for the T234 and T238 -platforms: 244 + * 245 + * | MRQ | Sub-command | Minimum payload length | 246 + * | --------------------- | ------------------------------------- | --------------------------------------------------- | 247 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 248 + * | #MRQ_STRAP | #STRAP_SET | 12 | 249 + * | #MRQ_THERMAL | #CMD_THERMAL_SET_TRIP | 20 | 250 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 | 251 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_READ | 5 | 252 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len | 253 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_GET_FIFO | 4 | 254 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 | 255 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 | 256 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 | 257 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_CONTROLLER_STATE | 6 | 258 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 | 259 + * | #MRQ_FMON | #CMD_FMON_GEAR_CLAMP | 16 | 260 + * | #MRQ_FMON | #CMD_FMON_GEAR_FREE | 4 | 261 + * | #MRQ_FMON | #CMD_FMON_GEAR_GET | 4 | 262 + * | #MRQ_FMON | #CMD_FMON_FAULT_STS_GET | 8 | 263 + * | #MRQ_EMC_DVFS_EMCHUB | - | 8 | 264 + * | #MRQ_EMC_DISP_RFL | - | 4 | 265 + * | #MRQ_BWMGR | #CMD_BWMGR_QUERY_ABI | 8 | 266 + * | #MRQ_BWMGR | #CMD_BWMGR_CALC_RATE | 8 + 8 * cmd_bwmgr_calc_rate_request.num_iso_clients | 267 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_QUERY_ABI | 8 | 268 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_CALCULATE_LA | 16 | 269 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_SET_LA | 16 | 270 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_GET_MAX_BW | 8 | 271 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_QUERY_ABI | 8 | 272 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CALC_AND_SET | 16 | 273 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CAP_SET | 8 | 274 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_GET_LAST_REQUEST | 9 | 275 + * | #MRQ_OC_STATUS | - | 0 | 276 + * @endcond 277 + * 278 + * @cond bpmp_t238 279 + * The following additional MRQs are supported on T238 platform: 280 + * 281 + * | MRQ | Sub-command | Minimum payload length | 282 + * | --------------------- | ------------------------------------- | --------------------------------------------------- | 283 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 284 + * | #MRQ_STRAP | #STRAP_SET | 12 | 285 + * | #MRQ_THERMAL | #CMD_THERMAL_SET_TRIP | 20 | 286 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_QUERY_ABI | 8 | 287 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_READ | 5 | 288 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_WRITE | 5 + cmd_ringbuf_console_write_req.len | 289 + * | #MRQ_RINGBUF_CONSOLE | #CMD_RINGBUF_CONSOLE_GET_FIFO | 4 | 290 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 | 291 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 | 292 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 | 293 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_CONTROLLER_STATE | 6 | 294 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 | 295 + * | #MRQ_FMON | #CMD_FMON_GEAR_CLAMP | 16 | 296 + * | #MRQ_FMON | #CMD_FMON_GEAR_FREE | 4 | 297 + * | #MRQ_FMON | #CMD_FMON_GEAR_GET | 4 | 298 + * | #MRQ_FMON | #CMD_FMON_FAULT_STS_GET | 8 | 299 + * | #MRQ_EMC_DVFS_EMCHUB | - | 8 | 300 + * | #MRQ_EMC_DISP_RFL | - | 4 | 301 + * | #MRQ_BWMGR | #CMD_BWMGR_QUERY_ABI | 8 | 302 + * | #MRQ_BWMGR | #CMD_BWMGR_CALC_RATE | 8 + 8 * cmd_bwmgr_calc_rate_request.num_iso_clients | 303 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_QUERY_ABI | 8 | 304 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_CALCULATE_LA | 16 | 305 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_SET_LA | 16 | 306 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_GET_MAX_BW | 8 | 307 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_QUERY_ABI | 8 | 308 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CALC_AND_SET | 16 | 309 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CAP_SET | 8 | 310 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_GET_LAST_REQUEST | 9 | 311 + * | #MRQ_OC_STATUS | - | 0 | 312 + * | #MRQ_THROTTLE | #CMD_THROTTLE_SET_OC_CONFIG | 5 | 313 + * @endcond 314 + * 315 + * @cond (bpmp_th500) 316 + * The following additional MRQs are supported on TH500 -platform: 317 + * 318 + * | MRQ | Sub-command | Minimum payload length | 319 + * | -------------------- | ------------------------------------- | ---------------------- | 320 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 321 + * | #MRQ_THERMAL | #CMD_THERMAL_SET_TRIP | 20 | 322 + * | #MRQ_STRAP | #STRAP_SET | 12 | 323 + * | #MRQ_SHUTDOWN | - | 4 | 324 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | 24 | 325 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_LANE_MARGIN_STATUS | 4 | 326 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT | 5 | 327 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_CONTROLLER_STATE | 6 | 328 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF | 5 | 329 + * | #MRQ_UPHY | #CMD_UPHY_PCIE_CONFIG_VDM | 3 | 330 + * | #MRQ_TELEMETRY | - | 8 | 331 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_QUERY_ABI | 8 | 332 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_SET | 20 | 333 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_GET | 16 | 334 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_CURR_CAP | 8 | 335 + * | #MRQ_GEARS | - | 0 | 336 + * | #MRQ_C2C | #CMD_C2C_QUERY_ABI | 8 | 337 + * | #MRQ_C2C | #CMD_C2C_START_INITIALIZATION | 5 | 338 + * | #MRQ_C2C | #CMD_C2C_GET_STATUS | 4 | 339 + * | #MRQ_C2C | #CMD_C2C_HOTRESET_PREP | 5 | 340 + * | #MRQ_C2C | #CMD_C2C_START_HOTRESET | 5 | 341 + * | #MRQ_THROTTLE | #CMD_THROTTLE_QUERY_ABI | 4 | 342 + * | #MRQ_THROTTLE | #CMD_THROTTLE_GET_CHIPTHROT_STATUS | 4 | 343 + * | #MRQ_PWRMODEL | #CMD_PWRMODEL_QUERY_ABI | 8 | 344 + * | #MRQ_PWRMODEL | #CMD_PWRMODEL_PWR_GET | 16 | 345 + * | #MRQ_PWR_CNTRL | #CMD_PWR_CNTRL_QUERY_ABI | 8 | 346 + * | #MRQ_PWR_CNTRL | #CMD_PWR_CNTRL_BYPASS_SET | 12 | 347 + * | #MRQ_PWR_CNTRL | #CMD_PWR_CNTRL_BYPASS_GET | 8 | 348 + * @endcond 349 + * 350 + * @cond (bpmp_tb500) 351 + * The following additional MRQs are supported on TB500 -platform: 352 + * 353 + * | MRQ | Sub-command | Minimum payload length | 354 + * | -------------------- | ---------------------------------------- | ---------------------- | 355 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_QUERY_ABI | 8 | 356 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_SET | 20 | 357 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_GET | 16 | 358 + * | #MRQ_PWR_LIMIT | #CMD_PWR_LIMIT_CURR_CAP | 8 | 359 + * | #MRQ_TELEMETRY_EX | #CMD_TELEMETRY_EX_QUERY_ABI | 8 | 360 + * | #MRQ_TELEMETRY_EX | #CMD_TELEMETRY_EX_BASE_SZ_GET | 12 | 361 + * | #MRQ_THROTTLE | #CMD_THROTTLE_GET_CHIPTHROT_STATUS | 4 | 362 + * | #MRQ_C2C | #CMD_C2C_QUERY_ABI | 8 | 363 + * | #MRQ_C2C | #CMD_C2C_START_INITIALIZATION | 5 | 364 + * | #MRQ_C2C | #CMD_C2C_GET_STATUS | 4 | 365 + * | #MRQ_C2C | #CMD_C2C_HOTRESET_PREP | 5 | 366 + * | #MRQ_C2C | #CMD_C2C_START_HOTRESET | 5 | 367 + * | MRQ_HWPM | CMD_HWPM_QUERY_ABI | 4 | 368 + * | MRQ_HWPM | CMD_HWPM_IPMU_SET_TRIGGERS | 120 | 369 + * | MRQ_HWPM | CMD_HWPM_IPMU_SET_PAYLOADS_SHIFTS | 120 | 370 + * | MRQ_HWPM | CMD_HWPM_IPMU_GET_MAX_PAYLOADS | 0 | 371 + * | MRQ_HWPM | CMD_HWPM_NVTHERM_SET_SAMPLE_RATE | 4 | 372 + * | MRQ_HWPM | CMD_HWPM_NVTHERM_SET_BUBBLE_INTERVAL | 4 | 373 + * | MRQ_HWPM | CMD_HWPM_NVTHERM_SET_FLEX_CHANNELS | 120 | 374 + * | MRQ_HWPM | CMD_HWPM_ISENSE_GET_SENSOR_NAME | 4 | 375 + * | MRQ_HWPM | CMD_HWPM_ISENSE_GET_SENSOR_CHANNEL | 4 | 376 + * | MRQ_HWPM | CMD_HWPM_ISENSE_GET_SENSOR_SCALE_FACTOR | 4 | 377 + * | MRQ_HWPM | CMD_HWPM_ISENSE_GET_SENSOR_OFFSET | 4 | 378 + * | MRQ_HWPM | CMD_HWPM_ISENSE_GET_SUM_BLOCK_NAME | 4 | 379 + * | MRQ_HWPM | CMD_HWPM_ISENSE_GET_SUM_BLOCK_INPUTS | 4 | 380 + * | MRQ_DVFS | CMD_DVFS_QUERY_ABI | 4 | 381 + * | MRQ_DVFS | CMD_DVFS_SET_CTRL_STATE | 8 | 382 + * | MRQ_DVFS | CMD_DVFS_SET_MGR_STATE | 8 | 383 + * | MRQ_PPP_PROFILE | CMD_PPP_PROFILE_QUERY_ABI | 8 | 384 + * | MRQ_PPP_PROFILE | CMD_PPP_PROFILE_QUERY_MASKS | 8 | 385 + * | MRQ_PPP_PROFILE | CMD_PPP_CORE_QUERY_CPU_MASK | 8 | 386 + * | MRQ_PPP_PROFILE | CMD_PPP_AVAILABLE_QUERY | 4 | 387 + * @endcond 388 + * 389 + * @cond (bpmp_safe && bpmp_t264) 390 + * The following additional MRQ is supported on functional-safety 391 + * builds for the T264 platform: 392 + * 393 + * | MRQ | Sub-command | Minimum payload length | 394 + * | -------------------- | --------------------------------- | ---------------------- | 395 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 396 + * | #MRQ_STRAP | #STRAP_SET | 12 | 397 + * | #MRQ_SHUTDOWN | - | 4 | 398 + * | #MRQ_FMON | #CMD_FMON_GEAR_CLAMP | 16 | 399 + * | #MRQ_FMON | #CMD_FMON_GEAR_FREE | 4 | 400 + * | #MRQ_FMON | #CMD_FMON_GEAR_GET | 4 | 401 + * | #MRQ_FMON | #CMD_FMON_FAULT_STS_GET | 8 | 402 + * | #MRQ_PCIE | #CMD_PCIE_EP_CONTROLLER_INIT | 5 | 403 + * | #MRQ_PCIE | #CMD_PCIE_EP_CONTROLLER_OFF | 5 | 404 + * | #MRQ_CR7 | #CMD_CR7_ENTRY | 12 | 405 + * | #MRQ_CR7 | #CMD_CR7_EXIT | 12 | 406 + * | #MRQ_SLC | #CMD_SLC_QUERY_ABI | 8 | 407 + * | #MRQ_SLC | #CMD_SLC_BYPASS_SET | 8 | 408 + * | #MRQ_SLC | #CMD_SLC_BYPASS_GET | 4 | 409 + * @endcond 410 + * 411 + * @cond (!bpmp_safe && bpmp_t264) 412 + * The following additional MRQs are supported on non-functional-safety 413 + * builds for the T264 -platform: 414 + * 415 + * | MRQ | Sub-command | Minimum payload length | 416 + * | -------------------- | --------------------------------- | ---------------------- | 417 + * | #MRQ_CPU_NDIV_LIMITS | - | 4 | 418 + * | #MRQ_STRAP | #STRAP_SET | 12 | 419 + * | #MRQ_SHUTDOWN | - | 4 | 420 + * | #MRQ_FMON | #CMD_FMON_GEAR_CLAMP | 16 | 421 + * | #MRQ_FMON | #CMD_FMON_GEAR_FREE | 4 | 422 + * | #MRQ_FMON | #CMD_FMON_GEAR_GET | 4 | 423 + * | #MRQ_FMON | #CMD_FMON_FAULT_STS_GET | 8 | 424 + * | #MRQ_OC_STATUS | - | 0 | 425 + * | #MRQ_PCIE | #CMD_PCIE_EP_CONTROLLER_INIT | 5 | 426 + * | #MRQ_PCIE | #CMD_PCIE_EP_CONTROLLER_OFF | 5 | 427 + * | #MRQ_PCIE | #CMD_PCIE_RP_CONTROLLER_OFF | 5 | 428 + * | #MRQ_CR7 | #CMD_CR7_ENTRY | 12 | 429 + * | #MRQ_CR7 | #CMD_CR7_EXIT | 12 | 430 + * | #MRQ_SLC | #CMD_SLC_QUERY_ABI | 8 | 431 + * | #MRQ_SLC | #CMD_SLC_BYPASS_SET | 8 | 432 + * | #MRQ_SLC | #CMD_SLC_BYPASS_GET | 4 | 433 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_QUERY_ABI | 8 | 434 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_CALCULATE_LA | 16 | 435 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_SET_LA | 16 | 436 + * | #MRQ_ISO_CLIENT | #CMD_ISO_CLIENT_GET_MAX_BW | 8 | 437 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_QUERY_ABI | 8 | 438 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CALC_AND_SET | 16 | 439 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CAP_SET | 8 | 440 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_CURR_AVAILABLE_BW | 8 | 441 + * | #MRQ_BWMGR_INT | #CMD_BWMGR_INT_GET_LAST_REQUEST | 9 | 442 + * @endcond 219 443 * 220 444 * **crc16** 221 445 * ··· 452 220 * including this header. However the crc16 field is considered to be set to 0 when 453 221 * calculating the CRC. Only used when #BPMP_MAIL_CRC_PRESENT is set. If 454 222 * #BPMP_MAIL_CRC_PRESENT is set and this field does not match the CRC as 455 - * calculated by BPMP, -BPMP_EBADMSG will be returned and the request will 223 + * calculated by BPMP, -#BPMP_EBADMSG will be returned and the request will 456 224 * be ignored. See code snippet below on how to calculate the CRC. 457 225 * 458 226 * @code ··· 554 322 #define MRQ_CPU_VHINT 28U 555 323 #define MRQ_ABI_RATCHET 29U 556 324 #define MRQ_EMC_DVFS_LATENCY 31U 325 + //adoc: tag::bpmp_dmce_mrq_shutdown[] 326 + #define MRQ_SHUTDOWN 49U 327 + //adoc: end::bpmp_dmce_mrq_shutdown[] 557 328 #define MRQ_RINGBUF_CONSOLE 65U 558 329 #define MRQ_PG 66U 559 330 #define MRQ_CPU_NDIV_LIMITS 67U ··· 576 341 #define MRQ_GEARS 82U 577 342 #define MRQ_BWMGR_INT 83U 578 343 #define MRQ_OC_STATUS 84U 579 - 580 - /** @cond DEPRECATED */ 581 - #define MRQ_RESERVED_2 2U 582 - #define MRQ_RESERVED_3 3U 583 - #define MRQ_RESERVED_4 4U 584 - #define MRQ_RESERVED_5 5U 585 - #define MRQ_RESERVED_6 6U 586 - #define MRQ_RESERVED_7 7U 587 - #define MRQ_RESERVED_8 8U 588 - #define MRQ_RESERVED_10 10U 589 - #define MRQ_RESERVED_11 11U 590 - #define MRQ_RESERVED_12 12U 591 - #define MRQ_RESERVED_13 13U 592 - #define MRQ_RESERVED_14 14U 593 - #define MRQ_RESERVED_15 15U 594 - #define MRQ_RESERVED_16 16U 595 - #define MRQ_RESERVED_17 17U 596 - #define MRQ_RESERVED_18 18U 597 - #define MRQ_RESERVED_24 24U 598 - #define MRQ_RESERVED_25 25U 599 - #define MRQ_RESERVED_26 26U 600 - #define MRQ_RESERVED_30 30U 601 - #define MRQ_RESERVED_64 64U 602 - #define MRQ_RESERVED_74 74U 603 - /** @endcond DEPRECATED */ 604 - 605 - /** @} */ 344 + #define MRQ_C2C 85U 345 + #define MRQ_THROTTLE 86U 346 + #define MRQ_PWRMODEL 87U 347 + #define MRQ_PCIE 88U 348 + #define MRQ_PWR_CNTRL 89U 349 + #define MRQ_CR7 90U 350 + #define MRQ_SLC 91U 351 + #define MRQ_TELEMETRY_EX 92U 352 + #define MRQ_HWPM 93U 353 + #define MRQ_DVFS 94U 354 + #define MRQ_PPP_PROFILE 95U 606 355 607 356 /** 608 - * @ingroup MRQ_Codes 609 357 * @brief Maximum MRQ code to be sent by CPU software to 610 358 * BPMP. Subject to change in future 611 359 */ 612 - #define MAX_CPU_MRQ_ID 84U 360 + #define MAX_CPU_MRQ_ID 95U 361 + 362 + /** @} */ 613 363 614 364 /** 615 365 * @addtogroup MRQ_Payloads 616 366 * @{ 617 367 * @defgroup Ping Ping 618 368 * @defgroup Query_Tag Query Tag 619 - * @defgroup Module Loadable Modules 620 - * @defgroup Trace Trace 621 369 * @defgroup Debugfs Debug File System 622 370 * @defgroup Reset Reset 623 371 * @defgroup I2C I2C ··· 608 390 * @defgroup ABI_info ABI Info 609 391 * @defgroup Powergating Power Gating 610 392 * @defgroup Thermal Thermal 393 + * @defgroup Throttle Throttle 611 394 * @defgroup OC_status OC status 612 395 * @defgroup Vhint CPU Voltage hint 613 396 * @defgroup EMC EMC ··· 624 405 * @defgroup Telemetry Telemetry 625 406 * @defgroup Pwrlimit PWR_LIMIT 626 407 * @defgroup Gears Gears 408 + * @defgroup Shutdown Shutdown 627 409 * @defgroup BWMGR_INT Bandwidth Manager Integrated 410 + * @defgroup C2C C2C 411 + * @defgroup Pwrmodel Power Model 412 + * @defgroup Pwrcntrl Power Controllers 413 + * @cond bpmp_t264 414 + * * @defgroup PCIE PCIE 415 + * * @defgroup CR7 CR7 416 + * * @defgroup Slc Slc 417 + * @endcond 418 + * @cond bpmp_tb500 419 + * * @defgroup Telemetry_ex Telemetry Expanded 420 + * * @defgroup HWPM Hardware Performance Monitoring 421 + * * @defgroup DVFS Dynamic Voltage and Frequency Scaling 422 + * * @defgroup PPP power/performance profiles 423 + * @endcond 628 424 * @} MRQ_Payloads 629 425 */ 630 426 ··· 648 414 * @def MRQ_PING 649 415 * @brief A simple ping 650 416 * 651 - * * Platforms: All 652 417 * * Initiators: Any 653 418 * * Targets: Any 654 419 * * Request Payload: @ref mrq_ping_request ··· 657 424 * @def MRQ_THREADED_PING 658 425 * @brief A deeper ping 659 426 * 660 - * * Platforms: All 661 427 * * Initiators: Any 662 428 * * Targets: BPMP 663 429 * * Request Payload: @ref mrq_ping_request ··· 673 441 * @brief Request with #MRQ_PING 674 442 * 675 443 * Used by the sender of an #MRQ_PING message to request a pong from 676 - * recipient. The response from the recipient is computed based on 677 - * #challenge. 444 + * recipient. The response from the recipient is computed based on the 445 + * mrq_ping_request::challenge -value. 678 446 */ 679 447 struct mrq_ping_request { 680 448 /** @brief Arbitrarily chosen value */ ··· 702 470 * 703 471 * @deprecated Use #MRQ_QUERY_FW_TAG instead. 704 472 * 705 - * * Platforms: All 473 + * @details 706 474 * * Initiators: CCPLEX 707 475 * * Targets: BPMP 708 476 * * Request Payload: @ref mrq_query_tag_request ··· 715 483 * @brief Request with #MRQ_QUERY_TAG 716 484 * 717 485 * @deprecated This structure will be removed in future version. 718 - * Use MRQ_QUERY_FW_TAG instead. 486 + * Use #MRQ_QUERY_FW_TAG instead. 719 487 */ 720 488 struct mrq_query_tag_request { 721 489 /** @brief Base address to store the firmware tag */ ··· 728 496 * @def MRQ_QUERY_FW_TAG 729 497 * @brief Query BPMP firmware's tag (i.e. unique identifier) 730 498 * 731 - * * Platforms: All 732 499 * * Initiators: Any 733 500 * * Targets: BPMP 734 501 * * Request Payload: N/A ··· 741 510 * 742 511 * Sent in response to #MRQ_QUERY_FW_TAG message. #tag contains the unique 743 512 * identifier for the version of firmware issuing the reply. 744 - * 745 513 */ 746 514 struct mrq_query_fw_tag_response { 747 - /** @brief Array to store tag information */ 515 + /** @brief Array to store tag information */ 748 516 uint8_t tag[32]; 749 517 } BPMP_ABI_PACKED; 750 518 ··· 762 532 * @def MRQ_DEBUGFS 763 533 * @brief Interact with BPMP's debugfs file nodes 764 534 * 765 - * @deprecated use MRQ_DEBUG instead. 535 + * @deprecated Use #MRQ_DEBUG instead. 766 536 * 767 - * * Platforms: T186, T194 768 537 * * Initiators: Any 769 538 * * Targets: BPMP 770 539 * * Request Payload: @ref mrq_debugfs_request ··· 855 626 856 627 /** 857 628 * @ingroup Debugfs 858 - * @brief Request with #MRQ_DEBUGFS. 629 + * @brief Request with #MRQ_DEBUG. 859 630 * 860 - * The sender of an MRQ_DEBUGFS message uses #cmd to specify a debugfs 631 + * The sender of an MRQ_DEBUG message uses #cmd to specify a debugfs 861 632 * command to execute. Legal commands are the values of @ref 862 633 * mrq_debugfs_commands. Each command requires a specific additional 863 634 * payload of data. ··· 905 676 /** 906 677 * @ingroup MRQ_Codes 907 678 * @def MRQ_DEBUG 908 - * @brief Interact with BPMP's debugfs file nodes. Use message payload 679 + * @brief Interact with BPMP-FW debugfs file nodes. Use message payload 909 680 * for exchanging data. This is functionally equivalent to 910 - * @ref MRQ_DEBUGFS. But the way in which data is exchanged is different. 911 - * When software running on CPU tries to read a debugfs file, 681 + * the deprecated MRQ_DEBUGFS but the way in which data is exchanged is 682 + * different. When software running on CPU tries to read a debugfs file, 912 683 * the file path and read data will be stored in message payload. 913 684 * Since the message payload size is limited, a debugfs file 914 685 * transaction might require multiple frames of data exchanged 915 686 * between BPMP and CPU until the transaction completes. 916 687 * 917 - * * Platforms: T194 918 688 * * Initiators: Any 919 689 * * Targets: BPMP 920 690 * * Request Payload: @ref mrq_debug_request ··· 922 694 923 695 /** @ingroup Debugfs */ 924 696 enum mrq_debug_commands { 925 - /** @brief Open required file for read operation */ 697 + /** 698 + * @brief Open file represented by the path in 699 + * cmd_debug_fopen_request::name for read operation 700 + */ 926 701 CMD_DEBUG_OPEN_RO = 0, 927 - /** @brief Open required file for write operation */ 702 + /** 703 + * @brief Open file represented by the path in 704 + * cmd_debug_fopen_request::name for write operation 705 + */ 928 706 CMD_DEBUG_OPEN_WO = 1, 929 - /** @brief Perform read */ 707 + /** 708 + * @brief Perform read on a previously opened file handle represented 709 + * by the cmd_debug_fread_request::fd -value. 710 + */ 930 711 CMD_DEBUG_READ = 2, 931 - /** @brief Perform write */ 712 + /** 713 + * @brief Perform write on a previously opened file handle represented 714 + * by the cmd_debug_fwrite_request::fd -value. 715 + */ 932 716 CMD_DEBUG_WRITE = 3, 933 - /** @brief Close file */ 717 + /** 718 + * @brief Close previously opened file handle. 719 + */ 934 720 CMD_DEBUG_CLOSE = 4, 935 - /** @brief Not a command */ 721 + /** 722 + * @brief Not a command, represents maximum number of supported 723 + * sub-commands 724 + */ 936 725 CMD_DEBUG_MAX 937 726 }; 938 727 ··· 972 727 973 728 /** 974 729 * @ingroup Debugfs 975 - * @brief Parameters for CMD_DEBUG_OPEN command 730 + * @brief Parameters for #CMD_DEBUG_OPEN_RO and #CMD_DEBUG_OPEN_WO -commands 976 731 */ 977 732 struct cmd_debug_fopen_request { 978 - /** @brief File name - Null-terminated string with maximum 979 - * length @ref DEBUG_FNAME_MAX_SZ 733 + /** 734 + * @brief File name - Null-terminated string with maximum 735 + * length including the terminator defined by the 736 + * #DEBUG_FNAME_MAX_SZ -preprocessor constant. 980 737 */ 981 738 char name[DEBUG_FNAME_MAX_SZ]; 982 739 } BPMP_ABI_PACKED; 983 740 984 741 /** 985 742 * @ingroup Debugfs 986 - * @brief Response data for CMD_DEBUG_OPEN_RO/WO command 743 + * @brief Response data for #CMD_DEBUG_OPEN_RO and #CMD_DEBUG_OPEN_WO commands 987 744 */ 988 745 struct cmd_debug_fopen_response { 989 746 /** @brief Identifier for file access */ 990 747 uint32_t fd; 991 748 /** @brief Data length. File data size for READ command. 992 - * Maximum allowed length for WRITE command 749 + * Maximum allowed length for WRITE command 993 750 */ 994 751 uint32_t datalen; 995 752 } BPMP_ABI_PACKED; 996 753 997 754 /** 998 755 * @ingroup Debugfs 999 - * @brief Parameters for CMD_DEBUG_READ command 756 + * @brief Parameters for #CMD_DEBUG_READ command 1000 757 */ 1001 758 struct cmd_debug_fread_request { 1002 - /** @brief File access identifier received in response 1003 - * to CMD_DEBUG_OPEN_RO request 759 + /** 760 + * @brief File access identifier received in response 761 + * to #CMD_DEBUG_OPEN_RO request 1004 762 */ 1005 763 uint32_t fd; 1006 764 } BPMP_ABI_PACKED; ··· 1018 770 1019 771 /** 1020 772 * @ingroup Debugfs 1021 - * @brief Response data for CMD_DEBUG_READ command 773 + * @brief Response data for #CMD_DEBUG_READ command 1022 774 */ 1023 775 struct cmd_debug_fread_response { 1024 776 /** @brief Size of data provided in this response in bytes */ ··· 1037 789 1038 790 /** 1039 791 * @ingroup Debugfs 1040 - * @brief Parameters for CMD_DEBUG_WRITE command 792 + * @brief Parameters for #CMD_DEBUG_WRITE command 1041 793 */ 1042 794 struct cmd_debug_fwrite_request { 1043 795 /** @brief File access identifier received in response 1044 - * to CMD_DEBUG_OPEN_RO request 796 + * to prior #CMD_DEBUG_OPEN_RO -request 1045 797 */ 1046 798 uint32_t fd; 1047 799 /** @brief Size of write data in bytes */ ··· 1052 804 1053 805 /** 1054 806 * @ingroup Debugfs 1055 - * @brief Parameters for CMD_DEBUG_CLOSE command 807 + * @brief Parameters for #CMD_DEBUG_CLOSE command 1056 808 */ 1057 809 struct cmd_debug_fclose_request { 1058 - /** @brief File access identifier received in response 1059 - * to CMD_DEBUG_OPEN_RO request 810 + /** 811 + * @brief File access identifier received in prior response 812 + * to #CMD_DEBUG_OPEN_RO or #CMD_DEBUG_OPEN_WO -request. 1060 813 */ 1061 814 uint32_t fd; 1062 815 } BPMP_ABI_PACKED; ··· 1066 817 * @ingroup Debugfs 1067 818 * @brief Request with #MRQ_DEBUG. 1068 819 * 1069 - * The sender of an MRQ_DEBUG message uses #cmd to specify a debugfs 1070 - * command to execute. Legal commands are the values of @ref 1071 - * mrq_debug_commands. Each command requires a specific additional 1072 - * payload of data. 820 + * The sender of an #MRQ_DEBUG message uses mrq_debug_request::cmd to specify 821 + * which debugfs sub-command to execute. Legal sub-commands are the values 822 + * specified in the @ref mrq_debug_commands -enumeration. Each sub-command 823 + * requires a specific additional payload of data according to the following 824 + * table: 1073 825 * 1074 - * |command |payload| 1075 - * |-------------------|-------| 1076 - * |CMD_DEBUG_OPEN_RO |fop | 1077 - * |CMD_DEBUG_OPEN_WO |fop | 1078 - * |CMD_DEBUG_READ |frd | 1079 - * |CMD_DEBUG_WRITE |fwr | 1080 - * |CMD_DEBUG_CLOSE |fcl | 826 + * |Sub-command |Payload structure | 827 + * |--------------------|---------------------------| 828 + * |#CMD_DEBUG_OPEN_RO |cmd_debug_fopen_request | 829 + * |#CMD_DEBUG_OPEN_WO |cmd_debug_fopen_request | 830 + * |#CMD_DEBUG_READ |cmd_debug_fread_request | 831 + * |#CMD_DEBUG_WRITE |cmd_debug_fwrite_request | 832 + * |#CMD_DEBUG_CLOSE |cmd_debug_fclose_request | 1081 833 */ 1082 834 struct mrq_debug_request { 1083 - /** @brief Sub-command (@ref mrq_debug_commands) */ 835 + /** @brief Sub-command identifier from @ref mrq_debug_commands */ 1084 836 uint32_t cmd; 1085 837 union { 1086 - /** @brief Request payload for CMD_DEBUG_OPEN_RO/WO command */ 838 + /** 839 + * @brief Request payload for #CMD_DEBUG_OPEN_RO and 840 + * #CMD_DEBUG_OPEN_WO sub-commands 841 + */ 1087 842 struct cmd_debug_fopen_request fop; 1088 - /** @brief Request payload for CMD_DEBUG_READ command */ 843 + /** @brief Request payload for #CMD_DEBUG_READ sub-command */ 1089 844 struct cmd_debug_fread_request frd; 1090 - /** @brief Request payload for CMD_DEBUG_WRITE command */ 845 + /** @brief Request payload for #CMD_DEBUG_WRITE sub-command */ 1091 846 struct cmd_debug_fwrite_request fwr; 1092 - /** @brief Request payload for CMD_DEBUG_CLOSE command */ 847 + /** @brief Request payload for #CMD_DEBUG_CLOSE sub-command */ 1093 848 struct cmd_debug_fclose_request fcl; 1094 849 } BPMP_UNION_ANON; 1095 850 } BPMP_ABI_PACKED; ··· 1103 850 */ 1104 851 struct mrq_debug_response { 1105 852 union { 1106 - /** @brief Response data for CMD_DEBUG_OPEN_RO/WO command */ 853 + /** 854 + * @brief Response data for the #CMD_DEBUG_OPEN_RO and 855 + * #CMD_DEBUG_OPEN_WO sub-commands 856 + */ 1107 857 struct cmd_debug_fopen_response fop; 1108 - /** @brief Response data for CMD_DEBUG_READ command */ 858 + /** @brief Response data for the #CMD_DEBUG_READ sub-command */ 1109 859 struct cmd_debug_fread_response frd; 1110 860 } BPMP_UNION_ANON; 1111 861 } BPMP_ABI_PACKED; ··· 1118 862 * @def MRQ_RESET 1119 863 * @brief Reset an IP block 1120 864 * 1121 - * * Platforms: T186, T194 1122 865 * * Initiators: Any 1123 866 * * Targets: BPMP 1124 867 * * Request Payload: @ref mrq_reset_request ··· 1127 872 * @{ 1128 873 */ 1129 874 875 + /** 876 + * @brief Sub-command identifiers for #MRQ_RESET 877 + */ 1130 878 enum mrq_reset_commands { 1131 879 /** 1132 880 * @brief Assert module reset 1133 881 * 1134 - * mrq_response::err is 0 if the operation was successful, or @n 1135 - * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n 1136 - * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n 1137 - * -#BPMP_ENOTSUP if target domain h/w state does not allow reset 882 + * mrq_response::err is 883 + * * 0 if the operation was successful 884 + * * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid 885 + * * -#BPMP_EACCES if mrq master is not an owner of target domain reset 886 + * * -#BPMP_ENOTSUP if target domain h/w state does not allow reset 1138 887 */ 1139 888 CMD_RESET_ASSERT = 1, 1140 889 /** 1141 890 * @brief Deassert module reset 1142 891 * 1143 - * mrq_response::err is 0 if the operation was successful, or @n 1144 - * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n 1145 - * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n 1146 - * -#BPMP_ENOTSUP if target domain h/w state does not allow reset 892 + * mrq_response::err is 893 + * * 0 if the operation was successful 894 + * * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid 895 + * * -#BPMP_EACCES if mrq master is not an owner of target domain reset 896 + * * -#BPMP_ENOTSUP if target domain h/w state does not allow reset 1147 897 */ 1148 898 CMD_RESET_DEASSERT = 2, 1149 899 /** 1150 900 * @brief Assert and deassert the module reset 1151 901 * 1152 - * mrq_response::err is 0 if the operation was successful, or @n 1153 - * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid @n 1154 - * -#BPMP_EACCES if mrq master is not an owner of target domain reset @n 1155 - * -#BPMP_ENOTSUP if target domain h/w state does not allow reset 902 + * mrq_response::err is 903 + * * 0 if the operation was successful 904 + * * -#BPMP_EINVAL if mrq_reset_request::reset_id is invalid 905 + * * -#BPMP_EACCES if mrq master is not an owner of target domain reset 906 + * * -#BPMP_ENOTSUP if target domain h/w state does not allow reset 1156 907 */ 1157 908 CMD_RESET_MODULE = 3, 1158 909 /** 1159 910 * @brief Get the highest reset ID 1160 911 * 1161 - * mrq_response::err is 0 if the operation was successful, or @n 1162 - * -#BPMP_ENODEV if no reset domains are supported (number of IDs is 0) 912 + * mrq_response::err is 913 + * * 0 if the operation was successful 914 + * * -#BPMP_ENODEV if no reset domains are supported (number of IDs is 0) 1163 915 */ 1164 916 CMD_RESET_GET_MAX_ID = 4, 1165 917 ··· 1175 913 }; 1176 914 1177 915 /** 1178 - * @brief Request with MRQ_RESET 916 + * @brief Request with #MRQ_RESET 1179 917 * 1180 918 * Used by the sender of an #MRQ_RESET message to request BPMP to 1181 - * assert or or deassert a given reset line. 919 + * assert or deassert a given reset line. 1182 920 */ 1183 921 struct mrq_reset_request { 1184 - /** @brief Reset action to perform (@ref mrq_reset_commands) */ 922 + /** @brief Reset action to perform, from @ref mrq_reset_commands */ 1185 923 uint32_t cmd; 1186 - /** @brief Id of the reset to affected */ 924 + /** @brief ID of the reset to affected, from @ref bpmp_reset_ids */ 1187 925 uint32_t reset_id; 1188 926 } BPMP_ABI_PACKED; 1189 927 ··· 1202 940 * 1203 941 * Each sub-command supported by @ref mrq_reset_request may return 1204 942 * sub-command-specific data. Some do and some do not as indicated 1205 - * in the following table 943 + * in the following table: 1206 944 * 1207 945 * | sub-command | payload | 1208 946 * |----------------------|------------------| ··· 1224 962 * @def MRQ_I2C 1225 963 * @brief Issue an i2c transaction 1226 964 * 1227 - * * Platforms: T186, T194 1228 965 * * Initiators: Any 1229 966 * * Targets: BPMP 1230 967 * * Request Payload: @ref mrq_i2c_request ··· 1232 971 * @addtogroup I2C 1233 972 * @{ 1234 973 */ 974 + 975 + /** 976 + * @brief Size of the cmd_i2c_xfer_request::data_buf -member array in bytes. 977 + */ 1235 978 #define TEGRA_I2C_IPC_MAX_IN_BUF_SIZE (MSG_DATA_MIN_SZ - 12U) 979 + 980 + /** 981 + * @brief Size of the cmd_i2c_xfer_response::data_buf -member array in bytes. 982 + */ 1236 983 #define TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE (MSG_DATA_MIN_SZ - 4U) 1237 984 985 + /** 986 + * @defgroup seriali2c_flags I2C flags 987 + * 988 + * @brief I2C transaction modifier flags for each transaction segment 989 + * in #MRQ_I2C subcommand CMD_I2C_XFER 990 + */ 991 + 992 + /** 993 + * @addtogroup seriali2c_flags 994 + * @{ 995 + */ 996 + 997 + /** @brief when set, use 10-bit I2C slave address */ 1238 998 #define SERIALI2C_TEN 0x0010U 999 + /** @brief when set, perform a Read transaction */ 1239 1000 #define SERIALI2C_RD 0x0001U 1240 - #define SERIALI2C_STOP 0x8000U 1001 + /** 1002 + * @brief when set, no repeated START is issued between the segments 1003 + * of transaction. This flag is ignored for the first segment as any 1004 + * transaction always starts with a START condition 1005 + */ 1241 1006 #define SERIALI2C_NOSTART 0x4000U 1242 - #define SERIALI2C_REV_DIR_ADDR 0x2000U 1007 + /** 1008 + * @brief when set, a no-ACK from slave device is ignored and treated 1009 + * always as success 1010 + */ 1243 1011 #define SERIALI2C_IGNORE_NAK 0x1000U 1012 + /** @} seriali2c_flags */ 1013 + 1014 + /** brief Unused flag. Retained for backwards compatibility. */ 1015 + #define SERIALI2C_STOP 0x8000U 1016 + /** brief Unused flag. Retained for backwards compatibility. */ 1017 + #define SERIALI2C_REV_DIR_ADDR 0x2000U 1018 + /** brief Unused flag. Retained for backwards compatibility. */ 1244 1019 #define SERIALI2C_NO_RD_ACK 0x0800U 1020 + /** brief Unused flag. Retained for backwards compatibility. */ 1245 1021 #define SERIALI2C_RECV_LEN 0x0400U 1246 1022 1247 - enum { 1023 + /** 1024 + * @brief Supported I2C sub-command identifiers 1025 + */ 1026 + enum mrq_i2c_commands { 1027 + /** @brief Perform an I2C transaction */ 1248 1028 CMD_I2C_XFER = 1 1249 1029 }; 1250 1030 ··· 1307 1005 struct serial_i2c_request { 1308 1006 /** @brief I2C slave address */ 1309 1007 uint16_t addr; 1310 - /** @brief Bitmask of SERIALI2C_ flags */ 1008 + /** @brief Bitmask of @ref seriali2c_flags */ 1311 1009 uint16_t flags; 1312 1010 /** @brief Length of I2C transaction in bytes */ 1313 1011 uint16_t len; ··· 1322 1020 /** 1323 1021 * @brief Tegra PWR_I2C bus identifier 1324 1022 * 1325 - * @cond (bpmp_t234 || bpmp_t238 || bpmp_t194) 1023 + * @cond (bpmp_t186 || bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_t264) 1326 1024 * Must be set to 5. 1327 - * @endcond (bpmp_t234 || bpmp_t238 || bpmp_t194) 1328 - * @cond bpmp_th500 1329 - * Must be set to 1. 1330 - * @endcond bpmp_th500 1025 + * @endcond 1331 1026 * 1027 + * @cond (bpmp_th500) 1028 + * Must be set to 1. 1029 + * @endcond 1332 1030 */ 1333 1031 uint32_t bus_id; 1334 1032 ··· 1349 1047 struct cmd_i2c_xfer_response { 1350 1048 /** @brief Count of valid bytes in #data_buf*/ 1351 1049 uint32_t data_size; 1352 - /** @brief I2c read data */ 1050 + /** @brief I2C read data */ 1353 1051 uint8_t data_buf[TEGRA_I2C_IPC_MAX_OUT_BUF_SIZE]; 1354 1052 } BPMP_ABI_PACKED; 1355 1053 ··· 1366 1064 /** 1367 1065 * @brief Response to #MRQ_I2C 1368 1066 * 1369 - * mrq_response:err is 1370 - * 0: Success 1371 - * -#BPMP_EBADCMD: if mrq_i2c_request::cmd is other than 1 1372 - * -#BPMP_EINVAL: if cmd_i2c_xfer_request does not contain correctly formatted request 1373 - * -#BPMP_ENODEV: if cmd_i2c_xfer_request::bus_id is not supported by BPMP 1374 - * -#BPMP_EACCES: if i2c transaction is not allowed due to firewall rules 1375 - * -#BPMP_ETIMEDOUT: if i2c transaction times out 1376 - * -#BPMP_ENXIO: if i2c slave device does not reply with ACK to the transaction 1377 - * -#BPMP_EAGAIN: if ARB_LOST condition is detected by the i2c controller 1378 - * -#BPMP_EIO: any other i2c controller error code than NO_ACK or ARB_LOST 1067 + * mrq_response::err value for this response is defined as: 1068 + * 1069 + * | Value | Description | 1070 + * |--------------------|---------------------------------------------------------------------| 1071 + * | 0 | Success | 1072 + * | -#BPMP_EBADCMD | mrq_i2c_request::cmd is other than 1 | 1073 + * | -#BPMP_EINVAL | cmd_i2c_xfer_request does not contain correctly formatted request | 1074 + * | -#BPMP_ENODEV | cmd_i2c_xfer_request::bus_id is not supported by BPMP | 1075 + * | -#BPMP_EACCES | I2C transaction is not allowed due to firewall rules | 1076 + * | -#BPMP_ETIMEDOUT | I2C transaction times out | 1077 + * | -#BPMP_ENXIO | I2C slave device does not reply with ACK to the transaction | 1078 + * | -#BPMP_EAGAIN | ARB_LOST condition is detected by the I2C controller | 1079 + * | -#BPMP_EIO | Any other I2C controller error code than NO_ACK or ARB_LOST | 1379 1080 */ 1380 1081 struct mrq_i2c_response { 1381 1082 struct cmd_i2c_xfer_response xfer; ··· 1391 1086 * @def MRQ_CLK 1392 1087 * @brief Perform a clock operation 1393 1088 * 1394 - * * Platforms: T186, T194 1395 1089 * * Initiators: Any 1396 1090 * * Targets: BPMP 1397 1091 * * Request Payload: @ref mrq_clk_request ··· 1399 1095 * @addtogroup Clocks 1400 1096 * @{ 1401 1097 */ 1402 - enum { 1098 + 1099 + /** 1100 + * @brief Sub-command identifiers for #MRQ_CLK 1101 + */ 1102 + enum mrq_clk_commands { 1103 + /** Get clock rate */ 1403 1104 CMD_CLK_GET_RATE = 1, 1105 + 1106 + /** Set clock rate */ 1404 1107 CMD_CLK_SET_RATE = 2, 1108 + 1109 + /** Get attainable clock rate closer to a given rate */ 1405 1110 CMD_CLK_ROUND_RATE = 3, 1111 + 1112 + /** Get parent clock identifier for a given clock */ 1406 1113 CMD_CLK_GET_PARENT = 4, 1114 + 1115 + /** Change clock parent */ 1407 1116 CMD_CLK_SET_PARENT = 5, 1117 + 1118 + /** Get clock enable status */ 1408 1119 CMD_CLK_IS_ENABLED = 6, 1120 + 1121 + /** Enable a clock */ 1409 1122 CMD_CLK_ENABLE = 7, 1123 + 1124 + /** Disable a clock */ 1410 1125 CMD_CLK_DISABLE = 8, 1411 - /** @cond DEPRECATED */ 1412 - CMD_CLK_PROPERTIES = 9, 1413 - CMD_CLK_POSSIBLE_PARENTS = 10, 1414 - CMD_CLK_NUM_POSSIBLE_PARENTS = 11, 1415 - CMD_CLK_GET_POSSIBLE_PARENT = 12, 1416 - CMD_CLK_RESET_REFCOUNTS = 13, 1417 - /** @endcond DEPRECATED */ 1126 + 1127 + /** Get all information about a clock */ 1418 1128 CMD_CLK_GET_ALL_INFO = 14, 1129 + 1130 + /** Get largest supported clock identifier */ 1419 1131 CMD_CLK_GET_MAX_CLK_ID = 15, 1132 + 1133 + /** Get clock maximum rate at VMIN */ 1420 1134 CMD_CLK_GET_FMAX_AT_VMIN = 16, 1135 + 1136 + /** Largest supported #MRQ_CLK sub-command identifier + 1 */ 1421 1137 CMD_CLK_MAX, 1422 1138 }; 1423 1139 1140 + /** 1141 + * Flag bit set in cmd_clk_get_all_info_response::flags -field when clock 1142 + * supports changing of the parent clock at runtime. 1143 + */ 1424 1144 #define BPMP_CLK_HAS_MUX (1U << 0U) 1145 + 1146 + /** 1147 + * Flag bit set in cmd_clk_get_all_info_response::flags -field when clock 1148 + * supports changing the clock rate at runtime. 1149 + */ 1425 1150 #define BPMP_CLK_HAS_SET_RATE (1U << 1U) 1151 + 1152 + /** 1153 + * Flag bit set in cmd_clk_get_all_info_response::flags -field when clock is a 1154 + * root clock without visible parents. 1155 + */ 1426 1156 #define BPMP_CLK_IS_ROOT (1U << 2U) 1157 + 1427 1158 #define BPMP_CLK_IS_VAR_ROOT (1U << 3U) 1159 + 1428 1160 /** 1429 1161 * @brief Protection against rate and parent changes 1430 1162 * 1431 - * #MRQ_CLK command #CMD_CLK_SET_RATE or #MRQ_CLK command #CMD_CLK_SET_PARENT will return 1432 - * -#BPMP_EACCES. 1163 + * #MRQ_CLK command #CMD_CLK_SET_RATE or #MRQ_CLK command #CMD_CLK_SET_PARENT 1164 + * will return -#BPMP_EACCES. 1433 1165 */ 1434 1166 #define BPMP_CLK_RATE_PARENT_CHANGE_DENIED (1U << 30) 1435 1167 1436 1168 /** 1437 1169 * @brief Protection against state changes 1438 1170 * 1439 - * #MRQ_CLK command #CMD_CLK_ENABLE or #MRQ_CLK command #CMD_CLK_DISABLE will return 1440 - * -#BPMP_EACCES. 1171 + * #MRQ_CLK command #CMD_CLK_ENABLE or #MRQ_CLK command #CMD_CLK_DISABLE 1172 + * will return -#BPMP_EACCES. 1441 1173 */ 1442 1174 #define BPMP_CLK_STATE_CHANGE_DENIED (1U << 31) 1443 1175 1176 + /** 1177 + * Size of the cmd_clk_get_all_info_response::name -array in number 1178 + * of elements. 1179 + */ 1444 1180 #define MRQ_CLK_NAME_MAXLEN 40U 1181 + 1182 + /** 1183 + * @brief Maximum number of elements in parent_id arrays of clock info responses. 1184 + */ 1445 1185 #define MRQ_CLK_MAX_PARENTS 16U 1446 1186 1447 - /** @private */ 1187 + /** 1188 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_GET_RATE 1189 + * 1190 + * This structure is an empty placeholder for future expansion of this 1191 + * sub-command. 1192 + */ 1448 1193 struct cmd_clk_get_rate_request { 1449 1194 BPMP_ABI_EMPTY 1450 1195 } BPMP_ABI_PACKED; 1451 1196 1197 + /** 1198 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_GET_RATE 1199 + */ 1452 1200 struct cmd_clk_get_rate_response { 1201 + /** 1202 + * Current rate of the given clock in Hz if mrq_response::err is 0 to 1203 + * indicate successful #CMD_CLK_GET_RATE -request. 1204 + */ 1453 1205 int64_t rate; 1454 1206 } BPMP_ABI_PACKED; 1455 1207 1208 + /** 1209 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_SET_RATE 1210 + */ 1456 1211 struct cmd_clk_set_rate_request { 1212 + /** Unused / reserved field. */ 1457 1213 int32_t unused; 1214 + 1215 + /** Requested rate of the clock in Hz. */ 1458 1216 int64_t rate; 1459 1217 } BPMP_ABI_PACKED; 1460 1218 1219 + /** 1220 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_SET_RATE 1221 + */ 1461 1222 struct cmd_clk_set_rate_response { 1223 + /** 1224 + * If request was successful (mrq_response::err is 0), set to the new 1225 + * rate of the given clock in Hz. 1226 + */ 1462 1227 int64_t rate; 1463 1228 } BPMP_ABI_PACKED; 1464 1229 1230 + /** 1231 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_ROUND_RATE 1232 + */ 1465 1233 struct cmd_clk_round_rate_request { 1234 + /** Unused / reserved field. */ 1466 1235 int32_t unused; 1236 + 1237 + /** Target rate for the clock */ 1467 1238 int64_t rate; 1468 1239 } BPMP_ABI_PACKED; 1469 1240 1241 + /** 1242 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_ROUND_RATE 1243 + */ 1470 1244 struct cmd_clk_round_rate_response { 1245 + /** 1246 + * The attainable rate if request was successful 1247 + * (mrq_response::err is 0). 1248 + */ 1471 1249 int64_t rate; 1472 1250 } BPMP_ABI_PACKED; 1473 1251 1474 - /** @private */ 1252 + /** 1253 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_GET_PARENT 1254 + * 1255 + * This structure is an empty placeholder for future expansion of this 1256 + * sub-command. 1257 + */ 1475 1258 struct cmd_clk_get_parent_request { 1476 1259 BPMP_ABI_EMPTY 1477 1260 } BPMP_ABI_PACKED; 1478 1261 1262 + /** 1263 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_GET_PARENT 1264 + */ 1479 1265 struct cmd_clk_get_parent_response { 1266 + /** 1267 + * The clock identifier of the parent clock if request was successful 1268 + * (mrq_response::err is 0). 1269 + */ 1480 1270 uint32_t parent_id; 1481 1271 } BPMP_ABI_PACKED; 1482 1272 1273 + /** 1274 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_SET_PARENT 1275 + */ 1483 1276 struct cmd_clk_set_parent_request { 1277 + /** 1278 + * The clock identifier of the new parent clock. 1279 + */ 1484 1280 uint32_t parent_id; 1485 1281 } BPMP_ABI_PACKED; 1486 1282 1283 + /** 1284 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_SET_PARENT 1285 + */ 1487 1286 struct cmd_clk_set_parent_response { 1287 + /** 1288 + * The clock identifier of the new parent clock if request was 1289 + * successful (mrq_response::err is 0). 1290 + */ 1488 1291 uint32_t parent_id; 1489 1292 } BPMP_ABI_PACKED; 1490 1293 1491 - /** @private */ 1294 + /** 1295 + * @brief Request payload for #CMD_CLK_IS_ENABLED -sub-command 1296 + * 1297 + * This structure is an empty placeholder for future expansion of this 1298 + * sub-command. 1299 + */ 1492 1300 struct cmd_clk_is_enabled_request { 1493 1301 BPMP_ABI_EMPTY 1494 1302 } BPMP_ABI_PACKED; 1495 1303 1496 1304 /** 1497 - * @brief Response data to #MRQ_CLK sub-command CMD_CLK_IS_ENABLED 1305 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_IS_ENABLED 1498 1306 */ 1499 1307 struct cmd_clk_is_enabled_response { 1500 1308 /** 1501 1309 * @brief The state of the clock that has been successfully 1502 - * requested with CMD_CLK_ENABLE or CMD_CLK_DISABLE by the 1310 + * requested with #CMD_CLK_ENABLE or #CMD_CLK_DISABLE by the 1503 1311 * master invoking the command earlier. 1504 1312 * 1505 1313 * The state may not reflect the physical state of the clock 1506 1314 * if there are some other masters requesting it to be 1507 - * enabled. 1315 + * enabled. Valid values: 1508 1316 * 1509 - * Value 0 is disabled, all other values indicate enabled. 1317 + * * Value 0: The clock is disabled, 1318 + * * Value 1: The clock is enabled. 1510 1319 */ 1511 1320 int32_t state; 1512 1321 } BPMP_ABI_PACKED; 1513 1322 1514 - /** @private */ 1323 + /** 1324 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_ENABLE 1325 + * 1326 + * This structure is an empty placeholder for future expansion of this 1327 + * sub-command. 1328 + */ 1515 1329 struct cmd_clk_enable_request { 1516 1330 BPMP_ABI_EMPTY 1517 1331 } BPMP_ABI_PACKED; 1518 1332 1519 - /** @private */ 1333 + /** 1334 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_ENABLE 1335 + * 1336 + * This structure is an empty placeholder for future expansion of this 1337 + * sub-command. 1338 + */ 1520 1339 struct cmd_clk_enable_response { 1521 1340 BPMP_ABI_EMPTY 1522 1341 } BPMP_ABI_PACKED; 1523 1342 1524 - /** @private */ 1343 + /** 1344 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_DISABLE 1345 + * 1346 + * This structure is an empty placeholder for future expansion of this 1347 + * sub-command. 1348 + */ 1525 1349 struct cmd_clk_disable_request { 1526 1350 BPMP_ABI_EMPTY 1527 1351 } BPMP_ABI_PACKED; 1528 1352 1529 - /** @private */ 1353 + /** 1354 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_DISABLE 1355 + * 1356 + * This structure is an empty placeholder for future expansion of this 1357 + * sub-command. 1358 + */ 1530 1359 struct cmd_clk_disable_response { 1531 1360 BPMP_ABI_EMPTY 1532 1361 } BPMP_ABI_PACKED; 1533 1362 1534 - /** @cond DEPRECATED */ 1535 - /** @private */ 1536 - struct cmd_clk_properties_request { 1537 - BPMP_ABI_EMPTY 1538 - } BPMP_ABI_PACKED; 1539 - 1540 - /** @todo flags need to be spelled out here */ 1541 - struct cmd_clk_properties_response { 1542 - uint32_t flags; 1543 - } BPMP_ABI_PACKED; 1544 - 1545 - /** @private */ 1546 - struct cmd_clk_possible_parents_request { 1547 - BPMP_ABI_EMPTY 1548 - } BPMP_ABI_PACKED; 1549 - 1550 - struct cmd_clk_possible_parents_response { 1551 - uint8_t num_parents; 1552 - uint8_t reserved[3]; 1553 - uint32_t parent_id[MRQ_CLK_MAX_PARENTS]; 1554 - } BPMP_ABI_PACKED; 1555 - 1556 - /** @private */ 1557 - struct cmd_clk_num_possible_parents_request { 1558 - BPMP_ABI_EMPTY 1559 - } BPMP_ABI_PACKED; 1560 - 1561 - struct cmd_clk_num_possible_parents_response { 1562 - uint8_t num_parents; 1563 - } BPMP_ABI_PACKED; 1564 - 1565 - struct cmd_clk_get_possible_parent_request { 1566 - uint8_t parent_idx; 1567 - } BPMP_ABI_PACKED; 1568 - 1569 - struct cmd_clk_get_possible_parent_response { 1570 - uint32_t parent_id; 1571 - } BPMP_ABI_PACKED; 1572 - /** @endcond DEPRECATED */ 1573 - 1574 - /** @private */ 1363 + /** 1364 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_GET_ALL_INFO 1365 + * 1366 + * This structure is an empty placeholder for future expansion of this 1367 + * sub-command. 1368 + */ 1575 1369 struct cmd_clk_get_all_info_request { 1576 1370 BPMP_ABI_EMPTY 1577 1371 } BPMP_ABI_PACKED; 1578 1372 1373 + 1374 + /** 1375 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_GET_ALL_INFO 1376 + * 1377 + * The values in the response are only set and valid if request status in 1378 + * mrq_response::err is 0. 1379 + */ 1579 1380 struct cmd_clk_get_all_info_response { 1381 + /** 1382 + * State / informational flags for the clock: 1383 + * 1384 + * | Flag bit | Description | 1385 + * |------------------------|------------------------------------------| 1386 + * | #BPMP_CLK_IS_ROOT | Clock is a root clock. | 1387 + * | #BPMP_CLK_HAS_MUX | Clock supports changing of parent clock. | 1388 + * | #BPMP_CLK_HAS_SET_RATE | Clock supports changing clock rate. | 1389 + */ 1580 1390 uint32_t flags; 1391 + 1392 + /** 1393 + * Current parent clock identifier. 1394 + */ 1581 1395 uint32_t parent; 1396 + 1397 + /** 1398 + * Array of possible parent clock identifiers. 1399 + */ 1582 1400 uint32_t parents[MRQ_CLK_MAX_PARENTS]; 1401 + 1402 + /** 1403 + * Number of identifiers in the #parents -array. 1404 + */ 1583 1405 uint8_t num_parents; 1406 + 1407 + /** 1408 + * Friendly name of the clock, truncated to fit the array 1409 + * and null-terminated. 1410 + */ 1584 1411 uint8_t name[MRQ_CLK_NAME_MAXLEN]; 1585 1412 } BPMP_ABI_PACKED; 1586 1413 1587 - /** @private */ 1414 + 1415 + /** 1416 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_GET_MAX_CLK_ID 1417 + * 1418 + * This structure is an empty placeholder for future expansion of this 1419 + * sub-command. 1420 + */ 1588 1421 struct cmd_clk_get_max_clk_id_request { 1589 1422 BPMP_ABI_EMPTY 1590 1423 } BPMP_ABI_PACKED; 1591 1424 1425 + /** 1426 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_GET_MAX_CLK_ID 1427 + */ 1592 1428 struct cmd_clk_get_max_clk_id_response { 1429 + /** @brief Largest supported clock identifier. */ 1593 1430 uint32_t max_id; 1594 1431 } BPMP_ABI_PACKED; 1595 1432 1596 - /** @private */ 1433 + /** 1434 + * @brief Request payload for #MRQ_CLK sub-command #CMD_CLK_GET_FMAX_AT_VMIN 1435 + * 1436 + * This structure is an empty placeholder for future expansion of this 1437 + * sub-command. 1438 + */ 1597 1439 struct cmd_clk_get_fmax_at_vmin_request { 1598 1440 BPMP_ABI_EMPTY 1599 1441 } BPMP_ABI_PACKED; 1600 1442 1443 + /** 1444 + * @brief Response payload for #MRQ_CLK sub-command #CMD_CLK_GET_FMAX_AT_VMIN 1445 + */ 1601 1446 struct cmd_clk_get_fmax_at_vmin_response { 1602 1447 int64_t rate; 1603 1448 } BPMP_ABI_PACKED; ··· 1761 1308 * require no additional data. Others have a sub-command specific 1762 1309 * payload 1763 1310 * 1764 - * |sub-command |payload | 1765 - * |----------------------------|-----------------------| 1766 - * |CMD_CLK_GET_RATE |- | 1767 - * |CMD_CLK_SET_RATE |clk_set_rate | 1768 - * |CMD_CLK_ROUND_RATE |clk_round_rate | 1769 - * |CMD_CLK_GET_PARENT |- | 1770 - * |CMD_CLK_SET_PARENT |clk_set_parent | 1771 - * |CMD_CLK_IS_ENABLED |- | 1772 - * |CMD_CLK_ENABLE |- | 1773 - * |CMD_CLK_DISABLE |- | 1774 - * |CMD_CLK_GET_ALL_INFO |- | 1775 - * |CMD_CLK_GET_MAX_CLK_ID |- | 1776 - * |CMD_CLK_GET_FMAX_AT_VMIN |- 1777 - * | 1778 - * 1311 + * |Sub-command |Payload | 1312 + * |----------------------------|-----------------------------| 1313 + * |#CMD_CLK_GET_RATE |- | 1314 + * |#CMD_CLK_SET_RATE |#cmd_clk_set_rate_request | 1315 + * |#CMD_CLK_ROUND_RATE |#cmd_clk_round_rate_request | 1316 + * |#CMD_CLK_GET_PARENT |- | 1317 + * |#CMD_CLK_SET_PARENT |#cmd_clk_set_parent_request | 1318 + * |#CMD_CLK_IS_ENABLED |- | 1319 + * |#CMD_CLK_ENABLE |- | 1320 + * |#CMD_CLK_DISABLE |- | 1321 + * |#CMD_CLK_GET_ALL_INFO |- | 1322 + * |#CMD_CLK_GET_MAX_CLK_ID |- | 1323 + * |#CMD_CLK_GET_FMAX_AT_VMIN |- | 1779 1324 */ 1780 - 1781 - /** @cond DEPRECATED 1782 - * 1783 - * Older versions of firmware also supported following sub-commands: 1784 - * |CMD_CLK_PROPERTIES |- | 1785 - * |CMD_CLK_POSSIBLE_PARENTS |- | 1786 - * |CMD_CLK_NUM_POSSIBLE_PARENTS|- | 1787 - * |CMD_CLK_GET_POSSIBLE_PARENT |clk_get_possible_parent| 1788 - * |CMD_CLK_RESET_REFCOUNTS |- | 1789 - * 1790 - * @endcond DEPRECATED */ 1791 1325 1792 1326 struct mrq_clk_request { 1793 1327 /** @brief Sub-command and clock id concatenated to 32-bit word. 1794 - * - bits[31..24] is the sub-cmd. 1795 - * - bits[23..0] is the clock id 1328 + * 1329 + * - bits[31..24] is the sub-command ID from @ref mrq_clk_commands. 1330 + * - bits[23..0] is the clock identifier from @ref bpmp_clock_ids. 1796 1331 */ 1797 1332 uint32_t cmd_and_id; 1798 1333 ··· 1798 1357 struct cmd_clk_disable_request clk_disable; 1799 1358 /** @private */ 1800 1359 struct cmd_clk_is_enabled_request clk_is_enabled; 1801 - /** @cond DEPRECATED */ 1802 - /** @private */ 1803 - struct cmd_clk_properties_request clk_properties; 1804 - /** @private */ 1805 - struct cmd_clk_possible_parents_request clk_possible_parents; 1806 - /** @private */ 1807 - struct cmd_clk_num_possible_parents_request clk_num_possible_parents; 1808 - struct cmd_clk_get_possible_parent_request clk_get_possible_parent; 1809 - /** @endcond DEPRECATED */ 1810 1360 /** @private */ 1811 1361 struct cmd_clk_get_all_info_request clk_get_all_info; 1812 1362 /** @private */ ··· 1813 1381 * 1814 1382 * Each sub-command supported by @ref mrq_clk_request may return 1815 1383 * sub-command-specific data. Some do and some do not as indicated in 1816 - * the following table 1384 + * the following table: 1817 1385 * 1818 - * |sub-command |payload | 1819 - * |----------------------------|------------------------| 1820 - * |CMD_CLK_GET_RATE |clk_get_rate | 1821 - * |CMD_CLK_SET_RATE |clk_set_rate | 1822 - * |CMD_CLK_ROUND_RATE |clk_round_rate | 1823 - * |CMD_CLK_GET_PARENT |clk_get_parent | 1824 - * |CMD_CLK_SET_PARENT |clk_set_parent | 1825 - * |CMD_CLK_IS_ENABLED |clk_is_enabled | 1826 - * |CMD_CLK_ENABLE |- | 1827 - * |CMD_CLK_DISABLE |- | 1828 - * |CMD_CLK_GET_ALL_INFO |clk_get_all_info | 1829 - * |CMD_CLK_GET_MAX_CLK_ID |clk_get_max_id | 1830 - * |CMD_CLK_GET_FMAX_AT_VMIN |clk_get_fmax_at_vmin | 1386 + * |Sub-command |Payload | 1387 + * |----------------------------|-----------------------------------| 1388 + * |#CMD_CLK_GET_RATE |#cmd_clk_get_rate_response | 1389 + * |#CMD_CLK_SET_RATE |#cmd_clk_set_rate_response | 1390 + * |#CMD_CLK_ROUND_RATE |#cmd_clk_round_rate_response | 1391 + * |#CMD_CLK_GET_PARENT |#cmd_clk_get_parent_response | 1392 + * |#CMD_CLK_SET_PARENT |#cmd_clk_set_parent_response | 1393 + * |#CMD_CLK_IS_ENABLED |#cmd_clk_is_enabled_response | 1394 + * |#CMD_CLK_ENABLE |- | 1395 + * |#CMD_CLK_DISABLE |- | 1396 + * |#CMD_CLK_GET_ALL_INFO |#cmd_clk_get_all_info_response | 1397 + * |#CMD_CLK_GET_MAX_CLK_ID |#cmd_clk_get_max_clk_id_response | 1398 + * |#CMD_CLK_GET_FMAX_AT_VMIN |#cmd_clk_get_fmax_at_vmin_response | 1831 1399 * 1832 1400 */ 1833 - 1834 - /** @cond DEPRECATED 1835 - * 1836 - * Older versions of firmware also supported following sub-commands: 1837 - * |CMD_CLK_PROPERTIES |clk_properties | 1838 - * |CMD_CLK_POSSIBLE_PARENTS |clk_possible_parents | 1839 - * |CMD_CLK_NUM_POSSIBLE_PARENTS|clk_num_possible_parents| 1840 - * |CMD_CLK_GET_POSSIBLE_PARENT |clk_get_possible_parents| 1841 - * |CMD_CLK_RESET_REFCOUNTS |- | 1842 - * 1843 - * @endcond DEPRECATED */ 1844 1401 1845 1402 struct mrq_clk_response { 1846 1403 union { ··· 1843 1422 /** @private */ 1844 1423 struct cmd_clk_disable_response clk_disable; 1845 1424 struct cmd_clk_is_enabled_response clk_is_enabled; 1846 - /** @cond DEPRECATED */ 1847 - struct cmd_clk_properties_response clk_properties; 1848 - struct cmd_clk_possible_parents_response clk_possible_parents; 1849 - struct cmd_clk_num_possible_parents_response clk_num_possible_parents; 1850 - struct cmd_clk_get_possible_parent_response clk_get_possible_parent; 1851 - /** @endcond DEPRECATED */ 1852 1425 struct cmd_clk_get_all_info_response clk_get_all_info; 1853 1426 struct cmd_clk_get_max_clk_id_response clk_get_max_clk_id; 1854 1427 struct cmd_clk_get_fmax_at_vmin_response clk_get_fmax_at_vmin; ··· 1856 1441 * @def MRQ_QUERY_ABI 1857 1442 * @brief Check if an MRQ is implemented 1858 1443 * 1859 - * * Platforms: All 1860 1444 * * Initiators: Any 1861 1445 * * Targets: Any except DMCE 1862 1446 * * Request Payload: @ref mrq_query_abi_request ··· 1864 1450 1865 1451 /** 1866 1452 * @ingroup ABI_info 1867 - * @brief Request with MRQ_QUERY_ABI 1453 + * @brief Request with #MRQ_QUERY_ABI 1868 1454 * 1869 1455 * Used by #MRQ_QUERY_ABI call to check if MRQ code #mrq is supported 1870 1456 * by the recipient. ··· 1882 1468 * successful, not that the MRQ itself is supported! 1883 1469 */ 1884 1470 struct mrq_query_abi_response { 1885 - /** @brief 0 if queried MRQ is supported. Else, -#BPMP_ENODEV */ 1471 + /** 1472 + * This response field is set to: 1473 + * - 0 if queried MRQ is supported, or 1474 + * - -#BPMP_ENODEV if queried MRQ is not supported 1475 + */ 1886 1476 int32_t status; 1887 1477 } BPMP_ABI_PACKED; 1888 1478 ··· 1894 1476 * 1895 1477 * @ingroup MRQ_Codes 1896 1478 * @def MRQ_PG 1897 - * @brief Control power-gating state of a partition. In contrast to 1898 - * MRQ_PG_UPDATE_STATE, operations that change the power partition 1899 - * state are NOT reference counted 1479 + * @brief Control power-gating state of a partition. 1900 1480 * 1901 1481 * @cond (bpmp_t194 || bpmp_t186) 1902 1482 * @note On T194 and earlier BPMP-FW forcefully turns off some partitions as ··· 1902 1486 * Therefore, it is recommended to power off all domains via MRQ_PG prior to SC7 1903 1487 * entry. 1904 1488 * See @ref bpmp_pdomain_ids for further detail. 1905 - * @endcond (bpmp_t194 || bpmp_t186) 1489 + * @endcond 1906 1490 * 1907 - * * Platforms: T186, T194 1908 1491 * * Initiators: Any 1909 1492 * * Targets: BPMP 1910 1493 * * Request Payload: @ref mrq_pg_request ··· 1911 1496 * 1912 1497 * @addtogroup Powergating 1913 1498 * @{ 1499 + */ 1500 + 1501 + /** 1502 + * @brief Sub-command identifiers for #MRQ_PG -command. 1914 1503 */ 1915 1504 enum mrq_pg_cmd { 1916 1505 /** ··· 1931 1512 * possible values for power domains are defined in enum 1932 1513 * pg_states 1933 1514 * 1934 - * mrq_response:err is 1935 - * 0: Success 1936 - * -#BPMP_EINVAL: Invalid request parameters 1515 + * mrq_response:err for this sub-command is defined as: 1516 + * 1517 + * | Value | Description | 1518 + * | -------------- | ------------------------------------------------------------------------ | 1519 + * | 0 | Request was successful. | 1520 + * | -#BPMP_EINVAL | Invalid request parameters were provided. | 1521 + * | -#BPMP_EACCES | Permission denied or always-off partition was attempted to be turned on. | 1522 + * | Any other <0 | Internal error while performing the operation. | 1937 1523 */ 1938 1524 CMD_PG_SET_STATE = 1, 1939 1525 ··· 1947 1523 * possible values for power domains are defined in enum 1948 1524 * pg_states 1949 1525 * 1950 - * mrq_response:err is 1951 - * 0: Success 1952 - * -#BPMP_EINVAL: Invalid request parameters 1526 + * mrq_response:err for this sub-command is defined as: 1527 + * 1528 + * | Value | Description | 1529 + * | -------------- | ---------------------------------------------- | 1530 + * | 0 | Request was successful. | 1531 + * | -#BPMP_EINVAL | Invalid request parameters were provided. | 1532 + * | Any other <0 | Internal error while performing the operation. | 1953 1533 */ 1954 1534 CMD_PG_GET_STATE = 2, 1955 1535 1956 1536 /** 1957 1537 * @brief Get the name string of specified power domain id. 1958 1538 * 1959 - * mrq_response:err is 1960 - * 0: Success 1961 - * -#BPMP_EINVAL: Invalid request parameters 1539 + * mrq_response:err for this sub-command is defined as: 1540 + * 1541 + * | Value | Description | 1542 + * | -------------- | ---------------------------------------------- | 1543 + * | 0 | Request was successful. | 1544 + * | -#BPMP_EINVAL | Invalid request parameters were provided. | 1545 + * | Any other <0 | Internal error while performing the operation. | 1962 1546 */ 1963 1547 CMD_PG_GET_NAME = 3, 1964 1548 ··· 1975 1543 * @brief Get the highest power domain id in the system. Not 1976 1544 * all IDs between 0 and max_id are valid IDs. 1977 1545 * 1978 - * mrq_response:err is 1979 - * 0: Success 1980 - * -#BPMP_EINVAL: Invalid request parameters 1546 + * mrq_response:err for this sub-command is defined as: 1547 + * 1548 + * | Value | Description | 1549 + * | -------------- | ---------------------------------------------- | 1550 + * | 0 | Request was successful. | 1551 + * | -#BPMP_EINVAL | Invalid request parameters were provided. | 1552 + * | Any other <0 | Internal error while performing the operation. | 1981 1553 */ 1982 1554 CMD_PG_GET_MAX_ID = 4, 1983 1555 }; 1984 1556 1985 1557 #define MRQ_PG_NAME_MAXLEN 40 1986 1558 1559 + /** 1560 + * @brief State value for the cmd_pg_set_state_request::state -field. 1561 + */ 1987 1562 enum pg_states { 1988 1563 /** @brief Power domain is OFF */ 1989 1564 PG_STATE_OFF = 0, 1990 1565 /** @brief Power domain is ON */ 1991 1566 PG_STATE_ON = 1, 1567 + 1568 + /** @cond bpmp_t186 */ 1992 1569 /** 1993 1570 * @brief a legacy state where power domain and the clock 1994 1571 * associated to the domain are ON. ··· 2005 1564 * deprecated. 2006 1565 */ 2007 1566 PG_STATE_RUNNING = 2, 1567 + /** @endcond */ 2008 1568 }; 2009 1569 2010 1570 struct cmd_pg_query_abi_request { 2011 - /** @ref mrq_pg_cmd */ 1571 + /** #MRQ_PG sub-command identifier from @ref mrq_pg_cmd */ 2012 1572 uint32_t type; 2013 1573 } BPMP_ABI_PACKED; 2014 1574 2015 1575 struct cmd_pg_set_state_request { 2016 - /** @ref pg_states */ 1576 + /** One of the state values from @ref pg_states */ 2017 1577 uint32_t state; 2018 1578 } BPMP_ABI_PACKED; 2019 1579 2020 1580 /** 2021 - * @brief Response data to #MRQ_PG sub command #CMD_PG_GET_STATE 1581 + * @brief Response payload for the #MRQ_PG sub-command #CMD_PG_GET_STATE 2022 1582 */ 2023 1583 struct cmd_pg_get_state_response { 2024 1584 /** 2025 1585 * @brief The state of the power partition that has been 2026 - * succesfuly requested by the master earlier using #MRQ_PG 1586 + * successfully requested by the master earlier using #MRQ_PG 2027 1587 * command #CMD_PG_SET_STATE. 2028 1588 * 2029 1589 * The state may not reflect the physical state of the power 2030 1590 * partition if there are some other masters requesting it to 2031 1591 * be enabled. 2032 1592 * 2033 - * See @ref pg_states for possible values 1593 + * See @ref pg_states for possible values. 2034 1594 */ 2035 1595 uint32_t state; 2036 1596 } BPMP_ABI_PACKED; 2037 1597 1598 + /** 1599 + * @brief Response payload for the #MRQ_PG sub-command #CMD_PG_GET_NAME 1600 + */ 2038 1601 struct cmd_pg_get_name_response { 1602 + /** 1603 + * @brief On successful response contains the null-terminated 1604 + * friendly name of the requested power-domain. 1605 + */ 2039 1606 uint8_t name[MRQ_PG_NAME_MAXLEN]; 2040 1607 } BPMP_ABI_PACKED; 2041 1608 1609 + /** 1610 + * @brief Response payload for the #MRQ_PG sub-command #CMD_PG_GET_MAX_ID 1611 + */ 2042 1612 struct cmd_pg_get_max_id_response { 2043 1613 uint32_t max_id; 2044 1614 } BPMP_ABI_PACKED; ··· 2058 1606 * @brief Request with #MRQ_PG 2059 1607 * 2060 1608 * Used by the sender of an #MRQ_PG message to control power 2061 - * partitions. The pg_request is split into several sub-commands. Some 2062 - * sub-commands require no additional data. Others have a sub-command 2063 - * specific payload 1609 + * partitions. The expected payload depends on the sub-command identifier. 1610 + * Some sub-commands require no additional data while others have a sub-command 1611 + * specific payload: 2064 1612 * 2065 - * |sub-command |payload | 2066 - * |----------------------------|-----------------------| 2067 - * |CMD_PG_QUERY_ABI | query_abi | 2068 - * |CMD_PG_SET_STATE | set_state | 2069 - * |CMD_PG_GET_STATE | - | 2070 - * |CMD_PG_GET_NAME | - | 2071 - * |CMD_PG_GET_MAX_ID | - | 1613 + * |Sub-command |Payload | 1614 + * |----------------------------|---------------------------| 1615 + * |#CMD_PG_QUERY_ABI | #cmd_pg_query_abi_request | 1616 + * |#CMD_PG_SET_STATE | #cmd_pg_set_state_request | 1617 + * |#CMD_PG_GET_STATE | - | 1618 + * |#CMD_PG_GET_NAME | - | 1619 + * |#CMD_PG_GET_MAX_ID | - | 2072 1620 * 2073 1621 */ 2074 1622 struct mrq_pg_request { 1623 + /** @brief Sub-command identifier from @ref mrq_pg_cmd. */ 2075 1624 uint32_t cmd; 1625 + 1626 + /** 1627 + * @brief Power-domain identifier 1628 + */ 2076 1629 uint32_t id; 1630 + 2077 1631 union { 2078 1632 struct cmd_pg_query_abi_request query_abi; 2079 1633 struct cmd_pg_set_state_request set_state; ··· 2087 1629 } BPMP_ABI_PACKED; 2088 1630 2089 1631 /** 2090 - * @brief Response to MRQ_PG 1632 + * @brief Response to #MRQ_PG 2091 1633 * 2092 - * Each sub-command supported by @ref mrq_pg_request may return 2093 - * sub-command-specific data. Some do and some do not as indicated in 2094 - * the following table 1634 + * Some of the #MRQ_PG sub-commands return a sub-command -specific payload 1635 + * as specified in the following table: 2095 1636 * 2096 - * |sub-command |payload | 2097 - * |----------------------------|-----------------------| 2098 - * |CMD_PG_QUERY_ABI | - | 2099 - * |CMD_PG_SET_STATE | - | 2100 - * |CMD_PG_GET_STATE | get_state | 2101 - * |CMD_PG_GET_NAME | get_name | 2102 - * |CMD_PG_GET_MAX_ID | get_max_id | 1637 + * |Sub-command |Payload | 1638 + * |--------------------|------------------------------| 1639 + * |#CMD_PG_QUERY_ABI | - | 1640 + * |#CMD_PG_SET_STATE | - | 1641 + * |#CMD_PG_GET_STATE | #cmd_pg_get_state_response | 1642 + * |#CMD_PG_GET_NAME | #cmd_pg_get_name_response | 1643 + * |#CMD_PG_GET_MAX_ID | #cmd_pg_get_max_id_response | 2103 1644 */ 2104 1645 struct mrq_pg_response { 2105 1646 union { ··· 2115 1658 * @def MRQ_THERMAL 2116 1659 * @brief Interact with BPMP thermal framework 2117 1660 * 2118 - * * Platforms: T186, T194 2119 1661 * * Initiators: Any 2120 1662 * * Targets: Any 2121 - * * Request Payload: TODO 2122 - * * Response Payload: TODO 1663 + * * Request Payload: #mrq_thermal_host_to_bpmp_request 1664 + * * Response Payload: #mrq_thermal_bpmp_to_host_response 2123 1665 * 2124 1666 * @addtogroup Thermal 2125 1667 * ··· 2142 1686 * payload of @ref mrq_thermal_bpmp_to_host_request. 2143 1687 * @{ 2144 1688 */ 1689 + 1690 + /** 1691 + * @brief Sub-command identifiers for Host->BPMP #MRQ_THERMAL -command. 1692 + */ 2145 1693 enum mrq_thermal_host_to_bpmp_cmd { 2146 1694 /** 2147 - * @brief Check whether the BPMP driver supports the specified 2148 - * request type. 1695 + * @brief Check whether BPMP-FW supports the specified 1696 + * #MRQ_THERMAL sub-command. 2149 1697 * 2150 1698 * Host needs to supply request parameters. 2151 1699 * ··· 2163 1703 * 2164 1704 * Host needs to supply request parameters. 2165 1705 * 2166 - * mrq_response::err is 2167 - * * 0: Temperature query succeeded. 2168 - * * -#BPMP_EINVAL: Invalid request parameters. 2169 - * * -#BPMP_ENOENT: No driver registered for thermal zone.. 2170 - * * -#BPMP_EFAULT: Problem reading temperature measurement. 1706 + * mrq_response::err value for this sub-command is: 1707 + * 1708 + * | Value | Description | 1709 + * | -------------- | ----------------------------------------- | 1710 + * | 0 | Temperature query succeeded. | 1711 + * | -#BPMP_EINVAL | Invalid request parameters. | 1712 + * | -#BPMP_ENOENT | No driver registered for thermal zone. | 1713 + * | -#BPMP_EFAULT | Problem reading temperature measurement. | 2171 1714 */ 2172 1715 CMD_THERMAL_GET_TEMP = 1, 2173 1716 2174 1717 /** 1718 + * @cond (!bpmp_safe && !bpmp_t264) 2175 1719 * @brief Enable or disable and set the lower and upper 2176 1720 * thermal limits for a thermal trip point. Each zone has 2177 1721 * one trip point. 2178 1722 * 2179 1723 * Host needs to supply request parameters. Once the 2180 1724 * temperature hits a trip point, the BPMP will send a message 2181 - * to the CPU having MRQ=MRQ_THERMAL and 2182 - * type=CMD_THERMAL_HOST_TRIP_REACHED 1725 + * to the CPU having MRQ command identifier equal to #MRQ_THERMAL and 1726 + * sub-command identifier equal to #CMD_THERMAL_HOST_TRIP_REACHED. 2183 1727 * 2184 - * mrq_response::err is 2185 - * * 0: Trip successfully set. 2186 - * * -#BPMP_EINVAL: Invalid request parameters. 2187 - * * -#BPMP_ENOENT: No driver registered for thermal zone. 2188 - * * -#BPMP_EFAULT: Problem setting trip point. 1728 + * If #CMD_THERMAL_SET_TRIP -sub-command is issued for a 1729 + * thermal zone that is currently power gated and unable to 1730 + * report temperature, a temperature of -256C is used as 1731 + * temperature for evaluation of the trip. 1732 + * 1733 + * mrq_response::err for this sub-command is defined as: 1734 + * 1735 + * | Value | Description | 1736 + * | --------------- | -------------------------------------- | 1737 + * | 0 | Trip successfully set. | 1738 + * | -#BPMP_EINVAL | Invalid request parameters. | 1739 + * | -#BPMP_ENOENT | No driver registered for thermal zone. | 1740 + * | -#BPMP_EFAULT | Problem setting trip point. | 2189 1741 */ 2190 1742 CMD_THERMAL_SET_TRIP = 2, 1743 + /** @endcond */ 2191 1744 2192 1745 /** 2193 1746 * @brief Get the number of supported thermal zones. ··· 2212 1739 CMD_THERMAL_GET_NUM_ZONES = 3, 2213 1740 2214 1741 /** 2215 - * @brief Get the thermtrip of the specified zone. 1742 + * @brief Get the thermal trip value of the specified zone. 2216 1743 * 2217 1744 * Host needs to supply request parameters. 2218 1745 * 2219 - * mrq_response::err is 2220 - * * 0: Valid zone information returned. 2221 - * * -#BPMP_EINVAL: Invalid request parameters. 2222 - * * -#BPMP_ENOENT: No driver registered for thermal zone. 2223 - * * -#BPMP_ERANGE if thermtrip is invalid or disabled. 2224 - * * -#BPMP_EFAULT: Problem reading zone information. 1746 + * mrq_response::err for this sub-command is defined as: 1747 + * 1748 + * | Value | Description | 1749 + * | --------------- | -------------------------------------- | 1750 + * | 0 | Valid zone information returned. | 1751 + * | -#BPMP_EINVAL | Invalid request parameters. | 1752 + * | -#BPMP_ENOENT | No driver registered for thermal zone. | 1753 + * | -#BPMP_ERANGE | Thermal trip is invalid or disabled. | 1754 + * | -#BPMP_EFAULT | Problem reading zone information. | 2225 1755 */ 2226 1756 CMD_THERMAL_GET_THERMTRIP = 4, 2227 1757 2228 - /** @brief: number of supported host-to-bpmp commands. May 2229 - * increase in future 1758 + /** 1759 + * @brief Number of supported host-to-bpmp commands. 2230 1760 */ 2231 1761 CMD_THERMAL_HOST_TO_BPMP_NUM 2232 1762 }; 2233 1763 1764 + /** 1765 + * @brief Sub-command identifiers for BPMP->host #MRQ_THERMAL -command 1766 + */ 2234 1767 enum mrq_thermal_bpmp_to_host_cmd { 2235 1768 /** 2236 1769 * @brief Indication that the temperature for a zone has 2237 - * exceeded the range indicated in the thermal trip point 2238 - * for the zone. 1770 + * exceeded the range indicated in the thermal trip point 1771 + * for the zone. 2239 1772 * 2240 - * BPMP needs to supply request parameters. Host only needs to 1773 + * BPMP-FW needs to supply request parameters. Host only needs to 2241 1774 * acknowledge. 2242 1775 */ 2243 1776 CMD_THERMAL_HOST_TRIP_REACHED = 100, 2244 1777 2245 - /** @brief: number of supported bpmp-to-host commands. May 2246 - * increase in future 1778 + /** 1779 + * @brief: Number of supported bpmp-to-host commands. May 1780 + * increase in future. 2247 1781 */ 2248 1782 CMD_THERMAL_BPMP_TO_HOST_NUM 2249 1783 }; 2250 1784 2251 - /* 2252 - * Host->BPMP request data for request type CMD_THERMAL_QUERY_ABI 2253 - * 2254 - * zone: Request type for which to check existence. 1785 + /** 1786 + * Host->BPMP request payload for the #CMD_THERMAL_QUERY_ABI sub-command 2255 1787 */ 2256 1788 struct cmd_thermal_query_abi_request { 1789 + /** 1790 + * Request type for which to check whether supported by BPMP-FW. 1791 + * 1792 + * Valid identifiers are available at #mrq_thermal_host_to_bpmp_cmd 1793 + */ 2257 1794 uint32_t type; 2258 1795 } BPMP_ABI_PACKED; 2259 1796 2260 - /* 2261 - * Host->BPMP request data for request type CMD_THERMAL_GET_TEMP 2262 - * 2263 - * zone: Number of thermal zone. 1797 + /** 1798 + * Host->BPMP request payload for the #CMD_THERMAL_GET_TEMP sub-command 2264 1799 */ 2265 1800 struct cmd_thermal_get_temp_request { 1801 + /** Thermal zone identifier from @ref bpmp_thermal_ids. */ 2266 1802 uint32_t zone; 2267 1803 } BPMP_ABI_PACKED; 2268 1804 2269 - /* 2270 - * BPMP->Host reply data for request CMD_THERMAL_GET_TEMP 1805 + /** 1806 + * BPMP->Host response payload for the #CMD_THERMAL_GET_TEMP sub-command. 2271 1807 * 2272 - * error: 0 if request succeeded. 2273 - * -BPMP_EINVAL if request parameters were invalid. 2274 - * -BPMP_ENOENT if no driver was registered for the specified thermal zone. 2275 - * -BPMP_EFAULT for other thermal zone driver errors. 2276 - * temp: Current temperature in millicelsius. 1808 + * mrq_response::err is defined as: 1809 + * 1810 + * | Value | Description | 1811 + * | ------------- | -------------------------------------------------------- | 1812 + * | 0 | Request succeeded. | 1813 + * | -#BPMP_EINVAL | Request parameters were invalid. | 1814 + * | -#BPMP_ENOENT | No driver was registered for the specified thermal zone. | 1815 + * | -#BPMP_EFAULT | For other BPMP-FW internal thermal zone driver errors. | 2277 1816 */ 2278 1817 struct cmd_thermal_get_temp_response { 1818 + /** @brief Current temperature in millicelsius. */ 2279 1819 int32_t temp; 2280 1820 } BPMP_ABI_PACKED; 2281 1821 2282 - /* 2283 - * Host->BPMP request data for request type CMD_THERMAL_SET_TRIP 1822 + /** 1823 + * @cond (!bpmp_safe && !bpmp_t264) 2284 1824 * 2285 - * zone: Number of thermal zone. 2286 - * low: Temperature of lower trip point in millicelsius 2287 - * high: Temperature of upper trip point in millicelsius 2288 - * enabled: 1 to enable trip point, 0 to disable trip point 1825 + * Host->BPMP request payload for the #CMD_THERMAL_SET_TRIP sub-command. 2289 1826 */ 2290 1827 struct cmd_thermal_set_trip_request { 1828 + /** @brief Thermal zone identifier from @ref bpmp_thermal_ids. */ 2291 1829 uint32_t zone; 1830 + /** @brief Temperature of lower trip point in millicelsius */ 2292 1831 int32_t low; 1832 + /** @brief Temperature of upper trip point in millicelsius */ 2293 1833 int32_t high; 1834 + /** 1 to enable trip point, 0 to disable trip point */ 2294 1835 uint32_t enabled; 2295 1836 } BPMP_ABI_PACKED; 2296 1837 2297 - /* 2298 - * BPMP->Host request data for request type CMD_THERMAL_HOST_TRIP_REACHED 2299 - * 2300 - * zone: Number of thermal zone where trip point was reached. 1838 + /** 1839 + * BPMP->Host request payload for the #CMD_THERMAL_HOST_TRIP_REACHED sub-command. 2301 1840 */ 2302 1841 struct cmd_thermal_host_trip_reached_request { 1842 + /** 1843 + * @brief ID of the thermal zone where trip point was reached, 1844 + * from @ref bpmp_thermal_ids. 1845 + */ 2303 1846 uint32_t zone; 2304 1847 } BPMP_ABI_PACKED; 1848 + /** @endcond */ 2305 1849 2306 - /* 2307 - * BPMP->Host reply data for request type CMD_THERMAL_GET_NUM_ZONES 2308 - * 2309 - * num: Number of supported thermal zones. The thermal zones are indexed 2310 - * starting from zero. 1850 + /** 1851 + * BPMP->Host response payload for the #CMD_THERMAL_GET_NUM_ZONES sub-command. 2311 1852 */ 2312 1853 struct cmd_thermal_get_num_zones_response { 1854 + /** 1855 + * @brief Number of supported thermal zones. 1856 + * 1857 + * The thermal zones are indexed starting from zero. 1858 + */ 2313 1859 uint32_t num; 2314 1860 } BPMP_ABI_PACKED; 2315 1861 2316 - /* 2317 - * Host->BPMP request data for request type CMD_THERMAL_GET_THERMTRIP 2318 - * 2319 - * zone: Number of thermal zone. 1862 + /** 1863 + * Host->BPMP request payload for the #CMD_THERMAL_GET_THERMTRIP sub-command. 2320 1864 */ 2321 1865 struct cmd_thermal_get_thermtrip_request { 1866 + /** @brief Thermal zone identifier from @ref bpmp_thermal_ids. */ 2322 1867 uint32_t zone; 2323 1868 } BPMP_ABI_PACKED; 2324 1869 2325 - /* 2326 - * BPMP->Host reply data for request CMD_THERMAL_GET_THERMTRIP 2327 - * 2328 - * thermtrip: HW shutdown temperature in millicelsius. 1870 + /** 1871 + * BPMP->Host response payload for the #CMD_THERMAL_GET_THERMTRIP sub-command. 2329 1872 */ 2330 1873 struct cmd_thermal_get_thermtrip_response { 1874 + /** @brief HW shutdown temperature in millicelsius. */ 2331 1875 int32_t thermtrip; 2332 1876 } BPMP_ABI_PACKED; 2333 1877 2334 - /* 2335 - * Host->BPMP request data. 1878 + /** 1879 + * Host->BPMP #MRQ_THERMAL request payload. 2336 1880 * 2337 - * Reply type is union mrq_thermal_bpmp_to_host_response. 2338 - * 2339 - * type: Type of request. Values listed in enum mrq_thermal_type. 2340 - * data: Request type specific parameters. 1881 + * Response payload type is #mrq_thermal_bpmp_to_host_response. 2341 1882 */ 2342 1883 struct mrq_thermal_host_to_bpmp_request { 1884 + /** 1885 + * Request sub-command identifier from @ref mrq_thermal_host_to_bpmp_cmd. 1886 + */ 2343 1887 uint32_t type; 1888 + 2344 1889 union { 2345 1890 struct cmd_thermal_query_abi_request query_abi; 2346 1891 struct cmd_thermal_get_temp_request get_temp; ··· 2367 1876 } BPMP_UNION_ANON; 2368 1877 } BPMP_ABI_PACKED; 2369 1878 2370 - /* 2371 - * BPMP->Host request data. 2372 - * 2373 - * type: Type of request. Values listed in enum mrq_thermal_type. 2374 - * data: Request type specific parameters. 1879 + /** 1880 + * @brief Request payload for the BPMP->Host #MRQ_THERMAL command. 2375 1881 */ 2376 1882 struct mrq_thermal_bpmp_to_host_request { 1883 + /** 1884 + * Request sub-command identifier from @ref mrq_thermal_bpmp_to_host_cmd. 1885 + */ 2377 1886 uint32_t type; 1887 + 2378 1888 union { 2379 1889 struct cmd_thermal_host_trip_reached_request host_trip_reached; 2380 1890 } BPMP_UNION_ANON; 2381 1891 } BPMP_ABI_PACKED; 2382 1892 2383 - /* 2384 - * Data in reply to a Host->BPMP request. 1893 + /** 1894 + * @brief Response payload for the Host->BPMP #MRQ_THERMAL command. 2385 1895 */ 2386 1896 union mrq_thermal_bpmp_to_host_response { 2387 1897 struct cmd_thermal_get_temp_response get_temp; ··· 2392 1900 2393 1901 /** @} Thermal */ 2394 1902 2395 - /** 1903 + /** @cond (!bpmp_safe && (bpmp_t234 || bpmp_t238 || bpmp_t264)) 2396 1904 * @ingroup MRQ_Codes 2397 1905 * @def MRQ_OC_STATUS 2398 - * @brief Query over current status 1906 + * @brief Query overcurrent status 2399 1907 * 2400 - * * Platforms: T234 2401 - * @cond bpmp_t234 2402 1908 * * Initiators: CCPLEX 2403 1909 * * Targets: BPMP 2404 1910 * * Request Payload: N/A ··· 2406 1916 * @{ 2407 1917 */ 2408 1918 1919 + /** 1920 + * @brief Size of the mrq_oc_status_response::throt_en and 1921 + * mrq_oc_status_response::event_cnt -arrays. 1922 + */ 2409 1923 #define OC_STATUS_MAX_SIZE 24U 2410 1924 2411 - /* 2412 - * @brief Response to #MRQ_OC_STATUS 2413 - * 2414 - * throt_en: Value for each OC alarm where zero signifies throttle is 2415 - * disabled, and non-zero throttle is enabled. 2416 - * event_cnt: Total number of OC events for each OC alarm. 1925 + /** 1926 + * @brief Response payload for the #MRQ_OC_STATUS -command. 2417 1927 * 2418 1928 * mrq_response::err is 0 if the operation was successful and 2419 1929 * -#BPMP_ENODEV otherwise. 2420 1930 */ 2421 1931 struct mrq_oc_status_response { 1932 + /** 1933 + * @brief Value for each overcurrent alarm where zero signifies 1934 + * throttle is disabled, and non-zero throttle is enabled. 1935 + */ 2422 1936 uint8_t throt_en[OC_STATUS_MAX_SIZE]; 1937 + 1938 + /** 1939 + * @brief Total number of overcurrent events for each overcurrent alarm. 1940 + */ 2423 1941 uint32_t event_cnt[OC_STATUS_MAX_SIZE]; 2424 1942 } BPMP_ABI_PACKED; 2425 1943 2426 1944 /** @} OC_status */ 2427 - /** @endcond bpmp_t234 */ 1945 + /** @endcond */ 1946 + 1947 + /** @cond (bpmp_th500 || bpmp_tb500 || bpmp_t238) 1948 + * @ingroup MRQ_Codes 1949 + * @def MRQ_THROTTLE 1950 + * @brief Overcurrent throttling 1951 + * 1952 + * * Initiators: CCPLEX 1953 + * * Targets: BPMP 1954 + * * Request Payload: @ref mrq_throttle_request 1955 + * * Response Payload: @ref mrq_throttle_response 1956 + * @addtogroup Throttle 1957 + * @{ 1958 + */ 1959 + enum mrq_throttle_cmd { 1960 + /** 1961 + * @brief Check whether the BPMP-FW supports the specified 1962 + * #MRQ_THROTTLE sub-command. 1963 + * 1964 + * mrq_response::err is 0 if the specified request is 1965 + * supported and -#BPMP_ENODEV otherwise. 1966 + */ 1967 + CMD_THROTTLE_QUERY_ABI = 0, 1968 + 1969 + /** 1970 + * @cond (bpmp_th500 || bpmp_tb500) 1971 + * @brief query chipthrot status 1972 + * 1973 + * mrq_response:err is defined as: 1974 + * 1975 + * | Value | Description | 1976 + * |----------------|--------------------------------------------------------------| 1977 + * | 0 | Success | 1978 + * | -#BPMP_ENODEV | CMD_THROTTLE_GET_CHIPTHROT_STATUS is not supported by BPMP-FW| 1979 + */ 1980 + CMD_THROTTLE_GET_CHIPTHROT_STATUS = 1, 1981 + /** @endcond */ 1982 + 1983 + /** 1984 + * @cond bpmp_t238 1985 + * @brief program OC throttle configuration 1986 + * 1987 + * mrq_response:err is defined as: 1988 + * 1989 + * | Value | Description | 1990 + * |----------------|--------------------------------------------------------------| 1991 + * | 0 | Success | 1992 + * | -#BPMP_EINVAL | ID out of range or alarm for this ID not enabled at boot | 1993 + * | -#BPMP_ENODEV | CMD_THROTTLE_SET_OC_CONFIG is not supported by BPMP-FW | 1994 + */ 1995 + CMD_THROTTLE_SET_OC_CONFIG = 2, 1996 + /** @endcond */ 1997 + }; 2428 1998 2429 1999 /** 2000 + * @brief Request payload for #MRQ_THROTTLE sub-command #CMD_THROTTLE_QUERY_ABI 2001 + */ 2002 + struct cmd_throttle_query_abi_request { 2003 + uint32_t cmd; /**< @ref mrq_throttle_cmd */ 2004 + } BPMP_ABI_PACKED; 2005 + 2006 + /** 2007 + * @cond bpmp_th500 2008 + * @brief Response payload for #MRQ_THROTTLE sub-command 2009 + * #CMD_THROTTLE_GET_CHIPTHROT_STATUS 2010 + * 2011 + * Bit-mask of all h/w throttling actions that have been engaged since 2012 + * last invocation of this command 2013 + * Bit 0...11 : HW throttling status of the thermal zones. 2014 + * Bit 12...23 : Reserved for future thermal zone events. 2015 + * Bit 24...25 : HW throttling status of the Over current Alarms OC1 & OC2. 2016 + * Bit 26...31 : Reserved for future Over current alarm events. 2017 + * Bit 32...63 : Reserved for future use. 2018 + * @endcond 2019 + * @cond bpmp_tb500 2020 + * @brief Response payload for #MRQ_THROTTLE sub-command 2021 + * #CMD_THROTTLE_GET_CHIPTHROT_STATUS 2022 + * 2023 + * Bit-mask of all h/w throttling actions that have been engaged since 2024 + * last invocation of this command 2025 + * Bit 0 : HW throttling status of the TB500C_TJ_MAX thermal zone. 2026 + * Bit 1...63 : Reserved for future use. 2027 + * @endcond 2028 + * @cond (bpmp_th500 || bpmp_tb500) 2029 + */ 2030 + struct cmd_throttle_get_chipthrot_status_response { 2031 + uint64_t status; 2032 + } BPMP_ABI_PACKED; 2033 + /** @endcond */ 2034 + 2035 + /** 2036 + * @cond bpmp_t238 2037 + * @brief Request payload for #MRQ_THROTTLE sub-command 2038 + * #CMD_THROTTLE_SET_OC_CONFIG 2039 + * 2040 + * Only alarms that have been configured as enabled in BPMP-DTB at boot can 2041 + * be reconfigured with this MRQ. 2042 + */ 2043 + struct cmd_throttle_set_oc_config_request { 2044 + /** @brief valid OC alarm ID from @ref bpmp_soctherm_edp_oc_ids */ 2045 + uint32_t id; 2046 + /** @brief Throttling enable/disable 2047 + * 2048 + * Set to 1 to enable throttling, or 0 to disable. Other values are 2049 + * disallowed. 2050 + */ 2051 + uint8_t en_throttle; 2052 + } BPMP_ABI_PACKED; 2053 + /** @endcond */ 2054 + 2055 + /** 2056 + * @brief Request payload for the #MRQ_THROTTLE -command 2057 + * 2058 + * | Sub-command | Request payload | 2059 + * |------------------------------------|----------------------------------| 2060 + * | #CMD_THROTTLE_QUERY_ABI | #cmd_throttle_query_abi_request | 2061 + * 2062 + * @cond bpmp_th500 2063 + * The following additional sub-commands are supported on TH500 platforms: 2064 + * | Sub-command | Request payload | 2065 + * |------------------------------------|----------------------------------| 2066 + * | #CMD_THROTTLE_GET_CHIPTHROT_STATUS | - | 2067 + * @endcond 2068 + * 2069 + * @cond bpmp_tb500 2070 + * The following additional sub-commands are supported on TB500 platforms: 2071 + * | Sub-command | Request payload | 2072 + * |------------------------------------|----------------------------------| 2073 + * | #CMD_THROTTLE_GET_CHIPTHROT_STATUS | - | 2074 + * @endcond 2075 + * 2076 + * @cond bpmp_t238 2077 + * The following additional sub-commands are supported on T238 platforms: 2078 + * | Sub-command | Request payload | 2079 + * |------------------------------------|-------------------------------------| 2080 + * | #CMD_THROTTLE_SET_OC_CONFIG | #cmd_throttle_set_oc_config_request | 2081 + * @endcond 2082 + */ 2083 + struct mrq_throttle_request { 2084 + uint32_t cmd; 2085 + union { 2086 + struct cmd_throttle_query_abi_request throttle_query_abi_req; 2087 + /** @cond bpmp_t238 */ 2088 + struct cmd_throttle_set_oc_config_request throttle_set_oc_config_req; 2089 + /** @endcond */ 2090 + } BPMP_UNION_ANON; 2091 + } BPMP_ABI_PACKED; 2092 + 2093 + /** 2094 + * @brief Response payload for the #MRQ_THROTTLE -command. 2095 + * 2096 + * | Sub-command | Response payload | 2097 + * |------------------------------------|--------------------------------------------| 2098 + * | #CMD_THROTTLE_QUERY_ABI | - | 2099 + * 2100 + * @cond bpmp_th500 2101 + * The following additional sub-commands are supported on TH500 platforms: 2102 + * | Sub-command | Response payload | 2103 + * |------------------------------------|--------------------------------------------| 2104 + * | #CMD_THROTTLE_GET_CHIPTHROT_STATUS | #cmd_throttle_get_chipthrot_status_response| 2105 + * @endcond 2106 + * 2107 + * @cond bpmp_tb500 2108 + * The following additional sub-commands are supported on TB500 platforms: 2109 + * | Sub-command | Response payload | 2110 + * |------------------------------------|--------------------------------------------| 2111 + * | #CMD_THROTTLE_GET_CHIPTHROT_STATUS | #cmd_throttle_get_chipthrot_status_response| 2112 + * @endcond 2113 + * 2114 + * @cond bpmp_t238 2115 + * The following additional sub-commands are supported on T238 platforms: 2116 + * | Sub-command | Response payload | 2117 + * |------------------------------------|--------------------------------------------| 2118 + * | #CMD_THROTTLE_SET_OC_CONFIG | - | 2119 + * @endcond 2120 + */ 2121 + struct mrq_throttle_response { 2122 + union { 2123 + /** @cond (bpmp_th500 || bpmp_tb500) */ 2124 + struct cmd_throttle_get_chipthrot_status_response throttle_get_chipthrot_status_resp; 2125 + /** @endcond */ 2126 + } BPMP_UNION_ANON; 2127 + } BPMP_ABI_PACKED; 2128 + /** @} Throttle */ 2129 + /** @endcond */ 2130 + 2131 + 2132 + /** @cond bpmp_t186 2430 2133 * @ingroup MRQ_Codes 2431 2134 * @def MRQ_CPU_VHINT 2432 2135 * @brief Query CPU voltage hint data 2433 2136 * 2434 - * * Platforms: T186 2435 - * @cond bpmp_t186 2436 2137 * * Initiators: CCPLEX 2437 2138 * * Targets: BPMP 2438 2139 * * Request Payload: @ref mrq_cpu_vhint_request ··· 2676 1995 } BPMP_ABI_PACKED; 2677 1996 2678 1997 /** @} Vhint */ 2679 - /** @endcond bpmp_t186 */ 1998 + /** @endcond */ 2680 1999 2681 2000 /** 2682 2001 * @ingroup MRQ_Codes 2683 2002 * @def MRQ_ABI_RATCHET 2684 2003 * @brief ABI ratchet value query 2685 2004 * 2686 - * * Platforms: T186, T194 2687 2005 * * Initiators: Any 2688 2006 * * Targets: BPMP 2689 2007 * * Request Payload: @ref mrq_abi_ratchet_request ··· 2694 2014 /** 2695 2015 * @brief An ABI compatibility mechanism 2696 2016 * 2697 - * BPMP_ABI_RATCHET_VALUE may increase for various reasons in a future 2017 + * #BPMP_ABI_RATCHET_VALUE may increase for various reasons in a future 2698 2018 * revision of this header file. 2699 2019 * 1. That future revision deprecates some MRQ 2700 2020 * 2. That future revision introduces a breaking change to an existing ··· 2731 2051 * 2732 2052 * If #ratchet is less than the requester's #BPMP_ABI_RATCHET_VALUE, 2733 2053 * the requster must either interoperate with BPMP according to an ABI 2734 - * header version with BPMP_ABI_RATCHET_VALUE = ratchet or cease 2054 + * header version with #BPMP_ABI_RATCHET_VALUE = ratchet or cease 2735 2055 * communication with BPMP. 2736 2056 * 2737 2057 * If mrq_response::err is 0 and ratchet is greater than or equal to the 2738 - * requester's BPMP_ABI_RATCHET_VALUE, the requester should continue 2058 + * requester's #BPMP_ABI_RATCHET_VALUE, the requester should continue 2739 2059 * normal operation. 2740 2060 */ 2741 2061 struct mrq_abi_ratchet_response { ··· 2750 2070 * @def MRQ_EMC_DVFS_LATENCY 2751 2071 * @brief Query frequency dependent EMC DVFS latency 2752 2072 * 2753 - * * Platforms: T186, T194, T234 2073 + * On T264 and onwards, this MRQ service is available only when 2074 + * BPMP-FW has valid DRAM timing table passed by earlier boot stages. 2075 + * 2754 2076 * * Initiators: CCPLEX 2755 2077 * * Targets: BPMP 2756 2078 * * Request Payload: N/A ··· 2776 2094 * @brief Response to #MRQ_EMC_DVFS_LATENCY 2777 2095 */ 2778 2096 struct mrq_emc_dvfs_latency_response { 2779 - /** @brief The number valid entries in #pairs */ 2097 + /** 2098 + * @brief The number valid entries in #pairs 2099 + * 2100 + * Valid range is [0, #EMC_DVFS_LATENCY_MAX_SIZE] 2101 + */ 2780 2102 uint32_t num_pairs; 2781 2103 /** @brief EMC DVFS node <frequency, latency> information */ 2782 2104 struct emc_dvfs_latency pairs[EMC_DVFS_LATENCY_MAX_SIZE]; ··· 2788 2102 2789 2103 /** @} EMC */ 2790 2104 2791 - /** 2105 + /** @cond (bpmp_t234) 2792 2106 * @ingroup MRQ_Codes 2793 2107 * @def MRQ_EMC_DVFS_EMCHUB 2794 2108 * @brief Query EMC HUB frequencies 2795 2109 * 2796 - * * Platforms: T234 onwards 2797 - * @cond (bpmp_t234 || bpmp_t238 || bpmp_th500) 2798 2110 * * Initiators: CCPLEX 2799 2111 * * Targets: BPMP 2800 2112 * * Request Payload: N/A ··· 2823 2139 } BPMP_ABI_PACKED; 2824 2140 2825 2141 /** @} EMC */ 2826 - /** @endcond (bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2142 + /** @endcond */ 2827 2143 2828 - /** 2144 + /** @cond (bpmp_t234) 2829 2145 * @ingroup MRQ_Codes 2830 2146 * @def MRQ_EMC_DISP_RFL 2831 2147 * @brief Set EMC display RFL handshake mode of operations 2832 2148 * 2833 - * * Platforms: T234 onwards 2834 - * @cond (bpmp_t234 || bpmp_t238 || bpmp_th500) 2835 2149 * * Initiators: CCPLEX 2836 2150 * * Targets: BPMP 2837 2151 * * Request Payload: @ref mrq_emc_disp_rfl_request ··· 2839 2157 * @{ 2840 2158 */ 2841 2159 2160 + /** 2161 + * @brief Allowed mode values for the mrq_emc_disp_rfl_request::mode -field. 2162 + */ 2842 2163 enum mrq_emc_disp_rfl_mode { 2843 2164 /** @brief EMC display RFL handshake disabled */ 2844 2165 EMC_DISP_RFL_MODE_DISABLED = 0, ··· 2856 2171 * Used by the sender of an #MRQ_EMC_DISP_RFL message to 2857 2172 * request the mode of EMC display RFL handshake. 2858 2173 * 2859 - * mrq_response::err is 2860 - * * 0: RFL mode is set successfully 2861 - * * -#BPMP_EINVAL: invalid mode requested 2862 - * * -#BPMP_ENOSYS: RFL handshake is not supported 2863 - * * -#BPMP_EACCES: Permission denied 2864 - * * -#BPMP_ENODEV: if disp rfl mrq is not supported by BPMP-FW 2174 + * mrq_response::err for this request is defined as: 2175 + * 2176 + * | Value | Description | 2177 + * | -------------- | --------------------------------------------- | 2178 + * | 0 | RFL mode is set successfully. | 2179 + * | -#BPMP_EINVAL | Invalid mode requested. | 2180 + * | -#BPMP_ENOSYS | RFL handshake is not supported. | 2181 + * | -#BPMP_EACCES | Permission denied. | 2182 + * | -#BPMP_ENODEV | if disp rfl mrq is not supported by BPMP-FW. | 2865 2183 */ 2866 2184 struct mrq_emc_disp_rfl_request { 2867 - /** @brief EMC display RFL mode (@ref mrq_emc_disp_rfl_mode) */ 2185 + /** @brief EMC display RFL mode from @ref mrq_emc_disp_rfl_mode */ 2868 2186 uint32_t mode; 2869 2187 } BPMP_ABI_PACKED; 2870 2188 2871 2189 /** @} EMC */ 2872 - /** @endcond (bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2190 + /** @endcond */ 2873 2191 2874 - /** 2192 + /** @cond (!bpmp_safe && (bpmp_t234 || bpmp_t238)) 2875 2193 * @ingroup MRQ_Codes 2876 2194 * @def MRQ_BWMGR 2877 - * @brief bwmgr requests 2195 + * @brief Bandwidth manager (BWMGR) commands 2878 2196 * 2879 - * * Platforms: T234 onwards 2880 - * @cond (bpmp_t234 || bpmp_t238 || bpmp_th500) 2881 2197 * * Initiators: CCPLEX 2882 2198 * * Targets: BPMP 2883 2199 * * Request Payload: @ref mrq_bwmgr_request 2884 2200 * * Response Payload: @ref mrq_bwmgr_response 2885 2201 * 2886 2202 * @addtogroup BWMGR 2887 - * 2888 2203 * @{ 2889 2204 */ 2890 2205 2206 + /** 2207 + * @brief Sub-command identifiers for #MRQ_BWMGR 2208 + */ 2891 2209 enum mrq_bwmgr_cmd { 2892 2210 /** 2893 - * @brief Check whether the BPMP driver supports the specified 2894 - * request type 2211 + * @brief Check whether BPMP-FW supports the specified 2212 + * #MRQ_BWMGR sub-command. 2895 2213 * 2896 - * mrq_response::err is 0 if the specified request is 2897 - * supported and -#BPMP_ENODEV otherwise. 2214 + * mrq_response::err is defined to be: 2215 + * 2216 + * | Value | Description 2217 + * |----------------|---------------------------- 2218 + * | 0 | Specified sub-command is supported. 2219 + * | -#BPMP_ENODEV | Specified sub-command is not supported. 2898 2220 */ 2899 2221 CMD_BWMGR_QUERY_ABI = 0, 2900 2222 2901 2223 /** 2902 - * @brief Determine dram rate to satisfy iso/niso bw requests 2224 + * @brief Determine DRAM rate to satisfy ISO/NISO bandwidth requests 2903 2225 * 2904 - * mrq_response::err is 2905 - * * 0: calc_rate succeeded. 2906 - * * -#BPMP_EINVAL: Invalid request parameters. 2907 - * * -#BPMP_ENOTSUP: Requested bw is not available. 2226 + * mrq_response::err is defined to be: 2227 + * 2228 + * | Value | Description 2229 + * |----------------|---------------------------- 2230 + * | 0 | Rate calculation succeeded. 2231 + * | -#BPMP_EINVAL | Invalid request parameters. 2232 + * | -#BPMP_ENOTSUP | Requested bandwidth is not available. 2233 + * | <0 | Any other internal error. 2908 2234 */ 2909 2235 CMD_BWMGR_CALC_RATE = 1 2910 2236 }; 2911 2237 2912 - /* 2913 - * request data for request type CMD_BWMGR_QUERY_ABI 2914 - * 2915 - * type: Request type for which to check existence. 2238 + /** 2239 + * @brief Request payload for #MRQ_BWMGR sub-command #CMD_BWMGR_QUERY_ABI 2916 2240 */ 2917 2241 struct cmd_bwmgr_query_abi_request { 2242 + /** @brief Sub-command identifier from @ref mrq_bwmgr_cmd. */ 2918 2243 uint32_t type; 2919 2244 } BPMP_ABI_PACKED; 2920 2245 ··· 2932 2237 * @brief Used by @ref cmd_bwmgr_calc_rate_request 2933 2238 */ 2934 2239 struct iso_req { 2935 - /* @brief bwmgr client ID @ref bpmp_bwmgr_ids */ 2240 + /** @brief BWMGR client ID from @ref bpmp_bwmgr_ids */ 2936 2241 uint32_t id; 2937 - /* @brief bw in kBps requested by client */ 2242 + /** @brief Bandwidth in kBps requested by client */ 2938 2243 uint32_t iso_bw; 2939 2244 } BPMP_ABI_PACKED; 2940 2245 2246 + /** 2247 + * @brief Size of the cmd_bwmgr_calc_rate_request::isobw_reqs -array. 2248 + */ 2941 2249 #define MAX_ISO_CLIENTS 13U 2942 - /* 2943 - * request data for request type CMD_BWMGR_CALC_RATE 2250 + 2251 + /** 2252 + * @brief Request payload for #MRQ_BWMGR sub-command #CMD_BWMGR_CALC_RATE 2944 2253 */ 2945 2254 struct cmd_bwmgr_calc_rate_request { 2946 - /* @brief total bw in kBps requested by all niso clients */ 2255 + /** @brief Total bandwidth in kBps requested by all NISO clients. */ 2947 2256 uint32_t sum_niso_bw; 2948 - /* @brief The number of iso clients */ 2257 + /** @brief The number of ISO client requests in #isobw_reqs -array */ 2949 2258 uint32_t num_iso_clients; 2950 - /* @brief iso_req <id, iso_bw> information */ 2259 + /** @brief iso_req <id, iso_bw> information */ 2951 2260 struct iso_req isobw_reqs[MAX_ISO_CLIENTS]; 2952 2261 } BPMP_ABI_PACKED; 2953 2262 2954 - /* 2955 - * response data for request type CMD_BWMGR_CALC_RATE 2956 - * 2957 - * iso_rate_min: min dram data clk rate in kHz to satisfy all iso bw reqs 2958 - * total_rate_min: min dram data clk rate in kHz to satisfy all bw reqs 2263 + /** 2264 + * @brief Response payload for #MRQ_BWMGR sub-command #CMD_BWMGR_CALC_RATE 2959 2265 */ 2960 2266 struct cmd_bwmgr_calc_rate_response { 2267 + /** 2268 + * @brief Minimum DRAM data clock rate in kHz to satisfy all ISO client 2269 + * bandwidth requests. 2270 + */ 2961 2271 uint32_t iso_rate_min; 2272 + 2273 + /** 2274 + * @brief Minimum DRAM data clock rate in kHz to satisfy all 2275 + * bandwidth requests. 2276 + */ 2962 2277 uint32_t total_rate_min; 2963 2278 } BPMP_ABI_PACKED; 2964 2279 2965 - /* 2966 - * @brief Request with #MRQ_BWMGR 2280 + /** 2281 + * @brief Request payload for the #MRQ_BWMGR -command. 2967 2282 * 2968 - * 2969 - * |sub-command |payload | 2970 - * |----------------------------|------------------------------| 2971 - * |CMD_BWMGR_QUERY_ABI | cmd_bwmgr_query_abi_request | 2972 - * |CMD_BWMGR_CALC_RATE | cmd_bwmgr_calc_rate_request | 2973 - * 2283 + * |Sub-command |Payload | 2284 + * |----------------------|-----------------------------| 2285 + * |#CMD_BWMGR_QUERY_ABI |#cmd_bwmgr_query_abi_request | 2286 + * |#CMD_BWMGR_CALC_RATE |#cmd_bwmgr_calc_rate_request | 2974 2287 */ 2975 2288 struct mrq_bwmgr_request { 2289 + /** @brief Sub-command identifier from @ref mrq_bwmgr_cmd. */ 2976 2290 uint32_t cmd; 2977 2291 union { 2978 2292 struct cmd_bwmgr_query_abi_request query_abi; ··· 2989 2285 } BPMP_UNION_ANON; 2990 2286 } BPMP_ABI_PACKED; 2991 2287 2992 - /* 2993 - * @brief Response to MRQ_BWMGR 2288 + /** 2289 + * @brief Response payload for the #MRQ_BWMGR -command. 2994 2290 * 2995 - * |sub-command |payload | 2996 - * |----------------------------|------------------------------| 2997 - * |CMD_BWMGR_CALC_RATE | cmd_bwmgr_calc_rate_response | 2291 + * |Sub-command |Payload | 2292 + * |----------------------|------------------------------| 2293 + * |#CMD_BWMGR_CALC_RATE |#cmd_bwmgr_calc_rate_response | 2998 2294 */ 2999 2295 struct mrq_bwmgr_response { 3000 2296 union { ··· 3003 2299 } BPMP_ABI_PACKED; 3004 2300 3005 2301 /** @} BWMGR */ 3006 - /** @endcond (bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2302 + /** @endcond */ 3007 2303 3008 - /** 2304 + /** @cond (!bpmp_safe && (bpmp_t234 || bpmp_t238 || bpmp_t264)) 3009 2305 * @ingroup MRQ_Codes 3010 2306 * @def MRQ_BWMGR_INT 3011 - * @brief bpmp-integrated bwmgr requests 2307 + * @brief BPMP-FW integrated BWMGR requests 3012 2308 * 3013 - * * Platforms: T234 onwards 3014 - * @cond (bpmp_t234 || bpmp_t238 || bpmp_th500) 3015 2309 * * Initiators: CCPLEX 3016 2310 * * Targets: BPMP 3017 2311 * * Request Payload: @ref mrq_bwmgr_int_request ··· 3019 2317 * @{ 3020 2318 */ 3021 2319 2320 + /** 2321 + * @brief Sub-command identifiers for #MRQ_BWMGR_INT 2322 + */ 3022 2323 enum mrq_bwmgr_int_cmd { 3023 2324 /** 3024 2325 * @brief Check whether the BPMP-FW supports the specified 3025 - * request type 2326 + * sub-command. 3026 2327 * 3027 2328 * mrq_response::err is 0 if the specified request is 3028 2329 * supported and -#BPMP_ENODEV otherwise. ··· 3033 2328 CMD_BWMGR_INT_QUERY_ABI = 1, 3034 2329 3035 2330 /** 3036 - * @brief Determine and set dram rate to satisfy iso/niso bw request 2331 + * @brief Determine and set DRAM rate to satisfy ISO/NISO bandwidth requests. 3037 2332 * 3038 - * mrq_response::err is 3039 - * * 0: request succeeded. 3040 - * * -#BPMP_EINVAL: Invalid request parameters. 3041 - * set_frequency in @ref cmd_bwmgr_int_calc_and_set_response 3042 - * will not be set. 3043 - * * -#BPMP_ENOTSUP: Requested bw is not available. 3044 - * set_frequency in @ref cmd_bwmgr_int_calc_and_set_response 3045 - * will be current dram-clk rate. 2333 + * mrq_response::err is defined as: 2334 + * 2335 + * |Value |Description | 2336 + * |-----------------|----------------------------------------------------------------------------------------------------------------| 2337 + * |0 |Request succeeded. | 2338 + * |-#BPMP_EINVAL |Invalid request parameters, cmd_bwmgr_int_calc_and_set_response::rate is not set. | 2339 + * |-#BPMP_ENOTSUP |Requested bandwidth is not available, cmd_bwmgr_int_calc_and_set_response::rate is the current DRAM clock rate. | 2340 + * |<0 |Any other internal error. | 3046 2341 */ 3047 2342 CMD_BWMGR_INT_CALC_AND_SET = 2, 3048 2343 3049 2344 /** 3050 - * @brief Set a max DRAM frequency for the bandwidth-manager 2345 + * @brief Set a max DRAM frequency for the bandwidth manager. 3051 2346 * 3052 - * mrq_response::err is 3053 - * * 0: request succeeded. 3054 - * * -#BPMP_ENOTSUP: Requested cap frequency is not possible. 2347 + * mrq_response::err is defined as: 2348 + * 2349 + * |Value |Description | 2350 + * |-----------------|------------------------------------------| 2351 + * |0 |Request succeeded. | 2352 + * |-#BPMP_ENOTSUP |Requested cap frequency is not possible. | 2353 + * |<0 |Any other internal error. | 3055 2354 */ 3056 - CMD_BWMGR_INT_CAP_SET = 3 2355 + CMD_BWMGR_INT_CAP_SET = 3, 2356 + 2357 + /** 2358 + * @brief Obtain the maximum amount of bandwidth currently allocatable 2359 + * to the requesting client. 2360 + * 2361 + * mrq_response::err is defined as: 2362 + * 2363 + * |Value |Description | 2364 + * |-----------------|------------------------------------------| 2365 + * |0 |Request succeeded. | 2366 + * |-#BPMP_EINVAL |Invalid request parameters. | 2367 + * |<0 |Any other internal error. | 2368 + */ 2369 + CMD_BWMGR_INT_CURR_AVAILABLE_BW = 4, 2370 + /** 2371 + * @brief Get the last request made by the client. 2372 + * 2373 + * mrq_response::err is defined as: 2374 + * 2375 + * |Value |Description | 2376 + * |-----------------|------------------------------------------| 2377 + * |0 |Request succeeded. | 2378 + * |-#BPMP_EINVAL |Invalid request parameters. | 2379 + * |<0 |Any other internal error. | 2380 + */ 2381 + CMD_BWMGR_INT_GET_LAST_REQUEST = 5, 3057 2382 }; 3058 2383 3059 - /* 3060 - * request structure for request type CMD_BWMGR_QUERY_ABI 3061 - * 3062 - * type: Request type for which to check existence. 2384 + /** 2385 + * @brief Request payload for #MRQ_BWMGR_INT sub-command #CMD_BWMGR_INT_QUERY_ABI 3063 2386 */ 3064 2387 struct cmd_bwmgr_int_query_abi_request { 3065 - /* @brief request type determined by @ref mrq_bwmgr_int_cmd */ 2388 + /** @brief Sub-command identifier from @ref mrq_bwmgr_int_cmd. */ 3066 2389 uint32_t type; 3067 2390 } BPMP_ABI_PACKED; 3068 2391 ··· 3106 2373 3107 2374 /** @} bwmgr_int_unit_type */ 3108 2375 3109 - /* 3110 - * request data for request type CMD_BWMGR_INT_CALC_AND_SET 2376 + /** 2377 + * @brief Request payload for #MRQ_BWMGR_INT sub-command #CMD_BWMGR_INT_CALC_AND_SET 3111 2378 */ 3112 2379 struct cmd_bwmgr_int_calc_and_set_request { 3113 - /* @brief bwmgr client ID @ref bpmp_bwmgr_ids */ 2380 + /** @brief BWGMR client ID from @ref bpmp_bwmgr_ids */ 3114 2381 uint32_t client_id; 3115 - /* @brief average niso bw usage in kBps requested by client. */ 2382 + /** @brief Average NISO bandwidth usage in kBps requested by client. */ 3116 2383 uint32_t niso_bw; 3117 - /* 3118 - * @brief average iso bw usage in kBps requested by client. 3119 - * Value is ignored if client is niso. Determined by client_id. 2384 + /** 2385 + * @brief Average ISO bandwidth usage in kBps requested by client. 2386 + * 2387 + * Value is ignored if client is NISO as determined by #client_id. 3120 2388 */ 3121 2389 uint32_t iso_bw; 3122 - /* 3123 - * @brief memory clock floor requested by client. 3124 - * Unit determined by floor_unit. 2390 + /** 2391 + * @brief Memory clock floor requested by client, unit of the value 2392 + * is determined by #floor_unit -field. 3125 2393 */ 3126 2394 uint32_t mc_floor; 3127 - /* 3128 - * @brief toggle to determine the unit-type of floor value. 3129 - * See @ref bwmgr_int_unit_type definitions for unit-type mappings. 2395 + /** 2396 + * @brief Value set to determine the unit of the #mc_floor value: 2397 + * 2398 + * | Value | Unit | 2399 + * |-----------------------|----------------------| 2400 + * | #BWMGR_INT_UNIT_KBPS | Kilobytes per second | 2401 + * | #BWMGR_INT_UNIT_KHZ | Kilohertz | 3130 2402 */ 3131 2403 uint8_t floor_unit; 3132 2404 } BPMP_ABI_PACKED; 3133 2405 3134 - struct cmd_bwmgr_int_cap_set_request { 3135 - /* @brief requested cap frequency in Hz. */ 3136 - uint64_t rate; 3137 - } BPMP_ABI_PACKED; 3138 - 3139 - /* 3140 - * response data for request type CMD_BWMGR_CALC_AND_SET 2406 + /** 2407 + * @brief Response payload for #MRQ_BWMGR_INT sub-command #CMD_BWMGR_INT_CALC_AND_SET 3141 2408 */ 3142 2409 struct cmd_bwmgr_int_calc_and_set_response { 3143 - /* @brief current set memory clock frequency in Hz */ 2410 + /** @brief Currently set memory clock frequency in Hz */ 3144 2411 uint64_t rate; 3145 2412 } BPMP_ABI_PACKED; 3146 2413 3147 - /* 3148 - * @brief Request with #MRQ_BWMGR_INT 2414 + /** 2415 + * @brief Request payload for #MRQ_BWMGR_INT sub-command #CMD_BWMGR_INT_CAP_SET 2416 + */ 2417 + struct cmd_bwmgr_int_cap_set_request { 2418 + /** @brief Requested cap frequency in Hz. */ 2419 + uint64_t rate; 2420 + } BPMP_ABI_PACKED; 2421 + 2422 + /** 2423 + * @brief Request payload for #MRQ_BWMGR_INT sub-command #CMD_BWMGR_INT_CURR_AVAILABLE_BW 2424 + */ 2425 + struct cmd_bwmgr_int_curr_available_bw_request { 2426 + /** @brief BWMGR client ID from @ref bpmp_bwmgr_ids */ 2427 + uint32_t id; 2428 + } BPMP_ABI_PACKED; 2429 + 2430 + /** 2431 + * @brief Response payload for #MRQ_BWMGR_INT sub-command #CMD_BWMGR_INT_CURR_AVAILABLE_BW 2432 + */ 2433 + struct cmd_bwmgr_int_curr_available_bw_response { 2434 + /** @brief Current cap frequency in KHz. */ 2435 + uint64_t cap_rate; 2436 + /** @brief Currently available bandwidth for the requesting client 2437 + * to allocate in KBps. 2438 + */ 2439 + uint64_t available_bw; 2440 + } BPMP_ABI_PACKED; 2441 + 2442 + struct cmd_bwmgr_int_get_last_request_request { 2443 + /** @brief BWMGR client ID from @ref bpmp_bwmgr_ids */ 2444 + uint32_t id; 2445 + /** 2446 + * @brief Value set to determine the unit of the returned mc_floor value: 2447 + * 2448 + * | Value | Unit | 2449 + * |-----------------------|----------------------| 2450 + * | #BWMGR_INT_UNIT_KBPS | Kilobytes per second | 2451 + * | #BWMGR_INT_UNIT_KHZ | Kilohertz | 2452 + */ 2453 + uint8_t floor_unit; 2454 + } BPMP_ABI_PACKED; 2455 + 2456 + struct cmd_bwmgr_int_get_last_request_response { 2457 + /** @brief BWGMR client ID from @ref bpmp_bwmgr_ids */ 2458 + uint32_t client_id; 2459 + /** @brief Average NISO bandwidth usage in kBps requested by client. */ 2460 + uint32_t niso_bw; 2461 + /** 2462 + * @brief Average ISO bandwidth usage in kBps requested by client. 2463 + */ 2464 + uint32_t iso_bw; 2465 + /** 2466 + * @brief Memory clock floor requested by client, unit of the value 2467 + * is determined by #floor_unit -field. 2468 + */ 2469 + uint32_t mc_floor; 2470 + /** 2471 + * @brief Value set to determine the unit of the #mc_floor value: 2472 + * 2473 + * | Value | Unit | 2474 + * |-----------------------|----------------------| 2475 + * | #BWMGR_INT_UNIT_KBPS | Kilobytes per second | 2476 + * | #BWMGR_INT_UNIT_KHZ | Kilohertz | 2477 + */ 2478 + uint8_t floor_unit; 2479 + } BPMP_ABI_PACKED; 2480 + 2481 + /** 2482 + * @brief Request payload for the #MRQ_BWMGR_INT -command. 3149 2483 * 2484 + * |Sub-command |Payload | 2485 + * |---------------------------------|-----------------------------------------| 2486 + * |#CMD_BWMGR_INT_QUERY_ABI |#cmd_bwmgr_int_query_abi_request | 2487 + * |#CMD_BWMGR_INT_CALC_AND_SET |#cmd_bwmgr_int_calc_and_set_request | 2488 + * |#CMD_BWMGR_INT_CAP_SET |#cmd_bwmgr_int_cap_set_request | 2489 + * |#CMD_BWMGR_INT_GET_LAST_REQUEST |#cmd_bwmgr_int_get_last_request_request | 3150 2490 * 3151 - * |sub-command |payload | 3152 - * |----------------------------|-----------------------------------| 3153 - * |CMD_BWMGR_INT_QUERY_ABI | cmd_bwmgr_int_query_abi_request | 3154 - * |CMD_BWMGR_INT_CALC_AND_SET | cmd_bwmgr_int_calc_and_set_request| 3155 - * |CMD_BWMGR_INT_CAP_SET | cmd_bwmgr_int_cap_set_request | 2491 + * The following additional sub-commands are supported on T264 platforms: 3156 2492 * 2493 + * |Sub-command |Payload | 2494 + * |---------------------------------|-----------------------------------------| 2495 + * |#CMD_BWMGR_INT_CURR_AVAILABLE_BW |#cmd_bwmgr_int_curr_available_bw_request | 3157 2496 */ 3158 2497 struct mrq_bwmgr_int_request { 2498 + /** @brief Sub-command identifier from @ref mrq_bwmgr_int_cmd. */ 3159 2499 uint32_t cmd; 3160 2500 union { 3161 2501 struct cmd_bwmgr_int_query_abi_request query_abi; 3162 2502 struct cmd_bwmgr_int_calc_and_set_request bwmgr_calc_set_req; 3163 2503 struct cmd_bwmgr_int_cap_set_request bwmgr_cap_set_req; 2504 + struct cmd_bwmgr_int_curr_available_bw_request bwmgr_curr_available_bw_req; 2505 + struct cmd_bwmgr_int_get_last_request_request bwmgr_get_last_request_req; 3164 2506 } BPMP_UNION_ANON; 3165 2507 } BPMP_ABI_PACKED; 3166 2508 3167 - /* 3168 - * @brief Response to MRQ_BWMGR_INT 2509 + /** 2510 + * @brief Response payload for the #MRQ_BWMGR_INT -command. 3169 2511 * 3170 - * |sub-command |payload | 3171 - * |----------------------------|---------------------------------------| 3172 - * |CMD_BWMGR_INT_CALC_AND_SET | cmd_bwmgr_int_calc_and_set_response | 2512 + * |Sub-command |Payload | 2513 + * |---------------------------------|------------------------------------------| 2514 + * |#CMD_BWMGR_INT_CALC_AND_SET |#cmd_bwmgr_int_calc_and_set_response | 2515 + * |#CMD_BWMGR_INT_GET_LAST_REQUEST |#cmd_bwmgr_int_get_last_request_response | 2516 + * 2517 + * The following additional sub-commands are supported on T264 platforms: 2518 + * |Sub-command |Payload | 2519 + * |---------------------------------|------------------------------------------| 2520 + * |#CMD_BWMGR_INT_CURR_AVAILABLE_BW |#cmd_bwmgr_int_curr_available_bw_response | 3173 2521 */ 3174 2522 struct mrq_bwmgr_int_response { 3175 2523 union { 3176 2524 struct cmd_bwmgr_int_calc_and_set_response bwmgr_calc_set_resp; 2525 + struct cmd_bwmgr_int_curr_available_bw_response bwmgr_curr_available_bw_resp; 2526 + struct cmd_bwmgr_int_get_last_request_response bwmgr_get_last_request_resp; 3177 2527 } BPMP_UNION_ANON; 3178 2528 } BPMP_ABI_PACKED; 3179 2529 3180 2530 /** @} BWMGR_INT */ 3181 - /** @endcond (bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2531 + /** @endcond */ 3182 2532 3183 - /** 2533 + /** @cond (!bpmp_safe && (bpmp_t234 || bpmp_t238 || bpmp_t264)) 3184 2534 * @ingroup MRQ_Codes 3185 2535 * @def MRQ_ISO_CLIENT 3186 2536 * @brief ISO client requests 3187 2537 * 3188 - * * Platforms: T234 onwards 3189 - * @cond (bpmp_t234 || bpmp_t238 || bpmp_th500) 3190 2538 * * Initiators: CCPLEX 3191 2539 * * Targets: BPMP 3192 2540 * * Request Payload: @ref mrq_iso_client_request ··· 3277 2463 * @{ 3278 2464 */ 3279 2465 2466 + /** 2467 + * @brief Sub-command identifiers for #MRQ_ISO_CLIENT. 2468 + */ 3280 2469 enum mrq_iso_client_cmd { 3281 2470 /** 3282 - * @brief Check whether the BPMP driver supports the specified 3283 - * request type 2471 + * @brief Check whether BPMP-FW supports a specified 2472 + * #MRQ_ISO_CLIENT sub-command. 3284 2473 * 3285 2474 * mrq_response::err is 0 if the specified request is 3286 2475 * supported and -#BPMP_ENODEV otherwise. 3287 2476 */ 3288 2477 CMD_ISO_CLIENT_QUERY_ABI = 0, 3289 2478 3290 - /* 3291 - * @brief check for legal LA for the iso client. Without programming 3292 - * LA MC registers, calculate and ensure that legal LA is possible for 3293 - * iso bw requested by the ISO client. 2479 + /** 2480 + * @brief Determine legal LA for ISO client. 3294 2481 * 3295 - * mrq_response::err is 3296 - * * 0: check la succeeded. 3297 - * * -#BPMP_EINVAL: Invalid request parameters. 3298 - * * -#BPMP_EFAULT: Legal LA is not possible for client requested iso_bw 2482 + * Without programming LA MC registers, calculate and ensure that 2483 + * a legal LA is possible for the ISO bandwidth requested by the 2484 + * ISO client. 2485 + * 2486 + * mrq_response::err for this sub-command is defined as: 2487 + * 2488 + * | Value | Description | 2489 + * |---------------|--------------------------------------------------------------| 2490 + * | 0 | Request successful and legal LA is possible. | 2491 + * | -#BPMP_EINVAL | Invalid request parameters. | 2492 + * | -#BPMP_EFAULT | Legal LA is not possible for client requested ISO bandwidth. | 2493 + * | <0 | Any other internal error. | 3299 2494 */ 3300 2495 CMD_ISO_CLIENT_CALCULATE_LA = 1, 3301 2496 3302 - /* 3303 - * @brief set LA for the iso client. Calculate and program the LA/PTSA 3304 - * MC registers corresponding to the client making bw request 2497 + /** 2498 + * @brief Set LA for ISO client. 3305 2499 * 3306 - * mrq_response::err is 3307 - * * 0: set la succeeded. 3308 - * * -#BPMP_EINVAL: Invalid request parameters. 3309 - * * -#BPMP_EFAULT: Failed to calculate or program MC registers. 2500 + * Calculate and program the LA/PTSA MC registers corresponding to the 2501 + * ISO client making the bandwidth request. 2502 + * 2503 + * mrq_response::err for this sub-command is defined as: 2504 + * 2505 + * | Value | Description | 2506 + * |---------------|----------------------------------------------| 2507 + * | 0 | Setting LA succeeded. | 2508 + * | -#BPMP_EINVAL | Invalid request parameters. | 2509 + * | -#BPMP_EFAULT | Failed to calculate or program MC registers. | 2510 + * | <0 | Any other internal error. | 3310 2511 */ 3311 2512 CMD_ISO_CLIENT_SET_LA = 2, 3312 2513 3313 - /* 3314 - * @brief Get max possible bw for iso client 2514 + /** 2515 + * @brief Get maximum possible bandwidth for ISO client. 3315 2516 * 3316 - * mrq_response::err is 3317 - * * 0: get_max_bw succeeded. 3318 - * * -#BPMP_EINVAL: Invalid request parameters. 2517 + * mrq_response::err for this sub-command is defined as: 2518 + * 2519 + * | Value | Description | 2520 + * |---------------|----------------------------------------------| 2521 + * | 0 | Operation successful. | 2522 + * | -#BPMP_EINVAL | Invalid request parameters. | 2523 + * | <0 | Any other internal error. | 3319 2524 */ 3320 2525 CMD_ISO_CLIENT_GET_MAX_BW = 3 3321 2526 }; 3322 2527 3323 - /* 3324 - * request data for request type CMD_ISO_CLIENT_QUERY_ABI 3325 - * 3326 - * type: Request type for which to check existence. 2528 + /** 2529 + * @brief Request payload for #MRQ_ISO_CLIENT sub-command #CMD_ISO_CLIENT_QUERY_ABI 3327 2530 */ 3328 2531 struct cmd_iso_client_query_abi_request { 2532 + /** 2533 + * @brief Sub-command identifier from @ref mrq_iso_client_cmd 2534 + * for which to check existence. 2535 + */ 3329 2536 uint32_t type; 3330 2537 } BPMP_ABI_PACKED; 3331 2538 3332 - /* 3333 - * request data for request type CMD_ISO_CLIENT_CALCULATE_LA 3334 - * 3335 - * id: client ID in @ref bpmp_bwmgr_ids 3336 - * bw: bw requested in kBps by client ID. 3337 - * init_bw_floor: initial dram_bw_floor in kBps passed by client ID. 3338 - * ISO client will perform mempool allocation and DVFS buffering based 3339 - * on this dram_bw_floor. 2539 + /** 2540 + * @brief Request payload #MRQ_ISO_CLIENT sub-command #CMD_ISO_CLIENT_CALCULATE_LA 3340 2541 */ 3341 2542 struct cmd_iso_client_calculate_la_request { 2543 + /** @brief BWMGR client ID from @ref bpmp_bwmgr_ids */ 3342 2544 uint32_t id; 2545 + /** @brief Bandwidth requested in kBps for the client specified in #id. */ 3343 2546 uint32_t bw; 2547 + /** 2548 + * @brief Initial DRAM bandwidth floor in kBps for the ISO client specified in #id. 2549 + * 2550 + * ISO client will perform mempool allocation and DVFS buffering based 2551 + * on this value. 2552 + */ 3344 2553 uint32_t init_bw_floor; 3345 2554 } BPMP_ABI_PACKED; 3346 2555 3347 - /* 3348 - * request data for request type CMD_ISO_CLIENT_SET_LA 3349 - * 3350 - * id: client ID in @ref bpmp_bwmgr_ids 3351 - * bw: bw requested in kBps by client ID. 3352 - * final_bw_floor: final dram_bw_floor in kBps. 3353 - * Sometimes the initial dram_bw_floor passed by ISO client may need to be 3354 - * updated by considering higher dram freq's. This is the final dram_bw_floor 3355 - * used to calculate and program MC registers. 2556 + /** 2557 + * @brief Response payload for #MRQ_ISO_CLIENT sub-command #CMD_ISO_CLIENT_CALCULATE_LA 2558 + */ 2559 + struct cmd_iso_client_calculate_la_response { 2560 + /** @brief Minimum DRAM rate in kHz at which a legal LA is possible */ 2561 + uint32_t la_rate_floor; 2562 + /** 2563 + * Minimum DRAM frequency in kHz required to satisfy this clients 2564 + * ISO bandwidth request, assuming all other ISO clients are inactive. 2565 + */ 2566 + uint32_t iso_client_only_rate; 2567 + } BPMP_ABI_PACKED; 2568 + 2569 + /** 2570 + * @brief Request payload for #MRQ_ISO_CLIENT sub-command #CMD_ISO_CLIENT_SET_LA 3356 2571 */ 3357 2572 struct cmd_iso_client_set_la_request { 2573 + /** @brief BMWGR client ID from @ref bpmp_bwmgr_ids */ 3358 2574 uint32_t id; 2575 + /** @brief Bandwidth requested in kBps for the client specified in #id. */ 3359 2576 uint32_t bw; 2577 + /** 2578 + * @brief Final DRAM bandwidth floor in kBps. 2579 + * 2580 + * Sometimes the initial cmd_iso_client_calculate_la_request::dram_bw_floor 2581 + * passed by ISO client may need to be updated by considering higher 2582 + * DRAM frequencies. This is the final DRAM bandwidth floor value used 2583 + * to calculate and program MC registers. 2584 + */ 3360 2585 uint32_t final_bw_floor; 3361 2586 } BPMP_ABI_PACKED; 3362 2587 3363 - /* 3364 - * request data for request type CMD_ISO_CLIENT_GET_MAX_BW 3365 - * 3366 - * id: client ID in @ref bpmp_bwmgr_ids 2588 + /** 2589 + * @brief Request payload for #MRQ_ISO_CLIENT sub-command #CMD_ISO_CLIENT_GET_MAX_BW 3367 2590 */ 3368 2591 struct cmd_iso_client_get_max_bw_request { 2592 + /** @brief BWMGR client ID from @ref bpmp_bwmgr_ids */ 3369 2593 uint32_t id; 3370 - } BPMP_ABI_PACKED; 3371 - 3372 - /* 3373 - * response data for request type CMD_ISO_CLIENT_CALCULATE_LA 3374 - * 3375 - * la_rate_floor: minimum dram_rate_floor in kHz at which a legal la is possible 3376 - * iso_client_only_rate: Minimum dram freq in kHz required to satisfy this clients 3377 - * iso bw request, assuming all other iso clients are inactive 3378 - */ 3379 - struct cmd_iso_client_calculate_la_response { 3380 - uint32_t la_rate_floor; 3381 - uint32_t iso_client_only_rate; 3382 2594 } BPMP_ABI_PACKED; 3383 2595 3384 2596 /** 3385 2597 * @brief Used by @ref cmd_iso_client_get_max_bw_response 3386 2598 */ 3387 2599 struct iso_max_bw { 3388 - /* @brief dram frequency in kHz */ 2600 + /** @brief dram frequency in kHz */ 3389 2601 uint32_t freq; 3390 - /* @brief max possible iso-bw in kBps */ 2602 + /** @brief max possible iso-bw in kBps */ 3391 2603 uint32_t iso_bw; 3392 2604 } BPMP_ABI_PACKED; 3393 2605 2606 + /** 2607 + * @brief Size of the cmd_iso_client_get_max_bw_response::pairs -array. 2608 + */ 3394 2609 #define ISO_MAX_BW_MAX_SIZE 14U 3395 - /* 3396 - * response data for request type CMD_ISO_CLIENT_GET_MAX_BW 2610 + 2611 + /** 2612 + * @brief Response payload for #MRQ_ISO_CLIENT sub-command #CMD_ISO_CLIENT_GET_MAX_BW 3397 2613 */ 3398 2614 struct cmd_iso_client_get_max_bw_response { 3399 - /* @brief The number valid entries in iso_max_bw pairs */ 2615 + /** @brief The number valid entries in iso_max_bw pairs */ 3400 2616 uint32_t num_pairs; 3401 - /* @brief max ISOBW <dram freq, max bw> information */ 2617 + /** @brief max ISOBW <dram freq, max bw> information */ 3402 2618 struct iso_max_bw pairs[ISO_MAX_BW_MAX_SIZE]; 3403 2619 } BPMP_ABI_PACKED; 3404 2620 3405 2621 /** 3406 - * @brief Request with #MRQ_ISO_CLIENT 2622 + * @brief Request payload for #MRQ_ISO_CLIENT command. 3407 2623 * 3408 - * Used by the sender of an #MRQ_ISO_CLIENT message. 2624 + * Each #MRQ_ISO_CLIENT -command is expected to include a sub-command specific 2625 + * payload as defined in table below: 3409 2626 * 3410 - * |sub-command |payload | 3411 - * |------------------------------------ |----------------------------------------| 3412 - * |CMD_ISO_CLIENT_QUERY_ABI |cmd_iso_client_query_abi_request | 3413 - * |CMD_ISO_CLIENT_CALCULATE_LA |cmd_iso_client_calculate_la_request | 3414 - * |CMD_ISO_CLIENT_SET_LA |cmd_iso_client_set_la_request | 3415 - * |CMD_ISO_CLIENT_GET_MAX_BW |cmd_iso_client_get_max_bw_request | 3416 - * 2627 + * |Sub-command |Request payload | 2628 + * |-----------------------------|--------------------------------------| 2629 + * |#CMD_ISO_CLIENT_QUERY_ABI |#cmd_iso_client_query_abi_request | 2630 + * |#CMD_ISO_CLIENT_CALCULATE_LA |#cmd_iso_client_calculate_la_request | 2631 + * |#CMD_ISO_CLIENT_SET_LA |#cmd_iso_client_set_la_request | 2632 + * |#CMD_ISO_CLIENT_GET_MAX_BW |#cmd_iso_client_get_max_bw_request | 3417 2633 */ 3418 - 3419 2634 struct mrq_iso_client_request { 3420 - /* Type of request. Values listed in enum mrq_iso_client_cmd */ 2635 + /** @brief Sub-command identifier from @ref mrq_iso_client_cmd. */ 3421 2636 uint32_t cmd; 2637 + 3422 2638 union { 3423 2639 struct cmd_iso_client_query_abi_request query_abi; 3424 2640 struct cmd_iso_client_calculate_la_request calculate_la_req; ··· 3458 2614 } BPMP_ABI_PACKED; 3459 2615 3460 2616 /** 3461 - * @brief Response to MRQ_ISO_CLIENT 2617 + * @brief Response payload for #MRQ_ISO_CLIENT command. 3462 2618 * 3463 - * Each sub-command supported by @ref mrq_iso_client_request may return 3464 - * sub-command-specific data. Some do and some do not as indicated in 3465 - * the following table 2619 + * Some of the sub-commands supported by #MRQ_ISO_CLIENT may return 2620 + * a sub-command -specific payload in the MRQ response as defined in table 2621 + * below: 3466 2622 * 3467 - * |sub-command |payload | 3468 - * |---------------------------- |------------------------------------| 3469 - * |CMD_ISO_CLIENT_CALCULATE_LA |cmd_iso_client_calculate_la_response| 3470 - * |CMD_ISO_CLIENT_SET_LA |N/A | 3471 - * |CMD_ISO_CLIENT_GET_MAX_BW |cmd_iso_client_get_max_bw_response | 2623 + * |Sub-command |Response payload | 2624 + * |---------------------------- |--------------------------------------| 2625 + * |#CMD_ISO_CLIENT_QUERY_ABI |- | 2626 + * |#CMD_ISO_CLIENT_CALCULATE_LA |#cmd_iso_client_calculate_la_response | 2627 + * |#CMD_ISO_CLIENT_SET_LA |- | 2628 + * |#CMD_ISO_CLIENT_GET_MAX_BW |#cmd_iso_client_get_max_bw_response | 3472 2629 * 3473 2630 */ 3474 - 3475 2631 struct mrq_iso_client_response { 3476 2632 union { 3477 2633 struct cmd_iso_client_calculate_la_response calculate_la_resp; ··· 3480 2636 } BPMP_ABI_PACKED; 3481 2637 3482 2638 /** @} ISO_CLIENT */ 3483 - /** @endcond (bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2639 + /** @endcond */ 3484 2640 3485 - /** 2641 + /** @cond (!bpmp_t186) 3486 2642 * @ingroup MRQ_Codes 3487 2643 * @def MRQ_CPU_NDIV_LIMITS 3488 - * @brief CPU freq. limits in ndiv 2644 + * @brief Return CPU cluster NDIV limits 3489 2645 * 3490 - * * Platforms: T194 onwards 3491 - * @cond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) 3492 2646 * * Initiators: CCPLEX 3493 2647 * * Targets: BPMP 3494 2648 * * Request Payload: @ref mrq_cpu_ndiv_limits_request ··· 3496 2654 */ 3497 2655 3498 2656 /** 3499 - * @brief Request for ndiv limits of a cluster 2657 + * @brief Request payload for the #MRQ_CPU_NDIV_LIMITS -command 3500 2658 */ 3501 2659 struct mrq_cpu_ndiv_limits_request { 3502 - /** @brief Enum cluster_id */ 2660 + /** @brief Logical CPU cluster identifier */ 3503 2661 uint32_t cluster_id; 3504 2662 } BPMP_ABI_PACKED; 3505 2663 ··· 3520 2678 } BPMP_ABI_PACKED; 3521 2679 3522 2680 /** @} CPU */ 3523 - /** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2681 + /** @endcond */ 3524 2682 3525 - /** 2683 + 2684 + /** @cond (bpmp_t194) 3526 2685 * @ingroup MRQ_Codes 3527 2686 * @def MRQ_CPU_AUTO_CC3 3528 2687 * @brief Query CPU cluster auto-CC3 configuration 3529 2688 * 3530 - * * Platforms: T194 3531 - * @cond bpmp_t194 3532 2689 * * Initiators: CCPLEX 3533 2690 * * Targets: BPMP 3534 2691 * * Request Payload: @ref mrq_cpu_auto_cc3_request ··· 3543 2702 */ 3544 2703 3545 2704 /** 3546 - * @brief Request for auto-CC3 configuration of a cluster 2705 + * @brief Request payload for the #MRQ_CPU_AUTO_CC3 -command 3547 2706 */ 3548 2707 struct mrq_cpu_auto_cc3_request { 3549 - /** @brief Enum cluster_id (logical cluster id, known to CCPLEX s/w) */ 2708 + /** @brief Logical CPU cluster ID */ 3550 2709 uint32_t cluster_id; 3551 2710 } BPMP_ABI_PACKED; 3552 2711 3553 2712 /** 3554 - * @brief Response to #MRQ_CPU_AUTO_CC3 2713 + * @brief Response payload for the #MRQ_CPU_AUTO_CC3 -command 3555 2714 */ 3556 2715 struct mrq_cpu_auto_cc3_response { 3557 2716 /** ··· 3565 2724 } BPMP_ABI_PACKED; 3566 2725 3567 2726 /** @} CC3 */ 3568 - /** @endcond bpmp_t194 */ 2727 + /** @endcond */ 3569 2728 3570 - /** 2729 + /** @cond (bpmp_t186 || bpmp_t194 || bpmp_t234) 3571 2730 * @ingroup MRQ_Codes 3572 2731 * @def MRQ_RINGBUF_CONSOLE 3573 2732 * @brief A ring buffer debug console for BPMP ··· 3652 2811 */ 3653 2812 struct cmd_ringbuf_console_read_req { 3654 2813 /** 3655 - * @brief Number of bytes requested to be read from the BPMP TX buffer 2814 + * @brief Number of bytes requested to be read from the BPMP TX buffer. 2815 + * 2816 + * Valid range is [0, #MRQ_RINGBUF_CONSOLE_MAX_READ_LEN] 3656 2817 */ 3657 2818 uint8_t len; 3658 2819 } BPMP_ABI_PACKED; ··· 3666 2823 struct cmd_ringbuf_console_read_resp { 3667 2824 /** @brief The actual data read from the BPMP TX buffer */ 3668 2825 uint8_t data[MRQ_RINGBUF_CONSOLE_MAX_READ_LEN]; 3669 - /** @brief Number of bytes in cmd_ringbuf_console_read_resp::data */ 2826 + /** 2827 + * @brief Number of bytes in cmd_ringbuf_console_read_resp::data 2828 + * 2829 + * Valid range is [0, #MRQ_RINGBUF_CONSOLE_MAX_WRITE_LEN] 2830 + */ 3670 2831 uint8_t len; 3671 2832 } BPMP_ABI_PACKED; 3672 2833 ··· 3751 2904 } BPMP_ABI_PACKED; 3752 2905 3753 2906 /** @} RingbufConsole */ 2907 + /** @endcond */ 3754 2908 3755 - /** 2909 + /** @cond (!bpmp_t186 && !(bpmp_safe && bpmp_t234)) 3756 2910 * @ingroup MRQ_Codes 3757 2911 * @def MRQ_STRAP 3758 2912 * @brief Set a strap value controlled by BPMP 3759 2913 * 3760 - * * Platforms: T194 onwards 3761 - * @cond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) 3762 2914 * * Initiators: CCPLEX 3763 2915 * * Targets: BPMP 3764 2916 * * Request Payload: @ref mrq_strap_request ··· 3771 2925 * deasserted. 3772 2926 * 3773 2927 * BPMP owns registers which act as straps to various units. It 3774 - * exposes limited control of those straps via #MRQ_STRAP. 2928 + * exposes limited control of those registers via #MRQ_STRAP. 3775 2929 * 3776 2930 * @{ 2931 + */ 2932 + 2933 + /** 2934 + * @brief Sub-command identifiers for the #MRQ_STRAP -command. 3777 2935 */ 3778 2936 enum mrq_strap_cmd { 3779 2937 /** @private */ ··· 3787 2937 }; 3788 2938 3789 2939 /** 3790 - * @brief Request with #MRQ_STRAP 2940 + * @brief Request payload for the #MRQ_STRAP -command. 3791 2941 */ 3792 2942 struct mrq_strap_request { 3793 - /** @brief @ref mrq_strap_cmd */ 2943 + /** @brief Sub-command identifier from @ref mrq_strap_cmd */ 3794 2944 uint32_t cmd; 3795 - /** @brief Strap ID from @ref Strap_Identifiers */ 2945 + /** 2946 + * @if (bpmp_t234 || bpmp_th500 || bpmp_t264) 2947 + * @brief Strap ID from @ref bpmp_strap_ids 2948 + * @else 2949 + * @brief Strap ID (undefined) 2950 + * @endif 2951 + */ 3796 2952 uint32_t id; 3797 - /** @brief Desired value for strap (if cmd is #STRAP_SET) */ 2953 + /** @brief Desired value for strap (if #cmd is #STRAP_SET) */ 3798 2954 uint32_t value; 3799 2955 } BPMP_ABI_PACKED; 3800 2956 3801 2957 /** @} Strap */ 3802 - /** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) */ 2958 + /** @endcond */ 3803 2959 3804 - /** 2960 + /** @cond (bpmp_t194 || bpmp_t234 || bpmp_th500) 3805 2961 * @ingroup MRQ_Codes 3806 2962 * @def MRQ_UPHY 3807 2963 * @brief Perform a UPHY operation 3808 2964 * 3809 - * * Platforms: T194 onwards 3810 - * @cond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) 3811 2965 * * Initiators: CCPLEX 3812 2966 * * Targets: BPMP 3813 2967 * * Request Payload: @ref mrq_uphy_request ··· 3820 2966 * @addtogroup UPHY 3821 2967 * @{ 3822 2968 */ 3823 - enum { 2969 + 2970 + /** 2971 + * @brief Sub-command identifiers for #MRQ_UPHY. 2972 + */ 2973 + enum mrq_uphy_cmd { 2974 + /** @brief Trigger PCIE lane margining procedure. */ 3824 2975 CMD_UPHY_PCIE_LANE_MARGIN_CONTROL = 1, 2976 + /** @brief Return PCIE lane margining status. */ 3825 2977 CMD_UPHY_PCIE_LANE_MARGIN_STATUS = 2, 2978 + /** @brief Initialize PCIE EP PLL controller. */ 3826 2979 CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT = 3, 2980 + /** @brief Set state of the PCIE RP/EP controller. */ 3827 2981 CMD_UPHY_PCIE_CONTROLLER_STATE = 4, 2982 + /** @brief Disable PCIE EP PLL controller. */ 3828 2983 CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF = 5, 2984 + 2985 + /** 2986 + * @cond bpmp_t238 2987 + * @brief Initialize and enable UPHY display port. 2988 + */ 3829 2989 CMD_UPHY_DISPLAY_PORT_INIT = 6, 2990 + /** @brief Disable UPHY display port. */ 3830 2991 CMD_UPHY_DISPLAY_PORT_OFF = 7, 2992 + /** @brief Trigger sequence to restore XUSB DYN lanes during SC7 exit. */ 3831 2993 CMD_UPHY_XUSB_DYN_LANES_RESTORE = 8, 2994 + /** @endcond */ 2995 + 2996 + /** 2997 + * @cond bpmp_th500 2998 + * @brief Perform UPHY Lane EOM scan. 2999 + */ 3000 + CMD_UPHY_LANE_EOM_SCAN = 9, 3001 + /** @brief Config PCIe VDM with a given BDF ID. */ 3002 + CMD_UPHY_PCIE_CONFIG_VDM = 10, 3003 + /** @endcond */ 3004 + 3832 3005 CMD_UPHY_MAX, 3833 3006 }; 3834 3007 3008 + /** 3009 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_PCIE_LANE_MARGIN_CONTROL. 3010 + */ 3835 3011 struct cmd_uphy_margin_control_request { 3836 - /** @brief Enable margin */ 3012 + /** 3013 + * @brief Enable margin. 3014 + * 3015 + * Valid values: 3016 + * * Value 0 disables margin, 3017 + * * Value 1 enables margin. 3018 + */ 3837 3019 int32_t en; 3838 - /** @brief Clear the number of error and sections */ 3020 + /** 3021 + * @brief Clear the number of error and sections. 3022 + * 3023 + * Valid values: 3024 + * 3025 + * * Value 0: Skip clear, 3026 + * * Value 1: Perform clear. 3027 + */ 3839 3028 int32_t clr; 3840 - /** @brief Set x offset (1's complement) for left/right margin type (y should be 0) */ 3029 + /** 3030 + * @brief Set x offset (1's complement) for left/right margin type (y should be 0). 3031 + * 3032 + * Valid range is [0, 127] 3033 + */ 3841 3034 uint32_t x; 3842 - /** @brief Set y offset (1's complement) for left/right margin type (x should be 0) */ 3035 + /** 3036 + * @brief Set y offset (1's complement) for left/right margin type (x should be 0) 3037 + * 3038 + * Valid range is [0, 63] 3039 + */ 3843 3040 uint32_t y; 3844 - /** @brief Set number of bit blocks for each margin section */ 3041 + /** 3042 + * @brief Set number of bit blocks for each margin section. 3043 + * 3044 + * Valid range is [0, 15] 3045 + */ 3845 3046 uint32_t nblks; 3846 3047 } BPMP_ABI_PACKED; 3847 3048 3049 + /** 3050 + * @brief Response payload for #MRQ_UPHY sub-command #CMD_UPHY_PCIE_LANE_MARGIN_STATUS. 3051 + */ 3848 3052 struct cmd_uphy_margin_status_response { 3849 3053 /** @brief Number of errors observed */ 3850 3054 uint32_t status; 3851 3055 } BPMP_ABI_PACKED; 3852 3056 3057 + /** 3058 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT. 3059 + */ 3853 3060 struct cmd_uphy_ep_controller_pll_init_request { 3854 3061 /** @brief EP controller number, T194 valid: 0, 4, 5; T234 valid: 5, 6, 7, 10; T238 valid: 0 */ 3855 3062 uint8_t ep_controller; 3856 3063 } BPMP_ABI_PACKED; 3857 3064 3065 + /** 3066 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_PCIE_CONTROLLER_STATE. 3067 + */ 3858 3068 struct cmd_uphy_pcie_controller_state_request { 3859 3069 /** @brief PCIE controller number, T194 valid: 0-4; T234 valid: 0-10; T238 valid: 0-3 */ 3860 3070 uint8_t pcie_controller; 3071 + /** @brief Nonzero value to enable controller, zero value to disable */ 3861 3072 uint8_t enable; 3862 3073 } BPMP_ABI_PACKED; 3863 3074 3075 + /** 3076 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF. 3077 + */ 3864 3078 struct cmd_uphy_ep_controller_pll_off_request { 3865 3079 /** @brief EP controller number, T194 valid: 0, 4, 5; T234 valid: 5, 6, 7, 10; T238 valid: 0 */ 3866 3080 uint8_t ep_controller; 3867 3081 } BPMP_ABI_PACKED; 3868 3082 3083 + /** 3084 + * @cond bpmp_t238 3085 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_DISPLAY_PORT_INIT. 3086 + */ 3869 3087 struct cmd_uphy_display_port_init_request { 3870 3088 /** @brief DisplayPort link rate, T238 valid: 1620, 2700, 5400, 8100, 2160, 2430, 3240, 4320, 6750 */ 3871 3089 uint16_t link_rate; ··· 3945 3019 uint16_t lanes_bitmap; 3946 3020 } BPMP_ABI_PACKED; 3947 3021 3022 + /** 3023 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_XUSB_DYN_LANES_RESTORE. 3024 + */ 3948 3025 struct cmd_uphy_xusb_dyn_lanes_restore_request { 3949 3026 /** @brief 1: lane 0; 2: lane 1; 3: lane 0 and 1 */ 3950 3027 uint16_t lanes_bitmap; 3951 3028 } BPMP_ABI_PACKED; 3029 + /** @endcond */ 3030 + 3031 + /** 3032 + * @cond bpmp_th500 3033 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_LANE_EOM_SCAN 3034 + */ 3035 + struct cmd_uphy_lane_eom_scan_request { 3036 + /** @brief UPHY brick number, valid: 0-5 */ 3037 + uint32_t brick; 3038 + /** @brief UPHY lane number, valid: 0-15 for UPHY0-UPHY3, 0-1 for UPHY4-UPHY5 */ 3039 + uint32_t lane; 3040 + /** @brief Perform EOM for PCIE GEN5 link: 1 for yes, 0 for no. */ 3041 + uint32_t pcie_gen5; 3042 + } BPMP_ABI_PACKED; 3043 + 3044 + /** 3045 + * @brief Response payload for #MRQ_UPHY sub-command #CMD_UPHY_LANE_EOM_SCAN 3046 + */ 3047 + struct cmd_uphy_lane_eom_scan_response { 3048 + uint32_t data; 3049 + } BPMP_ABI_PACKED; 3050 + 3051 + /** 3052 + * @brief Request payload for #MRQ_UPHY sub-command #CMD_UPHY_PCIE_CONFIG_VDM 3053 + */ 3054 + struct cmd_uphy_pcie_config_vdm_request { 3055 + uint8_t pcie_controller; 3056 + /** 3057 + * @brief Bus/Dev/Func ID to be programmed for VDM. 3058 + * 3059 + * - bits[15..8] Bus 3060 + * - bits[7..3] Dev 3061 + * - bit [2..0] Func 3062 + */ 3063 + uint16_t bdf; 3064 + } BPMP_ABI_PACKED; 3065 + /** @endcond */ 3952 3066 3953 3067 /** 3954 3068 * @ingroup UPHY 3955 - * @brief Request with #MRQ_UPHY 3069 + * @brief Request payload for the #MRQ_UPHY -command. 3956 3070 * 3957 3071 * Used by the sender of an #MRQ_UPHY message to control UPHY. 3958 3072 * The uphy_request is split into several sub-commands. CMD_UPHY_PCIE_LANE_MARGIN_STATUS 3959 3073 * requires no additional data. Others have a sub-command specific payload. Below table 3960 3074 * shows sub-commands with their corresponding payload data. 3961 3075 * 3962 - * |sub-command |payload | 3963 - * |------------------------------------ |----------------------------------------| 3964 - * |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL |uphy_set_margin_control | 3965 - * |CMD_UPHY_PCIE_LANE_MARGIN_STATUS | | 3966 - * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT |cmd_uphy_ep_controller_pll_init_request | 3967 - * |CMD_UPHY_PCIE_CONTROLLER_STATE |cmd_uphy_pcie_controller_state_request | 3968 - * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF |cmd_uphy_ep_controller_pll_off_request | 3969 - * |CMD_UPHY_PCIE_DISPLAY_PORT_INIT |cmd_uphy_display_port_init_request | 3970 - * |CMD_UPHY_PCIE_DISPLAY_PORT_OFF | | 3971 - * |CMD_UPHY_XUSB_DYN_LANES_RESTORE |cmd_uphy_xusb_dyn_lanes_restore_request | 3076 + * |sub-command |payload | 3077 + * |--------------------------------------|-----------------------------------------| 3078 + * |#CMD_UPHY_PCIE_LANE_MARGIN_CONTROL |#cmd_uphy_margin_control_request | 3079 + * |#CMD_UPHY_PCIE_LANE_MARGIN_STATUS |- | 3080 + * |#CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT |#cmd_uphy_ep_controller_pll_init_request | 3081 + * |#CMD_UPHY_PCIE_CONTROLLER_STATE |#cmd_uphy_pcie_controller_state_request | 3082 + * |#CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF |#cmd_uphy_ep_controller_pll_off_request | 3972 3083 * 3084 + * @cond bpmp_t238 3085 + * The following additional sub-commands are supported on T238 platforms: 3086 + * 3087 + * |sub-command |payload | 3088 + * |--------------------------------------|-----------------------------------------| 3089 + * |#CMD_UPHY_DISPLAY_PORT_INIT |#cmd_uphy_display_port_init_request | 3090 + * |#CMD_UPHY_DISPLAY_PORT_OFF |- | 3091 + * |#CMD_UPHY_XUSB_DYN_LANES_RESTORE |#cmd_uphy_xusb_dyn_lanes_restore_request | 3092 + * @endcond 3093 + * 3094 + * @cond bpmp_th500 3095 + * The following additional sub-commands are supported on TH500 platforms: 3096 + * |sub-command |payload | 3097 + * |--------------------------------------|-----------------------------------------| 3098 + * |#CMD_UPHY_LANE_EOM_SCAN |#cmd_uphy_lane_eom_scan_request | 3099 + * |#CMD_UPHY_PCIE_CONFIG_VDM |#cmd_uphy_pcie_config_vdm_request | 3100 + * @endcond 3973 3101 */ 3974 - 3975 3102 struct mrq_uphy_request { 3976 3103 /** @brief Lane number. */ 3977 3104 uint16_t lane; 3978 - /** @brief Sub-command id. */ 3105 + /** @brief Sub-command ID from @ref mrq_uphy_cmd. */ 3979 3106 uint16_t cmd; 3980 3107 3981 3108 union { ··· 4036 3057 struct cmd_uphy_ep_controller_pll_init_request ep_ctrlr_pll_init; 4037 3058 struct cmd_uphy_pcie_controller_state_request controller_state; 4038 3059 struct cmd_uphy_ep_controller_pll_off_request ep_ctrlr_pll_off; 3060 + /** @cond bpmp_t238 */ 4039 3061 struct cmd_uphy_display_port_init_request display_port_init; 4040 3062 struct cmd_uphy_xusb_dyn_lanes_restore_request xusb_dyn_lanes_restore; 3063 + /** @endcond */ 3064 + /** @cond bpmp_th500 */ 3065 + struct cmd_uphy_lane_eom_scan_request lane_eom_scan; 3066 + struct cmd_uphy_pcie_config_vdm_request pcie_vdm; 3067 + /** @endcond */ 4041 3068 } BPMP_UNION_ANON; 4042 3069 } BPMP_ABI_PACKED; 4043 3070 4044 3071 /** 4045 3072 * @ingroup UPHY 4046 - * @brief Response to MRQ_UPHY 3073 + * @brief Response payload for the #MRQ_UPHY -command. 4047 3074 * 4048 3075 * Each sub-command supported by @ref mrq_uphy_request may return 4049 3076 * sub-command-specific data. Some do and some do not as indicated in 4050 3077 * the following table 4051 3078 * 4052 - * |sub-command |payload | 4053 - * |---------------------------- |------------------------| 4054 - * |CMD_UPHY_PCIE_LANE_MARGIN_CONTROL | | 4055 - * |CMD_UPHY_PCIE_LANE_MARGIN_STATUS |uphy_get_margin_status | 3079 + * |sub-command |payload | 3080 + * |-----------------------------------|---------------------------------| 3081 + * |#CMD_UPHY_PCIE_LANE_MARGIN_CONTROL |- | 3082 + * |#CMD_UPHY_PCIE_LANE_MARGIN_STATUS |#cmd_uphy_margin_status_response | 4056 3083 * 3084 + * @cond bpmp_th500 3085 + * The following additional sub-commands are supported on TH500 platforms: 3086 + * |sub-command |payload | 3087 + * |-----------------------------------|---------------------------------| 3088 + * |#CMD_UPHY_LANE_EOM_SCAN |#cmd_uphy_lane_eom_scan_response | 3089 + * |#CMD_UPHY_PCIE_CONFIG_VDM |- | 3090 + * @endcond 4057 3091 */ 4058 - 4059 3092 struct mrq_uphy_response { 4060 3093 union { 4061 3094 struct cmd_uphy_margin_status_response uphy_get_margin_status; 3095 + /** @cond bpmp_th500 */ 3096 + struct cmd_uphy_lane_eom_scan_response eom_status; 3097 + /** @endcond */ 4062 3098 } BPMP_UNION_ANON; 4063 3099 } BPMP_ABI_PACKED; 4064 3100 4065 3101 /** @} UPHY */ 4066 - /** @endcond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) */ 3102 + /** @endcond */ 4067 3103 4068 - /** 3104 + /** @cond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_t264) 4069 3105 * @ingroup MRQ_Codes 4070 3106 * @def MRQ_FMON 4071 - * @brief Perform a frequency monitor configuration operations 3107 + * @brief Perform a frequency monitor configuration operation 4072 3108 * 4073 - * * Platforms: T194 onwards 4074 - * @cond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) 4075 3109 * * Initiators: CCPLEX 4076 3110 * * Targets: BPMP 4077 3111 * * Request Payload: @ref mrq_fmon_request 4078 3112 * * Response Payload: @ref mrq_fmon_response 4079 - * @endcond (bpmp_t194 || bpmp_t234 || bpmp_t238 || bpmp_th500) 4080 3113 * 4081 3114 * @addtogroup FMON 4082 3115 * @{ 4083 - * @cond (bpmp_t194 || bpmp_t234) 4084 3116 */ 4085 - enum { 3117 + 3118 + /** 3119 + * @brief Sub-command identifiers for #MRQ_FMON 3120 + */ 3121 + enum mrq_fmon_cmd { 4086 3122 /** 4087 3123 * @brief Clamp FMON configuration to specified rate. 4088 3124 * ··· 4105 3111 * clamped, FMON configuration is preserved when clock rate 4106 3112 * and/or state is changed. 4107 3113 * 4108 - * mrq_response::err is 0 if the operation was successful, or @n 4109 - * -#BPMP_EACCES: FMON access error @n 4110 - * -#BPMP_EBADCMD if subcommand is not supported @n 4111 - * -#BPMP_EBADSLT: clamp FMON on cluster with auto-CC3 enabled @n 4112 - * -#BPMP_EBUSY: fmon is already clamped at different rate @n 4113 - * -#BPMP_EFAULT: self-diagnostic error @n 4114 - * -#BPMP_EINVAL: invalid FMON configuration @n 4115 - * -#BPMP_EOPNOTSUPP: not in production mode @n 4116 - * -#BPMP_ENODEV: invalid clk_id @n 4117 - * -#BPMP_ENOENT: no calibration data, uninitialized @n 4118 - * -#BPMP_ENOTSUP: avfs config not set @n 4119 - * -#BPMP_ENOSYS: clamp FMON on cluster clock w/ no NAFLL @n 4120 - * -#BPMP_ETIMEDOUT: operation timed out @n 3114 + * mrq_response::err for this sub-command is defined to be: 3115 + * 3116 + * | Value | Description | 3117 + * |-------------------|---------------------------------------------------| 3118 + * | 0 | Operation was successful. | 3119 + * | -#BPMP_EBADCMD | Subcommand is not supported. | 3120 + * | -#BPMP_EACCES | FMON access error. | 3121 + * | -#BPMP_EBADSLT | Clamp FMON on cluster with auto-CC3 enabled. | 3122 + * | -#BPMP_EBUSY | FMON is already clamped at different rate. | 3123 + * | -#BPMP_EFAULT | Self-diagnostic error detected. | 3124 + * | -#BPMP_EINVAL | Invalid FMON configuration. | 3125 + * | -#BPMP_EOPNOTSUPP | Not in production mode. | 3126 + * | -#BPMP_ENODEV | Invalid clock ID in mrq_fmon_request::cmd_and_id. | 3127 + * | -#BPMP_ENOENT | No calibration data, uninitialized. | 3128 + * | -#BPMP_ENOTSUP | AVFS config not set. | 3129 + * | -#BPMP_ENOSYS | Clamp FMON on cluster clock w/ no NAFLL. | 3130 + * | -#BPMP_ETIMEDOUT | Operation timed out. | 4121 3131 */ 4122 3132 CMD_FMON_GEAR_CLAMP = 1, 3133 + 4123 3134 /** 4124 3135 * @brief Release clamped FMON configuration. 4125 3136 * 4126 3137 * Allow FMON configuration to follow monitored clock rate 4127 3138 * and/or state changes. 4128 3139 * 4129 - * mrq_response::err is 0 if the operation was successful, or @n 4130 - * -#BPMP_EBADCMD if subcommand is not supported @n 4131 - * -#BPMP_ENODEV: invalid clk_id @n 4132 - * -#BPMP_ENOENT: no calibration data, uninitialized @n 4133 - * -#BPMP_ENOTSUP: avfs config not set @n 4134 - * -#BPMP_EOPNOTSUPP: not in production mode @n 3140 + * mrq_response::err for this sub-command is defined to be: 3141 + * 3142 + * | Value | Description | 3143 + * |-------------------|---------------------------------------------------| 3144 + * | 0 | Operation was successful. | 3145 + * | -#BPMP_EBADCMD | Subcommand is not supported. | 3146 + * | -#BPMP_ENODEV | Invalid clock ID in mrq_fmon_request::cmd_and_id. | 3147 + * | -#BPMP_ENOENT | No calibration data, uninitialized. | 3148 + * | -#BPMP_ENOTSUP | AVFS config not set. | 3149 + * | -#BPMP_EOPNOTSUPP | Not in production mode. | 4135 3150 */ 4136 3151 CMD_FMON_GEAR_FREE = 2, 3152 + 4137 3153 /** 4138 - * @brief Return rate FMON is clamped at, or 0 if FMON is not 4139 - * clamped. 3154 + * @brief Return rate FMON is clamped at, or 0 if FMON is not clamped. 4140 3155 * 4141 - * Inherently racy, since clamp state can be changed 4142 - * concurrently. Useful for testing. 3156 + * Inherently racy, since clamp state can be changed concurrently, 3157 + * only provided and useful for testing purposes. 4143 3158 * 4144 - * mrq_response::err is 0 if the operation was successful, or @n 4145 - * -#BPMP_EBADCMD if subcommand is not supported @n 4146 - * -#BPMP_ENODEV: invalid clk_id @n 4147 - * -#BPMP_ENOENT: no calibration data, uninitialized @n 4148 - * -#BPMP_ENOTSUP: avfs config not set @n 4149 - * -#BPMP_EOPNOTSUPP: not in production mode @n 3159 + * mrq_response::err for this sub-command is defined to be: 3160 + * 3161 + * | Value | Description | 3162 + * |-------------------|---------------------------------------------------| 3163 + * | 0 | Operation was successful. | 3164 + * | -#BPMP_EBADCMD | Subcommand is not supported. | 3165 + * | -#BPMP_ENODEV | Invalid clock ID in mrq_fmon_request::cmd_and_id. | 3166 + * | -#BPMP_ENOENT | No calibration data, uninitialized. | 3167 + * | -#BPMP_ENOTSUP | AVFS config not set. | 3168 + * | -#BPMP_EOPNOTSUPP | Not in production mode. | 4150 3169 */ 4151 3170 CMD_FMON_GEAR_GET = 3, 3171 + 4152 3172 /** 4153 3173 * @brief Return current status of FMON faults detected by FMON 4154 - * h/w or s/w since last invocation of this command. 4155 - * Clears fault status. 3174 + * HW or SW since last invocation of this sub-command. 3175 + * Clears fault status. 4156 3176 * 4157 - * mrq_response::err is 0 if the operation was successful, or @n 4158 - * -#BPMP_EBADCMD if subcommand is not supported @n 4159 - * -#BPMP_EINVAL: invalid fault type @n 4160 - * -#BPMP_ENODEV: invalid clk_id @n 4161 - * -#BPMP_ENOENT: no calibration data, uninitialized @n 4162 - * -#BPMP_ENOTSUP: avfs config not set @n 4163 - * -#BPMP_EOPNOTSUPP: not in production mode @n 3177 + * mrq_response::err for this sub-command is defined to be: 3178 + * 3179 + * | Value | Description | 3180 + * |-------------------|---------------------------------------------------| 3181 + * | 0 | Operation was successful. | 3182 + * | -#BPMP_EBADCMD | Subcommand is not supported. | 3183 + * | -#BPMP_ENODEV | Invalid clock ID in mrq_fmon_request::cmd_and_id. | 3184 + * | -#BPMP_ENOENT | No calibration data, uninitialized. | 3185 + * | -#BPMP_ENOTSUP | AVFS config not set. | 3186 + * | -#BPMP_EOPNOTSUPP | Not in production mode. | 3187 + * | -#BPMP_EINVAL | Invalid fault type. | 4164 3188 */ 4165 3189 CMD_FMON_FAULT_STS_GET = 4, 4166 3190 }; ··· 4189 3177 */ 4190 3178 #define CMD_FMON_NUM 4 4191 3179 4192 - /** @endcond DEPRECATED */ 3180 + /** @endcond */ 4193 3181 4194 3182 /** 4195 - * @defgroup fmon_fault_type FMON fault type 3183 + * @defgroup fmon_fault_type FMON fault types 4196 3184 * @addtogroup fmon_fault_type 4197 3185 * @{ 4198 3186 */ 4199 - /** @brief All detected FMON faults (h/w or s/w) */ 3187 + /** @brief All detected FMON faults (HW or SW) */ 4200 3188 #define FMON_FAULT_TYPE_ALL 0U 4201 - /** @brief FMON faults detected by h/w */ 3189 + /** @brief FMON faults detected by HW */ 4202 3190 #define FMON_FAULT_TYPE_HW 1U 4203 - /** @brief FMON faults detected by s/w */ 3191 + /** @brief FMON faults detected by SW */ 4204 3192 #define FMON_FAULT_TYPE_SW 2U 4205 3193 4206 3194 /** @} fmon_fault_type */ 4207 3195 4208 - 3196 + /** 3197 + * @brief Request payload for #MRQ_FMON sub-command #CMD_FMON_GEAR_CLAMP. 3198 + */ 4209 3199 struct cmd_fmon_gear_clamp_request { 3200 + /** @brief Unused / reserved */ 4210 3201 int32_t unused; 3202 + 3203 + /** @brief Target rate in Hz. Valid range for the rate is [1, INT64_MAX] */ 4211 3204 int64_t rate; 4212 3205 } BPMP_ABI_PACKED; 4213 3206 ··· 4236 3219 BPMP_ABI_EMPTY 4237 3220 } BPMP_ABI_PACKED; 4238 3221 3222 + /** 3223 + * @brief Response payload for #MRQ_FMON sub-command #CMD_FMON_GEAR_GET. 3224 + */ 4239 3225 struct cmd_fmon_gear_get_response { 4240 3226 int64_t rate; 4241 3227 } BPMP_ABI_PACKED; 4242 3228 3229 + /** 3230 + * @brief Request payload for #MRQ_FMON sub-command #CMD_FMON_FAULT_STS_GET 3231 + */ 4243 3232 struct cmd_fmon_fault_sts_get_request { 4244 - uint32_t fault_type; /**< @ref fmon_fault_type */ 3233 + /** 3234 + * @brief Which fault types to return in response: 3235 + * 3236 + * | Value | Description | 3237 + * |----------------------|-----------------------------------------| 3238 + * | #FMON_FAULT_TYPE_ALL | Return all detected faults (HW and SW). | 3239 + * | #FMON_FAULT_TYPE_HW | Return only HW detected faults. | 3240 + * | #FMON_FAULT_TYPE_SW | Return only SW detected faults. | 3241 + */ 3242 + uint32_t fault_type; 4245 3243 } BPMP_ABI_PACKED; 4246 3244 3245 + /** 3246 + * @brief Response payload for #MRQ_FMON sub-command #CMD_FMON_FAULT_STS_GET 3247 + */ 4247 3248 struct cmd_fmon_fault_sts_get_response { 3249 + /** 3250 + * Bitmask of detected HW / SW specific faults, or 0 if no faults have 3251 + * been detected since last invocation of #CMD_FMON_FAULT_STS_GET. 3252 + */ 4248 3253 uint32_t fault_sts; 4249 3254 } BPMP_ABI_PACKED; 4250 3255 4251 3256 /** 4252 3257 * @ingroup FMON 4253 - * @brief Request with #MRQ_FMON 3258 + * @brief Request payload for the #MRQ_FMON -command. 4254 3259 * 4255 3260 * Used by the sender of an #MRQ_FMON message to configure clock 4256 3261 * frequency monitors. The FMON request is split into several 4257 - * sub-commands. Some sub-commands require no additional data. 4258 - * Others have a sub-command specific payload 3262 + * sub-commands. Sub-command specific payloads are defined in 3263 + * the following table: 4259 3264 * 4260 - * |sub-command |payload | 4261 - * |----------------------------|-----------------------| 4262 - * |CMD_FMON_GEAR_CLAMP |fmon_gear_clamp | 4263 - * |CMD_FMON_GEAR_FREE |- | 4264 - * |CMD_FMON_GEAR_GET |- | 4265 - * |CMD_FMON_FAULT_STS_GET |fmon_fault_sts_get | 3265 + * |Sub-command |Payload | 3266 + * |------------------------|--------------------------------| 3267 + * |#CMD_FMON_GEAR_CLAMP |#cmd_fmon_gear_clamp_request | 3268 + * |#CMD_FMON_GEAR_FREE |- | 3269 + * |#CMD_FMON_GEAR_GET |- | 3270 + * |#CMD_FMON_FAULT_STS_GET |#cmd_fmon_fault_sts_get_request | 4266 3271 * 4267 3272 */ 4268 3273 struct mrq_fmon_request { 4269 - /** @brief Sub-command and clock id concatenated to 32-bit word. 4270 - * - bits[31..24] is the sub-cmd. 4271 - * - bits[23..0] is monitored clock id used to select target 4272 - * FMON 3274 + /** 3275 + * @brief Sub-command and clock id concatenated to 32-bit word. 3276 + * 3277 + * - bits[31..24] -> Sub-command identifier from @ref mrq_fmon_cmd. 3278 + * - bits[23..0] -> Monitored clock identifier used to select target FMON. 4273 3279 */ 4274 3280 uint32_t cmd_and_id; 4275 3281 ··· 4308 3268 4309 3269 /** 4310 3270 * @ingroup FMON 4311 - * @brief Response to MRQ_FMON 3271 + * @brief Response payload for the #MRQ_FMON -command. 4312 3272 * 4313 3273 * Each sub-command supported by @ref mrq_fmon_request may 4314 3274 * return sub-command-specific data as indicated below. 4315 3275 * 4316 - * |sub-command |payload | 4317 - * |----------------------------|------------------------| 4318 - * |CMD_FMON_GEAR_CLAMP |- | 4319 - * |CMD_FMON_GEAR_FREE |- | 4320 - * |CMD_FMON_GEAR_GET |fmon_gear_get | 4321 - * |CMD_FMON_FAULT_STS_GET |fmon_fault_sts_get | 3276 + * |Sub-command |Payload | 3277 + * |------------------------|---------------------------------| 3278 + * |#CMD_FMON_GEAR_CLAMP |- | 3279 + * |#CMD_FMON_GEAR_FREE |- | 3280 + * |#CMD_FMON_GEAR_GET |#cmd_fmon_gear_get_response | 3281 + * |#CMD_FMON_FAULT_STS_GET |#cmd_fmon_fault_sts_get_response | 4322 3282 * 4323 3283 */ 4324 - 4325 3284 struct mrq_fmon_response { 4326 3285 union { 4327 3286 /** @private */ ··· 4332 3293 } BPMP_UNION_ANON; 4333 3294 } BPMP_ABI_PACKED; 4334 3295 4335 - /** @endcond (bpmp_t194 || bpmp_t234) */ 4336 3296 /** @} FMON */ 3297 + /** @endcond */ 4337 3298 4338 - /** 3299 + /** @cond (bpmp_t194) 4339 3300 * @ingroup MRQ_Codes 4340 3301 * @def MRQ_EC 4341 3302 * @brief Provide status information on faults reported by Error 4342 3303 * Collator (EC) to HSM. 4343 3304 * 4344 - * * Platforms: T194 4345 - * @cond bpmp_t194 4346 3305 * * Initiators: CCPLEX 4347 3306 * * Targets: BPMP 4348 3307 * * Request Payload: @ref mrq_ec_request ··· 4348 3311 * 4349 3312 * @note This MRQ ABI is under construction, and subject to change 4350 3313 * 4351 - * @endcond bpmp_t194 4352 3314 * @addtogroup EC 4353 3315 * @{ 4354 - * @cond bpmp_t194 4355 3316 */ 4356 3317 enum { 4357 3318 /** ··· 4360 3325 * -#BPMP_ENODEV if target EC is not owned by BPMP @n 4361 3326 * -#BPMP_EACCES if target EC power domain is turned off @n 4362 3327 * -#BPMP_EBADCMD if subcommand is not supported 4363 - * @endcond DEPRECATED 3328 + * @endcond 4364 3329 */ 4365 3330 CMD_EC_STATUS_GET = 1, /* deprecated */ 4366 3331 ··· 4607 3572 /** @brief EC error descriptors */ 4608 3573 union ec_err_desc error_descs[EC_ERR_STATUS_DESC_MAX_NUM]; 4609 3574 } BPMP_ABI_PACKED; 4610 - /** @endcond DEPRECATED */ 3575 + /** @endcond */ 4611 3576 4612 3577 struct cmd_ec_status_ex_get_response { 4613 3578 /** @brief Target EC id (the same id received with request). */ ··· 4645 3610 * |sub-command |payload | 4646 3611 * |----------------------------|-----------------------| 4647 3612 * |@ref CMD_EC_STATUS_GET |ec_status_get | 4648 - * @endcond DEPRECATED 3613 + * @endcond 4649 3614 * 4650 3615 * |sub-command |payload | 4651 3616 * |----------------------------|-----------------------| ··· 4673 3638 * |sub-command |payload | 4674 3639 * |----------------------------|------------------------| 4675 3640 * |@ref CMD_EC_STATUS_GET |ec_status_get | 4676 - * @endcond DEPRECATED 3641 + * @endcond 4677 3642 * 4678 3643 * |sub-command |payload | 4679 3644 * |----------------------------|------------------------| ··· 4687 3652 * @cond DEPRECATED 4688 3653 */ 4689 3654 struct cmd_ec_status_get_response ec_status_get; 4690 - /** @endcond DEPRECATED */ 3655 + /** @endcond */ 4691 3656 struct cmd_ec_status_ex_get_response ec_status_ex_get; 4692 3657 } BPMP_UNION_ANON; 4693 3658 } BPMP_ABI_PACKED; 4694 3659 4695 - /** @endcond bpmp_t194 */ 4696 3660 /** @} EC */ 3661 + /** @endcond */ 4697 3662 4698 - /** 3663 + /** @cond (bpmp_th500) 4699 3664 * @ingroup MRQ_Codes 4700 3665 * @def MRQ_TELEMETRY 4701 3666 * @brief Get address of memory buffer refreshed with recently sampled 4702 3667 * telemetry data 4703 3668 * 4704 - * * Platforms: TH500 onwards 4705 - * @cond bpmp_th500 4706 3669 * * Initiators: CCPLEX 4707 3670 * * Targets: BPMP 4708 3671 * * Request Payload: N/A ··· 4710 3677 */ 4711 3678 4712 3679 /** 4713 - * @brief Response to #MRQ_TELEMETRY 3680 + * @brief Response payload for the #MRQ_TELEMETRY -command 4714 3681 * 4715 - * mrq_response::err is 4716 - * * 0: Telemetry data is available at returned address 4717 - * * -#BPMP_EACCES: MRQ master is not allowed to request buffer refresh 4718 - * * -#BPMP_ENAVAIL: Telemetry buffer cannot be refreshed via this MRQ channel 4719 - * * -#BPMP_ENOTSUP: Telemetry buffer is not supported by BPMP-FW 4720 - * * -#BPMP_ENODEV: Telemetry mrq is not supported by BPMP-FW 3682 + * mrq_response::err is defined as: 3683 + * 3684 + * | Value | Description | 3685 + * |-----------------|------------------------------------------------------------| 3686 + * | 0 | Telemetry data is available at returned address. | 3687 + * | -#BPMP_EACCES | MRQ master is not allowed to request buffer refresh. | 3688 + * | -#BPMP_ENAVAIL | Telemetry buffer cannot be refreshed via this MRQ channel. | 3689 + * | -#BPMP_ENOTSUP | Telemetry buffer is not supported by BPMP-FW. | 3690 + * | -#BPMP_ENODEV | Telemetry MRQ is not supported by BPMP-FW. | 4721 3691 */ 4722 3692 struct mrq_telemetry_response { 4723 3693 /** @brief Physical address of telemetry data buffer */ ··· 4728 3692 } BPMP_ABI_PACKED; 4729 3693 4730 3694 /** @} Telemetry */ 4731 - /** @endcond bpmp_th500 */ 3695 + /** @endcond */ 3696 + 3697 + /** @cond (bpmp_tb500) 3698 + * @ingroup MRQ_Codes 3699 + * @def MRQ_TELEMETRY_EX 3700 + * @brief Get telemetry configuration settings. 3701 + * 3702 + * * Initiators: Any 3703 + * * Targets: BPMP 3704 + * * Request Payload: @ref mrq_telemetry_ex_request 3705 + * * Response Payload: @ref mrq_telemetry_ex_response 3706 + * 3707 + * @addtogroup Telemetry_ex 3708 + * @{ 3709 + */ 4732 3710 4733 3711 /** 3712 + * @brief Sub-command identifiers for #MRQ_TELEMETRY_EX. 3713 + */ 3714 + enum mrq_telemetry_ex_cmd { 3715 + /** 3716 + * @brief Check whether the BPMP-FW supports the specified 3717 + * #MRQ_TELEMETRY_EX sub-command. 3718 + * 3719 + * mrq_response::err is 0 if the specified request is 3720 + * supported and -#BPMP_ENODEV otherwise. 3721 + */ 3722 + CMD_TELEMETRY_EX_QUERY_ABI = 0, 3723 + 3724 + /** 3725 + * @brief Get telemetry buffer base address and data size 3726 + * 3727 + * mrq_response:err is defined as: 3728 + * 3729 + * | Value | Description | 3730 + * |----------------|------------------------------------------------| 3731 + * | 0 | Success | 3732 + * | -#BPMP_ENODEV | #MRQ_TELEMETRY_EX is not supported by BPMP-FW. | 3733 + */ 3734 + CMD_TELEMETRY_EX_BASE_SZ_GET = 1, 3735 + }; 3736 + 3737 + /** 3738 + * @brief Request data for #MRQ_TELEMETRY_EX sub-command 3739 + * #CMD_TELEMETRY_EX_QUERY_ABI 3740 + */ 3741 + struct cmd_telemetry_ex_query_abi_request { 3742 + /** @brief Sub-command identifier from @ref mrq_telemetry_ex_cmd */ 3743 + uint32_t cmd_code; 3744 + } BPMP_ABI_PACKED; 3745 + 3746 + /** 3747 + * @brief Response payload for #MRQ_TELEMETRY_EX sub-command 3748 + * #CMD_TELEMETRY_EX_BASE_SZ_GET 3749 + */ 3750 + struct cmd_telemetry_ex_base_sz_get_response { 3751 + /** 3752 + * @brief Physical address of telemetry data buffer 3753 + * 3754 + * 0 if no buffer is allocated for the initiator sending MRQ. 3755 + */ 3756 + uint64_t buf_base_addr; 3757 + /** @brief Telemetry data size in bytes */ 3758 + uint32_t buf_size; 3759 + } BPMP_ABI_PACKED; 3760 + 3761 + /** 3762 + * @brief Request payload for the #MRQ_TELEMETRY_EX -command 3763 + * 3764 + * | Sub-command | Request payload | 3765 + * |-------------------------------|----------------------------------------| 3766 + * | #CMD_TELEMETRY_EX_QUERY_ABI | #cmd_telemetry_ex_query_abi_request | 3767 + * | #CMD_TELEMETRY_EX_BASE_SZ_GET | - | 3768 + */ 3769 + struct mrq_telemetry_ex_request { 3770 + /** @brief Sub-command ID from @ref mrq_telemetry_ex_cmd. */ 3771 + uint32_t cmd; 3772 + union { 3773 + struct cmd_telemetry_ex_query_abi_request 3774 + telemetry_ex_query_abi_req; 3775 + } BPMP_UNION_ANON; 3776 + } BPMP_ABI_PACKED; 3777 + 3778 + /** 3779 + * @brief Response payload for the #MRQ_TELEMETRY_EX -command. 3780 + * 3781 + * | Sub-command | Response payload | 3782 + * |-------------------------------|----------------------------------------| 3783 + * | #CMD_TELEMETRY_EX_QUERY_ABI | - | 3784 + * | #CMD_TELEMETRY_EX_BASE_SZ_GET | #cmd_telemetry_ex_base_sz_get_response | 3785 + */ 3786 + struct mrq_telemetry_ex_response { 3787 + union { 3788 + struct cmd_telemetry_ex_base_sz_get_response 3789 + telemetry_ex_base_sz_get_rsp; 3790 + } BPMP_UNION_ANON; 3791 + } BPMP_ABI_PACKED; 3792 + 3793 + /** @} Telemetry_ex */ 3794 + /** @endcond */ 3795 + 3796 + /** @cond (bpmp_th500 || bpmp_tb500) 4734 3797 * @ingroup MRQ_Codes 4735 3798 * @def MRQ_PWR_LIMIT 4736 3799 * @brief Control power limits. 4737 3800 * 4738 - * * Platforms: TH500 onwards 4739 - * @cond bpmp_th500 4740 3801 * * Initiators: Any 4741 3802 * * Targets: BPMP 4742 3803 * * Request Payload: @ref mrq_pwr_limit_request ··· 4842 3709 * @addtogroup Pwrlimit 4843 3710 * @{ 4844 3711 */ 3712 + 3713 + /** 3714 + * @brief Sub-command identifiers for #MRQ_PWR_LIMIT. 3715 + */ 4845 3716 enum mrq_pwr_limit_cmd { 4846 3717 /** 4847 3718 * @brief Check whether the BPMP-FW supports the specified 4848 - * command 3719 + * #MRQ_PWR_LIMIT sub-command. 4849 3720 * 4850 3721 * mrq_response::err is 0 if the specified request is 4851 3722 * supported and -#BPMP_ENODEV otherwise. ··· 4859 3722 /** 4860 3723 * @brief Set power limit 4861 3724 * 4862 - * mrq_response:err is 4863 - * * 0: Success 4864 - * * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW 4865 - * * -#BPMP_ENAVAIL: Invalid request parameters 4866 - * * -#BPMP_EACCES: Request is not accepted 3725 + * mrq_response:err is defined as: 3726 + * 3727 + * | Value | Description | 3728 + * |----------------|---------------------------------------------| 3729 + * | 0 | Success | 3730 + * | -#BPMP_ENODEV | #MRQ_PWR_LIMIT is not supported by BPMP-FW. | 3731 + * | -#BPMP_EINVAL | Invalid request parameters. | 3732 + * | -#BPMP_EACCES | Request is not accepted. | 4867 3733 */ 4868 3734 CMD_PWR_LIMIT_SET = 1, 4869 3735 4870 3736 /** 4871 3737 * @brief Get power limit setting 4872 3738 * 4873 - * mrq_response:err is 4874 - * * 0: Success 4875 - * * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW 4876 - * * -#BPMP_ENAVAIL: Invalid request parameters 3739 + * mrq_response:err is defined as: 3740 + * 3741 + * | Value | Description | 3742 + * |----------------|---------------------------------------------| 3743 + * | 0 | Success | 3744 + * | -#BPMP_ENODEV | #MRQ_PWR_LIMIT is not supported by BPMP-FW. | 3745 + * | -#BPMP_EINVAL | Invalid request parameters. | 4877 3746 */ 4878 3747 CMD_PWR_LIMIT_GET = 2, 4879 3748 4880 3749 /** 4881 - * @brief Get current power cap 3750 + * @brief Get current aggregated power cap 4882 3751 * 4883 - * mrq_response:err is 4884 - * * 0: Success 4885 - * * -#BPMP_ENODEV: Pwr limit mrq is not supported by BPMP-FW 4886 - * * -#BPMP_ENAVAIL: Invalid request parameters 3752 + * Get currently applied power cap for the specified limit id 3753 + * aggregated across all limit sources and types. 3754 + * 3755 + * mrq_response:err is defined as: 3756 + * 3757 + * | Value | Description | 3758 + * |----------------|---------------------------------------------| 3759 + * | 0 | Success | 3760 + * | -#BPMP_ENODEV | #MRQ_PWR_LIMIT is not supported by BPMP-FW. | 3761 + * | -#BPMP_EINVAL | Invalid request parameters. | 4887 3762 */ 4888 3763 CMD_PWR_LIMIT_CURR_CAP = 3, 4889 3764 }; ··· 4910 3761 #define PWR_LIMIT_TYPE_BOUND_MAX 1U 4911 3762 /** @brief Limit value specifies minimum possible target cap */ 4912 3763 #define PWR_LIMIT_TYPE_BOUND_MIN 2U 4913 - /** @brief Number of limit types supported by mrq interface */ 3764 + /** @brief Number of limit types supported by #MRQ_PWR_LIMIT command */ 4914 3765 #define PWR_LIMIT_TYPE_NUM 3U 4915 3766 4916 3767 /** @} bpmp_pwr_limit_type */ ··· 4919 3770 * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_QUERY_ABI 4920 3771 */ 4921 3772 struct cmd_pwr_limit_query_abi_request { 4922 - uint32_t cmd_code; /**< @ref mrq_pwr_limit_cmd */ 3773 + /** @brief Sub-command identifier from @ref mrq_pwr_limit_cmd */ 3774 + uint32_t cmd_code; 4923 3775 } BPMP_ABI_PACKED; 4924 3776 4925 3777 /** ··· 4932 3782 * is ignored by the arbitration (i.e., indicates "no limit set"). 4933 3783 */ 4934 3784 struct cmd_pwr_limit_set_request { 4935 - uint32_t limit_id; /**< @ref bpmp_pwr_limit_id */ 3785 + /** @brief Power limit identifier from @ref bpmp_pwr_limit_id */ 3786 + uint32_t limit_id; 3787 + /** @brief Power limit source identifier from @ref bpmp_pwr_limit_src */ 4936 3788 uint32_t limit_src; /**< @ref bpmp_pwr_limit_src */ 4937 - uint32_t limit_type; /**< @ref bpmp_pwr_limit_type */ 3789 + /** @brief Power limit type from @ref bpmp_pwr_limit_type */ 3790 + uint32_t limit_type; 3791 + /** @brief New power limit value */ 4938 3792 uint32_t limit_setting; 4939 3793 } BPMP_ABI_PACKED; 4940 3794 4941 3795 /** 4942 - * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_GET 3796 + * @brief Request payload for #MRQ_PWR_LIMIT sub-command #CMD_PWR_LIMIT_GET 4943 3797 * 4944 3798 * Get previously set from specified source specified limit value of specified 4945 3799 * type. 4946 3800 */ 4947 3801 struct cmd_pwr_limit_get_request { 4948 - uint32_t limit_id; /**< @ref bpmp_pwr_limit_id */ 3802 + /** @brief Power limit identifier from @ref bpmp_pwr_limit_id */ 3803 + uint32_t limit_id; 3804 + /** @brief Power limit source identifier from @ref bpmp_pwr_limit_src */ 4949 3805 uint32_t limit_src; /**< @ref bpmp_pwr_limit_src */ 4950 - uint32_t limit_type; /**< @ref bpmp_pwr_limit_type */ 3806 + /** @brief Power limit type from @ref bpmp_pwr_limit_type */ 3807 + uint32_t limit_type; 4951 3808 } BPMP_ABI_PACKED; 4952 3809 4953 3810 /** 4954 - * @brief Response data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_GET 3811 + * @brief Response payload for #MRQ_PWR_LIMIT sub-command #CMD_PWR_LIMIT_GET 4955 3812 */ 4956 3813 struct cmd_pwr_limit_get_response { 3814 + /** @brief Power limit value */ 4957 3815 uint32_t limit_setting; 4958 3816 } BPMP_ABI_PACKED; 4959 3817 4960 3818 /** 4961 - * @brief Request data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_CURR_CAP 3819 + * @brief Request payload for #MRQ_PWR_LIMIT sub-command #CMD_PWR_LIMIT_CURR_CAP 4962 3820 * 4963 3821 * For specified limit get current power cap aggregated from all sources. 4964 3822 */ 4965 3823 struct cmd_pwr_limit_curr_cap_request { 4966 - uint32_t limit_id; /**< @ref bpmp_pwr_limit_id */ 3824 + /** @brief Power limit identifier from @ref bpmp_pwr_limit_id */ 3825 + uint32_t limit_id; 4967 3826 } BPMP_ABI_PACKED; 4968 3827 4969 3828 /** 4970 - * @brief Response data for #MRQ_PWR_LIMIT command CMD_PWR_LIMIT_CURR_CAP 3829 + * @brief Response payload for #MRQ_PWR_LIMIT sub-command #CMD_PWR_LIMIT_CURR_CAP 4971 3830 */ 4972 3831 struct cmd_pwr_limit_curr_cap_response { 3832 + /** @brief Current power cap value */ 4973 3833 uint32_t curr_cap; 4974 3834 } BPMP_ABI_PACKED; 4975 3835 4976 3836 /** 4977 - * @brief Request with #MRQ_PWR_LIMIT 3837 + * @brief Request payload for the #MRQ_PWR_LIMIT -command 4978 3838 * 4979 - * |sub-command |payload | 4980 - * |----------------------------|---------------------------------| 4981 - * |CMD_PWR_LIMIT_QUERY_ABI | cmd_pwr_limit_query_abi_request | 4982 - * |CMD_PWR_LIMIT_SET | cmd_pwr_limit_set_request | 4983 - * |CMD_PWR_LIMIT_GET | cmd_pwr_limit_get_request | 4984 - * |CMD_PWR_LIMIT_CURR_CAP | cmd_pwr_limit_curr_cap_request | 3839 + * | Sub-command | Request payload | 3840 + * |--------------------------|----------------------------------| 3841 + * | #CMD_PWR_LIMIT_QUERY_ABI | #cmd_pwr_limit_query_abi_request | 3842 + * | #CMD_PWR_LIMIT_SET | #cmd_pwr_limit_set_request | 3843 + * | #CMD_PWR_LIMIT_GET | #cmd_pwr_limit_get_request | 3844 + * | #CMD_PWR_LIMIT_CURR_CAP | #cmd_pwr_limit_curr_cap_request | 4985 3845 */ 4986 3846 struct mrq_pwr_limit_request { 4987 3847 uint32_t cmd; ··· 5004 3844 } BPMP_ABI_PACKED; 5005 3845 5006 3846 /** 5007 - * @brief Response to MRQ_PWR_LIMIT 3847 + * @brief Response payload for the #MRQ_PWR_LIMIT -command. 5008 3848 * 5009 - * |sub-command |payload | 5010 - * |----------------------------|---------------------------------| 5011 - * |CMD_PWR_LIMIT_QUERY_ABI | - | 5012 - * |CMD_PWR_LIMIT_SET | - | 5013 - * |CMD_PWR_LIMIT_GET | cmd_pwr_limit_get_response | 5014 - * |CMD_PWR_LIMIT_CURR_CAP | cmd_pwr_limit_curr_cap_response | 3849 + * | Sub-command | Response payload | 3850 + * |--------------------------|----------------------------------| 3851 + * | #CMD_PWR_LIMIT_QUERY_ABI | - | 3852 + * | #CMD_PWR_LIMIT_SET | - | 3853 + * | #CMD_PWR_LIMIT_GET | #cmd_pwr_limit_get_response | 3854 + * | #CMD_PWR_LIMIT_CURR_CAP | #cmd_pwr_limit_curr_cap_response | 5015 3855 */ 5016 3856 struct mrq_pwr_limit_response { 5017 3857 union { ··· 5020 3860 } BPMP_UNION_ANON; 5021 3861 } BPMP_ABI_PACKED; 5022 3862 5023 - /** @} PwrLimit */ 5024 - /** @endcond bpmp_th500 */ 3863 + /** @} Pwrlimit */ 3864 + /** @endcond */ 5025 3865 3866 + 3867 + 3868 + /** @cond (bpmp_th500) 3869 + * @ingroup MRQ_Codes 3870 + * @def MRQ_PWRMODEL 3871 + * @brief Retrieve power evaluted by SoC power model. 3872 + * 3873 + * * Initiators: Any 3874 + * * Targets: BPMP 3875 + * * Request Payload: @ref mrq_pwrmodel_request 3876 + * * Response Payload: @ref mrq_pwrmodel_response 3877 + * 3878 + * @addtogroup Pwrmodel 3879 + * @{ 3880 + */ 5026 3881 5027 3882 /** 3883 + * @brief Sub-command identifiers for #MRQ_PWRMODEL. 3884 + */ 3885 + enum mrq_pwrmodel_cmd { 3886 + /** 3887 + * @brief Check whether the BPMP-FW supports the specified 3888 + * #MRQ_PWRMODEL sub-command. 3889 + * 3890 + * mrq_response::err is 0 if the specified request is 3891 + * supported and -#BPMP_ENODEV otherwise. 3892 + */ 3893 + CMD_PWRMODEL_QUERY_ABI = 0, 3894 + 3895 + /** 3896 + * @brief Get power model output power 3897 + * 3898 + * mrq_response:err is defined as: 3899 + * 3900 + * | Value | Description | 3901 + * |----------------|---------------------------------------------| 3902 + * | 0 | Success | 3903 + * | -#BPMP_ENODEV | #MRQ_PWRMODEL is not supported by BPMP-FW. | 3904 + * | -#BPMP_ERANGE | Power model calculation overflow. | 3905 + */ 3906 + CMD_PWRMODEL_PWR_GET = 1, 3907 + }; 3908 + 3909 + /** 3910 + * @brief Request data for #MRQ_PWRMODEL sub-command #CMD_PWRMODEL_QUERY_ABI 3911 + */ 3912 + struct cmd_pwrmodel_query_abi_request { 3913 + /** @brief Sub-command identifier from @ref mrq_pwrmodel_cmd */ 3914 + uint32_t cmd_code; 3915 + } BPMP_ABI_PACKED; 3916 + 3917 + /** 3918 + * @brief Request payload for #MRQ_PWRMODEL sub-command #CMD_PWRMODEL_PWR_GET 3919 + * 3920 + * Rerieve power evaluated by power model for specified work-load factor, 3921 + * temperature, and cpu iso frequency for all cores. 3922 + */ 3923 + struct cmd_pwrmodel_pwr_get_request { 3924 + /** @brief Unitless work load factor to evaluate power model at */ 3925 + uint32_t work_load_factor; 3926 + /** @brief CPU frequency in kHz to evaluate power model at */ 3927 + uint32_t cpu_frequency; 3928 + /** @brief Temperature in mC to evaluate power model at */ 3929 + int32_t temperature; 3930 + } BPMP_ABI_PACKED; 3931 + 3932 + /** 3933 + * @brief Response payload for #MRQ_PWRMODEL sub-command #CMD_PWRMODEL_PWR_GET 3934 + */ 3935 + struct cmd_pwrmodel_pwr_get_response { 3936 + /** @brief Power model output in mW */ 3937 + uint32_t power; 3938 + } BPMP_ABI_PACKED; 3939 + 3940 + /** 3941 + * @brief Request payload for the #MRQ_PWRMODEL -command 3942 + * 3943 + * | Sub-command | Request payload | 3944 + * |--------------------------|----------------------------------| 3945 + * | #CMD_PWRMODEL_QUERY_ABI | #cmd_pwrmodel_query_abi_request | 3946 + * | #CMD_PWRMODEL_PWR_GET | #cmd_pwrmodel_pwr_get_request | 3947 + */ 3948 + struct mrq_pwrmodel_request { 3949 + uint32_t cmd; 3950 + union { 3951 + struct cmd_pwrmodel_query_abi_request pwrmodel_query_abi_req; 3952 + struct cmd_pwrmodel_pwr_get_request pwrmodel_pwr_get_req; 3953 + } BPMP_UNION_ANON; 3954 + } BPMP_ABI_PACKED; 3955 + 3956 + /** 3957 + * @brief Response payload for the #MRQ_PWRMODEL -command. 3958 + * 3959 + * | Sub-command | Response payload | 3960 + * |--------------------------|----------------------------------| 3961 + * | #CMD_PWRMODEL_QUERY_ABI | - | 3962 + * | #CMD_PWRMODEL_PWR_GET | #cmd_pwrmodel_pwr_get_response | 3963 + */ 3964 + struct mrq_pwrmodel_response { 3965 + union { 3966 + struct cmd_pwrmodel_pwr_get_response pwrmodel_pwr_get_rsp; 3967 + } BPMP_UNION_ANON; 3968 + } BPMP_ABI_PACKED; 3969 + 3970 + /** @} Pwrmodel */ 3971 + /** @endcond */ 3972 + 3973 + 3974 + /** @cond (bpmp_th500) 3975 + * @ingroup MRQ_Codes 3976 + * @def MRQ_PWR_CNTRL 3977 + * @brief Configure power controllers. 3978 + * 3979 + * * Initiators: Any 3980 + * * Targets: BPMP 3981 + * * Request Payload: @ref mrq_pwr_cntrl_request 3982 + * * Response Payload: @ref mrq_pwr_cntrl_response 3983 + * 3984 + * @addtogroup Pwrcntrl 3985 + * @{ 3986 + */ 3987 + 3988 + /** 3989 + * @brief Sub-command identifiers for #MRQ_PWR_CNTRL. 3990 + */ 3991 + enum mrq_pwr_cntrl_cmd { 3992 + /** 3993 + * @brief Check whether the BPMP-FW supports the specified 3994 + * #MRQ_PWR_CNTRL sub-command. 3995 + * 3996 + * mrq_response::err is 0 if the specified request is 3997 + * supported and -#BPMP_ENODEV otherwise. 3998 + */ 3999 + CMD_PWR_CNTRL_QUERY_ABI = 0, 4000 + 4001 + /** 4002 + * @brief Switch power controller to/out of bypass mode 4003 + * 4004 + * mrq_response:err is defined as: 4005 + * 4006 + * | Value | Description | 4007 + * |----------------|---------------------------------------------| 4008 + * | 0 | Success | 4009 + * | -#BPMP_ENODEV | #MRQ_PWR_CNTRL is not supported by BPMP-FW. | 4010 + * | -#BPMP_EINVAL | Invalid request parameters. | 4011 + * | -#BPMP_ENOTSUP | Bypass mode is not supported. | 4012 + */ 4013 + CMD_PWR_CNTRL_BYPASS_SET = 1, 4014 + 4015 + /** 4016 + * @brief Get power controller bypass mode status 4017 + * 4018 + * mrq_response:err is defined as: 4019 + * 4020 + * | Value | Description | 4021 + * |----------------|---------------------------------------------| 4022 + * | 0 | Success | 4023 + * | -#BPMP_ENODEV | #MRQ_PWR_CNTRL is not supported by BPMP-FW. | 4024 + * | -#BPMP_EINVAL | Invalid request parameters. | 4025 + */ 4026 + CMD_PWR_CNTRL_BYPASS_GET = 2, 4027 + }; 4028 + 4029 + /** 4030 + * @brief Request data for #MRQ_PWR_CNTRL sub-command #CMD_PWR_CNTRL_QUERY_ABI 4031 + */ 4032 + struct cmd_pwr_cntrl_query_abi_request { 4033 + /** @brief Sub-command identifier from @ref mrq_pwr_cntrl_cmd */ 4034 + uint32_t cmd_code; 4035 + } BPMP_ABI_PACKED; 4036 + 4037 + /** 4038 + * @brief Request data for #MRQ_PWR_CNTRL sub-command #CMD_PWR_CNTRL_BYPASS_SET 4039 + * 4040 + * Switch specified power controller to / out of bypass mode provided such 4041 + * mode is supported by the controller. 4042 + */ 4043 + struct cmd_pwr_cntrl_bypass_set_request { 4044 + /** @brief Power controller identifier from @ref bpmp_pwr_cntrl_id */ 4045 + uint32_t cntrl_id; 4046 + /** 4047 + * @brief Bypass setting. 4048 + * 4049 + * Valid values: 4050 + * 4051 + * * 1 to enter bypass mode, 4052 + * * 0 to exit bypass mode. 4053 + */ 4054 + uint32_t bypass_setting; 4055 + } BPMP_ABI_PACKED; 4056 + 4057 + /** 4058 + * @brief Request data for #MRQ_PWR_CNTRL sub-command #CMD_PWR_CNTRL_BYPASS_GET 4059 + * 4060 + * Get bypass mode status of the specified power controller. 4061 + */ 4062 + struct cmd_pwr_cntrl_bypass_get_request { 4063 + /** @brief Power controller identifier from @ref bpmp_pwr_cntrl_id */ 4064 + uint32_t cntrl_id; 4065 + } BPMP_ABI_PACKED; 4066 + 4067 + /** 4068 + * @brief Response data for #MRQ_PWR_CNTRL sub-command #CMD_PWR_CNTRL_BYPASS_GET 4069 + * 4070 + * Get current bypass mode status if such mode is supported by the controller. 4071 + * Otherwise, return "out of bypass" . 4072 + */ 4073 + struct cmd_pwr_cntrl_bypass_get_response { 4074 + /** 4075 + * @brief Bypass mode status: 1 controller is in bypass, 4076 + * 0 controller is out of bypass. 4077 + */ 4078 + uint32_t bypass_status; 4079 + } BPMP_ABI_PACKED; 4080 + 4081 + /** 4082 + * @brief Request payload for the #MRQ_PWR_CNTRL -command 4083 + * 4084 + * | Sub-command | Request payload | 4085 + * |---------------------------|-----------------------------------| 4086 + * | #CMD_PWR_CNTRL_QUERY_ABI | #cmd_pwr_cntrl_query_abi_request | 4087 + * | #CMD_PWR_CNTRL_BYPASS_SET | #cmd_pwr_cntrl_bypass_set_request | 4088 + * | #CMD_PWR_CNTRL_BYPASS_GET | #cmd_pwr_cntrl_bypass_get_request | 4089 + */ 4090 + struct mrq_pwr_cntrl_request { 4091 + uint32_t cmd; 4092 + union { 4093 + struct cmd_pwr_cntrl_query_abi_request pwr_cntrl_query_abi_req; 4094 + struct cmd_pwr_cntrl_bypass_set_request pwr_cntrl_bypass_set_req; 4095 + struct cmd_pwr_cntrl_bypass_get_request pwr_cntrl_bypass_get_req; 4096 + } BPMP_UNION_ANON; 4097 + } BPMP_ABI_PACKED; 4098 + 4099 + /** 4100 + * @brief Response payload for the #MRQ_PWR_CNTRL -command. 4101 + * 4102 + * | Sub-command | Response payload | 4103 + * |---------------------------|-----------------------------------| 4104 + * | #CMD_PWR_CNTRL_QUERY_ABI | - | 4105 + * | #CMD_PWR_CNTRL_BYPASS_SET | - | 4106 + * | #CMD_PWR_CNTRL_BYPASS_GET | #cmd_pwr_cntrl_bypass_get_response| 4107 + */ 4108 + struct mrq_pwr_cntrl_response { 4109 + union { 4110 + struct cmd_pwr_cntrl_bypass_get_response pwr_cntrl_bypass_get_rsp; 4111 + } BPMP_UNION_ANON; 4112 + } BPMP_ABI_PACKED; 4113 + 4114 + /** @} Pwrcntrl */ 4115 + /** @endcond */ 4116 + 4117 + 4118 + /** @cond (bpmp_t264) 4119 + * @ingroup MRQ_Codes 4120 + * @def MRQ_SLC 4121 + * @brief Configure SLC state. 4122 + * 4123 + * * Initiators: Any 4124 + * * Targets: BPMP 4125 + * * Request Payload: @ref mrq_slc_request 4126 + * * Response Payload: @ref mrq_slc_response 4127 + * 4128 + * @addtogroup Slc 4129 + * @{ 4130 + */ 4131 + 4132 + /** 4133 + * @brief Sub-command identifiers for #MRQ_SLC. 4134 + */ 4135 + enum mrq_slc_cmd { 4136 + /** 4137 + * @brief Check whether the BPMP-FW supports the specified 4138 + * #MRQ_SLC sub-command. 4139 + * 4140 + * mrq_response::err is 0 if the specified request is 4141 + * supported and -#BPMP_ENODEV otherwise. 4142 + */ 4143 + CMD_SLC_QUERY_ABI = 0, 4144 + 4145 + /** 4146 + * @brief Switch SLC to/out of bypass mode 4147 + * 4148 + * mrq_response:err is defined as: 4149 + * 4150 + * | Value | Description | 4151 + * |----------------|---------------------------------------------| 4152 + * | 0 | Success | 4153 + * | -#BPMP_ENODEV | #MRQ_SLC is not supported by BPMP-FW. | 4154 + * | -#BPMP_EINVAL | Invalid request parameters. | 4155 + * | -#BPMP_ENOTSUP | Bypass mode is not supported. | 4156 + */ 4157 + CMD_SLC_BYPASS_SET = 1, 4158 + 4159 + /** 4160 + * @brief Get SLC bypass mode status 4161 + * 4162 + * mrq_response:err is defined as: 4163 + * 4164 + * | Value | Description | 4165 + * |----------------|---------------------------------------------| 4166 + * | 0 | Success | 4167 + * | -#BPMP_ENODEV | #MRQ_SLC is not supported by BPMP-FW. | 4168 + */ 4169 + CMD_SLC_BYPASS_GET = 2, 4170 + }; 4171 + 4172 + /** 4173 + * @brief Request data for #MRQ_SLC sub-command #CMD_SLC_QUERY_ABI 4174 + */ 4175 + struct cmd_slc_query_abi_request { 4176 + /** @brief Sub-command identifier from @ref mrq_slc_cmd */ 4177 + uint32_t cmd_code; 4178 + } BPMP_ABI_PACKED; 4179 + 4180 + /** 4181 + * @brief Request data for #MRQ_SLC sub-command #CMD_SLC_BYPASS_SET 4182 + * 4183 + * Switch SLC to / out of bypass mode provided such 4184 + * mode is supported by the SLC. 4185 + */ 4186 + struct cmd_slc_bypass_set_request { 4187 + /** 4188 + * @brief Bypass setting. 4189 + * 4190 + * Valid values: 4191 + * 4192 + * * 1 to enter bypass mode, 4193 + * * 0 to exit bypass mode. 4194 + */ 4195 + uint32_t bypass_setting; 4196 + } BPMP_ABI_PACKED; 4197 + 4198 + /** 4199 + * @brief Response data for #MRQ_SLC sub-command #CMD_SLC_BYPASS_GET 4200 + * 4201 + * Get current bypass mode status if such mode is supported by the SLC. 4202 + * Otherwise, return "out of bypass" . 4203 + */ 4204 + struct cmd_slc_bypass_get_response { 4205 + /** 4206 + * @brief Bypass mode status: 1 SLC is in bypass, 4207 + * 0 SLC is out of bypass. 4208 + */ 4209 + uint32_t bypass_status; 4210 + } BPMP_ABI_PACKED; 4211 + 4212 + /** 4213 + * @brief Request payload for the #MRQ_SLC -command 4214 + * 4215 + * | Sub-command | Request payload | 4216 + * |---------------------------|-----------------------------------| 4217 + * | #CMD_SLC_QUERY_ABI | #cmd_slc_query_abi_request | 4218 + * | #CMD_SLC_BYPASS_SET | #cmd_slc_bypass_set_request | 4219 + * | #CMD_SLC_BYPASS_GET | - | 4220 + */ 4221 + struct mrq_slc_request { 4222 + uint32_t cmd; 4223 + union { 4224 + struct cmd_slc_query_abi_request slc_query_abi_req; 4225 + struct cmd_slc_bypass_set_request slc_bypass_set_req; 4226 + } BPMP_UNION_ANON; 4227 + } BPMP_ABI_PACKED; 4228 + 4229 + /** 4230 + * @brief Response payload for the #MRQ_SLC -command. 4231 + * 4232 + * | Sub-command | Response payload | 4233 + * |---------------------------|-----------------------------------| 4234 + * | #CMD_SLC_QUERY_ABI | - | 4235 + * | #CMD_SLC_BYPASS_SET | - | 4236 + * | #CMD_SLC_BYPASS_GET | #cmd_slc_bypass_get_response | 4237 + */ 4238 + struct mrq_slc_response { 4239 + union { 4240 + struct cmd_slc_bypass_get_response slc_bypass_get_rsp; 4241 + } BPMP_UNION_ANON; 4242 + } BPMP_ABI_PACKED; 4243 + 4244 + /** @} Slc */ 4245 + /** @endcond */ 4246 + 4247 + /** @cond (bpmp_th500) 5028 4248 * @ingroup MRQ_Codes 5029 4249 * @def MRQ_GEARS 5030 4250 * @brief Get thresholds for NDIV offset switching 5031 4251 * 5032 - * * Platforms: TH500 onwards 5033 - * @cond bpmp_th500 5034 4252 * * Initiators: CCPLEX 5035 4253 * * Targets: BPMP 5036 4254 * * Request Payload: N/A ··· 5443 3905 */ 5444 3906 struct mrq_gears_response { 5445 3907 /** @brief number of online CPUs for each gear */ 5446 - uint32_t ncpu[16]; 3908 + uint32_t ncpu[8]; 3909 + /** @brief ndiv offset for each gear */ 3910 + uint32_t ndiv_offset[8]; 3911 + /** @brief voltage below which gears are disabled */ 3912 + uint32_t uv_threshold; 5447 3913 } BPMP_ABI_PACKED; 5448 3914 5449 3915 /** @} Gears */ 5450 - /** @endcond bpmp_th500 */ 3916 + /** @endcond */ 3917 + 3918 + 3919 + /** 3920 + * @ingroup MRQ_Codes 3921 + * @def MRQ_SHUTDOWN 3922 + * @brief System shutdown 3923 + * 3924 + * This message indicates system shutdown or reboot request. BPMP will 3925 + * initiate system shutdown/reboot after receiving this message, it 3926 + * may include turning off some rails in sequence and programming 3927 + * PMIC. 3928 + * 3929 + * * Initiators: CPU_S, MCE 3930 + * * Targets: BPMP 3931 + * * Request Payload: @ref mrq_shutdown_request 3932 + * * Response Payload: N/A 3933 + * @addtogroup Shutdown 3934 + * @{ 3935 + */ 3936 + 3937 + /** 3938 + * @brief Request with #MRQ_SHUTDOWN 3939 + */ 3940 + struct mrq_shutdown_request { 3941 + /** 3942 + * @brief Shutdown state ID 3943 + * 3944 + * Legal values: 3945 + * * 0 - Power off 3946 + * * 1 - Reboot 3947 + * @cond bpmp_t264 3948 + * * 2 - Suspend 3949 + * @endcond 3950 + */ 3951 + uint32_t state; 3952 + } BPMP_ABI_PACKED; 3953 + 3954 + /** @} Shutdown */ 3955 + 3956 + /** @cond (bpmp_th500 || bpmp_tb500) 3957 + * @defgroup bpmp_c2c_status C2C link status 3958 + * @addtogroup bpmp_c2c_status 3959 + * @{ 3960 + */ 3961 + /** @brief initial status code */ 3962 + #define BPMP_C2C_STATUS_INIT_NOT_STARTED 0 3963 + /** @brief Invalid speedo code */ 3964 + #define BPMP_C2C_STATUS_C2C_INVALID_SPEEDO_CODE 7 3965 + /** @brief Invalid frequency */ 3966 + #define BPMP_C2C_STATUS_C2C_INVALID_FREQ 8 3967 + /** @brief Invalid link */ 3968 + #define BPMP_C2C_STATUS_C2C_INVALID_LINK 9 3969 + /** @brief refpll lock polling times out - partition 0 */ 3970 + #define BPMP_C2C_STATUS_C2C0_REFPLL_FAIL 10 3971 + /** @brief refpll lock polling times out - partition 1 */ 3972 + #define BPMP_C2C_STATUS_C2C1_REFPLL_FAIL 11 3973 + /** @brief PLL cal times out - partition 0 */ 3974 + #define BPMP_C2C_STATUS_C2C0_PLLCAL_FAIL 12 3975 + /** @brief PLL cal times out - partition 1 */ 3976 + #define BPMP_C2C_STATUS_C2C1_PLLCAL_FAIL 13 3977 + /** @brief clock detection times out - partition 0 */ 3978 + #define BPMP_C2C_STATUS_C2C0_CLKDET_FAIL 14 3979 + /** @brief clock detection times out - partition 1 */ 3980 + #define BPMP_C2C_STATUS_C2C1_CLKDET_FAIL 15 3981 + /** @brief Final trainings fail partition 0 */ 3982 + #define BPMP_C2C_STATUS_C2C0_TR_FAIL 16 3983 + /** @brief Final trainings fail partition 1 */ 3984 + #define BPMP_C2C_STATUS_C2C1_TR_FAIL 17 3985 + /** @brief C2C FW init done */ 3986 + #define NV_GFW_GLOBAL_DEVINIT_C2C_STATUS_C2C_FW_INIT_DONE 20 3987 + /** @brief C2C FW init failed partition 0 */ 3988 + #define NV_GFW_GLOBAL_DEVINIT_C2C_STATUS_C2C0_FW_INIT_FAIL 21 3989 + /** @brief C2C FW init failed partition 1 */ 3990 + #define NV_GFW_GLOBAL_DEVINIT_C2C_STATUS_C2C1_FW_INIT_FAIL 22 3991 + /** @brief no failure seen, c2c init was successful */ 3992 + #define BPMP_C2C_STATUS_C2C_LINK_TRAIN_PASS 255 3993 + /** @} bpmp_c2c_status */ 3994 + 3995 + /** 3996 + * @ingroup MRQ_Codes 3997 + * @def MRQ_C2C 3998 + * @brief Control C2C partitions initialization. 3999 + * 4000 + * * Initiators: Any 4001 + * * Targets: BPMP 4002 + * * Request Payload: @ref mrq_c2c_request 4003 + * * Response Payload: @ref mrq_c2c_response 4004 + * 4005 + * @addtogroup C2C 4006 + * @{ 4007 + */ 4008 + enum mrq_c2c_cmd { 4009 + /** 4010 + * @brief Check whether the BPMP driver supports the specified request 4011 + * type 4012 + * 4013 + * mrq_response:: err is 0 if the specified request is supported and 4014 + * -#BPMP_ENODEV otherwise 4015 + */ 4016 + CMD_C2C_QUERY_ABI = 0, 4017 + 4018 + /** 4019 + * @brief Start C2C initialization 4020 + * 4021 + * mrq_response:err is 4022 + * * 0: Success 4023 + * * -#BPMP_ENODEV: MRQ_C2C is not supported by BPMP-FW 4024 + * * -#BPMP_ENAVAIL: Invalid request parameters 4025 + * * -#BPMP_EACCES: Request is not accepted 4026 + */ 4027 + CMD_C2C_START_INITIALIZATION = 1, 4028 + 4029 + /** 4030 + * @brief Command to query current C2C training status 4031 + * 4032 + * This command will return the result of the latest C2C re-training that is initiated with 4033 + * MRQ_C2C.CMD_C2C_START_INITIALIZATION or MRQ_C2C.CMD_C2C_START_HOTRESET calls. 4034 + * If no training has been initiated yet, the command will return code BPMP_C2C_STATUS_INIT_NOT_STARTED. 4035 + * 4036 + * mrq_response:err is 4037 + * * 0: Success 4038 + * * -#BPMP_ENODEV: MRQ_C2C is not supported by BPMP-FW 4039 + * * -#BPMP_EACCES: Request is not accepted 4040 + */ 4041 + CMD_C2C_GET_STATUS = 2, 4042 + /** 4043 + * @brief C2C hot-reset precondition 4044 + * 4045 + * mrq_response:err is 4046 + * * 0: Success 4047 + * * -#BPMP_ENODEV: MRQ_C2C is not supported by BPMP-FW 4048 + * * -#BPMP_ENAVAIL: Invalid request parameters 4049 + * * -#BPMP_EACCES: Request is not accepted 4050 + */ 4051 + CMD_C2C_HOTRESET_PREP = 3, 4052 + /** 4053 + * @brief Start C2C hot-reset 4054 + * 4055 + * mrq_response:err is 4056 + * * 0: Success 4057 + * * -#BPMP_ENODEV: MRQ_C2C is not supported by BPMP-FW 4058 + * * -#BPMP_ENAVAIL: Invalid request parameters 4059 + * * -#BPMP_EACCES: Request is not accepted 4060 + */ 4061 + CMD_C2C_START_HOTRESET = 4, 4062 + 4063 + CMD_C2C_MAX 4064 + }; 4065 + 4066 + /** 4067 + * @brief Request data for #MRQ_C2C command CMD_C2C_QUERY_ABI 4068 + */ 4069 + struct cmd_c2c_query_abi_request { 4070 + /** @brief Command identifier to be queried */ 4071 + uint32_t cmd; 4072 + } BPMP_ABI_PACKED; 4073 + 4074 + /** 4075 + * @brief Request data for #MRQ_C2C command CMD_C2C_START_INITIALIZATION 4076 + */ 4077 + struct cmd_c2c_start_init_request { 4078 + /** @brief 1: partition 0; 2: partition 1; 3: partition 0 and 1; */ 4079 + uint8_t partitions; 4080 + } BPMP_ABI_PACKED; 4081 + 4082 + /** 4083 + * @brief Response data for #MRQ_C2C command CMD_C2C_START_INITIALIZATION 4084 + */ 4085 + struct cmd_c2c_start_init_response { 4086 + /** @brief Refer to @ref bpmp_c2c_status */ 4087 + uint8_t status; 4088 + } BPMP_ABI_PACKED; 4089 + 4090 + /** 4091 + * @brief Response data for #MRQ_C2C command CMD_C2C_GET_STATUS 4092 + */ 4093 + struct cmd_c2c_get_status_response { 4094 + /** @brief Refer to @ref bpmp_c2c_status */ 4095 + uint8_t status; 4096 + } BPMP_ABI_PACKED; 4097 + 4098 + /** 4099 + * @brief Request data for #MRQ_C2C command CMD_C2C_HOTRESET_PREP 4100 + */ 4101 + struct cmd_c2c_hotreset_prep_request { 4102 + /** @brief 1: partition 0; 2: partition 1; 3: partition 0 and 1; */ 4103 + uint8_t partitions; 4104 + } BPMP_ABI_PACKED; 4105 + 4106 + /** 4107 + * @brief Request data for #MRQ_C2C command CMD_C2C_START_HOTRESET 4108 + */ 4109 + struct cmd_c2c_start_hotreset_request { 4110 + /** @brief 1: partition 0; 2: partition 1; 3: partition 0 and 1; */ 4111 + uint8_t partitions; 4112 + } BPMP_ABI_PACKED; 4113 + 4114 + /** 4115 + * @brief Response data for #MRQ_C2C command CMD_C2C_START_HOTRESET 4116 + */ 4117 + struct cmd_c2c_start_hotreset_response { 4118 + /** @brief Refer to @ref bpmp_c2c_status */ 4119 + uint8_t status; 4120 + } BPMP_ABI_PACKED; 4121 + 4122 + /** 4123 + * @brief Request with #MRQ_C2C 4124 + * 4125 + * |sub-command |payload | 4126 + * |-----------------------------|-------------------------------| 4127 + * |CMD_C2C_QUERY_ABI |cmd_c2c_query_abi_request | 4128 + * |CMD_C2C_START_INITIALIZATION |cmd_c2c_start_init_request | 4129 + * |CMD_C2C_GET_STATUS | | 4130 + * |CMD_C2C_HOTRESET_PREP |cmd_c2c_hotreset_prep_request | 4131 + * |CMD_C2C_START_HOTRESET |cmd_c2c_start_hotreset_request | 4132 + 4133 + */ 4134 + struct mrq_c2c_request { 4135 + uint32_t cmd; 4136 + union { 4137 + struct cmd_c2c_query_abi_request c2c_query_abi_req; 4138 + struct cmd_c2c_start_init_request c2c_start_init_req; 4139 + struct cmd_c2c_hotreset_prep_request c2c_hotreset_prep_req; 4140 + struct cmd_c2c_start_hotreset_request c2c_start_hotreset_req; 4141 + } BPMP_UNION_ANON; 4142 + } BPMP_ABI_PACKED; 4143 + 4144 + /** 4145 + * @brief Response to MRQ_C2C 4146 + * 4147 + * |sub-command |payload | 4148 + * |-----------------------------|--------------------------------| 4149 + * |CMD_C2C_QUERY_ABI | | 4150 + * |CMD_C2C_START_INITIALIZATION |cmd_c2c_start_init_response | 4151 + * |CMD_C2C_GET_STATUS |cmd_c2c_get_status_response | 4152 + * |CMD_C2C_HOTRESET_PREP | | 4153 + * |CMD_C2C_START_HOTRESET |cmd_c2c_start_hotreset_response | 4154 + */ 4155 + struct mrq_c2c_response { 4156 + union { 4157 + struct cmd_c2c_start_init_response c2c_start_init_resp; 4158 + struct cmd_c2c_get_status_response c2c_get_status_resp; 4159 + struct cmd_c2c_start_hotreset_response c2c_start_hotreset_resp; 4160 + } BPMP_UNION_ANON; 4161 + } BPMP_ABI_PACKED; 4162 + /** @} */ 4163 + /** @endcond */ 4164 + 4165 + 4166 + /** @cond (bpmp_t264) 4167 + * @ingroup MRQ_Codes 4168 + * @def MRQ_PCIE 4169 + * @brief Perform a PCIE operation 4170 + * 4171 + * * Initiators: CCPLEX 4172 + * * Targets: BPMP 4173 + * * Request Payload: @ref mrq_pcie_request 4174 + * 4175 + * @addtogroup PCIE 4176 + * @{ 4177 + */ 4178 + 4179 + /** 4180 + * @brief Sub-command identifiers for #MRQ_PCIE. 4181 + */ 4182 + enum mrq_pcie_cmd { 4183 + /** @brief Initialize PCIE EP controller. */ 4184 + CMD_PCIE_EP_CONTROLLER_INIT = 0, 4185 + /** @brief Disable PCIE EP controller. */ 4186 + CMD_PCIE_EP_CONTROLLER_OFF = 1, 4187 + 4188 + /** @brief Disable PCIE RP controller. */ 4189 + CMD_PCIE_RP_CONTROLLER_OFF = 100, 4190 + 4191 + CMD_PCIE_MAX, 4192 + }; 4193 + 4194 + /** 4195 + * @brief Request payload for #MRQ_PCIE sub-command #CMD_PCIE_EP_CONTROLLER_INIT. 4196 + */ 4197 + struct cmd_pcie_ep_controller_init_request { 4198 + /** 4199 + * @brief PCIe EP controller number. 4200 + * Valid entries for T264 are 2, 4 and 5. 4201 + */ 4202 + uint8_t ep_controller; 4203 + /** 4204 + * @brief PCIe EP function programming interface code. 4205 + * Valid range in HW is [0, 0xFFU], BPMP-FW programs the input value without any check. 4206 + * It is up to the requester to send valid input as documented in "PCI CODE AND ID 4207 + * ASSIGNMENT SPECIFICATION". 4208 + */ 4209 + uint8_t progif_code; 4210 + /** 4211 + * @brief PCIe EP function sub-class code. 4212 + * Valid range in HW is [0, 0xFFU], BPMP-FW programs the input value without any check. 4213 + * It is up to the requester to send valid input as documented in "PCI CODE AND ID 4214 + * ASSIGNMENT SPECIFICATION". 4215 + */ 4216 + uint8_t subclass_code; 4217 + /** 4218 + * @brief PCIe EP function base class code. 4219 + * Valid range in HW is [0, 0xFFU], BPMP-FW programs the input value without any check. 4220 + * It is up to the requester to send valid input as documented in "PCI CODE AND ID 4221 + * ASSIGNMENT SPECIFICATION". 4222 + */ 4223 + uint8_t baseclass_code; 4224 + /** 4225 + * @brief PCIe EP function device id. 4226 + * Valid range is [0, 0x7FU], only LSB 7 bits are writable in 16-bit PCI device id. 4227 + * Valid range check is done on input value and returns -BPMP_EINVAL on failure. 4228 + */ 4229 + uint8_t deviceid; 4230 + /** 4231 + * @brief PCIe EP EP BAR1 size. 4232 + * Valid range is [6U, 16U], which translate to [64MB, 64GB] size. 4233 + * Valid range check is done on input value and returns -BPMP_EINVAL on failure. 4234 + */ 4235 + uint8_t bar1_size; 4236 + } BPMP_ABI_PACKED; 4237 + 4238 + /** 4239 + * @brief Request payload for #MRQ_PCIE sub-command #CMD_PCIE_EP_CONTROLLER_OFF. 4240 + */ 4241 + struct cmd_pcie_ep_controller_off_request { 4242 + /** @brief EP controller number, T264 valid: 2, 4, 5. */ 4243 + uint8_t ep_controller; 4244 + } BPMP_ABI_PACKED; 4245 + 4246 + /** 4247 + * @brief Request payload for #MRQ_PCIE sub-command #CMD_PCIE_RP_CONTROLLER_OFF. 4248 + */ 4249 + struct cmd_pcie_rp_controller_off_request { 4250 + /** @brief RP controller number, T264 valid: 1-5 */ 4251 + uint8_t rp_controller; 4252 + } BPMP_ABI_PACKED; 4253 + 4254 + /** 4255 + * @ingroup PCIE 4256 + * @brief Request payload for the #MRQ_PCIE command. 4257 + * 4258 + * Used by the sender of an #MRQ_PCIE message to control PCIE. 4259 + * Below table shows sub-commands with their corresponding payload data. 4260 + * 4261 + * |sub-command |payload | 4262 + * |--------------------------------------|-----------------------------------------| 4263 + * |#CMD_PCIE_EP_CONTROLLER_INIT |#cmd_pcie_ep_controller_init_request | 4264 + * |#CMD_PCIE_EP_CONTROLLER_OFF |#cmd_pcie_ep_controller_off_request | 4265 + * 4266 + * @cond (!bpmp_safe) 4267 + * 4268 + * The following additional MRQs are supported on non-functional-safety 4269 + * builds: 4270 + * |sub-command |payload | 4271 + * |--------------------------------------|-----------------------------------------| 4272 + * |#CMD_PCIE_RP_CONTROLLER_OFF |#cmd_pcie_rp_controller_off_request | 4273 + * 4274 + * @endcond 4275 + * 4276 + */ 4277 + struct mrq_pcie_request { 4278 + /** @brief Sub-command ID from @ref mrq_pcie_cmd. */ 4279 + uint32_t cmd; 4280 + 4281 + union { 4282 + struct cmd_pcie_ep_controller_init_request ep_ctrlr_init; 4283 + struct cmd_pcie_ep_controller_off_request ep_ctrlr_off; 4284 + /** @cond (!bpmp_safe) */ 4285 + struct cmd_pcie_rp_controller_off_request rp_ctrlr_off; 4286 + /** @endcond */ 4287 + } BPMP_UNION_ANON; 4288 + } BPMP_ABI_PACKED; 4289 + 4290 + /** @} PCIE */ 4291 + /** @endcond */ 4292 + 4293 + /** @cond (bpmp_t264) 4294 + * @ingroup MRQ_Codes 4295 + * @def MRQ_CR7 4296 + * @brief Perform a CR7 operation 4297 + * 4298 + * * Initiators: CPU_S 4299 + * * Targets: BPMP 4300 + * * Request Payload: @ref mrq_cr7_request 4301 + * 4302 + * @addtogroup CR7 4303 + * @{ 4304 + */ 4305 + 4306 + /** 4307 + * @brief Payload for #MRQ_CR7 4308 + * 2 fields for future parameters are provided. These must be 0 currently. 4309 + */ 4310 + struct cmd_cr7_request { 4311 + uint32_t fld0; 4312 + uint32_t fld1; 4313 + } BPMP_ABI_PACKED; 4314 + 4315 + struct cmd_cr7_query_abi_request { 4316 + /** #MRQ_CR7 sub-command identifier from @ref mrq_cr7_cmd */ 4317 + uint32_t type; 4318 + } BPMP_ABI_PACKED; 4319 + 4320 + /** 4321 + * @brief Sub-command identifiers for #MRQ_CR7. 4322 + */ 4323 + enum mrq_cr7_cmd { 4324 + /** 4325 + * @brief Check whether the BPMP driver supports the specified request 4326 + * type 4327 + * 4328 + * mrq_response:: err is 0 if the specified request is supported and 4329 + * -#BPMP_ENODEV otherwise 4330 + */ 4331 + CMD_CR7_QUERY_ABI = 0, 4332 + 4333 + /** @brief Enter CR7 state on the package BPMP-FW is running on. */ 4334 + CMD_CR7_ENTRY = 1, 4335 + /** @brief Exit CR7 state on the package BPMP-FW is running on. */ 4336 + CMD_CR7_EXIT = 2, 4337 + 4338 + CMD_CR7_MAX, 4339 + }; 4340 + 4341 + /** 4342 + * @ingroup CR7 4343 + * @brief #MRQ_CR7 structure 4344 + * 4345 + * |Sub-command |Payload | 4346 + * |----------------------------|---------------------------| 4347 + * |#CMD_CR7_QUERY_ABI | #cmd_cr7_query_abi_request| 4348 + * |#CMD_CR7_ENTRY | #cmd_cr7_request | 4349 + * |#CMD_CR7_EXIT | #cmd_cr7_request | 4350 + 4351 + */ 4352 + struct mrq_cr7_request { 4353 + /** @brief Sub-command ID from @ref mrq_cr7_cmd. */ 4354 + uint32_t cmd; 4355 + union { 4356 + struct cmd_cr7_query_abi_request query_abi; 4357 + struct cmd_cr7_request cr7_request; 4358 + } BPMP_UNION_ANON; 4359 + } BPMP_ABI_PACKED; 4360 + 4361 + /** @} CR7 */ 4362 + /** @endcond */ 4363 + 4364 + /** @cond (bpmp_tb500) 4365 + * @ingroup MRQ_Codes 4366 + * @def MRQ_HWPM 4367 + * @brief Configure and query HWPM functionality 4368 + * 4369 + * * Initiators: CCPLEX 4370 + * * Targets: BPMP 4371 + * * Request Payload: @ref mrq_hwpm_request 4372 + * * Response Payload: @ref mrq_hwpm_response 4373 + * 4374 + * @addtogroup HWPM 4375 + * @{ 4376 + */ 4377 + 4378 + /** 4379 + * @brief Sub-command identifiers for #MRQ_HWPM. 4380 + */ 4381 + enum mrq_hwpm_cmd { 4382 + /** 4383 + * @brief Check whether the BPMP-FW supports the specified 4384 + * #MRQ_HWPM sub-command. 4385 + * 4386 + * mrq_response:err is 0 if the specified request is 4387 + * supported and -#BPMP_ENODEV otherwise. 4388 + */ 4389 + CMD_HWPM_QUERY_ABI = 1, 4390 + 4391 + /** 4392 + * @brief Configure IPMU triggers 4393 + * 4394 + * mrq_response:err is defined as: 4395 + * 4396 + * | Value | Description | 4397 + * | -------------- | ------------------------------------------- | 4398 + * | 0 | Success | 4399 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4400 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4401 + * | -#BPMP_EINVAL | Invalid request parameters. | 4402 + */ 4403 + CMD_HWPM_IPMU_SET_TRIGGERS = 2, 4404 + 4405 + /** 4406 + * @brief Configure IPMU payloads and shifts 4407 + * 4408 + * mrq_response:err is defined as: 4409 + * 4410 + * | Value | Description | 4411 + * | -------------- | ------------------------------------------- | 4412 + * | 0 | Success | 4413 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4414 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4415 + * | -#BPMP_EINVAL | Invalid request parameters. | 4416 + */ 4417 + CMD_HWPM_IPMU_SET_PAYLOADS_SHIFTS = 3, 4418 + 4419 + /** 4420 + * @brief Get maximum number of payloads 4421 + * 4422 + * mrq_response:err is defined as: 4423 + * 4424 + * | Value | Description | 4425 + * | -------------- | ------------------------------------------- | 4426 + * | 0 | Success | 4427 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4428 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4429 + */ 4430 + CMD_HWPM_IPMU_GET_MAX_PAYLOADS = 4, 4431 + 4432 + /** 4433 + * @brief Configure NVTHERM sample rate 4434 + * 4435 + * mrq_response:err is defined as: 4436 + * 4437 + * | Value | Description | 4438 + * | -------------- | ------------------------------------------- | 4439 + * | 0 | Success | 4440 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4441 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4442 + * | -#BPMP_EINVAL | Invalid request parameters. | 4443 + */ 4444 + CMD_HWPM_NVTHERM_SET_SAMPLE_RATE = 5, 4445 + 4446 + /** 4447 + * @brief Set NVTHERM bubble interval 4448 + * 4449 + * mrq_response:err is defined as: 4450 + * 4451 + * | Value | Description | 4452 + * | -------------- | ------------------------------------------- | 4453 + * | 0 | Success | 4454 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4455 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4456 + * | -#BPMP_EINVAL | Invalid request parameters. | 4457 + */ 4458 + CMD_HWPM_NVTHERM_SET_BUBBLE_INTERVAL = 6, 4459 + 4460 + /** 4461 + * @brief Configure NVTHERM DG flexible channels 4462 + * 4463 + * mrq_response:err is defined as: 4464 + * 4465 + * | Value | Description | 4466 + * | -------------- | ------------------------------------------- | 4467 + * | 0 | Success | 4468 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4469 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4470 + * | -#BPMP_EINVAL | Invalid request parameters. | 4471 + */ 4472 + CMD_HWPM_NVTHERM_SET_FLEX_CHANNELS = 7, 4473 + 4474 + /** 4475 + * @brief Get ISENSE sensor name 4476 + * 4477 + * mrq_response:err is defined as: 4478 + * 4479 + * | Value | Description | 4480 + * | -------------- | ------------------------------------------- | 4481 + * | 0 | Success | 4482 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4483 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4484 + * | -#BPMP_EINVAL | Invalid request parameters. | 4485 + */ 4486 + CMD_HWPM_ISENSE_GET_SENSOR_NAME = 8, 4487 + 4488 + /** 4489 + * @brief Get ISENSE sensor channel 4490 + * 4491 + * mrq_response:err is defined as: 4492 + * 4493 + * | Value | Description | 4494 + * | -------------- | ------------------------------------------- | 4495 + * | 0 | Success | 4496 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4497 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4498 + * | -#BPMP_EINVAL | Invalid request parameters. | 4499 + */ 4500 + CMD_HWPM_ISENSE_GET_SENSOR_CHANNEL = 9, 4501 + 4502 + /** 4503 + * @brief Get ISENSE sensor scale factor 4504 + * 4505 + * mrq_response:err is defined as: 4506 + * 4507 + * | Value | Description | 4508 + * | -------------- | ------------------------------------------- | 4509 + * | 0 | Success | 4510 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4511 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4512 + * | -#BPMP_EINVAL | Invalid request parameters. | 4513 + */ 4514 + CMD_HWPM_ISENSE_GET_SENSOR_SCALE_FACTOR = 10, 4515 + 4516 + /** 4517 + * @brief Get ISENSE sensor offset 4518 + * 4519 + * mrq_response:err is defined as: 4520 + * 4521 + * | Value | Description | 4522 + * | -------------- | ------------------------------------------- | 4523 + * | 0 | Success | 4524 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4525 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4526 + * | -#BPMP_EINVAL | Invalid request parameters. | 4527 + * | -#BPMP_ENODATA | No sensor offset. | 4528 + */ 4529 + CMD_HWPM_ISENSE_GET_SENSOR_OFFSET = 11, 4530 + 4531 + /** 4532 + * @brief Get ISENSE sum block name 4533 + * 4534 + * mrq_response:err is defined as: 4535 + * 4536 + * | Value | Description | 4537 + * | -------------- | ------------------------------------------- | 4538 + * | 0 | Success | 4539 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4540 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4541 + * | -#BPMP_EINVAL | Invalid request parameters. | 4542 + */ 4543 + CMD_HWPM_ISENSE_GET_SUM_BLOCK_NAME = 12, 4544 + 4545 + /** 4546 + * @brief Get ISENSE sum input sensor IDs 4547 + * 4548 + * mrq_response:err is defined as: 4549 + * 4550 + * | Value | Description | 4551 + * | -------------- | ------------------------------------------- | 4552 + * | 0 | Success | 4553 + * | -#BPMP_ENODEV | #MRQ_HWPM is not supported by BPMP-FW. | 4554 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4555 + * | -#BPMP_EINVAL | Invalid request parameters. | 4556 + */ 4557 + CMD_HWPM_ISENSE_GET_SUM_BLOCK_INPUTS = 13, 4558 + 4559 + /** 4560 + * @brief Largest supported #MRQ_HWPM sub-command identifier + 1 4561 + */ 4562 + CMD_HWPM_MAX, 4563 + }; 4564 + 4565 + /** 4566 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_QUERY_ABI 4567 + */ 4568 + struct cmd_hwpm_query_abi_req { 4569 + /** @brief Sub-command identifier from @ref mrq_hwpm_cmd */ 4570 + uint32_t cmd_code; 4571 + } BPMP_ABI_PACKED; 4572 + 4573 + /** 4574 + * @brief Maximum array length for IPMU trigger bitmask 4575 + */ 4576 + #define HWPM_IPMU_TRIGGER_ARR_LEN 28U 4577 + 4578 + /** 4579 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_IPMU_SET_TRIGGERS 4580 + */ 4581 + struct cmd_hwpm_ipmu_set_triggers_req { 4582 + /** @brief IPMU physical ID 4583 + * 4584 + * @note Valid range from [0, MAX_CPU_CORES), see @ref bpmp_hwpm_core_config 4585 + */ 4586 + uint32_t ipmu_phys_id; 4587 + /** @brief Trigger bitmask, see @ref bpmp_ipmu_trigger_ids 4588 + * 4589 + * @note Setting a trigger bit will cause the associated trigger to 4590 + * generate an output packet from IPMU to the HWPM perfmux. 4591 + * @note Up to a maximum possible 896 triggers 4592 + */ 4593 + uint32_t triggers[HWPM_IPMU_TRIGGER_ARR_LEN]; 4594 + } BPMP_ABI_PACKED; 4595 + 4596 + /** 4597 + * @brief Array length for IPMU payload bitmask 4598 + */ 4599 + #define HWPM_IPMU_PAYLOAD_ARR_LEN 26U 4600 + 4601 + /** 4602 + * @brief Array length for IPMU payload shift bitmask 4603 + */ 4604 + #define HWPM_IPMU_SHIFT_ARR_LEN 2U 4605 + 4606 + /** 4607 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_IPMU_SET_PAYLOADS_SHIFTS 4608 + */ 4609 + struct cmd_hwpm_ipmu_set_payloads_shifts_req { 4610 + /** @brief IPMU physical ID 4611 + * 4612 + * @note Valid range from [0, MAX_CPU_CORES), see @ref bpmp_hwpm_core_config 4613 + */ 4614 + uint32_t ipmu_phys_id; 4615 + /** @brief Payload bitmask, see @ref bpmp_ipmu_payload_ids 4616 + * 4617 + * @note Setting a payload bit will add the associated payload to the 4618 + * IPMU output packet. 4619 + * @note The maximum number of payloads is platform dependent, 4620 + * @see #CMD_HWPM_IPMU_GET_MAX_PAYLOADS 4621 + * @note To disable IPMU streaming on this instance, set all payload bits to 0. 4622 + * @note Up to a maximum of 832 available payloads 4623 + */ 4624 + uint32_t payloads[HWPM_IPMU_PAYLOAD_ARR_LEN]; 4625 + /** 4626 + * @brief Payload shift mask 4627 + * 4628 + * @note Setting the i-th shift bit will right-shift the 4629 + * i-th enabled payload by 1 bit. 4630 + * @note Up to a maximum of 64 simultaneous emitted payloads 4631 + */ 4632 + uint32_t shifts[HWPM_IPMU_SHIFT_ARR_LEN]; 4633 + } BPMP_ABI_PACKED; 4634 + 4635 + /** 4636 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_IPMU_GET_MAX_PAYLOADS 4637 + */ 4638 + struct cmd_hwpm_ipmu_get_max_payloads_req { 4639 + BPMP_ABI_EMPTY 4640 + } BPMP_ABI_PACKED; 4641 + 4642 + /** 4643 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_NVTHERM_SET_SAMPLE_RATE 4644 + */ 4645 + struct cmd_hwpm_nvtherm_set_sample_rate_req { 4646 + /** @brief Sample rate in microseconds 4647 + * 4648 + * @note Requesting a sample rate of 0 will disable NVTHERM streaming. 4649 + */ 4650 + uint32_t sample_rate; 4651 + } BPMP_ABI_PACKED; 4652 + 4653 + /** 4654 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_NVTHERM_SET_BUBBLE_INTERVAL 4655 + */ 4656 + struct cmd_hwpm_nvtherm_set_bubble_interval_req { 4657 + /** @brief Bubble interval in microseconds */ 4658 + uint32_t bubble_interval; 4659 + } BPMP_ABI_PACKED; 4660 + 4661 + /** 4662 + * @brief Maximum array length for NVTHERM flexible channel bitmask 4663 + */ 4664 + #define HWPM_NVTHERM_FLEX_CHANNEL_ARR_LEN 29U 4665 + 4666 + /** 4667 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_NVTHERM_SET_FLEX_CHANNELS 4668 + */ 4669 + struct cmd_hwpm_nvtherm_set_flex_channels_req { 4670 + /** @brief NVTHERM flexible channel bitmask 4671 + * 4672 + * @see #bpmp_nvtherm_flex_channel_ids 4673 + * 4674 + * @note Up to a maximum of 928 flexible channels 4675 + */ 4676 + uint32_t channels[HWPM_NVTHERM_FLEX_CHANNEL_ARR_LEN]; 4677 + } BPMP_ABI_PACKED; 4678 + 4679 + /** 4680 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_NAME 4681 + */ 4682 + struct cmd_hwpm_isense_get_sensor_name_req { 4683 + /** @brief Sensor ID from @ref bpmp_isense_sensor_ids */ 4684 + uint32_t sensor_id; 4685 + } BPMP_ABI_PACKED; 4686 + 4687 + /** 4688 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_CHANNEL 4689 + */ 4690 + struct cmd_hwpm_isense_get_sensor_channel_req { 4691 + /** @brief Sensor ID from @ref bpmp_isense_sensor_ids */ 4692 + uint32_t sensor_id; 4693 + } BPMP_ABI_PACKED; 4694 + 4695 + /** 4696 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_SCALE_FACTOR 4697 + */ 4698 + struct cmd_hwpm_isense_get_sensor_scale_factor_req { 4699 + /** @brief Sensor ID from @ref bpmp_isense_sensor_ids */ 4700 + uint32_t sensor_id; 4701 + } BPMP_ABI_PACKED; 4702 + 4703 + /** 4704 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_OFFSET 4705 + */ 4706 + struct cmd_hwpm_isense_get_sensor_offset_req { 4707 + /** @brief Sensor ID from @ref bpmp_isense_sensor_ids */ 4708 + uint32_t sensor_id; 4709 + } BPMP_ABI_PACKED; 4710 + 4711 + /** 4712 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SUM_BLOCK_NAME 4713 + */ 4714 + struct cmd_hwpm_isense_get_sum_block_name_req { 4715 + /** @brief Sum block index */ 4716 + uint32_t sum_block_index; 4717 + } BPMP_ABI_PACKED; 4718 + 4719 + /** 4720 + * @brief Request data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SUM_BLOCK_INPUTS 4721 + */ 4722 + struct cmd_hwpm_isense_get_sum_block_inputs_req { 4723 + /** @brief Sum block index */ 4724 + uint32_t sum_block_index; 4725 + } BPMP_ABI_PACKED; 4726 + 4727 + /** 4728 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_IPMU_GET_MAX_PAYLOADS 4729 + */ 4730 + struct cmd_hwpm_ipmu_get_max_payloads_resp { 4731 + /** @brief Maximum number of payloads */ 4732 + uint32_t max_payloads; 4733 + } BPMP_ABI_PACKED; 4734 + 4735 + /** 4736 + * @brief Maximum array length for ISENSE sensor name 4737 + */ 4738 + #define HWPM_ISENSE_SENSOR_MAX_NAME_LEN 64U 4739 + 4740 + /** 4741 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_NAME 4742 + */ 4743 + struct cmd_hwpm_isense_get_sensor_name_resp { 4744 + /** @brief Sensor name */ 4745 + char sensor_name[HWPM_ISENSE_SENSOR_MAX_NAME_LEN]; 4746 + } BPMP_ABI_PACKED; 4747 + 4748 + /** 4749 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_CHANNEL 4750 + */ 4751 + struct cmd_hwpm_isense_get_sensor_channel_resp { 4752 + /** @brief Physical channel index */ 4753 + uint32_t channel_index; 4754 + } BPMP_ABI_PACKED; 4755 + 4756 + /** 4757 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_SCALE_FACTOR 4758 + */ 4759 + struct cmd_hwpm_isense_get_sensor_scale_factor_resp { 4760 + /** @brief Scale factor */ 4761 + float scale_factor; 4762 + } BPMP_ABI_PACKED; 4763 + 4764 + /** 4765 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SENSOR_OFFSET 4766 + */ 4767 + struct cmd_hwpm_isense_get_sensor_offset_resp { 4768 + /** @brief Offset sensor ID */ 4769 + uint32_t offset_sensor_id; 4770 + } BPMP_ABI_PACKED; 4771 + 4772 + /** 4773 + * @brief Maximum array length for ISENSE sum name 4774 + */ 4775 + #define HWPM_ISENSE_SUM_BLOCK_MAX_NAME_LEN 64U 4776 + 4777 + /** 4778 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SUM_BLOCK_NAME 4779 + */ 4780 + struct cmd_hwpm_isense_get_sum_block_name_resp { 4781 + /** @brief Sum block name */ 4782 + char sum_block_name[HWPM_ISENSE_SUM_BLOCK_MAX_NAME_LEN]; 4783 + } BPMP_ABI_PACKED; 4784 + 4785 + /** 4786 + * @brief Maximum array length for ISENSE sum block input sensor IDs 4787 + */ 4788 + #define HWPM_ISENSE_SUM_BLOCK_INPUTS_MAX 16U 4789 + 4790 + /** 4791 + * @brief Response data for #MRQ_HWPM sub-command #CMD_HWPM_ISENSE_GET_SUM_BLOCK_INPUTS 4792 + */ 4793 + struct cmd_hwpm_isense_get_sum_block_inputs_resp { 4794 + /** @brief Input channel indices; negative if no input is applied */ 4795 + int32_t input_channel_idx[HWPM_ISENSE_SUM_BLOCK_INPUTS_MAX]; 4796 + } BPMP_ABI_PACKED; 4797 + 4798 + /** 4799 + * @brief Request payload for the #MRQ_HWPM -command 4800 + * 4801 + * | Sub-command | Request payload | 4802 + * | ---------------------------------------- | -------------------------------------------- | 4803 + * | #CMD_HWPM_QUERY_ABI | #cmd_hwpm_query_abi_req | 4804 + * | #CMD_HWPM_IPMU_SET_TRIGGERS | #cmd_hwpm_ipmu_set_triggers_req | 4805 + * | #CMD_HWPM_IPMU_SET_PAYLOADS_SHIFTS | #cmd_hwpm_ipmu_set_payloads_shifts_req | 4806 + * | #CMD_HWPM_IPMU_GET_MAX_PAYLOADS | #cmd_hwpm_ipmu_get_max_payloads_req | 4807 + * | #CMD_HWPM_NVTHERM_SET_SAMPLE_RATE | #cmd_hwpm_nvtherm_set_sample_rate_req | 4808 + * | #CMD_HWPM_NVTHERM_SET_BUBBLE_INTERVAL | #cmd_hwpm_nvtherm_set_bubble_interval_req | 4809 + * | #CMD_HWPM_NVTHERM_SET_FLEX_CHANNELS | #cmd_hwpm_nvtherm_set_flex_channels_req | 4810 + * | #CMD_HWPM_ISENSE_GET_SENSOR_CHANNEL | #cmd_hwpm_isense_get_sensor_channel_req | 4811 + * | #CMD_HWPM_ISENSE_GET_SENSOR_SCALE_FACTOR | #cmd_hwpm_isense_get_sensor_scale_factor_req | 4812 + * | #CMD_HWPM_ISENSE_GET_SENSOR_OFFSET | #cmd_hwpm_isense_get_sensor_offset_req | 4813 + * | #CMD_HWPM_ISENSE_GET_SUM_BLOCK_NAME | #cmd_hwpm_isense_get_sum_block_name_req | 4814 + * | #CMD_HWPM_ISENSE_GET_SUM_BLOCK_INPUTS | #cmd_hwpm_isense_get_sum_block_inputs_req | 4815 + */ 4816 + struct mrq_hwpm_request { 4817 + uint32_t cmd; 4818 + union { 4819 + struct cmd_hwpm_query_abi_req query_abi; 4820 + struct cmd_hwpm_ipmu_set_triggers_req ipmu_set_triggers; 4821 + struct cmd_hwpm_ipmu_set_payloads_shifts_req ipmu_set_payloads_shifts; 4822 + struct cmd_hwpm_ipmu_get_max_payloads_req ipmu_get_max_payloads; 4823 + struct cmd_hwpm_nvtherm_set_sample_rate_req nvtherm_set_sample_rate; 4824 + struct cmd_hwpm_nvtherm_set_bubble_interval_req nvtherm_set_bubble_interval; 4825 + struct cmd_hwpm_nvtherm_set_flex_channels_req nvtherm_set_flex_channels; 4826 + struct cmd_hwpm_isense_get_sensor_name_req isense_get_sensor_name; 4827 + struct cmd_hwpm_isense_get_sensor_channel_req isense_get_sensor_channel; 4828 + struct cmd_hwpm_isense_get_sensor_scale_factor_req isense_get_sensor_scale_factor; 4829 + struct cmd_hwpm_isense_get_sensor_offset_req isense_get_sensor_offset; 4830 + struct cmd_hwpm_isense_get_sum_block_name_req isense_get_sum_block_name; 4831 + struct cmd_hwpm_isense_get_sum_block_inputs_req isense_get_sum_block_inputs; 4832 + } BPMP_UNION_ANON; 4833 + } BPMP_ABI_PACKED; 4834 + 4835 + /** 4836 + * @brief Response payload for the #MRQ_HWPM -command 4837 + * 4838 + * | Sub-command | Response payload | 4839 + * | ---------------------------------------- | --------------------------------------------- | 4840 + * | #CMD_HWPM_QUERY_ABI | - | 4841 + * | #CMD_HWPM_IPMU_SET_TRIGGERS | - | 4842 + * | #CMD_HWPM_IPMU_SET_PAYLOADS_SHIFTS | - | 4843 + * | #CMD_HWPM_IPMU_GET_MAX_PAYLOADS | #cmd_hwpm_ipmu_get_max_payloads_resp | 4844 + * | #CMD_HWPM_NVTHERM_SET_SAMPLE_RATE | - | 4845 + * | #CMD_HWPM_NVTHERM_SET_BUBBLE_INTERVAL | - | 4846 + * | #CMD_HWPM_NVTHERM_SET_FLEX_CHANNELS | - | 4847 + * | #CMD_HWPM_ISENSE_GET_SENSOR_NAME | #cmd_hwpm_isense_get_sensor_name_resp | 4848 + * | #CMD_HWPM_ISENSE_GET_SENSOR_CHANNEL | #cmd_hwpm_isense_get_sensor_channel_resp | 4849 + * | #CMD_HWPM_ISENSE_GET_SENSOR_SCALE_FACTOR | #cmd_hwpm_isense_get_sensor_scale_factor_resp | 4850 + * | #CMD_HWPM_ISENSE_GET_SENSOR_OFFSET | #cmd_hwpm_isense_get_sensor_offset_resp | 4851 + * | #CMD_HWPM_ISENSE_GET_SUM_BLOCK_NAME | #cmd_hwpm_isense_get_sum_block_name_resp | 4852 + * | #CMD_HWPM_ISENSE_GET_SUM_BLOCK_INPUTS | #cmd_hwpm_isense_get_sum_block_inputs_resp | 4853 + */ 4854 + struct mrq_hwpm_response { 4855 + uint32_t err; 4856 + union { 4857 + struct cmd_hwpm_ipmu_get_max_payloads_resp ipmu_get_max_payloads; 4858 + struct cmd_hwpm_isense_get_sensor_name_resp isense_get_sensor_name; 4859 + struct cmd_hwpm_isense_get_sensor_channel_resp isense_get_sensor_channel; 4860 + struct cmd_hwpm_isense_get_sensor_scale_factor_resp isense_get_sensor_scale_factor; 4861 + struct cmd_hwpm_isense_get_sensor_offset_resp isense_get_sensor_offset; 4862 + struct cmd_hwpm_isense_get_sum_block_name_resp isense_get_sum_block_name; 4863 + struct cmd_hwpm_isense_get_sum_block_inputs_resp isense_get_sum_block_inputs; 4864 + } BPMP_UNION_ANON; 4865 + } BPMP_ABI_PACKED; 4866 + 4867 + /** @} HWPM */ 4868 + /** @endcond */ 4869 + 4870 + /** @cond (bpmp_tb500) 4871 + * @ingroup MRQ_Codes 4872 + * @def MRQ_DVFS 4873 + * @brief Configure DVFS functionality 4874 + * 4875 + * * Initiators: CCPLEX 4876 + * * Targets: BPMP 4877 + * * Request Payload: @ref mrq_dvfs_request 4878 + * 4879 + * @addtogroup DVFS 4880 + * @{ 4881 + */ 4882 + 4883 + /** 4884 + * @brief Sub-command identifiers for #MRQ_DVFS. 4885 + */ 4886 + enum mrq_dvfs_cmd { 4887 + /** 4888 + * @brief Check whether the BPMP-FW supports the specified 4889 + * #MRQ_DVFS sub-command. 4890 + * 4891 + * mrq_response:err is 0 if the specified request is 4892 + * supported and -#BPMP_ENODEV otherwise. 4893 + */ 4894 + CMD_DVFS_QUERY_ABI = 1, 4895 + 4896 + /** 4897 + * @brief Configure DVFS controller 4898 + * 4899 + * mrq_response:err is defined as: 4900 + * 4901 + * | Value | Description | 4902 + * | -------------- | ------------------------------------------- | 4903 + * | 0 | Success | 4904 + * | -#BPMP_ENODEV | #MRQ_DVFS is not supported by BPMP-FW. | 4905 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4906 + * | -#BPMP_EINVAL | Invalid request parameters. | 4907 + */ 4908 + CMD_DVFS_SET_CTRL_STATE = 2, 4909 + 4910 + /** 4911 + * @brief Configure DVFS manager 4912 + * 4913 + * mrq_response:err is defined as: 4914 + * 4915 + * | Value | Description | 4916 + * | -------------- | ------------------------------------------- | 4917 + * | 0 | Success | 4918 + * | -#BPMP_ENODEV | #MRQ_DVFS is not supported by BPMP-FW. | 4919 + * | -#BPMP_ENOTSUP | Subcommand is not supported by BPMP-FW. | 4920 + * | -#BPMP_EINVAL | Invalid request parameters. | 4921 + */ 4922 + CMD_DVFS_SET_MGR_STATE = 3, 4923 + 4924 + /** 4925 + * @brief Largest supported #MRQ_DVFS sub-command identifier + 1 4926 + */ 4927 + CMD_DVFS_MAX, 4928 + }; 4929 + 4930 + /** 4931 + * @brief Request data for #MRQ_DVFS sub-command #CMD_DVFS_QUERY_ABI 4932 + */ 4933 + struct cmd_dvfs_query_abi_req { 4934 + /** @brief Sub-command identifier from @ref mrq_dvfs_cmd */ 4935 + uint32_t cmd_code; 4936 + } BPMP_ABI_PACKED; 4937 + 4938 + struct cmd_dvfs_set_ctrl_state_req { 4939 + /** @brief Controller ID from @ref bpmp_dvfs_ctrl_ids */ 4940 + uint32_t ctrl_id; 4941 + /** @brief Controller enable state */ 4942 + uint32_t enable; 4943 + } BPMP_ABI_PACKED; 4944 + 4945 + struct cmd_dvfs_set_mgr_state_req { 4946 + /** @brief Manager ID from @ref bpmp_dvfs_mgr_ids */ 4947 + uint32_t mgr_id; 4948 + /** @brief Manager enable state */ 4949 + uint32_t enable; 4950 + } BPMP_ABI_PACKED; 4951 + 4952 + /** 4953 + * @brief Request payload for the #MRQ_DVFS -command 4954 + * 4955 + * | Sub-command | Request payload | 4956 + * | ---------------------------------------- | -------------------------------------------- | 4957 + * | #CMD_DVFS_QUERY_ABI | #cmd_dvfs_query_abi_req | 4958 + * | #CMD_DVFS_SET_CTRL_STATE | #cmd_dvfs_set_ctrl_state_req | 4959 + * | #CMD_DVFS_SET_MGR_STATE | #cmd_dvfs_set_mgr_state_req | 4960 + */ 4961 + struct mrq_dvfs_request { 4962 + uint32_t cmd; 4963 + union { 4964 + struct cmd_dvfs_query_abi_req query_abi; 4965 + struct cmd_dvfs_set_ctrl_state_req set_ctrl_state; 4966 + struct cmd_dvfs_set_mgr_state_req set_mgr_state; 4967 + } BPMP_UNION_ANON; 4968 + } BPMP_ABI_PACKED; 4969 + 4970 + /** @} DVFS */ 4971 + /** @endcond */ 4972 + 4973 + /** @cond (bpmp_tb500) 4974 + * @ingroup MRQ_Codes 4975 + * @def MRQ_PPP_PROFILE 4976 + * @brief Get power/performance profile configuration settings. 4977 + * 4978 + * * Initiators: Any 4979 + * * Targets: BPMP 4980 + * * Request Payload: @ref mrq_ppp_profile_request 4981 + * * Response Payload: @ref mrq_ppp_profile_response 4982 + * 4983 + * @addtogroup PPP 4984 + * @{ 4985 + */ 4986 + 4987 + /** 4988 + * @brief Sub-command identifiers for #MRQ_PPP_PROFILE. 4989 + */ 4990 + enum mrq_ppp_profile_cmd { 4991 + /** 4992 + * @brief Check whether the BPMP-FW supports the specified 4993 + * #MRQ_PPP_PROFILE sub-command. 4994 + * 4995 + * mrq_ppp_profile_response:err is 0 if the specified request is 4996 + * supported and -#BPMP_ENOTSUP otherwise. 4997 + */ 4998 + 4999 + CMD_PPP_PROFILE_QUERY_ABI = 0, 5000 + /** 5001 + * @brief Query the BPMP for the CPU core and SLC slice configuration associated 5002 + * with a given Power/Performance Profile (PPP). 5003 + * 5004 + * mrq_ppp_profile_response:err is defined as: 5005 + * 5006 + * | Value | Description | 5007 + * |----------------|------------------------------------------------| 5008 + * | 0 | Success | 5009 + * | -#BPMP_ENOTSUP | #MRQ_PPP_PROFILE is not supported by BPMP-FW. | 5010 + * | -#BPMP_EINVAL | Invalid request parameters. | 5011 + */ 5012 + CMD_PPP_PROFILE_QUERY_MASKS = 1, 5013 + /** 5014 + * @brief Query BPMP for the CPU mask corresponding to a requested 5015 + * number of active CPU cores. 5016 + * 5017 + * mrq_ppp_profile_response:err is defined as: 5018 + * 5019 + * | Value | Description | 5020 + * |----------------|------------------------------------------------| 5021 + * | 0 | Success | 5022 + * | -#BPMP_ENOTSUP | #MRQ_PPP_PROFILE is not supported by BPMP-FW. | 5023 + * | -#BPMP_EINVAL | Invalid request parameters. | 5024 + */ 5025 + CMD_PPP_CORE_QUERY_CPU_MASK = 2, 5026 + /** 5027 + * @brief Query BPMP-FW for the currently available Power/Performance Profiles. 5028 + * 5029 + * mrq_ppp_profile_response:err is defined as: 5030 + * 5031 + * | Value | Description | 5032 + * |----------------|------------------------------------------------| 5033 + * | 0 | Success | 5034 + * | -#BPMP_ENOTSUP | #MRQ_PPP_PROFILE is not supported by BPMP-FW. | 5035 + * | -#BPMP_EINVAL | Invalid request parameters. | 5036 + */ 5037 + CMD_PPP_AVAILABLE_QUERY = 3, 5038 + }; 5039 + 5040 + /** 5041 + * @brief Request data for #MRQ_PPP_PROFILE sub-command 5042 + * #CMD_PPP_PROFILE_QUERY_ABI 5043 + */ 5044 + struct cmd_ppp_profile_query_abi_req { 5045 + /** @brief Sub-command identifier from @ref mrq_ppp_profile_cmd */ 5046 + uint32_t cmd_code; 5047 + } BPMP_ABI_PACKED; 5048 + 5049 + /** 5050 + * @brief Response data for #MRQ_PPP_PROFILE sub-command 5051 + * #CMD_PPP_AVAILABLE_QUERY 5052 + */ 5053 + struct cmd_ppp_available_query_resp { 5054 + /** 5055 + * @brief Bitmask of available profiles. 5056 + * Bit N = 1 ⇒ profile N is available 5057 + */ 5058 + uint32_t avail_ppp_mask; 5059 + } BPMP_ABI_PACKED; 5060 + 5061 + /** 5062 + * @brief Request data for #MRQ_PPP_PROFILE sub-command 5063 + * #CMD_PPP_PROFILE_QUERY_MASKS 5064 + */ 5065 + struct cmd_ppp_profile_query_masks_req { 5066 + /** @brief power/perf profile identifier */ 5067 + uint32_t profile_id; 5068 + } BPMP_ABI_PACKED; 5069 + 5070 + /** 5071 + * @brief Response payload for #MRQ_PPP_PROFILE sub-command 5072 + * #CMD_PPP_PROFILE_QUERY_MASKS 5073 + */ 5074 + struct cmd_ppp_profile_query_masks_resp { 5075 + /** @brief Enabled cores in this profile */ 5076 + uint32_t num_active_cores; 5077 + /** @brief Enabled SLC slices in this profile */ 5078 + uint32_t num_active_slcs; 5079 + /** @brief Number of valid words in active_core_masks array */ 5080 + uint32_t max_num_core_words; 5081 + /** @brief Number of valid words in active_slc_masks array */ 5082 + uint32_t max_num_slc_words; 5083 + /** @brief Enabled cores bit mask (bit N = 1 => core N enabled) */ 5084 + uint32_t active_core_masks[8]; 5085 + /** @brief Enabled SLC slices bit mask (bit N = 1 => SLC slice N enabled) */ 5086 + uint32_t active_slc_masks[8]; 5087 + } BPMP_ABI_PACKED; 5088 + 5089 + /** 5090 + * @brief Request data for #MRQ_PPP_PROFILE sub-command 5091 + * #CMD_PPP_CORE_QUERY_CPU_MASK 5092 + */ 5093 + struct cmd_ppp_core_query_cpu_mask_req { 5094 + /** @brief Requested number of active cores */ 5095 + uint32_t num_cores; 5096 + } BPMP_ABI_PACKED; 5097 + 5098 + /** 5099 + * @brief Response data for #MRQ_PPP_PROFILE sub-command 5100 + * #CMD_PPP_CORE_QUERY_CPU_MASK 5101 + */ 5102 + struct cmd_ppp_core_query_cpu_mask_resp { 5103 + /** @brief Number of valid words in active_core_masks array */ 5104 + uint32_t max_num_words; 5105 + /** @brief Enabled CPU core bitmask (bit N = 1 ⇒ core N enabled) */ 5106 + uint32_t active_core_masks[8]; 5107 + } BPMP_ABI_PACKED; 5108 + 5109 + /** 5110 + * @brief Request payload for the #MRQ_PPP_PROFILE -command 5111 + * 5112 + * | Sub-command | Request payload | 5113 + * |-------------------------------|----------------------------------------| 5114 + * | #CMD_PPP_PROFILE_QUERY_ABI | #cmd_ppp_profile_query_abi_req | 5115 + * | #CMD_PPP_PROFILE_QUERY_MASKS | #cmd_ppp_profile_query_masks_req | 5116 + * | #CMD_PPP_CORE_QUERY_CPU_MASK | #cmd_ppp_core_query_cpu_mask_req | 5117 + * | #CMD_PPP_AVAILABLE_QUERY | - | 5118 + */ 5119 + struct mrq_ppp_profile_request { 5120 + /** @brief Sub-command ID from @ref mrq_ppp_profile_cmd. */ 5121 + uint32_t cmd; 5122 + union { 5123 + struct cmd_ppp_profile_query_abi_req query_abi; 5124 + struct cmd_ppp_profile_query_masks_req ppp_profile_masks_req; 5125 + struct cmd_ppp_core_query_cpu_mask_req ppp_core_mask_req; 5126 + } BPMP_UNION_ANON; 5127 + } BPMP_ABI_PACKED; 5128 + 5129 + /** 5130 + * @brief Response payload for the #MRQ_PPP_PROFILE -command. 5131 + * 5132 + * | Sub-command | Response payload | 5133 + * |-------------------------------|----------------------------------------| 5134 + * | #CMD_PPP_PROFILE_QUERY_ABI | - | 5135 + * | #CMD_PPP_PROFILE_QUERY_MASKS | #cmd_ppp_profile_query_masks_resp | 5136 + * | #CMD_PPP_CORE_QUERY_CPU_MASK | #cmd_ppp_core_query_cpu_mask_resp | 5137 + * | #CMD_PPP_AVAILABLE_QUERY | #cmd_ppp_available_query_resp | 5138 + */ 5139 + struct mrq_ppp_profile_response { 5140 + uint32_t err; 5141 + union { 5142 + struct cmd_ppp_profile_query_masks_resp ppp_profile_masks_resp; 5143 + struct cmd_ppp_core_query_cpu_mask_resp ppp_core_mask_resp; 5144 + struct cmd_ppp_available_query_resp ppp_avail_query_resp; 5145 + } BPMP_UNION_ANON; 5146 + } BPMP_ABI_PACKED; 5147 + 5148 + /** @} PPP */ 5149 + /** @endcond */ 5451 5150 5452 5151 /** 5453 5152 * @addtogroup Error_Codes ··· 6728 3953 #define BPMP_ENOSYS 38 6729 3954 /** @brief Invalid slot */ 6730 3955 #define BPMP_EBADSLT 57 3956 + /** @brief No data */ 3957 + #define BPMP_ENODATA 61 6731 3958 /** @brief Invalid message */ 6732 3959 #define BPMP_EBADMSG 77 6733 3960 /** @brief Operation not supported */