Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _HFI_DEFS_H_ |
| 14 | #define _HFI_DEFS_H_ |
| 15 | |
| 16 | #include <linux/types.h> |
| 17 | |
| 18 | /* |
| 19 | * Following base acts as common starting points |
| 20 | * for all enumerations. |
| 21 | */ |
| 22 | #define HFI_COMMON_BASE 0x0 |
| 23 | |
| 24 | /* HFI Domain base offset for commands and messages */ |
| 25 | #define HFI_DOMAIN_SHFT (24) |
| 26 | #define HFI_DOMAIN_BMSK (0x7 << HFI_DOMAIN_SHFT) |
| 27 | #define HFI_DOMAIN_BASE_ICP (0x0 << HFI_DOMAIN_SHFT) |
| 28 | #define HFI_DOMAIN_BASE_IPE_BPS (0x1 << HFI_DOMAIN_SHFT) |
| 29 | #define HFI_DOMAIN_BASE_CDM (0x2 << HFI_DOMAIN_SHFT) |
| 30 | #define HFI_DOMAIN_BASE_DBG (0x3 << HFI_DOMAIN_SHFT) |
| 31 | |
| 32 | /* Command base offset for commands */ |
| 33 | #define HFI_CMD_START_OFFSET 0x10000 |
| 34 | |
| 35 | /* Command base offset for messages */ |
| 36 | #define HFI_MSG_START_OFFSET 0x20000 |
| 37 | |
| 38 | /* System Level Error types */ |
| 39 | #define HFI_ERR_SYS_NONE (HFI_COMMON_BASE) |
| 40 | #define HFI_ERR_SYS_FATAL (HFI_COMMON_BASE + 0x1) |
| 41 | #define HFI_ERR_SYS_VERSION_MISMATCH (HFI_COMMON_BASE + 0x2) |
| 42 | #define HFI_ERR_SYS_UNSUPPORTED_DOMAIN (HFI_COMMON_BASE + 0x3) |
| 43 | #define HFI_ERR_SYS_UNSUPPORT_CMD (HFI_COMMON_BASE + 0x4) |
| 44 | #define HFI_ERR_SYS_CMDFAILED (HFI_COMMON_BASE + 0x5) |
| 45 | #define HFI_ERR_SYS_CMDSIZE (HFI_COMMON_BASE + 0x6) |
| 46 | |
| 47 | /* System Level Event types */ |
| 48 | #define HFI_EVENT_SYS_ERROR (HFI_COMMON_BASE + 0x1) |
| 49 | #define HFI_EVENT_ICP_ERROR (HFI_COMMON_BASE + 0x2) |
| 50 | #define HFI_EVENT_IPE_BPS_ERROR (HFI_COMMON_BASE + 0x3) |
| 51 | #define HFI_EVENT_CDM_ERROR (HFI_COMMON_BASE + 0x4) |
| 52 | #define HFI_EVENT_DBG_ERROR (HFI_COMMON_BASE + 0x5) |
| 53 | |
| 54 | /* Core level start Ranges for errors */ |
| 55 | #define HFI_ERR_ICP_START (HFI_COMMON_BASE + 0x64) |
| 56 | #define HFI_ERR_IPE_BPS_START (HFI_ERR_ICP_START + 0x64) |
| 57 | #define HFI_ERR_CDM_START (HFI_ERR_IPE_BPS_START + 0x64) |
| 58 | #define HFI_ERR_DBG_START (HFI_ERR_CDM_START + 0x64) |
| 59 | |
| 60 | /*ICP Core level error messages */ |
| 61 | #define HFI_ERR_NO_RES (HFI_ERR_ICP_START + 0x1) |
| 62 | #define HFI_ERR_UNSUPPORTED_RES (HFI_ERR_ICP_START + 0x2) |
| 63 | #define HFI_ERR_UNSUPPORTED_PROP (HFI_ERR_ICP_START + 0x3) |
| 64 | #define HFI_ERR_INIT_EXPECTED (HFI_ERR_ICP_START + 0x4) |
| 65 | #define HFI_ERR_INIT_IGNORED (HFI_ERR_ICP_START + 0x5) |
| 66 | |
| 67 | /* System level commands */ |
| 68 | #define HFI_CMD_COMMON_START \ |
| 69 | (HFI_DOMAIN_BASE_ICP + HFI_CMD_START_OFFSET + 0x0) |
| 70 | #define HFI_CMD_SYS_INIT (HFI_CMD_COMMON_START + 0x1) |
| 71 | #define HFI_CMD_SYS_PC_PREP (HFI_CMD_COMMON_START + 0x2) |
| 72 | #define HFI_CMD_SYS_SET_PROPERTY (HFI_CMD_COMMON_START + 0x3) |
| 73 | #define HFI_CMD_SYS_GET_PROPERTY (HFI_CMD_COMMON_START + 0x4) |
| 74 | #define HFI_CMD_SYS_PING (HFI_CMD_COMMON_START + 0x5) |
| 75 | #define HFI_CMD_SYS_RESET (HFI_CMD_COMMON_START + 0x6) |
| 76 | |
| 77 | /* Core level commands */ |
| 78 | /* IPE/BPS core Commands */ |
| 79 | #define HFI_CMD_IPE_BPS_COMMON_START \ |
| 80 | (HFI_DOMAIN_BASE_IPE_BPS + HFI_CMD_START_OFFSET + 0x0) |
| 81 | #define HFI_CMD_IPEBPS_CREATE_HANDLE \ |
| 82 | (HFI_CMD_IPE_BPS_COMMON_START + 0x8) |
| 83 | #define HFI_CMD_IPEBPS_ASYNC_COMMAND_DIRECT \ |
| 84 | (HFI_CMD_IPE_BPS_COMMON_START + 0xa) |
| 85 | #define HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT \ |
| 86 | (HFI_CMD_IPE_BPS_COMMON_START + 0xe) |
| 87 | |
| 88 | /* CDM core Commands */ |
| 89 | #define HFI_CMD_CDM_COMMON_START \ |
| 90 | (HFI_DOMAIN_BASE_CDM + HFI_CMD_START_OFFSET + 0x0) |
| 91 | #define HFI_CMD_CDM_TEST_START (HFI_CMD_CDM_COMMON_START + 0x800) |
| 92 | #define HFI_CMD_CDM_END (HFI_CMD_CDM_COMMON_START + 0xFFF) |
| 93 | |
| 94 | /* Debug/Test Commands */ |
| 95 | #define HFI_CMD_DBG_COMMON_START \ |
| 96 | (HFI_DOMAIN_BASE_DBG + HFI_CMD_START_OFFSET + 0x0) |
| 97 | #define HFI_CMD_DBG_TEST_START (HFI_CMD_DBG_COMMON_START + 0x800) |
| 98 | #define HFI_CMD_DBG_END (HFI_CMD_DBG_COMMON_START + 0xFFF) |
| 99 | |
| 100 | /* System level messages */ |
| 101 | #define HFI_MSG_ICP_COMMON_START \ |
| 102 | (HFI_DOMAIN_BASE_ICP + HFI_MSG_START_OFFSET + 0x0) |
| 103 | #define HFI_MSG_SYS_INIT_DONE (HFI_MSG_ICP_COMMON_START + 0x1) |
| 104 | #define HFI_MSG_SYS_PC_PREP_DONE (HFI_MSG_ICP_COMMON_START + 0x2) |
| 105 | #define HFI_MSG_SYS_DEBUG (HFI_MSG_ICP_COMMON_START + 0x3) |
| 106 | #define HFI_MSG_SYS_IDLE (HFI_MSG_ICP_COMMON_START + 0x4) |
| 107 | #define HFI_MSG_SYS_PROPERTY_INFO (HFI_MSG_ICP_COMMON_START + 0x5) |
| 108 | #define HFI_MSG_SYS_PING_ACK (HFI_MSG_ICP_COMMON_START + 0x6) |
| 109 | #define HFI_MSG_SYS_RESET_ACK (HFI_MSG_ICP_COMMON_START + 0x7) |
| 110 | #define HFI_MSG_EVENT_NOTIFY (HFI_MSG_ICP_COMMON_START + 0x8) |
| 111 | |
| 112 | /* Core level Messages */ |
| 113 | /* IPE/BPS core Messages */ |
| 114 | #define HFI_MSG_IPE_BPS_COMMON_START \ |
| 115 | (HFI_DOMAIN_BASE_IPE_BPS + HFI_MSG_START_OFFSET + 0x0) |
| 116 | #define HFI_MSG_IPEBPS_CREATE_HANDLE_ACK \ |
| 117 | (HFI_MSG_IPE_BPS_COMMON_START + 0x08) |
| 118 | #define HFI_MSG_IPEBPS_ASYNC_COMMAND_DIRECT_ACK \ |
| 119 | (HFI_MSG_IPE_BPS_COMMON_START + 0x0a) |
| 120 | #define HFI_MSG_IPEBPS_ASYNC_COMMAND_INDIRECT_ACK \ |
| 121 | (HFI_MSG_IPE_BPS_COMMON_START + 0x0e) |
| 122 | #define HFI_MSG_IPE_BPS_TEST_START \ |
| 123 | (HFI_MSG_IPE_BPS_COMMON_START + 0x800) |
| 124 | #define HFI_MSG_IPE_BPS_END \ |
| 125 | (HFI_MSG_IPE_BPS_COMMON_START + 0xFFF) |
| 126 | |
| 127 | /* CDM core Messages */ |
| 128 | #define HFI_MSG_CDM_COMMON_START \ |
| 129 | (HFI_DOMAIN_BASE_CDM + HFI_MSG_START_OFFSET + 0x0) |
| 130 | #define HFI_MSG_PRI_CDM_PAYLOAD_ACK (HFI_MSG_CDM_COMMON_START + 0xa) |
| 131 | #define HFI_MSG_PRI_LLD_PAYLOAD_ACK (HFI_MSG_CDM_COMMON_START + 0xb) |
| 132 | #define HFI_MSG_CDM_TEST_START (HFI_MSG_CDM_COMMON_START + 0x800) |
| 133 | #define HFI_MSG_CDM_END (HFI_MSG_CDM_COMMON_START + 0xFFF) |
| 134 | |
| 135 | /* core level test command ranges */ |
| 136 | /* ICP core level test command range */ |
| 137 | #define HFI_CMD_ICP_TEST_START (HFI_CMD_ICP_COMMON_START + 0x800) |
| 138 | #define HFI_CMD_ICP_END (HFI_CMD_ICP_COMMON_START + 0xFFF) |
| 139 | |
| 140 | /* IPE/BPS core level test command range */ |
| 141 | #define HFI_CMD_IPE_BPS_TEST_START \ |
| 142 | (HFI_CMD_IPE_BPS_COMMON_START + 0x800) |
| 143 | #define HFI_CMD_IPE_BPS_END (HFI_CMD_IPE_BPS_COMMON_START + 0xFFF) |
| 144 | |
| 145 | /* ICP core level test message range */ |
| 146 | #define HFI_MSG_ICP_TEST_START (HFI_MSG_ICP_COMMON_START + 0x800) |
| 147 | #define HFI_MSG_ICP_END (HFI_MSG_ICP_COMMON_START + 0xFFF) |
| 148 | |
| 149 | /* ICP core level Debug test message range */ |
| 150 | #define HFI_MSG_DBG_COMMON_START \ |
| 151 | (HFI_DOMAIN_BASE_DBG + 0x0) |
| 152 | #define HFI_MSG_DBG_TEST_START (HFI_MSG_DBG_COMMON_START + 0x800) |
| 153 | #define HFI_MSG_DBG_END (HFI_MSG_DBG_COMMON_START + 0xFFF) |
| 154 | |
| 155 | /* System level property base offset */ |
| 156 | #define HFI_PROPERTY_ICP_COMMON_START (HFI_DOMAIN_BASE_ICP + 0x0) |
| 157 | |
| 158 | #define HFI_PROP_SYS_DEBUG_CFG (HFI_PROPERTY_ICP_COMMON_START + 0x1) |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 159 | #define HFI_PROP_SYS_UBWC_CFG (HFI_PROPERTY_ICP_COMMON_START + 0x2) |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 160 | #define HFI_PROP_SYS_IMAGE_VER (HFI_PROPERTY_ICP_COMMON_START + 0x3) |
| 161 | #define HFI_PROP_SYS_SUPPORTED (HFI_PROPERTY_ICP_COMMON_START + 0x4) |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 162 | #define HFI_PROP_SYS_IPEBPS_PC (HFI_PROPERTY_ICP_COMMON_START + 0x5) |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 163 | |
| 164 | /* Capabilities reported at sys init */ |
| 165 | #define HFI_CAPS_PLACEHOLDER_1 (HFI_COMMON_BASE + 0x1) |
| 166 | #define HFI_CAPS_PLACEHOLDER_2 (HFI_COMMON_BASE + 0x2) |
| 167 | |
| 168 | /* Section describes different debug levels (HFI_DEBUG_MSG_X) |
| 169 | * available for debug messages from FW |
| 170 | */ |
| 171 | #define HFI_DEBUG_MSG_LOW 0x00000001 |
| 172 | #define HFI_DEBUG_MSG_MEDIUM 0x00000002 |
| 173 | #define HFI_DEBUG_MSG_HIGH 0x00000004 |
| 174 | #define HFI_DEBUG_MSG_ERROR 0x00000008 |
| 175 | #define HFI_DEBUG_MSG_FATAL 0x00000010 |
| 176 | /* Messages containing performance data */ |
| 177 | #define HFI_DEBUG_MSG_PERF 0x00000020 |
| 178 | /* Disable ARM9 WFI in low power mode. */ |
| 179 | #define HFI_DEBUG_CFG_WFI 0x01000000 |
| 180 | /* Disable ARM9 watchdog. */ |
| 181 | #define HFI_DEBUG_CFG_ARM9WD 0x10000000 |
| 182 | |
| 183 | /* Debug Msg Communication types: |
| 184 | * Section describes different modes (HFI_DEBUG_MODE_X) |
| 185 | * available to communicate the debug messages |
| 186 | */ |
| 187 | /* Debug message output through the interface debug queue. */ |
| 188 | #define HFI_DEBUG_MODE_QUEUE 0x00000001 |
| 189 | /* Debug message output through QDSS. */ |
| 190 | #define HFI_DEBUG_MODE_QDSS 0x00000002 |
| 191 | |
| 192 | |
| 193 | #define HFI_DEBUG_MSG_LOW 0x00000001 |
| 194 | #define HFI_DEBUG_MSG_MEDIUM 0x00000002 |
| 195 | #define HFI_DEBUG_MSG_HIGH 0x00000004 |
| 196 | #define HFI_DEBUG_MSG_ERROR 0x00000008 |
| 197 | #define HFI_DEBUG_MSG_FATAL 0x00000010 |
| 198 | #define HFI_DEBUG_MSG_PERF 0x00000020 |
| 199 | #define HFI_DEBUG_CFG_WFI 0x01000000 |
| 200 | #define HFI_DEBUG_CFG_ARM9WD 0x10000000 |
| 201 | |
| 202 | #define HFI_DEBUG_MODE_QUEUE 0x00000001 |
| 203 | #define HFI_DEBUG_MODE_QDSS 0x00000002 |
| 204 | |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 205 | #define HFI_DEV_VERSION_MAX 0x5 |
| 206 | |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 207 | /** |
| 208 | * start of sys command packet types |
| 209 | * These commands are used to get system level information |
| 210 | * from firmware |
| 211 | */ |
| 212 | |
| 213 | /** |
| 214 | * struct hfi_caps_support |
| 215 | * payload to report caps through HFI_PROPERTY_PARAM_CAPABILITY_SUPPORTED |
| 216 | * @type: capability type |
| 217 | * @min: minimum supported value for the capability |
| 218 | * @max: maximum supported value for the capability |
| 219 | * @step_size: supported steps between min-max |
| 220 | */ |
| 221 | struct hfi_caps_support { |
| 222 | uint32_t type; |
| 223 | uint32_t min; |
| 224 | uint32_t max; |
| 225 | uint32_t step_size; |
| 226 | } __packed; |
| 227 | |
| 228 | /** |
| 229 | * struct hfi_caps_support_info |
| 230 | * capability report through HFI_PROPERTY_PARAM_CAPABILITY_SUPPORTED |
| 231 | * @num_caps: number of capabilities listed |
| 232 | * @caps_data: capabilities info array |
| 233 | */ |
| 234 | struct hfi_caps_support_info { |
| 235 | uint32_t num_caps; |
| 236 | struct hfi_caps_support caps_data[1]; |
| 237 | } __packed; |
| 238 | |
| 239 | /** |
| 240 | * struct hfi_debug |
| 241 | * payload structure to configure HFI_PROPERTY_SYS_DEBUG_CONFIG |
| 242 | * @debug_config: it is a result of HFI_DEBUG_MSG_X values that |
| 243 | * are OR-ed together to specify the debug message types |
| 244 | * to otput |
| 245 | * @debug_mode: debug message output through debug queue/qdss |
| 246 | * @HFI_PROPERTY_SYS_DEBUG_CONFIG |
| 247 | */ |
| 248 | struct hfi_debug { |
| 249 | uint32_t debug_config; |
| 250 | uint32_t debug_mode; |
| 251 | } __packed; |
| 252 | |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 253 | /** |
| 254 | * struct hfi_ipe_bps_pc |
| 255 | * payload structure to configure HFI_PROPERTY_SYS_IPEBPS_PC |
| 256 | * @enable: Flag to enable IPE, BPS interfrane power collapse |
Alok Pandey | 78093d3 | 2017-11-08 18:56:54 +0530 | [diff] [blame^] | 257 | * @core_info: Core information to firmware |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 258 | */ |
| 259 | struct hfi_ipe_bps_pc { |
| 260 | uint32_t enable; |
Alok Pandey | 78093d3 | 2017-11-08 18:56:54 +0530 | [diff] [blame^] | 261 | uint32_t core_info; |
Suresh Vankadara | 6657bc2 | 2017-07-31 10:33:04 +0530 | [diff] [blame] | 262 | } __packed; |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 263 | |
| 264 | /** |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 265 | * struct hfi_cmd_ubwc_cfg |
| 266 | * Payload structure to configure HFI_PROP_SYS_UBWC_CFG |
| 267 | * @ubwc_fetch_cfg: UBWC configuration for fecth |
| 268 | * @ubwc_write_cfg: UBWC configuration for write |
| 269 | */ |
| 270 | struct hfi_cmd_ubwc_cfg { |
| 271 | uint32_t ubwc_fetch_cfg; |
| 272 | uint32_t ubwc_write_cfg; |
| 273 | }; |
| 274 | |
| 275 | /** |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 276 | * struct hfi_cmd_sys_init |
| 277 | * command to initialization of system session |
| 278 | * @size: packet size in bytes |
| 279 | * @pkt_type: opcode of a packet |
| 280 | * @HFI_CMD_SYS_INIT |
| 281 | */ |
| 282 | struct hfi_cmd_sys_init { |
| 283 | uint32_t size; |
| 284 | uint32_t pkt_type; |
| 285 | } __packed; |
| 286 | |
| 287 | /** |
| 288 | * struct hfi_cmd_pc_prep |
| 289 | * command to firmware to prepare for power collapse |
| 290 | * @eize: packet size in bytes |
| 291 | * @pkt_type: opcode of a packet |
| 292 | * @HFI_CMD_SYS_PC_PREP |
| 293 | */ |
| 294 | struct hfi_cmd_pc_prep { |
| 295 | uint32_t size; |
| 296 | uint32_t pkt_type; |
| 297 | } __packed; |
| 298 | |
| 299 | /** |
| 300 | * struct hfi_cmd_prop |
| 301 | * command to get/set properties of firmware |
| 302 | * @size: packet size in bytes |
| 303 | * @pkt_type: opcode of a packet |
| 304 | * @num_prop: number of properties queried/set |
| 305 | * @prop_data: array of property IDs being queried. size depends on num_prop |
| 306 | * array of property IDs and associated structure pairs in set |
| 307 | * @HFI_CMD_SYS_GET_PROPERTY |
| 308 | * @HFI_CMD_SYS_SET_PROPERTY |
| 309 | */ |
| 310 | struct hfi_cmd_prop { |
| 311 | uint32_t size; |
| 312 | uint32_t pkt_type; |
| 313 | uint32_t num_prop; |
| 314 | uint32_t prop_data[1]; |
| 315 | } __packed; |
| 316 | |
| 317 | /** |
| 318 | * struct hfi_cmd_ping_pkt |
| 319 | * ping command pings the firmware to confirm whether |
| 320 | * it is alive. |
| 321 | * @size: packet size in bytes |
| 322 | * @pkt_type: opcode of a packet |
| 323 | * @user_data: client data, firmware returns this data |
| 324 | * as part of HFI_MSG_SYS_PING_ACK |
| 325 | * @HFI_CMD_SYS_PING |
| 326 | */ |
| 327 | struct hfi_cmd_ping_pkt { |
| 328 | uint32_t size; |
| 329 | uint32_t pkt_type; |
| 330 | uint64_t user_data; |
| 331 | } __packed; |
| 332 | |
| 333 | /** |
| 334 | * struct hfi_cmd_sys_reset_pkt |
| 335 | * sends the reset command to FW. FW responds in the same type |
| 336 | * of packet. so can be used for reset_ack_pkt type also |
| 337 | * @size: packet size in bytes |
| 338 | * @pkt_type: opcode of a packet |
| 339 | * @user_data: client data, firmware returns this data |
| 340 | * as part of HFI_MSG_SYS_RESET_ACK |
| 341 | * @HFI_CMD_SYS_RESET |
| 342 | */ |
| 343 | |
| 344 | struct hfi_cmd_sys_reset_pkt { |
| 345 | uint32_t size; |
| 346 | uint32_t pkt_type; |
| 347 | uint64_t user_data; |
| 348 | } __packed; |
| 349 | |
| 350 | /* end of sys command packet types */ |
| 351 | |
| 352 | /* start of sys message packet types */ |
| 353 | |
| 354 | /** |
| 355 | * struct hfi_prop |
| 356 | * structure to report maximum supported features of firmware. |
| 357 | */ |
| 358 | struct hfi_sys_support { |
| 359 | uint32_t place_holder; |
| 360 | } __packed; |
| 361 | |
| 362 | /** |
| 363 | * struct hfi_supported_prop |
| 364 | * structure to report HFI_PROPERTY_PARAM_PROPERTIES_SUPPORTED |
| 365 | * for a session |
| 366 | * @num_prop: number of properties supported |
| 367 | * @prop_data: array of supported property IDs |
| 368 | */ |
| 369 | struct hfi_supported_prop { |
| 370 | uint32_t num_prop; |
| 371 | uint32_t prop_data[1]; |
| 372 | } __packed; |
| 373 | |
| 374 | /** |
| 375 | * struct hfi_image_version |
| 376 | * system image version |
| 377 | * @major: major version number |
| 378 | * @minor: minor version number |
| 379 | * @ver_name_size: size of version name |
| 380 | * @ver_name: image version name |
| 381 | */ |
| 382 | struct hfi_image_version { |
| 383 | uint32_t major; |
| 384 | uint32_t minor; |
| 385 | uint32_t ver_name_size; |
| 386 | uint8_t ver_name[1]; |
| 387 | } __packed; |
| 388 | |
| 389 | /** |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 390 | * struct hfi_msg_init_done_data |
| 391 | * @api_ver: Firmware API version |
| 392 | * @dev_ver: Device version |
| 393 | * @num_icp_hw: Number of ICP hardware information |
| 394 | * @dev_hw_ver: Supported hardware version information |
| 395 | * @reserved: Reserved field |
| 396 | */ |
| 397 | struct hfi_msg_init_done_data { |
| 398 | uint32_t api_ver; |
| 399 | uint32_t dev_ver; |
| 400 | uint32_t num_icp_hw; |
| 401 | uint32_t dev_hw_ver[HFI_DEV_VERSION_MAX]; |
| 402 | uint32_t reserved; |
| 403 | }; |
| 404 | |
| 405 | /** |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 406 | * struct hfi_msg_init_done |
| 407 | * system init done message from firmware. Many system level properties |
| 408 | * are returned with the packet |
Suresh Vankadara | aa6ff8f | 2017-10-26 22:51:27 +0530 | [diff] [blame] | 409 | * @size: Packet size in bytes |
| 410 | * @pkt_type: Opcode of a packet |
| 411 | * @err_type: Error code associated with response |
| 412 | * @num_prop: Number of default capability info |
| 413 | * @prop_data: Array of property ids and corresponding structure pairs |
Lakshmi Narayana Kalavala | 85c4035 | 2017-05-15 16:19:13 -0700 | [diff] [blame] | 414 | */ |
| 415 | struct hfi_msg_init_done { |
| 416 | uint32_t size; |
| 417 | uint32_t pkt_type; |
| 418 | uint32_t err_type; |
| 419 | uint32_t num_prop; |
| 420 | uint32_t prop_data[1]; |
| 421 | } __packed; |
| 422 | |
| 423 | /** |
| 424 | * struct hfi_msg_pc_prep_done |
| 425 | * system power collapse preperation done message |
| 426 | * @size: packet size in bytes |
| 427 | * @pkt_type: opcode of a packet |
| 428 | * @err_type: error code associated with the response |
| 429 | */ |
| 430 | struct hfi_msg_pc_prep_done { |
| 431 | uint32_t size; |
| 432 | uint32_t pkt_type; |
| 433 | uint32_t err_type; |
| 434 | } __packed; |
| 435 | |
| 436 | /** |
| 437 | * struct hfi_msg_prop |
| 438 | * system property info from firmware |
| 439 | * @size: packet size in bytes |
| 440 | * @pkt_type: opcode of a packet |
| 441 | * @num_prop: number of property info structures |
| 442 | * @prop_data: array of property IDs and associated structure pairs |
| 443 | */ |
| 444 | struct hfi_msg_prop { |
| 445 | uint32_t size; |
| 446 | uint32_t pkt_type; |
| 447 | uint32_t num_prop; |
| 448 | uint32_t prop_data[1]; |
| 449 | } __packed; |
| 450 | |
| 451 | /** |
| 452 | * struct hfi_msg_idle |
| 453 | * system idle message from firmware |
| 454 | * @size: packet size in bytes |
| 455 | * @pkt_type: opcode of a packet |
| 456 | */ |
| 457 | struct hfi_msg_idle { |
| 458 | uint32_t size; |
| 459 | uint32_t pkt_type; |
| 460 | } __packed; |
| 461 | |
| 462 | /** |
| 463 | * struct hfi_msg_ping_ack |
| 464 | * system ping ack message |
| 465 | * @size: packet size in bytes |
| 466 | * @pkt_type: opcode of a packet |
| 467 | * @user_data: this data is sent as part of ping command from host |
| 468 | */ |
| 469 | struct hfi_msg_ping_ack { |
| 470 | uint32_t size; |
| 471 | uint32_t pkt_type; |
| 472 | uint64_t user_data; |
| 473 | } __packed; |
| 474 | |
| 475 | /** |
| 476 | * struct hfi_msg_debug |
| 477 | * system debug message defination |
| 478 | * @size: packet size in bytes |
| 479 | * @pkt_type: opcode of a packet |
| 480 | * @msg_type: debug message type |
| 481 | * @msg_size: size of debug message in bytes |
| 482 | * @timestamp_hi: most significant 32 bits of the 64 bit timestamp field. |
| 483 | * timestamp shall be interpreted as a signed 64-bit value |
| 484 | * representing microseconds. |
| 485 | * @timestamp_lo: least significant 32 bits of the 64 bit timestamp field. |
| 486 | * timestamp shall be interpreted as a signed 64-bit value |
| 487 | * representing microseconds. |
| 488 | * @msg_data: message data in string form |
| 489 | */ |
| 490 | struct hfi_msg_debug { |
| 491 | uint32_t size; |
| 492 | uint32_t pkt_type; |
| 493 | uint32_t msg_type; |
| 494 | uint32_t msg_size; |
| 495 | uint32_t timestamp_hi; |
| 496 | uint32_t timestamp_lo; |
| 497 | uint8_t msg_data[1]; |
| 498 | } __packed; |
| 499 | /** |
| 500 | * struct hfi_msg_event_notify |
| 501 | * event notify message |
| 502 | * @size: packet size in bytes |
| 503 | * @pkt_type: opcode of a packet |
| 504 | * @fw_handle: firmware session handle |
| 505 | * @event_id: session event id |
| 506 | * @event_data1: event data corresponding to event ID |
| 507 | * @event_data2: event data corresponding to event ID |
| 508 | * @ext_event_data: info array, interpreted based on event_data1 |
| 509 | * and event_data2 |
| 510 | */ |
| 511 | struct hfi_msg_event_notify { |
| 512 | uint32_t size; |
| 513 | uint32_t pkt_type; |
| 514 | uint32_t fw_handle; |
| 515 | uint32_t event_id; |
| 516 | uint32_t event_data1; |
| 517 | uint32_t event_data2; |
| 518 | uint32_t ext_event_data[1]; |
| 519 | } __packed; |
| 520 | /** |
| 521 | * end of sys message packet types |
| 522 | */ |
| 523 | |
| 524 | #endif /* _HFI_DEFS_H_ */ |