.. | .. |
---|
8 | 8 | * Copyright(c) 2014 Intel Corporation. All rights reserved. |
---|
9 | 9 | * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH |
---|
10 | 10 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
---|
| 11 | + * Copyright (C) 2018 - 2020 Intel Corporation |
---|
11 | 12 | * |
---|
12 | 13 | * This program is free software; you can redistribute it and/or modify |
---|
13 | 14 | * it under the terms of version 2 of the GNU General Public License as |
---|
.. | .. |
---|
17 | 18 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | 20 | * General Public License for more details. |
---|
20 | | - * |
---|
21 | | - * You should have received a copy of the GNU General Public License |
---|
22 | | - * along with this program; if not, write to the Free Software |
---|
23 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, |
---|
24 | | - * USA |
---|
25 | 21 | * |
---|
26 | 22 | * The full GNU General Public License is included in this distribution |
---|
27 | 23 | * in the file called COPYING. |
---|
.. | .. |
---|
35 | 31 | * Copyright(c) 2014 Intel Corporation. All rights reserved. |
---|
36 | 32 | * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH |
---|
37 | 33 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
---|
| 34 | + * Copyright (C) 2018 - 2020 Intel Corporation |
---|
38 | 35 | * All rights reserved. |
---|
39 | 36 | * |
---|
40 | 37 | * Redistribution and use in source and binary forms, with or without |
---|
.. | .. |
---|
68 | 65 | #define __fw_error_dump_h__ |
---|
69 | 66 | |
---|
70 | 67 | #include <linux/types.h> |
---|
| 68 | +#include "fw/api/cmdhdr.h" |
---|
71 | 69 | |
---|
72 | 70 | #define IWL_FW_ERROR_DUMP_BARKER 0x14789632 |
---|
| 71 | +#define IWL_FW_INI_ERROR_DUMP_BARKER 0x14789633 |
---|
73 | 72 | |
---|
74 | 73 | /** |
---|
75 | 74 | * enum iwl_fw_error_dump_type - types of data in the dump file |
---|
.. | .. |
---|
116 | 115 | IWL_FW_ERROR_DUMP_INTERNAL_TXF = 14, |
---|
117 | 116 | IWL_FW_ERROR_DUMP_EXTERNAL = 15, /* Do not move */ |
---|
118 | 117 | IWL_FW_ERROR_DUMP_MEM_CFG = 16, |
---|
| 118 | + IWL_FW_ERROR_DUMP_D3_DEBUG_DATA = 17, |
---|
119 | 119 | |
---|
120 | 120 | IWL_FW_ERROR_DUMP_MAX, |
---|
121 | 121 | }; |
---|
.. | .. |
---|
182 | 182 | IWL_FW_ERROR_DUMP_FAMILY_8 = 8, |
---|
183 | 183 | }; |
---|
184 | 184 | |
---|
| 185 | +#define MAX_NUM_LMAC 2 |
---|
| 186 | + |
---|
185 | 187 | /** |
---|
186 | 188 | * struct iwl_fw_error_dump_info - info on the device / firmware |
---|
187 | | - * @device_family: the family of the device (7 / 8) |
---|
| 189 | + * @hw_type: the type of the device |
---|
188 | 190 | * @hw_step: the step of the device |
---|
189 | 191 | * @fw_human_readable: human readable FW version |
---|
190 | 192 | * @dev_human_readable: name of the device |
---|
191 | 193 | * @bus_human_readable: name of the bus used |
---|
| 194 | + * @num_of_lmacs: the number of lmacs |
---|
| 195 | + * @lmac_err_id: the lmac 0/1 error_id/rt_status that triggered the latest dump |
---|
| 196 | + * if the dump collection was not initiated by an assert, the value is 0 |
---|
| 197 | + * @umac_err_id: the umac error_id/rt_status that triggered the latest dump |
---|
| 198 | + * if the dump collection was not initiated by an assert, the value is 0 |
---|
192 | 199 | */ |
---|
193 | 200 | struct iwl_fw_error_dump_info { |
---|
194 | | - __le32 device_family; |
---|
| 201 | + __le32 hw_type; |
---|
195 | 202 | __le32 hw_step; |
---|
196 | 203 | u8 fw_human_readable[FW_VER_HUMAN_READABLE_SZ]; |
---|
197 | 204 | u8 dev_human_readable[64]; |
---|
198 | 205 | u8 bus_human_readable[8]; |
---|
| 206 | + u8 num_of_lmacs; |
---|
| 207 | + __le32 umac_err_id; |
---|
| 208 | + __le32 lmac_err_id[MAX_NUM_LMAC]; |
---|
199 | 209 | } __packed; |
---|
200 | 210 | |
---|
201 | 211 | /** |
---|
.. | .. |
---|
203 | 213 | * @fw_mon_wr_ptr: the position of the write pointer in the cyclic buffer |
---|
204 | 214 | * @fw_mon_base_ptr: base pointer of the data |
---|
205 | 215 | * @fw_mon_cycle_cnt: number of wraparounds |
---|
| 216 | + * @fw_mon_base_high_ptr: used in AX210 devices, the base adderss is 64 bit |
---|
| 217 | + * so fw_mon_base_ptr holds LSB 32 bits and fw_mon_base_high_ptr hold |
---|
| 218 | + * MSB 32 bits |
---|
206 | 219 | * @reserved: for future use |
---|
207 | 220 | * @data: captured data |
---|
208 | 221 | */ |
---|
.. | .. |
---|
210 | 223 | __le32 fw_mon_wr_ptr; |
---|
211 | 224 | __le32 fw_mon_base_ptr; |
---|
212 | 225 | __le32 fw_mon_cycle_cnt; |
---|
213 | | - __le32 reserved[3]; |
---|
| 226 | + __le32 fw_mon_base_high_ptr; |
---|
| 227 | + __le32 reserved[2]; |
---|
214 | 228 | u8 data[]; |
---|
215 | 229 | } __packed; |
---|
216 | 230 | |
---|
.. | .. |
---|
251 | 265 | enum iwl_fw_error_dump_mem_type { |
---|
252 | 266 | IWL_FW_ERROR_DUMP_MEM_SRAM, |
---|
253 | 267 | IWL_FW_ERROR_DUMP_MEM_SMEM, |
---|
| 268 | + IWL_FW_ERROR_DUMP_MEM_NAMED_MEM = 10, |
---|
254 | 269 | }; |
---|
255 | 270 | |
---|
256 | 271 | /** |
---|
.. | .. |
---|
265 | 280 | u8 data[]; |
---|
266 | 281 | }; |
---|
267 | 282 | |
---|
| 283 | +/* Dump version, used by the dump parser to differentiate between |
---|
| 284 | + * different dump formats |
---|
| 285 | + */ |
---|
| 286 | +#define IWL_INI_DUMP_VER 1 |
---|
| 287 | + |
---|
| 288 | +/* Use bit 31 as dump info type to avoid colliding with region types */ |
---|
| 289 | +#define IWL_INI_DUMP_INFO_TYPE BIT(31) |
---|
| 290 | + |
---|
| 291 | +/** |
---|
| 292 | + * struct iwl_fw_ini_dump_entry |
---|
| 293 | + * @list: list of dump entries |
---|
| 294 | + * @size: size of the data |
---|
| 295 | + * @data: entry data |
---|
| 296 | + */ |
---|
| 297 | +struct iwl_fw_ini_dump_entry { |
---|
| 298 | + struct list_head list; |
---|
| 299 | + u32 size; |
---|
| 300 | + u8 data[]; |
---|
| 301 | +} __packed; |
---|
| 302 | + |
---|
| 303 | +/** |
---|
| 304 | + * struct iwl_fw_error_dump_file - header of dump file |
---|
| 305 | + * @barker: must be %IWL_FW_INI_ERROR_DUMP_BARKER |
---|
| 306 | + * @file_len: the length of all the file including the header |
---|
| 307 | + */ |
---|
| 308 | +struct iwl_fw_ini_dump_file_hdr { |
---|
| 309 | + __le32 barker; |
---|
| 310 | + __le32 file_len; |
---|
| 311 | +} __packed; |
---|
| 312 | + |
---|
| 313 | +/** |
---|
| 314 | + * struct iwl_fw_ini_fifo_hdr - fifo range header |
---|
| 315 | + * @fifo_num: the fifo number. In case of umac rx fifo, set BIT(31) to |
---|
| 316 | + * distinguish between lmac and umac rx fifos |
---|
| 317 | + * @num_of_registers: num of registers to dump, dword size each |
---|
| 318 | + */ |
---|
| 319 | +struct iwl_fw_ini_fifo_hdr { |
---|
| 320 | + __le32 fifo_num; |
---|
| 321 | + __le32 num_of_registers; |
---|
| 322 | +} __packed; |
---|
| 323 | + |
---|
| 324 | +/** |
---|
| 325 | + * struct iwl_fw_ini_error_dump_range - range of memory |
---|
| 326 | + * @range_data_size: the size of this range, in bytes |
---|
| 327 | + * @internal_base_addr: base address of internal memory range |
---|
| 328 | + * @dram_base_addr: base address of dram monitor range |
---|
| 329 | + * @page_num: page number of memory range |
---|
| 330 | + * @fifo_hdr: fifo header of memory range |
---|
| 331 | + * @fw_pkt: FW packet header of memory range |
---|
| 332 | + * @data: the actual memory |
---|
| 333 | + */ |
---|
| 334 | +struct iwl_fw_ini_error_dump_range { |
---|
| 335 | + __le32 range_data_size; |
---|
| 336 | + union { |
---|
| 337 | + __le32 internal_base_addr; |
---|
| 338 | + __le64 dram_base_addr; |
---|
| 339 | + __le32 page_num; |
---|
| 340 | + struct iwl_fw_ini_fifo_hdr fifo_hdr; |
---|
| 341 | + struct iwl_cmd_header fw_pkt_hdr; |
---|
| 342 | + }; |
---|
| 343 | + __le32 data[]; |
---|
| 344 | +} __packed; |
---|
| 345 | + |
---|
| 346 | +/** |
---|
| 347 | + * struct iwl_fw_ini_error_dump_header - ini region dump header |
---|
| 348 | + * @version: dump version |
---|
| 349 | + * @region_id: id of the region |
---|
| 350 | + * @num_of_ranges: number of ranges in this region |
---|
| 351 | + * @name_len: number of bytes allocated to the name string of this region |
---|
| 352 | + * @name: name of the region |
---|
| 353 | + */ |
---|
| 354 | +struct iwl_fw_ini_error_dump_header { |
---|
| 355 | + __le32 version; |
---|
| 356 | + __le32 region_id; |
---|
| 357 | + __le32 num_of_ranges; |
---|
| 358 | + __le32 name_len; |
---|
| 359 | + u8 name[IWL_FW_INI_MAX_NAME]; |
---|
| 360 | +}; |
---|
| 361 | + |
---|
| 362 | +/** |
---|
| 363 | + * struct iwl_fw_ini_error_dump - ini region dump |
---|
| 364 | + * @header: the header of this region |
---|
| 365 | + * @ranges: the memory ranges of this region |
---|
| 366 | + */ |
---|
| 367 | +struct iwl_fw_ini_error_dump { |
---|
| 368 | + struct iwl_fw_ini_error_dump_header header; |
---|
| 369 | + struct iwl_fw_ini_error_dump_range ranges[]; |
---|
| 370 | +} __packed; |
---|
| 371 | + |
---|
| 372 | +/* This bit is used to differentiate between lmac and umac rxf */ |
---|
| 373 | +#define IWL_RXF_UMAC_BIT BIT(31) |
---|
| 374 | + |
---|
| 375 | +/** |
---|
| 376 | + * struct iwl_fw_ini_error_dump_register - ini register dump |
---|
| 377 | + * @addr: address of the register |
---|
| 378 | + * @data: data of the register |
---|
| 379 | + */ |
---|
| 380 | +struct iwl_fw_ini_error_dump_register { |
---|
| 381 | + __le32 addr; |
---|
| 382 | + __le32 data; |
---|
| 383 | +} __packed; |
---|
| 384 | + |
---|
| 385 | +/** |
---|
| 386 | + * struct iwl_fw_ini_dump_cfg_name - configuration name |
---|
| 387 | + * @image_type: image type the configuration is related to |
---|
| 388 | + * @cfg_name_len: length of the configuration name |
---|
| 389 | + * @cfg_name: name of the configuraiton |
---|
| 390 | + */ |
---|
| 391 | +struct iwl_fw_ini_dump_cfg_name { |
---|
| 392 | + __le32 image_type; |
---|
| 393 | + __le32 cfg_name_len; |
---|
| 394 | + u8 cfg_name[IWL_FW_INI_MAX_CFG_NAME]; |
---|
| 395 | +} __packed; |
---|
| 396 | + |
---|
| 397 | +/* AX210's HW type */ |
---|
| 398 | +#define IWL_AX210_HW_TYPE 0x42 |
---|
| 399 | +/* How many bits to roll when adding to the HW type of AX210 HW */ |
---|
| 400 | +#define IWL_AX210_HW_TYPE_ADDITION_SHIFT 12 |
---|
| 401 | +/* This prph is used to tell apart HW_TYPE == 0x42 NICs */ |
---|
| 402 | +#define WFPM_OTP_CFG1_ADDR 0xd03098 |
---|
| 403 | +#define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(4) |
---|
| 404 | +#define WFPM_OTP_CFG1_IS_CDB_BIT BIT(5) |
---|
| 405 | + |
---|
| 406 | +/* struct iwl_fw_ini_dump_info - ini dump information |
---|
| 407 | + * @version: dump version |
---|
| 408 | + * @time_point: time point that caused the dump collection |
---|
| 409 | + * @trigger_reason: reason of the trigger |
---|
| 410 | + * @external_cfg_state: &enum iwl_ini_cfg_state |
---|
| 411 | + * @ver_type: FW version type |
---|
| 412 | + * @ver_subtype: FW version subype |
---|
| 413 | + * @hw_step: HW step |
---|
| 414 | + * @hw_type: HW type |
---|
| 415 | + * @rf_id_flavor: HW RF id flavor |
---|
| 416 | + * @rf_id_dash: HW RF id dash |
---|
| 417 | + * @rf_id_step: HW RF id step |
---|
| 418 | + * @rf_id_type: HW RF id type |
---|
| 419 | + * @lmac_major: lmac major version |
---|
| 420 | + * @lmac_minor: lmac minor version |
---|
| 421 | + * @umac_major: umac major version |
---|
| 422 | + * @umac_minor: umac minor version |
---|
| 423 | + * @fw_mon_mode: FW monitor mode &enum iwl_fw_ini_buffer_location |
---|
| 424 | + * @regions_mask: bitmap mask of regions ids in the dump |
---|
| 425 | + * @build_tag_len: length of the build tag |
---|
| 426 | + * @build_tag: build tag string |
---|
| 427 | + * @num_of_cfg_names: number of configuration name structs |
---|
| 428 | + * @cfg_names: configuration names |
---|
| 429 | + */ |
---|
| 430 | +struct iwl_fw_ini_dump_info { |
---|
| 431 | + __le32 version; |
---|
| 432 | + __le32 time_point; |
---|
| 433 | + __le32 trigger_reason; |
---|
| 434 | + __le32 external_cfg_state; |
---|
| 435 | + __le32 ver_type; |
---|
| 436 | + __le32 ver_subtype; |
---|
| 437 | + __le32 hw_step; |
---|
| 438 | + __le32 hw_type; |
---|
| 439 | + __le32 rf_id_flavor; |
---|
| 440 | + __le32 rf_id_dash; |
---|
| 441 | + __le32 rf_id_step; |
---|
| 442 | + __le32 rf_id_type; |
---|
| 443 | + __le32 lmac_major; |
---|
| 444 | + __le32 lmac_minor; |
---|
| 445 | + __le32 umac_major; |
---|
| 446 | + __le32 umac_minor; |
---|
| 447 | + __le32 fw_mon_mode; |
---|
| 448 | + __le64 regions_mask; |
---|
| 449 | + __le32 build_tag_len; |
---|
| 450 | + u8 build_tag[FW_VER_HUMAN_READABLE_SZ]; |
---|
| 451 | + __le32 num_of_cfg_names; |
---|
| 452 | + struct iwl_fw_ini_dump_cfg_name cfg_names[]; |
---|
| 453 | +} __packed; |
---|
| 454 | + |
---|
| 455 | +/** |
---|
| 456 | + * struct iwl_fw_ini_err_table_dump - ini error table dump |
---|
| 457 | + * @header: header of the region |
---|
| 458 | + * @version: error table version |
---|
| 459 | + * @ranges: the memory ranges of this this region |
---|
| 460 | + */ |
---|
| 461 | +struct iwl_fw_ini_err_table_dump { |
---|
| 462 | + struct iwl_fw_ini_error_dump_header header; |
---|
| 463 | + __le32 version; |
---|
| 464 | + struct iwl_fw_ini_error_dump_range ranges[]; |
---|
| 465 | +} __packed; |
---|
| 466 | + |
---|
268 | 467 | /** |
---|
269 | 468 | * struct iwl_fw_error_dump_rb - content of an Receive Buffer |
---|
270 | 469 | * @index: the index of the Receive Buffer in the Rx queue |
---|
.. | .. |
---|
278 | 477 | __le32 reserved; |
---|
279 | 478 | u8 data[]; |
---|
280 | 479 | }; |
---|
| 480 | + |
---|
| 481 | +/** |
---|
| 482 | + * struct iwl_fw_ini_monitor_dump - ini monitor dump |
---|
| 483 | + * @header: header of the region |
---|
| 484 | + * @write_ptr: write pointer position in the buffer |
---|
| 485 | + * @cycle_cnt: cycles count |
---|
| 486 | + * @cur_frag: current fragment in use |
---|
| 487 | + * @ranges: the memory ranges of this this region |
---|
| 488 | + */ |
---|
| 489 | +struct iwl_fw_ini_monitor_dump { |
---|
| 490 | + struct iwl_fw_ini_error_dump_header header; |
---|
| 491 | + __le32 write_ptr; |
---|
| 492 | + __le32 cycle_cnt; |
---|
| 493 | + __le32 cur_frag; |
---|
| 494 | + struct iwl_fw_ini_error_dump_range ranges[]; |
---|
| 495 | +} __packed; |
---|
| 496 | + |
---|
| 497 | +/** |
---|
| 498 | + * struct iwl_fw_ini_special_device_memory - special device memory |
---|
| 499 | + * @header: header of the region |
---|
| 500 | + * @type: type of special memory |
---|
| 501 | + * @version: struct special memory version |
---|
| 502 | + * @ranges: the memory ranges of this this region |
---|
| 503 | + */ |
---|
| 504 | +struct iwl_fw_ini_special_device_memory { |
---|
| 505 | + struct iwl_fw_ini_error_dump_header header; |
---|
| 506 | + __le16 type; |
---|
| 507 | + __le16 version; |
---|
| 508 | + struct iwl_fw_ini_error_dump_range ranges[]; |
---|
| 509 | +} __packed; |
---|
281 | 510 | |
---|
282 | 511 | /** |
---|
283 | 512 | * struct iwl_fw_error_dump_paging - content of the UMAC's image page |
---|
.. | .. |
---|
330 | 559 | * @FW_DBG_TDLS: trigger log collection upon TDLS related events. |
---|
331 | 560 | * @FW_DBG_TRIGGER_TX_STATUS: trigger log collection upon tx status when |
---|
332 | 561 | * the firmware sends a tx reply. |
---|
| 562 | + * @FW_DBG_TRIGGER_ALIVE_TIMEOUT: trigger log collection if alive flow timeouts |
---|
| 563 | + * @FW_DBG_TRIGGER_DRIVER: trigger log collection upon a flow failure |
---|
| 564 | + * in the driver. |
---|
333 | 565 | */ |
---|
334 | 566 | enum iwl_fw_dbg_trigger { |
---|
335 | 567 | FW_DBG_TRIGGER_INVALID = 0, |
---|
.. | .. |
---|
347 | 579 | FW_DBG_TRIGGER_TX_LATENCY, |
---|
348 | 580 | FW_DBG_TRIGGER_TDLS, |
---|
349 | 581 | FW_DBG_TRIGGER_TX_STATUS, |
---|
| 582 | + FW_DBG_TRIGGER_ALIVE_TIMEOUT, |
---|
| 583 | + FW_DBG_TRIGGER_DRIVER, |
---|
350 | 584 | |
---|
351 | 585 | /* must be last */ |
---|
352 | 586 | FW_DBG_TRIGGER_MAX, |
---|