| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) |
|---|
| 1 | 2 | /* QLogic qed NIC Driver |
|---|
| 2 | 3 | * Copyright (c) 2015 QLogic Corporation |
|---|
| 3 | | - * |
|---|
| 4 | | - * This software is available under the terms of the GNU General Public License |
|---|
| 5 | | - * (GPL) Version 2, available from the file COPYING in the main directory of |
|---|
| 6 | | - * this source tree. |
|---|
| 4 | + * Copyright (c) 2019-2020 Marvell International Ltd. |
|---|
| 7 | 5 | */ |
|---|
| 8 | 6 | |
|---|
| 9 | 7 | #include <linux/module.h> |
|---|
| 10 | 8 | #include <linux/vmalloc.h> |
|---|
| 11 | 9 | #include <linux/crc32.h> |
|---|
| 12 | 10 | #include "qed.h" |
|---|
| 11 | +#include "qed_cxt.h" |
|---|
| 13 | 12 | #include "qed_hsi.h" |
|---|
| 14 | 13 | #include "qed_hw.h" |
|---|
| 15 | 14 | #include "qed_mcp.h" |
|---|
| .. | .. |
|---|
| 25 | 24 | MEM_GROUP_BRB_RAM, |
|---|
| 26 | 25 | MEM_GROUP_BRB_MEM, |
|---|
| 27 | 26 | MEM_GROUP_PRS_MEM, |
|---|
| 28 | | - MEM_GROUP_IOR, |
|---|
| 29 | | - MEM_GROUP_BTB_RAM, |
|---|
| 30 | | - MEM_GROUP_CONN_CFC_MEM, |
|---|
| 31 | | - MEM_GROUP_TASK_CFC_MEM, |
|---|
| 32 | | - MEM_GROUP_CAU_PI, |
|---|
| 33 | | - MEM_GROUP_CAU_MEM, |
|---|
| 34 | | - MEM_GROUP_PXP_ILT, |
|---|
| 35 | | - MEM_GROUP_TM_MEM, |
|---|
| 36 | 27 | MEM_GROUP_SDM_MEM, |
|---|
| 37 | 28 | MEM_GROUP_PBUF, |
|---|
| 29 | + MEM_GROUP_IOR, |
|---|
| 38 | 30 | MEM_GROUP_RAM, |
|---|
| 39 | | - MEM_GROUP_MULD_MEM, |
|---|
| 40 | | - MEM_GROUP_BTB_MEM, |
|---|
| 31 | + MEM_GROUP_BTB_RAM, |
|---|
| 41 | 32 | MEM_GROUP_RDIF_CTX, |
|---|
| 42 | 33 | MEM_GROUP_TDIF_CTX, |
|---|
| 43 | 34 | MEM_GROUP_CFC_MEM, |
|---|
| 35 | + MEM_GROUP_CONN_CFC_MEM, |
|---|
| 36 | + MEM_GROUP_CAU_PI, |
|---|
| 37 | + MEM_GROUP_CAU_MEM, |
|---|
| 38 | + MEM_GROUP_CAU_MEM_EXT, |
|---|
| 39 | + MEM_GROUP_PXP_ILT, |
|---|
| 40 | + MEM_GROUP_MULD_MEM, |
|---|
| 41 | + MEM_GROUP_BTB_MEM, |
|---|
| 44 | 42 | MEM_GROUP_IGU_MEM, |
|---|
| 45 | 43 | MEM_GROUP_IGU_MSIX, |
|---|
| 46 | 44 | MEM_GROUP_CAU_SB, |
|---|
| 47 | 45 | MEM_GROUP_BMB_RAM, |
|---|
| 48 | 46 | MEM_GROUP_BMB_MEM, |
|---|
| 47 | + MEM_GROUP_TM_MEM, |
|---|
| 48 | + MEM_GROUP_TASK_CFC_MEM, |
|---|
| 49 | 49 | MEM_GROUPS_NUM |
|---|
| 50 | 50 | }; |
|---|
| 51 | 51 | |
|---|
| .. | .. |
|---|
| 59 | 59 | "BRB_RAM", |
|---|
| 60 | 60 | "BRB_MEM", |
|---|
| 61 | 61 | "PRS_MEM", |
|---|
| 62 | | - "IOR", |
|---|
| 63 | | - "BTB_RAM", |
|---|
| 64 | | - "CONN_CFC_MEM", |
|---|
| 65 | | - "TASK_CFC_MEM", |
|---|
| 66 | | - "CAU_PI", |
|---|
| 67 | | - "CAU_MEM", |
|---|
| 68 | | - "PXP_ILT", |
|---|
| 69 | | - "TM_MEM", |
|---|
| 70 | 62 | "SDM_MEM", |
|---|
| 71 | 63 | "PBUF", |
|---|
| 64 | + "IOR", |
|---|
| 72 | 65 | "RAM", |
|---|
| 73 | | - "MULD_MEM", |
|---|
| 74 | | - "BTB_MEM", |
|---|
| 66 | + "BTB_RAM", |
|---|
| 75 | 67 | "RDIF_CTX", |
|---|
| 76 | 68 | "TDIF_CTX", |
|---|
| 77 | 69 | "CFC_MEM", |
|---|
| 70 | + "CONN_CFC_MEM", |
|---|
| 71 | + "CAU_PI", |
|---|
| 72 | + "CAU_MEM", |
|---|
| 73 | + "CAU_MEM_EXT", |
|---|
| 74 | + "PXP_ILT", |
|---|
| 75 | + "MULD_MEM", |
|---|
| 76 | + "BTB_MEM", |
|---|
| 78 | 77 | "IGU_MEM", |
|---|
| 79 | 78 | "IGU_MSIX", |
|---|
| 80 | 79 | "CAU_SB", |
|---|
| 81 | 80 | "BMB_RAM", |
|---|
| 82 | 81 | "BMB_MEM", |
|---|
| 82 | + "TM_MEM", |
|---|
| 83 | + "TASK_CFC_MEM", |
|---|
| 83 | 84 | }; |
|---|
| 84 | 85 | |
|---|
| 85 | 86 | /* Idle check conditions */ |
|---|
| .. | .. |
|---|
| 173 | 174 | cond13, |
|---|
| 174 | 175 | }; |
|---|
| 175 | 176 | |
|---|
| 177 | +#define NUM_PHYS_BLOCKS 84 |
|---|
| 178 | + |
|---|
| 179 | +#define NUM_DBG_RESET_REGS 8 |
|---|
| 180 | + |
|---|
| 176 | 181 | /******************************* Data Types **********************************/ |
|---|
| 177 | 182 | |
|---|
| 178 | | -enum platform_ids { |
|---|
| 179 | | - PLATFORM_ASIC, |
|---|
| 183 | +enum hw_types { |
|---|
| 184 | + HW_TYPE_ASIC, |
|---|
| 180 | 185 | PLATFORM_RESERVED, |
|---|
| 181 | 186 | PLATFORM_RESERVED2, |
|---|
| 182 | 187 | PLATFORM_RESERVED3, |
|---|
| 183 | | - MAX_PLATFORM_IDS |
|---|
| 188 | + PLATFORM_RESERVED4, |
|---|
| 189 | + MAX_HW_TYPES |
|---|
| 190 | +}; |
|---|
| 191 | + |
|---|
| 192 | +/* CM context types */ |
|---|
| 193 | +enum cm_ctx_types { |
|---|
| 194 | + CM_CTX_CONN_AG, |
|---|
| 195 | + CM_CTX_CONN_ST, |
|---|
| 196 | + CM_CTX_TASK_AG, |
|---|
| 197 | + CM_CTX_TASK_ST, |
|---|
| 198 | + NUM_CM_CTX_TYPES |
|---|
| 199 | +}; |
|---|
| 200 | + |
|---|
| 201 | +/* Debug bus frame modes */ |
|---|
| 202 | +enum dbg_bus_frame_modes { |
|---|
| 203 | + DBG_BUS_FRAME_MODE_4ST = 0, /* 4 Storm dwords (no HW) */ |
|---|
| 204 | + DBG_BUS_FRAME_MODE_2ST_2HW = 1, /* 2 Storm dwords, 2 HW dwords */ |
|---|
| 205 | + DBG_BUS_FRAME_MODE_1ST_3HW = 2, /* 1 Storm dwords, 3 HW dwords */ |
|---|
| 206 | + DBG_BUS_FRAME_MODE_4HW = 3, /* 4 HW dwords (no Storms) */ |
|---|
| 207 | + DBG_BUS_FRAME_MODE_8HW = 4, /* 8 HW dwords (no Storms) */ |
|---|
| 208 | + DBG_BUS_NUM_FRAME_MODES |
|---|
| 184 | 209 | }; |
|---|
| 185 | 210 | |
|---|
| 186 | 211 | /* Chip constant definitions */ |
|---|
| 187 | 212 | struct chip_defs { |
|---|
| 188 | 213 | const char *name; |
|---|
| 214 | + u32 num_ilt_pages; |
|---|
| 189 | 215 | }; |
|---|
| 190 | 216 | |
|---|
| 191 | | -/* Platform constant definitions */ |
|---|
| 192 | | -struct platform_defs { |
|---|
| 217 | +/* HW type constant definitions */ |
|---|
| 218 | +struct hw_type_defs { |
|---|
| 193 | 219 | const char *name; |
|---|
| 194 | 220 | u32 delay_factor; |
|---|
| 195 | 221 | u32 dmae_thresh; |
|---|
| 196 | 222 | u32 log_thresh; |
|---|
| 223 | +}; |
|---|
| 224 | + |
|---|
| 225 | +/* RBC reset definitions */ |
|---|
| 226 | +struct rbc_reset_defs { |
|---|
| 227 | + u32 reset_reg_addr; |
|---|
| 228 | + u32 reset_val[MAX_CHIP_IDS]; |
|---|
| 197 | 229 | }; |
|---|
| 198 | 230 | |
|---|
| 199 | 231 | /* Storm constant definitions. |
|---|
| .. | .. |
|---|
| 201 | 233 | */ |
|---|
| 202 | 234 | struct storm_defs { |
|---|
| 203 | 235 | char letter; |
|---|
| 204 | | - enum block_id block_id; |
|---|
| 236 | + enum block_id sem_block_id; |
|---|
| 205 | 237 | enum dbg_bus_clients dbg_client_id[MAX_CHIP_IDS]; |
|---|
| 206 | 238 | bool has_vfc; |
|---|
| 207 | 239 | u32 sem_fast_mem_addr; |
|---|
| .. | .. |
|---|
| 210 | 242 | u32 sem_slow_mode_addr; |
|---|
| 211 | 243 | u32 sem_slow_mode1_conf_addr; |
|---|
| 212 | 244 | u32 sem_sync_dbg_empty_addr; |
|---|
| 213 | | - u32 sem_slow_dbg_empty_addr; |
|---|
| 245 | + u32 sem_gpre_vect_addr; |
|---|
| 214 | 246 | u32 cm_ctx_wr_addr; |
|---|
| 215 | | - u32 cm_conn_ag_ctx_lid_size; |
|---|
| 216 | | - u32 cm_conn_ag_ctx_rd_addr; |
|---|
| 217 | | - u32 cm_conn_st_ctx_lid_size; |
|---|
| 218 | | - u32 cm_conn_st_ctx_rd_addr; |
|---|
| 219 | | - u32 cm_task_ag_ctx_lid_size; |
|---|
| 220 | | - u32 cm_task_ag_ctx_rd_addr; |
|---|
| 221 | | - u32 cm_task_st_ctx_lid_size; |
|---|
| 222 | | - u32 cm_task_st_ctx_rd_addr; |
|---|
| 247 | + u32 cm_ctx_rd_addr[NUM_CM_CTX_TYPES]; |
|---|
| 248 | + u32 cm_ctx_lid_sizes[MAX_CHIP_IDS][NUM_CM_CTX_TYPES]; |
|---|
| 223 | 249 | }; |
|---|
| 224 | 250 | |
|---|
| 225 | | -/* Block constant definitions */ |
|---|
| 226 | | -struct block_defs { |
|---|
| 251 | +/* Debug Bus Constraint operation constant definitions */ |
|---|
| 252 | +struct dbg_bus_constraint_op_defs { |
|---|
| 253 | + u8 hw_op_val; |
|---|
| 254 | + bool is_cyclic; |
|---|
| 255 | +}; |
|---|
| 256 | + |
|---|
| 257 | +/* Storm Mode definitions */ |
|---|
| 258 | +struct storm_mode_defs { |
|---|
| 227 | 259 | const char *name; |
|---|
| 260 | + bool is_fast_dbg; |
|---|
| 261 | + u8 id_in_hw; |
|---|
| 262 | + u32 src_disable_reg_addr; |
|---|
| 263 | + u32 src_enable_val; |
|---|
| 228 | 264 | bool exists[MAX_CHIP_IDS]; |
|---|
| 229 | | - bool associated_to_storm; |
|---|
| 230 | | - |
|---|
| 231 | | - /* Valid only if associated_to_storm is true */ |
|---|
| 232 | | - u32 storm_id; |
|---|
| 233 | | - enum dbg_bus_clients dbg_client_id[MAX_CHIP_IDS]; |
|---|
| 234 | | - u32 dbg_select_addr; |
|---|
| 235 | | - u32 dbg_enable_addr; |
|---|
| 236 | | - u32 dbg_shift_addr; |
|---|
| 237 | | - u32 dbg_force_valid_addr; |
|---|
| 238 | | - u32 dbg_force_frame_addr; |
|---|
| 239 | | - bool has_reset_bit; |
|---|
| 240 | | - |
|---|
| 241 | | - /* If true, block is taken out of reset before dump */ |
|---|
| 242 | | - bool unreset; |
|---|
| 243 | | - enum dbg_reset_regs reset_reg; |
|---|
| 244 | | - |
|---|
| 245 | | - /* Bit offset in reset register */ |
|---|
| 246 | | - u8 reset_bit_offset; |
|---|
| 247 | | -}; |
|---|
| 248 | | - |
|---|
| 249 | | -/* Reset register definitions */ |
|---|
| 250 | | -struct reset_reg_defs { |
|---|
| 251 | | - u32 addr; |
|---|
| 252 | | - bool exists[MAX_CHIP_IDS]; |
|---|
| 253 | | - u32 unreset_val[MAX_CHIP_IDS]; |
|---|
| 254 | 265 | }; |
|---|
| 255 | 266 | |
|---|
| 256 | 267 | struct grc_param_defs { |
|---|
| .. | .. |
|---|
| 260 | 271 | bool is_preset; |
|---|
| 261 | 272 | bool is_persistent; |
|---|
| 262 | 273 | u32 exclude_all_preset_val; |
|---|
| 263 | | - u32 crash_preset_val; |
|---|
| 274 | + u32 crash_preset_val[MAX_CHIP_IDS]; |
|---|
| 264 | 275 | }; |
|---|
| 265 | 276 | |
|---|
| 266 | 277 | /* Address is in 128b units. Width is in bits. */ |
|---|
| .. | .. |
|---|
| 317 | 328 | |
|---|
| 318 | 329 | /******************************** Constants **********************************/ |
|---|
| 319 | 330 | |
|---|
| 320 | | -#define MAX_LCIDS 320 |
|---|
| 321 | | -#define MAX_LTIDS 320 |
|---|
| 322 | | - |
|---|
| 323 | | -#define NUM_IOR_SETS 2 |
|---|
| 324 | | -#define IORS_PER_SET 176 |
|---|
| 325 | | -#define IOR_SET_OFFSET(set_id) ((set_id) * 256) |
|---|
| 326 | | - |
|---|
| 327 | 331 | #define BYTES_IN_DWORD sizeof(u32) |
|---|
| 328 | | - |
|---|
| 329 | 332 | /* In the macros below, size and offset are specified in bits */ |
|---|
| 330 | 333 | #define CEIL_DWORDS(size) DIV_ROUND_UP(size, 32) |
|---|
| 331 | 334 | #define FIELD_BIT_OFFSET(type, field) type ## _ ## field ## _ ## OFFSET |
|---|
| .. | .. |
|---|
| 351 | 354 | qed_wr(dev, ptt, addr, (arr)[i]); \ |
|---|
| 352 | 355 | } while (0) |
|---|
| 353 | 356 | |
|---|
| 354 | | -#define ARR_REG_RD(dev, ptt, addr, arr, arr_size) \ |
|---|
| 355 | | - do { \ |
|---|
| 356 | | - for (i = 0; i < (arr_size); i++) \ |
|---|
| 357 | | - (arr)[i] = qed_rd(dev, ptt, addr); \ |
|---|
| 358 | | - } while (0) |
|---|
| 359 | | - |
|---|
| 360 | 357 | #define DWORDS_TO_BYTES(dwords) ((dwords) * BYTES_IN_DWORD) |
|---|
| 361 | 358 | #define BYTES_TO_DWORDS(bytes) ((bytes) / BYTES_IN_DWORD) |
|---|
| 362 | 359 | |
|---|
| 363 | | -/* Extra lines include a signature line + optional latency events line */ |
|---|
| 364 | | -#define NUM_EXTRA_DBG_LINES(block_desc) \ |
|---|
| 365 | | - (1 + ((block_desc)->has_latency_events ? 1 : 0)) |
|---|
| 366 | | -#define NUM_DBG_LINES(block_desc) \ |
|---|
| 367 | | - ((block_desc)->num_of_lines + NUM_EXTRA_DBG_LINES(block_desc)) |
|---|
| 360 | +/* extra lines include a signature line + optional latency events line */ |
|---|
| 361 | +#define NUM_EXTRA_DBG_LINES(block) \ |
|---|
| 362 | + (GET_FIELD((block)->flags, DBG_BLOCK_CHIP_HAS_LATENCY_EVENTS) ? 2 : 1) |
|---|
| 363 | +#define NUM_DBG_LINES(block) \ |
|---|
| 364 | + ((block)->num_of_dbg_bus_lines + NUM_EXTRA_DBG_LINES(block)) |
|---|
| 365 | + |
|---|
| 366 | +#define USE_DMAE true |
|---|
| 367 | +#define PROTECT_WIDE_BUS true |
|---|
| 368 | 368 | |
|---|
| 369 | 369 | #define RAM_LINES_TO_DWORDS(lines) ((lines) * 2) |
|---|
| 370 | 370 | #define RAM_LINES_TO_BYTES(lines) \ |
|---|
| .. | .. |
|---|
| 382 | 382 | |
|---|
| 383 | 383 | #define IDLE_CHK_RESULT_REG_HDR_DWORDS \ |
|---|
| 384 | 384 | BYTES_TO_DWORDS(sizeof(struct dbg_idle_chk_result_reg_hdr)) |
|---|
| 385 | + |
|---|
| 386 | +#define PAGE_MEM_DESC_SIZE_DWORDS \ |
|---|
| 387 | + BYTES_TO_DWORDS(sizeof(struct phys_mem_desc)) |
|---|
| 385 | 388 | |
|---|
| 386 | 389 | #define IDLE_CHK_MAX_ENTRIES_SIZE 32 |
|---|
| 387 | 390 | |
|---|
| .. | .. |
|---|
| 428 | 431 | |
|---|
| 429 | 432 | #define STATIC_DEBUG_LINE_DWORDS 9 |
|---|
| 430 | 433 | |
|---|
| 431 | | -#define NUM_COMMON_GLOBAL_PARAMS 8 |
|---|
| 434 | +#define NUM_COMMON_GLOBAL_PARAMS 9 |
|---|
| 435 | + |
|---|
| 436 | +#define MAX_RECURSION_DEPTH 10 |
|---|
| 432 | 437 | |
|---|
| 433 | 438 | #define FW_IMG_MAIN 1 |
|---|
| 434 | 439 | |
|---|
| .. | .. |
|---|
| 452 | 457 | (MCP_REG_SCRATCH + \ |
|---|
| 453 | 458 | offsetof(struct static_init, sections[SPAD_SECTION_TRACE])) |
|---|
| 454 | 459 | |
|---|
| 460 | +#define MAX_SW_PLTAFORM_STR_SIZE 64 |
|---|
| 461 | + |
|---|
| 455 | 462 | #define EMPTY_FW_VERSION_STR "???_???_???_???" |
|---|
| 456 | 463 | #define EMPTY_FW_IMAGE_STR "???????????????" |
|---|
| 457 | 464 | |
|---|
| 458 | 465 | /***************************** Constant Arrays *******************************/ |
|---|
| 459 | 466 | |
|---|
| 460 | | -struct dbg_array { |
|---|
| 461 | | - const u32 *ptr; |
|---|
| 462 | | - u32 size_in_dwords; |
|---|
| 463 | | -}; |
|---|
| 464 | | - |
|---|
| 465 | | -/* Debug arrays */ |
|---|
| 466 | | -static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {NULL} }; |
|---|
| 467 | | - |
|---|
| 468 | 467 | /* Chip constant definitions array */ |
|---|
| 469 | 468 | static struct chip_defs s_chip_defs[MAX_CHIP_IDS] = { |
|---|
| 470 | | - {"bb"}, |
|---|
| 471 | | - {"ah"}, |
|---|
| 472 | | - {"reserved"}, |
|---|
| 469 | + {"bb", PSWRQ2_REG_ILT_MEMORY_SIZE_BB / 2}, |
|---|
| 470 | + {"ah", PSWRQ2_REG_ILT_MEMORY_SIZE_K2 / 2} |
|---|
| 473 | 471 | }; |
|---|
| 474 | 472 | |
|---|
| 475 | 473 | /* Storm constant definitions array */ |
|---|
| 476 | 474 | static struct storm_defs s_storm_defs[] = { |
|---|
| 477 | 475 | /* Tstorm */ |
|---|
| 478 | 476 | {'T', BLOCK_TSEM, |
|---|
| 479 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT, |
|---|
| 480 | | - DBG_BUS_CLIENT_RBCT}, true, |
|---|
| 481 | | - TSEM_REG_FAST_MEMORY, |
|---|
| 482 | | - TSEM_REG_DBG_FRAME_MODE_BB_K2, TSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 483 | | - TSEM_REG_SLOW_DBG_MODE_BB_K2, TSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 484 | | - TSEM_REG_SYNC_DBG_EMPTY, TSEM_REG_SLOW_DBG_EMPTY_BB_K2, |
|---|
| 485 | | - TCM_REG_CTX_RBC_ACCS, |
|---|
| 486 | | - 4, TCM_REG_AGG_CON_CTX, |
|---|
| 487 | | - 16, TCM_REG_SM_CON_CTX, |
|---|
| 488 | | - 2, TCM_REG_AGG_TASK_CTX, |
|---|
| 489 | | - 4, TCM_REG_SM_TASK_CTX}, |
|---|
| 477 | + {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT}, |
|---|
| 478 | + true, |
|---|
| 479 | + TSEM_REG_FAST_MEMORY, |
|---|
| 480 | + TSEM_REG_DBG_FRAME_MODE_BB_K2, TSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 481 | + TSEM_REG_SLOW_DBG_MODE_BB_K2, TSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 482 | + TSEM_REG_SYNC_DBG_EMPTY, TSEM_REG_DBG_GPRE_VECT, |
|---|
| 483 | + TCM_REG_CTX_RBC_ACCS, |
|---|
| 484 | + {TCM_REG_AGG_CON_CTX, TCM_REG_SM_CON_CTX, TCM_REG_AGG_TASK_CTX, |
|---|
| 485 | + TCM_REG_SM_TASK_CTX}, |
|---|
| 486 | + {{4, 16, 2, 4}, {4, 16, 2, 4}} /* {bb} {k2} */ |
|---|
| 487 | + }, |
|---|
| 490 | 488 | |
|---|
| 491 | 489 | /* Mstorm */ |
|---|
| 492 | 490 | {'M', BLOCK_MSEM, |
|---|
| 493 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, |
|---|
| 494 | | - DBG_BUS_CLIENT_RBCM}, false, |
|---|
| 495 | | - MSEM_REG_FAST_MEMORY, |
|---|
| 496 | | - MSEM_REG_DBG_FRAME_MODE_BB_K2, MSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 497 | | - MSEM_REG_SLOW_DBG_MODE_BB_K2, MSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 498 | | - MSEM_REG_SYNC_DBG_EMPTY, MSEM_REG_SLOW_DBG_EMPTY_BB_K2, |
|---|
| 499 | | - MCM_REG_CTX_RBC_ACCS, |
|---|
| 500 | | - 1, MCM_REG_AGG_CON_CTX, |
|---|
| 501 | | - 10, MCM_REG_SM_CON_CTX, |
|---|
| 502 | | - 2, MCM_REG_AGG_TASK_CTX, |
|---|
| 503 | | - 7, MCM_REG_SM_TASK_CTX}, |
|---|
| 491 | + {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM}, |
|---|
| 492 | + false, |
|---|
| 493 | + MSEM_REG_FAST_MEMORY, |
|---|
| 494 | + MSEM_REG_DBG_FRAME_MODE_BB_K2, |
|---|
| 495 | + MSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 496 | + MSEM_REG_SLOW_DBG_MODE_BB_K2, |
|---|
| 497 | + MSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 498 | + MSEM_REG_SYNC_DBG_EMPTY, |
|---|
| 499 | + MSEM_REG_DBG_GPRE_VECT, |
|---|
| 500 | + MCM_REG_CTX_RBC_ACCS, |
|---|
| 501 | + {MCM_REG_AGG_CON_CTX, MCM_REG_SM_CON_CTX, MCM_REG_AGG_TASK_CTX, |
|---|
| 502 | + MCM_REG_SM_TASK_CTX }, |
|---|
| 503 | + {{1, 10, 2, 7}, {1, 10, 2, 7}} /* {bb} {k2}*/ |
|---|
| 504 | + }, |
|---|
| 504 | 505 | |
|---|
| 505 | 506 | /* Ustorm */ |
|---|
| 506 | 507 | {'U', BLOCK_USEM, |
|---|
| 507 | | - {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU, |
|---|
| 508 | | - DBG_BUS_CLIENT_RBCU}, false, |
|---|
| 509 | | - USEM_REG_FAST_MEMORY, |
|---|
| 510 | | - USEM_REG_DBG_FRAME_MODE_BB_K2, USEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 511 | | - USEM_REG_SLOW_DBG_MODE_BB_K2, USEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 512 | | - USEM_REG_SYNC_DBG_EMPTY, USEM_REG_SLOW_DBG_EMPTY_BB_K2, |
|---|
| 513 | | - UCM_REG_CTX_RBC_ACCS, |
|---|
| 514 | | - 2, UCM_REG_AGG_CON_CTX, |
|---|
| 515 | | - 13, UCM_REG_SM_CON_CTX, |
|---|
| 516 | | - 3, UCM_REG_AGG_TASK_CTX, |
|---|
| 517 | | - 3, UCM_REG_SM_TASK_CTX}, |
|---|
| 508 | + {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU}, |
|---|
| 509 | + false, |
|---|
| 510 | + USEM_REG_FAST_MEMORY, |
|---|
| 511 | + USEM_REG_DBG_FRAME_MODE_BB_K2, |
|---|
| 512 | + USEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 513 | + USEM_REG_SLOW_DBG_MODE_BB_K2, |
|---|
| 514 | + USEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 515 | + USEM_REG_SYNC_DBG_EMPTY, |
|---|
| 516 | + USEM_REG_DBG_GPRE_VECT, |
|---|
| 517 | + UCM_REG_CTX_RBC_ACCS, |
|---|
| 518 | + {UCM_REG_AGG_CON_CTX, UCM_REG_SM_CON_CTX, UCM_REG_AGG_TASK_CTX, |
|---|
| 519 | + UCM_REG_SM_TASK_CTX}, |
|---|
| 520 | + {{2, 13, 3, 3}, {2, 13, 3, 3}} /* {bb} {k2} */ |
|---|
| 521 | + }, |
|---|
| 518 | 522 | |
|---|
| 519 | 523 | /* Xstorm */ |
|---|
| 520 | 524 | {'X', BLOCK_XSEM, |
|---|
| 521 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX, |
|---|
| 522 | | - DBG_BUS_CLIENT_RBCX}, false, |
|---|
| 523 | | - XSEM_REG_FAST_MEMORY, |
|---|
| 524 | | - XSEM_REG_DBG_FRAME_MODE_BB_K2, XSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 525 | | - XSEM_REG_SLOW_DBG_MODE_BB_K2, XSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 526 | | - XSEM_REG_SYNC_DBG_EMPTY, XSEM_REG_SLOW_DBG_EMPTY_BB_K2, |
|---|
| 527 | | - XCM_REG_CTX_RBC_ACCS, |
|---|
| 528 | | - 9, XCM_REG_AGG_CON_CTX, |
|---|
| 529 | | - 15, XCM_REG_SM_CON_CTX, |
|---|
| 530 | | - 0, 0, |
|---|
| 531 | | - 0, 0}, |
|---|
| 525 | + {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX}, |
|---|
| 526 | + false, |
|---|
| 527 | + XSEM_REG_FAST_MEMORY, |
|---|
| 528 | + XSEM_REG_DBG_FRAME_MODE_BB_K2, |
|---|
| 529 | + XSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 530 | + XSEM_REG_SLOW_DBG_MODE_BB_K2, |
|---|
| 531 | + XSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 532 | + XSEM_REG_SYNC_DBG_EMPTY, |
|---|
| 533 | + XSEM_REG_DBG_GPRE_VECT, |
|---|
| 534 | + XCM_REG_CTX_RBC_ACCS, |
|---|
| 535 | + {XCM_REG_AGG_CON_CTX, XCM_REG_SM_CON_CTX, 0, 0}, |
|---|
| 536 | + {{9, 15, 0, 0}, {9, 15, 0, 0}} /* {bb} {k2} */ |
|---|
| 537 | + }, |
|---|
| 532 | 538 | |
|---|
| 533 | 539 | /* Ystorm */ |
|---|
| 534 | 540 | {'Y', BLOCK_YSEM, |
|---|
| 535 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCY, |
|---|
| 536 | | - DBG_BUS_CLIENT_RBCY}, false, |
|---|
| 537 | | - YSEM_REG_FAST_MEMORY, |
|---|
| 538 | | - YSEM_REG_DBG_FRAME_MODE_BB_K2, YSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 539 | | - YSEM_REG_SLOW_DBG_MODE_BB_K2, YSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 540 | | - YSEM_REG_SYNC_DBG_EMPTY, TSEM_REG_SLOW_DBG_EMPTY_BB_K2, |
|---|
| 541 | | - YCM_REG_CTX_RBC_ACCS, |
|---|
| 542 | | - 2, YCM_REG_AGG_CON_CTX, |
|---|
| 543 | | - 3, YCM_REG_SM_CON_CTX, |
|---|
| 544 | | - 2, YCM_REG_AGG_TASK_CTX, |
|---|
| 545 | | - 12, YCM_REG_SM_TASK_CTX}, |
|---|
| 541 | + {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCY}, |
|---|
| 542 | + false, |
|---|
| 543 | + YSEM_REG_FAST_MEMORY, |
|---|
| 544 | + YSEM_REG_DBG_FRAME_MODE_BB_K2, |
|---|
| 545 | + YSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 546 | + YSEM_REG_SLOW_DBG_MODE_BB_K2, |
|---|
| 547 | + YSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 548 | + YSEM_REG_SYNC_DBG_EMPTY, |
|---|
| 549 | + YSEM_REG_DBG_GPRE_VECT, |
|---|
| 550 | + YCM_REG_CTX_RBC_ACCS, |
|---|
| 551 | + {YCM_REG_AGG_CON_CTX, YCM_REG_SM_CON_CTX, YCM_REG_AGG_TASK_CTX, |
|---|
| 552 | + YCM_REG_SM_TASK_CTX}, |
|---|
| 553 | + {{2, 3, 2, 12}, {2, 3, 2, 12}} /* {bb} {k2} */ |
|---|
| 554 | + }, |
|---|
| 546 | 555 | |
|---|
| 547 | 556 | /* Pstorm */ |
|---|
| 548 | 557 | {'P', BLOCK_PSEM, |
|---|
| 549 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS, |
|---|
| 550 | | - DBG_BUS_CLIENT_RBCS}, true, |
|---|
| 551 | | - PSEM_REG_FAST_MEMORY, |
|---|
| 552 | | - PSEM_REG_DBG_FRAME_MODE_BB_K2, PSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 553 | | - PSEM_REG_SLOW_DBG_MODE_BB_K2, PSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 554 | | - PSEM_REG_SYNC_DBG_EMPTY, PSEM_REG_SLOW_DBG_EMPTY_BB_K2, |
|---|
| 555 | | - PCM_REG_CTX_RBC_ACCS, |
|---|
| 556 | | - 0, 0, |
|---|
| 557 | | - 10, PCM_REG_SM_CON_CTX, |
|---|
| 558 | | - 0, 0, |
|---|
| 559 | | - 0, 0} |
|---|
| 558 | + {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 559 | + true, |
|---|
| 560 | + PSEM_REG_FAST_MEMORY, |
|---|
| 561 | + PSEM_REG_DBG_FRAME_MODE_BB_K2, |
|---|
| 562 | + PSEM_REG_SLOW_DBG_ACTIVE_BB_K2, |
|---|
| 563 | + PSEM_REG_SLOW_DBG_MODE_BB_K2, |
|---|
| 564 | + PSEM_REG_DBG_MODE1_CFG_BB_K2, |
|---|
| 565 | + PSEM_REG_SYNC_DBG_EMPTY, |
|---|
| 566 | + PSEM_REG_DBG_GPRE_VECT, |
|---|
| 567 | + PCM_REG_CTX_RBC_ACCS, |
|---|
| 568 | + {0, PCM_REG_SM_CON_CTX, 0, 0}, |
|---|
| 569 | + {{0, 10, 0, 0}, {0, 10, 0, 0}} /* {bb} {k2} */ |
|---|
| 570 | + }, |
|---|
| 560 | 571 | }; |
|---|
| 561 | 572 | |
|---|
| 562 | | -/* Block definitions array */ |
|---|
| 563 | | - |
|---|
| 564 | | -static struct block_defs block_grc_defs = { |
|---|
| 565 | | - "grc", |
|---|
| 566 | | - {true, true, true}, false, 0, |
|---|
| 567 | | - {DBG_BUS_CLIENT_RBCN, DBG_BUS_CLIENT_RBCN, DBG_BUS_CLIENT_RBCN}, |
|---|
| 568 | | - GRC_REG_DBG_SELECT, GRC_REG_DBG_DWORD_ENABLE, |
|---|
| 569 | | - GRC_REG_DBG_SHIFT, GRC_REG_DBG_FORCE_VALID, |
|---|
| 570 | | - GRC_REG_DBG_FORCE_FRAME, |
|---|
| 571 | | - true, false, DBG_RESET_REG_MISC_PL_UA, 1 |
|---|
| 572 | | -}; |
|---|
| 573 | | - |
|---|
| 574 | | -static struct block_defs block_miscs_defs = { |
|---|
| 575 | | - "miscs", {true, true, true}, false, 0, |
|---|
| 576 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 577 | | - 0, 0, 0, 0, 0, |
|---|
| 578 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 579 | | -}; |
|---|
| 580 | | - |
|---|
| 581 | | -static struct block_defs block_misc_defs = { |
|---|
| 582 | | - "misc", {true, true, true}, false, 0, |
|---|
| 583 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 584 | | - 0, 0, 0, 0, 0, |
|---|
| 585 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 586 | | -}; |
|---|
| 587 | | - |
|---|
| 588 | | -static struct block_defs block_dbu_defs = { |
|---|
| 589 | | - "dbu", {true, true, true}, false, 0, |
|---|
| 590 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 591 | | - 0, 0, 0, 0, 0, |
|---|
| 592 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 593 | | -}; |
|---|
| 594 | | - |
|---|
| 595 | | -static struct block_defs block_pglue_b_defs = { |
|---|
| 596 | | - "pglue_b", |
|---|
| 597 | | - {true, true, true}, false, 0, |
|---|
| 598 | | - {DBG_BUS_CLIENT_RBCH, DBG_BUS_CLIENT_RBCH, DBG_BUS_CLIENT_RBCH}, |
|---|
| 599 | | - PGLUE_B_REG_DBG_SELECT, PGLUE_B_REG_DBG_DWORD_ENABLE, |
|---|
| 600 | | - PGLUE_B_REG_DBG_SHIFT, PGLUE_B_REG_DBG_FORCE_VALID, |
|---|
| 601 | | - PGLUE_B_REG_DBG_FORCE_FRAME, |
|---|
| 602 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 1 |
|---|
| 603 | | -}; |
|---|
| 604 | | - |
|---|
| 605 | | -static struct block_defs block_cnig_defs = { |
|---|
| 606 | | - "cnig", |
|---|
| 607 | | - {true, true, true}, false, 0, |
|---|
| 608 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCW, |
|---|
| 609 | | - DBG_BUS_CLIENT_RBCW}, |
|---|
| 610 | | - CNIG_REG_DBG_SELECT_K2_E5, CNIG_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 611 | | - CNIG_REG_DBG_SHIFT_K2_E5, CNIG_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 612 | | - CNIG_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 613 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 0 |
|---|
| 614 | | -}; |
|---|
| 615 | | - |
|---|
| 616 | | -static struct block_defs block_cpmu_defs = { |
|---|
| 617 | | - "cpmu", {true, true, true}, false, 0, |
|---|
| 618 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 619 | | - 0, 0, 0, 0, 0, |
|---|
| 620 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 8 |
|---|
| 621 | | -}; |
|---|
| 622 | | - |
|---|
| 623 | | -static struct block_defs block_ncsi_defs = { |
|---|
| 624 | | - "ncsi", |
|---|
| 625 | | - {true, true, true}, false, 0, |
|---|
| 626 | | - {DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCZ}, |
|---|
| 627 | | - NCSI_REG_DBG_SELECT, NCSI_REG_DBG_DWORD_ENABLE, |
|---|
| 628 | | - NCSI_REG_DBG_SHIFT, NCSI_REG_DBG_FORCE_VALID, |
|---|
| 629 | | - NCSI_REG_DBG_FORCE_FRAME, |
|---|
| 630 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 5 |
|---|
| 631 | | -}; |
|---|
| 632 | | - |
|---|
| 633 | | -static struct block_defs block_opte_defs = { |
|---|
| 634 | | - "opte", {true, true, false}, false, 0, |
|---|
| 635 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 636 | | - 0, 0, 0, 0, 0, |
|---|
| 637 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 4 |
|---|
| 638 | | -}; |
|---|
| 639 | | - |
|---|
| 640 | | -static struct block_defs block_bmb_defs = { |
|---|
| 641 | | - "bmb", |
|---|
| 642 | | - {true, true, true}, false, 0, |
|---|
| 643 | | - {DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCB, DBG_BUS_CLIENT_RBCB}, |
|---|
| 644 | | - BMB_REG_DBG_SELECT, BMB_REG_DBG_DWORD_ENABLE, |
|---|
| 645 | | - BMB_REG_DBG_SHIFT, BMB_REG_DBG_FORCE_VALID, |
|---|
| 646 | | - BMB_REG_DBG_FORCE_FRAME, |
|---|
| 647 | | - true, false, DBG_RESET_REG_MISCS_PL_UA, 7 |
|---|
| 648 | | -}; |
|---|
| 649 | | - |
|---|
| 650 | | -static struct block_defs block_pcie_defs = { |
|---|
| 651 | | - "pcie", |
|---|
| 652 | | - {true, true, true}, false, 0, |
|---|
| 653 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCH, |
|---|
| 654 | | - DBG_BUS_CLIENT_RBCH}, |
|---|
| 655 | | - PCIE_REG_DBG_COMMON_SELECT_K2_E5, |
|---|
| 656 | | - PCIE_REG_DBG_COMMON_DWORD_ENABLE_K2_E5, |
|---|
| 657 | | - PCIE_REG_DBG_COMMON_SHIFT_K2_E5, |
|---|
| 658 | | - PCIE_REG_DBG_COMMON_FORCE_VALID_K2_E5, |
|---|
| 659 | | - PCIE_REG_DBG_COMMON_FORCE_FRAME_K2_E5, |
|---|
| 660 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 661 | | -}; |
|---|
| 662 | | - |
|---|
| 663 | | -static struct block_defs block_mcp_defs = { |
|---|
| 664 | | - "mcp", {true, true, true}, false, 0, |
|---|
| 665 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 666 | | - 0, 0, 0, 0, 0, |
|---|
| 667 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 668 | | -}; |
|---|
| 669 | | - |
|---|
| 670 | | -static struct block_defs block_mcp2_defs = { |
|---|
| 671 | | - "mcp2", |
|---|
| 672 | | - {true, true, true}, false, 0, |
|---|
| 673 | | - {DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCZ}, |
|---|
| 674 | | - MCP2_REG_DBG_SELECT, MCP2_REG_DBG_DWORD_ENABLE, |
|---|
| 675 | | - MCP2_REG_DBG_SHIFT, MCP2_REG_DBG_FORCE_VALID, |
|---|
| 676 | | - MCP2_REG_DBG_FORCE_FRAME, |
|---|
| 677 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 678 | | -}; |
|---|
| 679 | | - |
|---|
| 680 | | -static struct block_defs block_pswhst_defs = { |
|---|
| 681 | | - "pswhst", |
|---|
| 682 | | - {true, true, true}, false, 0, |
|---|
| 683 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 684 | | - PSWHST_REG_DBG_SELECT, PSWHST_REG_DBG_DWORD_ENABLE, |
|---|
| 685 | | - PSWHST_REG_DBG_SHIFT, PSWHST_REG_DBG_FORCE_VALID, |
|---|
| 686 | | - PSWHST_REG_DBG_FORCE_FRAME, |
|---|
| 687 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 0 |
|---|
| 688 | | -}; |
|---|
| 689 | | - |
|---|
| 690 | | -static struct block_defs block_pswhst2_defs = { |
|---|
| 691 | | - "pswhst2", |
|---|
| 692 | | - {true, true, true}, false, 0, |
|---|
| 693 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 694 | | - PSWHST2_REG_DBG_SELECT, PSWHST2_REG_DBG_DWORD_ENABLE, |
|---|
| 695 | | - PSWHST2_REG_DBG_SHIFT, PSWHST2_REG_DBG_FORCE_VALID, |
|---|
| 696 | | - PSWHST2_REG_DBG_FORCE_FRAME, |
|---|
| 697 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 0 |
|---|
| 698 | | -}; |
|---|
| 699 | | - |
|---|
| 700 | | -static struct block_defs block_pswrd_defs = { |
|---|
| 701 | | - "pswrd", |
|---|
| 702 | | - {true, true, true}, false, 0, |
|---|
| 703 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 704 | | - PSWRD_REG_DBG_SELECT, PSWRD_REG_DBG_DWORD_ENABLE, |
|---|
| 705 | | - PSWRD_REG_DBG_SHIFT, PSWRD_REG_DBG_FORCE_VALID, |
|---|
| 706 | | - PSWRD_REG_DBG_FORCE_FRAME, |
|---|
| 707 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 2 |
|---|
| 708 | | -}; |
|---|
| 709 | | - |
|---|
| 710 | | -static struct block_defs block_pswrd2_defs = { |
|---|
| 711 | | - "pswrd2", |
|---|
| 712 | | - {true, true, true}, false, 0, |
|---|
| 713 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 714 | | - PSWRD2_REG_DBG_SELECT, PSWRD2_REG_DBG_DWORD_ENABLE, |
|---|
| 715 | | - PSWRD2_REG_DBG_SHIFT, PSWRD2_REG_DBG_FORCE_VALID, |
|---|
| 716 | | - PSWRD2_REG_DBG_FORCE_FRAME, |
|---|
| 717 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 2 |
|---|
| 718 | | -}; |
|---|
| 719 | | - |
|---|
| 720 | | -static struct block_defs block_pswwr_defs = { |
|---|
| 721 | | - "pswwr", |
|---|
| 722 | | - {true, true, true}, false, 0, |
|---|
| 723 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 724 | | - PSWWR_REG_DBG_SELECT, PSWWR_REG_DBG_DWORD_ENABLE, |
|---|
| 725 | | - PSWWR_REG_DBG_SHIFT, PSWWR_REG_DBG_FORCE_VALID, |
|---|
| 726 | | - PSWWR_REG_DBG_FORCE_FRAME, |
|---|
| 727 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 3 |
|---|
| 728 | | -}; |
|---|
| 729 | | - |
|---|
| 730 | | -static struct block_defs block_pswwr2_defs = { |
|---|
| 731 | | - "pswwr2", {true, true, true}, false, 0, |
|---|
| 732 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 733 | | - 0, 0, 0, 0, 0, |
|---|
| 734 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 3 |
|---|
| 735 | | -}; |
|---|
| 736 | | - |
|---|
| 737 | | -static struct block_defs block_pswrq_defs = { |
|---|
| 738 | | - "pswrq", |
|---|
| 739 | | - {true, true, true}, false, 0, |
|---|
| 740 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 741 | | - PSWRQ_REG_DBG_SELECT, PSWRQ_REG_DBG_DWORD_ENABLE, |
|---|
| 742 | | - PSWRQ_REG_DBG_SHIFT, PSWRQ_REG_DBG_FORCE_VALID, |
|---|
| 743 | | - PSWRQ_REG_DBG_FORCE_FRAME, |
|---|
| 744 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 1 |
|---|
| 745 | | -}; |
|---|
| 746 | | - |
|---|
| 747 | | -static struct block_defs block_pswrq2_defs = { |
|---|
| 748 | | - "pswrq2", |
|---|
| 749 | | - {true, true, true}, false, 0, |
|---|
| 750 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 751 | | - PSWRQ2_REG_DBG_SELECT, PSWRQ2_REG_DBG_DWORD_ENABLE, |
|---|
| 752 | | - PSWRQ2_REG_DBG_SHIFT, PSWRQ2_REG_DBG_FORCE_VALID, |
|---|
| 753 | | - PSWRQ2_REG_DBG_FORCE_FRAME, |
|---|
| 754 | | - true, false, DBG_RESET_REG_MISC_PL_HV, 1 |
|---|
| 755 | | -}; |
|---|
| 756 | | - |
|---|
| 757 | | -static struct block_defs block_pglcs_defs = { |
|---|
| 758 | | - "pglcs", |
|---|
| 759 | | - {true, true, true}, false, 0, |
|---|
| 760 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCH, |
|---|
| 761 | | - DBG_BUS_CLIENT_RBCH}, |
|---|
| 762 | | - PGLCS_REG_DBG_SELECT_K2_E5, PGLCS_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 763 | | - PGLCS_REG_DBG_SHIFT_K2_E5, PGLCS_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 764 | | - PGLCS_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 765 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 2 |
|---|
| 766 | | -}; |
|---|
| 767 | | - |
|---|
| 768 | | -static struct block_defs block_ptu_defs = { |
|---|
| 769 | | - "ptu", |
|---|
| 770 | | - {true, true, true}, false, 0, |
|---|
| 771 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 772 | | - PTU_REG_DBG_SELECT, PTU_REG_DBG_DWORD_ENABLE, |
|---|
| 773 | | - PTU_REG_DBG_SHIFT, PTU_REG_DBG_FORCE_VALID, |
|---|
| 774 | | - PTU_REG_DBG_FORCE_FRAME, |
|---|
| 775 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 20 |
|---|
| 776 | | -}; |
|---|
| 777 | | - |
|---|
| 778 | | -static struct block_defs block_dmae_defs = { |
|---|
| 779 | | - "dmae", |
|---|
| 780 | | - {true, true, true}, false, 0, |
|---|
| 781 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 782 | | - DMAE_REG_DBG_SELECT, DMAE_REG_DBG_DWORD_ENABLE, |
|---|
| 783 | | - DMAE_REG_DBG_SHIFT, DMAE_REG_DBG_FORCE_VALID, |
|---|
| 784 | | - DMAE_REG_DBG_FORCE_FRAME, |
|---|
| 785 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 28 |
|---|
| 786 | | -}; |
|---|
| 787 | | - |
|---|
| 788 | | -static struct block_defs block_tcm_defs = { |
|---|
| 789 | | - "tcm", |
|---|
| 790 | | - {true, true, true}, true, DBG_TSTORM_ID, |
|---|
| 791 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT}, |
|---|
| 792 | | - TCM_REG_DBG_SELECT, TCM_REG_DBG_DWORD_ENABLE, |
|---|
| 793 | | - TCM_REG_DBG_SHIFT, TCM_REG_DBG_FORCE_VALID, |
|---|
| 794 | | - TCM_REG_DBG_FORCE_FRAME, |
|---|
| 795 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 5 |
|---|
| 796 | | -}; |
|---|
| 797 | | - |
|---|
| 798 | | -static struct block_defs block_mcm_defs = { |
|---|
| 799 | | - "mcm", |
|---|
| 800 | | - {true, true, true}, true, DBG_MSTORM_ID, |
|---|
| 801 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 802 | | - MCM_REG_DBG_SELECT, MCM_REG_DBG_DWORD_ENABLE, |
|---|
| 803 | | - MCM_REG_DBG_SHIFT, MCM_REG_DBG_FORCE_VALID, |
|---|
| 804 | | - MCM_REG_DBG_FORCE_FRAME, |
|---|
| 805 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 3 |
|---|
| 806 | | -}; |
|---|
| 807 | | - |
|---|
| 808 | | -static struct block_defs block_ucm_defs = { |
|---|
| 809 | | - "ucm", |
|---|
| 810 | | - {true, true, true}, true, DBG_USTORM_ID, |
|---|
| 811 | | - {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU}, |
|---|
| 812 | | - UCM_REG_DBG_SELECT, UCM_REG_DBG_DWORD_ENABLE, |
|---|
| 813 | | - UCM_REG_DBG_SHIFT, UCM_REG_DBG_FORCE_VALID, |
|---|
| 814 | | - UCM_REG_DBG_FORCE_FRAME, |
|---|
| 815 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 8 |
|---|
| 816 | | -}; |
|---|
| 817 | | - |
|---|
| 818 | | -static struct block_defs block_xcm_defs = { |
|---|
| 819 | | - "xcm", |
|---|
| 820 | | - {true, true, true}, true, DBG_XSTORM_ID, |
|---|
| 821 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX}, |
|---|
| 822 | | - XCM_REG_DBG_SELECT, XCM_REG_DBG_DWORD_ENABLE, |
|---|
| 823 | | - XCM_REG_DBG_SHIFT, XCM_REG_DBG_FORCE_VALID, |
|---|
| 824 | | - XCM_REG_DBG_FORCE_FRAME, |
|---|
| 825 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 19 |
|---|
| 826 | | -}; |
|---|
| 827 | | - |
|---|
| 828 | | -static struct block_defs block_ycm_defs = { |
|---|
| 829 | | - "ycm", |
|---|
| 830 | | - {true, true, true}, true, DBG_YSTORM_ID, |
|---|
| 831 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCY, DBG_BUS_CLIENT_RBCY}, |
|---|
| 832 | | - YCM_REG_DBG_SELECT, YCM_REG_DBG_DWORD_ENABLE, |
|---|
| 833 | | - YCM_REG_DBG_SHIFT, YCM_REG_DBG_FORCE_VALID, |
|---|
| 834 | | - YCM_REG_DBG_FORCE_FRAME, |
|---|
| 835 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 5 |
|---|
| 836 | | -}; |
|---|
| 837 | | - |
|---|
| 838 | | -static struct block_defs block_pcm_defs = { |
|---|
| 839 | | - "pcm", |
|---|
| 840 | | - {true, true, true}, true, DBG_PSTORM_ID, |
|---|
| 841 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 842 | | - PCM_REG_DBG_SELECT, PCM_REG_DBG_DWORD_ENABLE, |
|---|
| 843 | | - PCM_REG_DBG_SHIFT, PCM_REG_DBG_FORCE_VALID, |
|---|
| 844 | | - PCM_REG_DBG_FORCE_FRAME, |
|---|
| 845 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 4 |
|---|
| 846 | | -}; |
|---|
| 847 | | - |
|---|
| 848 | | -static struct block_defs block_qm_defs = { |
|---|
| 849 | | - "qm", |
|---|
| 850 | | - {true, true, true}, false, 0, |
|---|
| 851 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCQ, DBG_BUS_CLIENT_RBCQ}, |
|---|
| 852 | | - QM_REG_DBG_SELECT, QM_REG_DBG_DWORD_ENABLE, |
|---|
| 853 | | - QM_REG_DBG_SHIFT, QM_REG_DBG_FORCE_VALID, |
|---|
| 854 | | - QM_REG_DBG_FORCE_FRAME, |
|---|
| 855 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 16 |
|---|
| 856 | | -}; |
|---|
| 857 | | - |
|---|
| 858 | | -static struct block_defs block_tm_defs = { |
|---|
| 859 | | - "tm", |
|---|
| 860 | | - {true, true, true}, false, 0, |
|---|
| 861 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 862 | | - TM_REG_DBG_SELECT, TM_REG_DBG_DWORD_ENABLE, |
|---|
| 863 | | - TM_REG_DBG_SHIFT, TM_REG_DBG_FORCE_VALID, |
|---|
| 864 | | - TM_REG_DBG_FORCE_FRAME, |
|---|
| 865 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 17 |
|---|
| 866 | | -}; |
|---|
| 867 | | - |
|---|
| 868 | | -static struct block_defs block_dorq_defs = { |
|---|
| 869 | | - "dorq", |
|---|
| 870 | | - {true, true, true}, false, 0, |
|---|
| 871 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCY, DBG_BUS_CLIENT_RBCY}, |
|---|
| 872 | | - DORQ_REG_DBG_SELECT, DORQ_REG_DBG_DWORD_ENABLE, |
|---|
| 873 | | - DORQ_REG_DBG_SHIFT, DORQ_REG_DBG_FORCE_VALID, |
|---|
| 874 | | - DORQ_REG_DBG_FORCE_FRAME, |
|---|
| 875 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 18 |
|---|
| 876 | | -}; |
|---|
| 877 | | - |
|---|
| 878 | | -static struct block_defs block_brb_defs = { |
|---|
| 879 | | - "brb", |
|---|
| 880 | | - {true, true, true}, false, 0, |
|---|
| 881 | | - {DBG_BUS_CLIENT_RBCR, DBG_BUS_CLIENT_RBCR, DBG_BUS_CLIENT_RBCR}, |
|---|
| 882 | | - BRB_REG_DBG_SELECT, BRB_REG_DBG_DWORD_ENABLE, |
|---|
| 883 | | - BRB_REG_DBG_SHIFT, BRB_REG_DBG_FORCE_VALID, |
|---|
| 884 | | - BRB_REG_DBG_FORCE_FRAME, |
|---|
| 885 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 0 |
|---|
| 886 | | -}; |
|---|
| 887 | | - |
|---|
| 888 | | -static struct block_defs block_src_defs = { |
|---|
| 889 | | - "src", |
|---|
| 890 | | - {true, true, true}, false, 0, |
|---|
| 891 | | - {DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF}, |
|---|
| 892 | | - SRC_REG_DBG_SELECT, SRC_REG_DBG_DWORD_ENABLE, |
|---|
| 893 | | - SRC_REG_DBG_SHIFT, SRC_REG_DBG_FORCE_VALID, |
|---|
| 894 | | - SRC_REG_DBG_FORCE_FRAME, |
|---|
| 895 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 2 |
|---|
| 896 | | -}; |
|---|
| 897 | | - |
|---|
| 898 | | -static struct block_defs block_prs_defs = { |
|---|
| 899 | | - "prs", |
|---|
| 900 | | - {true, true, true}, false, 0, |
|---|
| 901 | | - {DBG_BUS_CLIENT_RBCR, DBG_BUS_CLIENT_RBCR, DBG_BUS_CLIENT_RBCR}, |
|---|
| 902 | | - PRS_REG_DBG_SELECT, PRS_REG_DBG_DWORD_ENABLE, |
|---|
| 903 | | - PRS_REG_DBG_SHIFT, PRS_REG_DBG_FORCE_VALID, |
|---|
| 904 | | - PRS_REG_DBG_FORCE_FRAME, |
|---|
| 905 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 1 |
|---|
| 906 | | -}; |
|---|
| 907 | | - |
|---|
| 908 | | -static struct block_defs block_tsdm_defs = { |
|---|
| 909 | | - "tsdm", |
|---|
| 910 | | - {true, true, true}, true, DBG_TSTORM_ID, |
|---|
| 911 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT}, |
|---|
| 912 | | - TSDM_REG_DBG_SELECT, TSDM_REG_DBG_DWORD_ENABLE, |
|---|
| 913 | | - TSDM_REG_DBG_SHIFT, TSDM_REG_DBG_FORCE_VALID, |
|---|
| 914 | | - TSDM_REG_DBG_FORCE_FRAME, |
|---|
| 915 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 3 |
|---|
| 916 | | -}; |
|---|
| 917 | | - |
|---|
| 918 | | -static struct block_defs block_msdm_defs = { |
|---|
| 919 | | - "msdm", |
|---|
| 920 | | - {true, true, true}, true, DBG_MSTORM_ID, |
|---|
| 921 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 922 | | - MSDM_REG_DBG_SELECT, MSDM_REG_DBG_DWORD_ENABLE, |
|---|
| 923 | | - MSDM_REG_DBG_SHIFT, MSDM_REG_DBG_FORCE_VALID, |
|---|
| 924 | | - MSDM_REG_DBG_FORCE_FRAME, |
|---|
| 925 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 6 |
|---|
| 926 | | -}; |
|---|
| 927 | | - |
|---|
| 928 | | -static struct block_defs block_usdm_defs = { |
|---|
| 929 | | - "usdm", |
|---|
| 930 | | - {true, true, true}, true, DBG_USTORM_ID, |
|---|
| 931 | | - {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU}, |
|---|
| 932 | | - USDM_REG_DBG_SELECT, USDM_REG_DBG_DWORD_ENABLE, |
|---|
| 933 | | - USDM_REG_DBG_SHIFT, USDM_REG_DBG_FORCE_VALID, |
|---|
| 934 | | - USDM_REG_DBG_FORCE_FRAME, |
|---|
| 935 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 7 |
|---|
| 936 | | -}; |
|---|
| 937 | | - |
|---|
| 938 | | -static struct block_defs block_xsdm_defs = { |
|---|
| 939 | | - "xsdm", |
|---|
| 940 | | - {true, true, true}, true, DBG_XSTORM_ID, |
|---|
| 941 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX}, |
|---|
| 942 | | - XSDM_REG_DBG_SELECT, XSDM_REG_DBG_DWORD_ENABLE, |
|---|
| 943 | | - XSDM_REG_DBG_SHIFT, XSDM_REG_DBG_FORCE_VALID, |
|---|
| 944 | | - XSDM_REG_DBG_FORCE_FRAME, |
|---|
| 945 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 20 |
|---|
| 946 | | -}; |
|---|
| 947 | | - |
|---|
| 948 | | -static struct block_defs block_ysdm_defs = { |
|---|
| 949 | | - "ysdm", |
|---|
| 950 | | - {true, true, true}, true, DBG_YSTORM_ID, |
|---|
| 951 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCY, DBG_BUS_CLIENT_RBCY}, |
|---|
| 952 | | - YSDM_REG_DBG_SELECT, YSDM_REG_DBG_DWORD_ENABLE, |
|---|
| 953 | | - YSDM_REG_DBG_SHIFT, YSDM_REG_DBG_FORCE_VALID, |
|---|
| 954 | | - YSDM_REG_DBG_FORCE_FRAME, |
|---|
| 955 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 8 |
|---|
| 956 | | -}; |
|---|
| 957 | | - |
|---|
| 958 | | -static struct block_defs block_psdm_defs = { |
|---|
| 959 | | - "psdm", |
|---|
| 960 | | - {true, true, true}, true, DBG_PSTORM_ID, |
|---|
| 961 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 962 | | - PSDM_REG_DBG_SELECT, PSDM_REG_DBG_DWORD_ENABLE, |
|---|
| 963 | | - PSDM_REG_DBG_SHIFT, PSDM_REG_DBG_FORCE_VALID, |
|---|
| 964 | | - PSDM_REG_DBG_FORCE_FRAME, |
|---|
| 965 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 7 |
|---|
| 966 | | -}; |
|---|
| 967 | | - |
|---|
| 968 | | -static struct block_defs block_tsem_defs = { |
|---|
| 969 | | - "tsem", |
|---|
| 970 | | - {true, true, true}, true, DBG_TSTORM_ID, |
|---|
| 971 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT}, |
|---|
| 972 | | - TSEM_REG_DBG_SELECT, TSEM_REG_DBG_DWORD_ENABLE, |
|---|
| 973 | | - TSEM_REG_DBG_SHIFT, TSEM_REG_DBG_FORCE_VALID, |
|---|
| 974 | | - TSEM_REG_DBG_FORCE_FRAME, |
|---|
| 975 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 4 |
|---|
| 976 | | -}; |
|---|
| 977 | | - |
|---|
| 978 | | -static struct block_defs block_msem_defs = { |
|---|
| 979 | | - "msem", |
|---|
| 980 | | - {true, true, true}, true, DBG_MSTORM_ID, |
|---|
| 981 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 982 | | - MSEM_REG_DBG_SELECT, MSEM_REG_DBG_DWORD_ENABLE, |
|---|
| 983 | | - MSEM_REG_DBG_SHIFT, MSEM_REG_DBG_FORCE_VALID, |
|---|
| 984 | | - MSEM_REG_DBG_FORCE_FRAME, |
|---|
| 985 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 9 |
|---|
| 986 | | -}; |
|---|
| 987 | | - |
|---|
| 988 | | -static struct block_defs block_usem_defs = { |
|---|
| 989 | | - "usem", |
|---|
| 990 | | - {true, true, true}, true, DBG_USTORM_ID, |
|---|
| 991 | | - {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU}, |
|---|
| 992 | | - USEM_REG_DBG_SELECT, USEM_REG_DBG_DWORD_ENABLE, |
|---|
| 993 | | - USEM_REG_DBG_SHIFT, USEM_REG_DBG_FORCE_VALID, |
|---|
| 994 | | - USEM_REG_DBG_FORCE_FRAME, |
|---|
| 995 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 9 |
|---|
| 996 | | -}; |
|---|
| 997 | | - |
|---|
| 998 | | -static struct block_defs block_xsem_defs = { |
|---|
| 999 | | - "xsem", |
|---|
| 1000 | | - {true, true, true}, true, DBG_XSTORM_ID, |
|---|
| 1001 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX}, |
|---|
| 1002 | | - XSEM_REG_DBG_SELECT, XSEM_REG_DBG_DWORD_ENABLE, |
|---|
| 1003 | | - XSEM_REG_DBG_SHIFT, XSEM_REG_DBG_FORCE_VALID, |
|---|
| 1004 | | - XSEM_REG_DBG_FORCE_FRAME, |
|---|
| 1005 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 21 |
|---|
| 1006 | | -}; |
|---|
| 1007 | | - |
|---|
| 1008 | | -static struct block_defs block_ysem_defs = { |
|---|
| 1009 | | - "ysem", |
|---|
| 1010 | | - {true, true, true}, true, DBG_YSTORM_ID, |
|---|
| 1011 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCY, DBG_BUS_CLIENT_RBCY}, |
|---|
| 1012 | | - YSEM_REG_DBG_SELECT, YSEM_REG_DBG_DWORD_ENABLE, |
|---|
| 1013 | | - YSEM_REG_DBG_SHIFT, YSEM_REG_DBG_FORCE_VALID, |
|---|
| 1014 | | - YSEM_REG_DBG_FORCE_FRAME, |
|---|
| 1015 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 11 |
|---|
| 1016 | | -}; |
|---|
| 1017 | | - |
|---|
| 1018 | | -static struct block_defs block_psem_defs = { |
|---|
| 1019 | | - "psem", |
|---|
| 1020 | | - {true, true, true}, true, DBG_PSTORM_ID, |
|---|
| 1021 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 1022 | | - PSEM_REG_DBG_SELECT, PSEM_REG_DBG_DWORD_ENABLE, |
|---|
| 1023 | | - PSEM_REG_DBG_SHIFT, PSEM_REG_DBG_FORCE_VALID, |
|---|
| 1024 | | - PSEM_REG_DBG_FORCE_FRAME, |
|---|
| 1025 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 10 |
|---|
| 1026 | | -}; |
|---|
| 1027 | | - |
|---|
| 1028 | | -static struct block_defs block_rss_defs = { |
|---|
| 1029 | | - "rss", |
|---|
| 1030 | | - {true, true, true}, false, 0, |
|---|
| 1031 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCT}, |
|---|
| 1032 | | - RSS_REG_DBG_SELECT, RSS_REG_DBG_DWORD_ENABLE, |
|---|
| 1033 | | - RSS_REG_DBG_SHIFT, RSS_REG_DBG_FORCE_VALID, |
|---|
| 1034 | | - RSS_REG_DBG_FORCE_FRAME, |
|---|
| 1035 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 18 |
|---|
| 1036 | | -}; |
|---|
| 1037 | | - |
|---|
| 1038 | | -static struct block_defs block_tmld_defs = { |
|---|
| 1039 | | - "tmld", |
|---|
| 1040 | | - {true, true, true}, false, 0, |
|---|
| 1041 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 1042 | | - TMLD_REG_DBG_SELECT, TMLD_REG_DBG_DWORD_ENABLE, |
|---|
| 1043 | | - TMLD_REG_DBG_SHIFT, TMLD_REG_DBG_FORCE_VALID, |
|---|
| 1044 | | - TMLD_REG_DBG_FORCE_FRAME, |
|---|
| 1045 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 13 |
|---|
| 1046 | | -}; |
|---|
| 1047 | | - |
|---|
| 1048 | | -static struct block_defs block_muld_defs = { |
|---|
| 1049 | | - "muld", |
|---|
| 1050 | | - {true, true, true}, false, 0, |
|---|
| 1051 | | - {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU}, |
|---|
| 1052 | | - MULD_REG_DBG_SELECT, MULD_REG_DBG_DWORD_ENABLE, |
|---|
| 1053 | | - MULD_REG_DBG_SHIFT, MULD_REG_DBG_FORCE_VALID, |
|---|
| 1054 | | - MULD_REG_DBG_FORCE_FRAME, |
|---|
| 1055 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 14 |
|---|
| 1056 | | -}; |
|---|
| 1057 | | - |
|---|
| 1058 | | -static struct block_defs block_yuld_defs = { |
|---|
| 1059 | | - "yuld", |
|---|
| 1060 | | - {true, true, false}, false, 0, |
|---|
| 1061 | | - {DBG_BUS_CLIENT_RBCU, DBG_BUS_CLIENT_RBCU, |
|---|
| 1062 | | - MAX_DBG_BUS_CLIENTS}, |
|---|
| 1063 | | - YULD_REG_DBG_SELECT_BB_K2, YULD_REG_DBG_DWORD_ENABLE_BB_K2, |
|---|
| 1064 | | - YULD_REG_DBG_SHIFT_BB_K2, YULD_REG_DBG_FORCE_VALID_BB_K2, |
|---|
| 1065 | | - YULD_REG_DBG_FORCE_FRAME_BB_K2, |
|---|
| 1066 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, |
|---|
| 1067 | | - 15 |
|---|
| 1068 | | -}; |
|---|
| 1069 | | - |
|---|
| 1070 | | -static struct block_defs block_xyld_defs = { |
|---|
| 1071 | | - "xyld", |
|---|
| 1072 | | - {true, true, true}, false, 0, |
|---|
| 1073 | | - {DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX, DBG_BUS_CLIENT_RBCX}, |
|---|
| 1074 | | - XYLD_REG_DBG_SELECT, XYLD_REG_DBG_DWORD_ENABLE, |
|---|
| 1075 | | - XYLD_REG_DBG_SHIFT, XYLD_REG_DBG_FORCE_VALID, |
|---|
| 1076 | | - XYLD_REG_DBG_FORCE_FRAME, |
|---|
| 1077 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 12 |
|---|
| 1078 | | -}; |
|---|
| 1079 | | - |
|---|
| 1080 | | -static struct block_defs block_ptld_defs = { |
|---|
| 1081 | | - "ptld", |
|---|
| 1082 | | - {false, false, true}, false, 0, |
|---|
| 1083 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCT}, |
|---|
| 1084 | | - PTLD_REG_DBG_SELECT_E5, PTLD_REG_DBG_DWORD_ENABLE_E5, |
|---|
| 1085 | | - PTLD_REG_DBG_SHIFT_E5, PTLD_REG_DBG_FORCE_VALID_E5, |
|---|
| 1086 | | - PTLD_REG_DBG_FORCE_FRAME_E5, |
|---|
| 1087 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, |
|---|
| 1088 | | - 28 |
|---|
| 1089 | | -}; |
|---|
| 1090 | | - |
|---|
| 1091 | | -static struct block_defs block_ypld_defs = { |
|---|
| 1092 | | - "ypld", |
|---|
| 1093 | | - {false, false, true}, false, 0, |
|---|
| 1094 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 1095 | | - YPLD_REG_DBG_SELECT_E5, YPLD_REG_DBG_DWORD_ENABLE_E5, |
|---|
| 1096 | | - YPLD_REG_DBG_SHIFT_E5, YPLD_REG_DBG_FORCE_VALID_E5, |
|---|
| 1097 | | - YPLD_REG_DBG_FORCE_FRAME_E5, |
|---|
| 1098 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, |
|---|
| 1099 | | - 27 |
|---|
| 1100 | | -}; |
|---|
| 1101 | | - |
|---|
| 1102 | | -static struct block_defs block_prm_defs = { |
|---|
| 1103 | | - "prm", |
|---|
| 1104 | | - {true, true, true}, false, 0, |
|---|
| 1105 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 1106 | | - PRM_REG_DBG_SELECT, PRM_REG_DBG_DWORD_ENABLE, |
|---|
| 1107 | | - PRM_REG_DBG_SHIFT, PRM_REG_DBG_FORCE_VALID, |
|---|
| 1108 | | - PRM_REG_DBG_FORCE_FRAME, |
|---|
| 1109 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 21 |
|---|
| 1110 | | -}; |
|---|
| 1111 | | - |
|---|
| 1112 | | -static struct block_defs block_pbf_pb1_defs = { |
|---|
| 1113 | | - "pbf_pb1", |
|---|
| 1114 | | - {true, true, true}, false, 0, |
|---|
| 1115 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCV, DBG_BUS_CLIENT_RBCV}, |
|---|
| 1116 | | - PBF_PB1_REG_DBG_SELECT, PBF_PB1_REG_DBG_DWORD_ENABLE, |
|---|
| 1117 | | - PBF_PB1_REG_DBG_SHIFT, PBF_PB1_REG_DBG_FORCE_VALID, |
|---|
| 1118 | | - PBF_PB1_REG_DBG_FORCE_FRAME, |
|---|
| 1119 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, |
|---|
| 1120 | | - 11 |
|---|
| 1121 | | -}; |
|---|
| 1122 | | - |
|---|
| 1123 | | -static struct block_defs block_pbf_pb2_defs = { |
|---|
| 1124 | | - "pbf_pb2", |
|---|
| 1125 | | - {true, true, true}, false, 0, |
|---|
| 1126 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCV, DBG_BUS_CLIENT_RBCV}, |
|---|
| 1127 | | - PBF_PB2_REG_DBG_SELECT, PBF_PB2_REG_DBG_DWORD_ENABLE, |
|---|
| 1128 | | - PBF_PB2_REG_DBG_SHIFT, PBF_PB2_REG_DBG_FORCE_VALID, |
|---|
| 1129 | | - PBF_PB2_REG_DBG_FORCE_FRAME, |
|---|
| 1130 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, |
|---|
| 1131 | | - 12 |
|---|
| 1132 | | -}; |
|---|
| 1133 | | - |
|---|
| 1134 | | -static struct block_defs block_rpb_defs = { |
|---|
| 1135 | | - "rpb", |
|---|
| 1136 | | - {true, true, true}, false, 0, |
|---|
| 1137 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 1138 | | - RPB_REG_DBG_SELECT, RPB_REG_DBG_DWORD_ENABLE, |
|---|
| 1139 | | - RPB_REG_DBG_SHIFT, RPB_REG_DBG_FORCE_VALID, |
|---|
| 1140 | | - RPB_REG_DBG_FORCE_FRAME, |
|---|
| 1141 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 13 |
|---|
| 1142 | | -}; |
|---|
| 1143 | | - |
|---|
| 1144 | | -static struct block_defs block_btb_defs = { |
|---|
| 1145 | | - "btb", |
|---|
| 1146 | | - {true, true, true}, false, 0, |
|---|
| 1147 | | - {DBG_BUS_CLIENT_RBCR, DBG_BUS_CLIENT_RBCV, DBG_BUS_CLIENT_RBCV}, |
|---|
| 1148 | | - BTB_REG_DBG_SELECT, BTB_REG_DBG_DWORD_ENABLE, |
|---|
| 1149 | | - BTB_REG_DBG_SHIFT, BTB_REG_DBG_FORCE_VALID, |
|---|
| 1150 | | - BTB_REG_DBG_FORCE_FRAME, |
|---|
| 1151 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 10 |
|---|
| 1152 | | -}; |
|---|
| 1153 | | - |
|---|
| 1154 | | -static struct block_defs block_pbf_defs = { |
|---|
| 1155 | | - "pbf", |
|---|
| 1156 | | - {true, true, true}, false, 0, |
|---|
| 1157 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCV, DBG_BUS_CLIENT_RBCV}, |
|---|
| 1158 | | - PBF_REG_DBG_SELECT, PBF_REG_DBG_DWORD_ENABLE, |
|---|
| 1159 | | - PBF_REG_DBG_SHIFT, PBF_REG_DBG_FORCE_VALID, |
|---|
| 1160 | | - PBF_REG_DBG_FORCE_FRAME, |
|---|
| 1161 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 15 |
|---|
| 1162 | | -}; |
|---|
| 1163 | | - |
|---|
| 1164 | | -static struct block_defs block_rdif_defs = { |
|---|
| 1165 | | - "rdif", |
|---|
| 1166 | | - {true, true, true}, false, 0, |
|---|
| 1167 | | - {DBG_BUS_CLIENT_RBCT, DBG_BUS_CLIENT_RBCM, DBG_BUS_CLIENT_RBCM}, |
|---|
| 1168 | | - RDIF_REG_DBG_SELECT, RDIF_REG_DBG_DWORD_ENABLE, |
|---|
| 1169 | | - RDIF_REG_DBG_SHIFT, RDIF_REG_DBG_FORCE_VALID, |
|---|
| 1170 | | - RDIF_REG_DBG_FORCE_FRAME, |
|---|
| 1171 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 16 |
|---|
| 1172 | | -}; |
|---|
| 1173 | | - |
|---|
| 1174 | | -static struct block_defs block_tdif_defs = { |
|---|
| 1175 | | - "tdif", |
|---|
| 1176 | | - {true, true, true}, false, 0, |
|---|
| 1177 | | - {DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS, DBG_BUS_CLIENT_RBCS}, |
|---|
| 1178 | | - TDIF_REG_DBG_SELECT, TDIF_REG_DBG_DWORD_ENABLE, |
|---|
| 1179 | | - TDIF_REG_DBG_SHIFT, TDIF_REG_DBG_FORCE_VALID, |
|---|
| 1180 | | - TDIF_REG_DBG_FORCE_FRAME, |
|---|
| 1181 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 17 |
|---|
| 1182 | | -}; |
|---|
| 1183 | | - |
|---|
| 1184 | | -static struct block_defs block_cdu_defs = { |
|---|
| 1185 | | - "cdu", |
|---|
| 1186 | | - {true, true, true}, false, 0, |
|---|
| 1187 | | - {DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF}, |
|---|
| 1188 | | - CDU_REG_DBG_SELECT, CDU_REG_DBG_DWORD_ENABLE, |
|---|
| 1189 | | - CDU_REG_DBG_SHIFT, CDU_REG_DBG_FORCE_VALID, |
|---|
| 1190 | | - CDU_REG_DBG_FORCE_FRAME, |
|---|
| 1191 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 23 |
|---|
| 1192 | | -}; |
|---|
| 1193 | | - |
|---|
| 1194 | | -static struct block_defs block_ccfc_defs = { |
|---|
| 1195 | | - "ccfc", |
|---|
| 1196 | | - {true, true, true}, false, 0, |
|---|
| 1197 | | - {DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF}, |
|---|
| 1198 | | - CCFC_REG_DBG_SELECT, CCFC_REG_DBG_DWORD_ENABLE, |
|---|
| 1199 | | - CCFC_REG_DBG_SHIFT, CCFC_REG_DBG_FORCE_VALID, |
|---|
| 1200 | | - CCFC_REG_DBG_FORCE_FRAME, |
|---|
| 1201 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 24 |
|---|
| 1202 | | -}; |
|---|
| 1203 | | - |
|---|
| 1204 | | -static struct block_defs block_tcfc_defs = { |
|---|
| 1205 | | - "tcfc", |
|---|
| 1206 | | - {true, true, true}, false, 0, |
|---|
| 1207 | | - {DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF, DBG_BUS_CLIENT_RBCF}, |
|---|
| 1208 | | - TCFC_REG_DBG_SELECT, TCFC_REG_DBG_DWORD_ENABLE, |
|---|
| 1209 | | - TCFC_REG_DBG_SHIFT, TCFC_REG_DBG_FORCE_VALID, |
|---|
| 1210 | | - TCFC_REG_DBG_FORCE_FRAME, |
|---|
| 1211 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 25 |
|---|
| 1212 | | -}; |
|---|
| 1213 | | - |
|---|
| 1214 | | -static struct block_defs block_igu_defs = { |
|---|
| 1215 | | - "igu", |
|---|
| 1216 | | - {true, true, true}, false, 0, |
|---|
| 1217 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 1218 | | - IGU_REG_DBG_SELECT, IGU_REG_DBG_DWORD_ENABLE, |
|---|
| 1219 | | - IGU_REG_DBG_SHIFT, IGU_REG_DBG_FORCE_VALID, |
|---|
| 1220 | | - IGU_REG_DBG_FORCE_FRAME, |
|---|
| 1221 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, 27 |
|---|
| 1222 | | -}; |
|---|
| 1223 | | - |
|---|
| 1224 | | -static struct block_defs block_cau_defs = { |
|---|
| 1225 | | - "cau", |
|---|
| 1226 | | - {true, true, true}, false, 0, |
|---|
| 1227 | | - {DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP, DBG_BUS_CLIENT_RBCP}, |
|---|
| 1228 | | - CAU_REG_DBG_SELECT, CAU_REG_DBG_DWORD_ENABLE, |
|---|
| 1229 | | - CAU_REG_DBG_SHIFT, CAU_REG_DBG_FORCE_VALID, |
|---|
| 1230 | | - CAU_REG_DBG_FORCE_FRAME, |
|---|
| 1231 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 19 |
|---|
| 1232 | | -}; |
|---|
| 1233 | | - |
|---|
| 1234 | | -static struct block_defs block_rgfs_defs = { |
|---|
| 1235 | | - "rgfs", {false, false, true}, false, 0, |
|---|
| 1236 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1237 | | - 0, 0, 0, 0, 0, |
|---|
| 1238 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 29 |
|---|
| 1239 | | -}; |
|---|
| 1240 | | - |
|---|
| 1241 | | -static struct block_defs block_rgsrc_defs = { |
|---|
| 1242 | | - "rgsrc", |
|---|
| 1243 | | - {false, false, true}, false, 0, |
|---|
| 1244 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCH}, |
|---|
| 1245 | | - RGSRC_REG_DBG_SELECT_E5, RGSRC_REG_DBG_DWORD_ENABLE_E5, |
|---|
| 1246 | | - RGSRC_REG_DBG_SHIFT_E5, RGSRC_REG_DBG_FORCE_VALID_E5, |
|---|
| 1247 | | - RGSRC_REG_DBG_FORCE_FRAME_E5, |
|---|
| 1248 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, |
|---|
| 1249 | | - 30 |
|---|
| 1250 | | -}; |
|---|
| 1251 | | - |
|---|
| 1252 | | -static struct block_defs block_tgfs_defs = { |
|---|
| 1253 | | - "tgfs", {false, false, true}, false, 0, |
|---|
| 1254 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1255 | | - 0, 0, 0, 0, 0, |
|---|
| 1256 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_2, 30 |
|---|
| 1257 | | -}; |
|---|
| 1258 | | - |
|---|
| 1259 | | -static struct block_defs block_tgsrc_defs = { |
|---|
| 1260 | | - "tgsrc", |
|---|
| 1261 | | - {false, false, true}, false, 0, |
|---|
| 1262 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCV}, |
|---|
| 1263 | | - TGSRC_REG_DBG_SELECT_E5, TGSRC_REG_DBG_DWORD_ENABLE_E5, |
|---|
| 1264 | | - TGSRC_REG_DBG_SHIFT_E5, TGSRC_REG_DBG_FORCE_VALID_E5, |
|---|
| 1265 | | - TGSRC_REG_DBG_FORCE_FRAME_E5, |
|---|
| 1266 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VMAIN_1, |
|---|
| 1267 | | - 31 |
|---|
| 1268 | | -}; |
|---|
| 1269 | | - |
|---|
| 1270 | | -static struct block_defs block_umac_defs = { |
|---|
| 1271 | | - "umac", |
|---|
| 1272 | | - {true, true, true}, false, 0, |
|---|
| 1273 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCZ, |
|---|
| 1274 | | - DBG_BUS_CLIENT_RBCZ}, |
|---|
| 1275 | | - UMAC_REG_DBG_SELECT_K2_E5, UMAC_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 1276 | | - UMAC_REG_DBG_SHIFT_K2_E5, UMAC_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 1277 | | - UMAC_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 1278 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 6 |
|---|
| 1279 | | -}; |
|---|
| 1280 | | - |
|---|
| 1281 | | -static struct block_defs block_xmac_defs = { |
|---|
| 1282 | | - "xmac", {true, false, false}, false, 0, |
|---|
| 1283 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1284 | | - 0, 0, 0, 0, 0, |
|---|
| 1285 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 1286 | | -}; |
|---|
| 1287 | | - |
|---|
| 1288 | | -static struct block_defs block_dbg_defs = { |
|---|
| 1289 | | - "dbg", {true, true, true}, false, 0, |
|---|
| 1290 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1291 | | - 0, 0, 0, 0, 0, |
|---|
| 1292 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VAUX, 3 |
|---|
| 1293 | | -}; |
|---|
| 1294 | | - |
|---|
| 1295 | | -static struct block_defs block_nig_defs = { |
|---|
| 1296 | | - "nig", |
|---|
| 1297 | | - {true, true, true}, false, 0, |
|---|
| 1298 | | - {DBG_BUS_CLIENT_RBCN, DBG_BUS_CLIENT_RBCN, DBG_BUS_CLIENT_RBCN}, |
|---|
| 1299 | | - NIG_REG_DBG_SELECT, NIG_REG_DBG_DWORD_ENABLE, |
|---|
| 1300 | | - NIG_REG_DBG_SHIFT, NIG_REG_DBG_FORCE_VALID, |
|---|
| 1301 | | - NIG_REG_DBG_FORCE_FRAME, |
|---|
| 1302 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VAUX, 0 |
|---|
| 1303 | | -}; |
|---|
| 1304 | | - |
|---|
| 1305 | | -static struct block_defs block_wol_defs = { |
|---|
| 1306 | | - "wol", |
|---|
| 1307 | | - {false, true, true}, false, 0, |
|---|
| 1308 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCZ}, |
|---|
| 1309 | | - WOL_REG_DBG_SELECT_K2_E5, WOL_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 1310 | | - WOL_REG_DBG_SHIFT_K2_E5, WOL_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 1311 | | - WOL_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 1312 | | - true, true, DBG_RESET_REG_MISC_PL_PDA_VAUX, 7 |
|---|
| 1313 | | -}; |
|---|
| 1314 | | - |
|---|
| 1315 | | -static struct block_defs block_bmbn_defs = { |
|---|
| 1316 | | - "bmbn", |
|---|
| 1317 | | - {false, true, true}, false, 0, |
|---|
| 1318 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCB, |
|---|
| 1319 | | - DBG_BUS_CLIENT_RBCB}, |
|---|
| 1320 | | - BMBN_REG_DBG_SELECT_K2_E5, BMBN_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 1321 | | - BMBN_REG_DBG_SHIFT_K2_E5, BMBN_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 1322 | | - BMBN_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 1323 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 1324 | | -}; |
|---|
| 1325 | | - |
|---|
| 1326 | | -static struct block_defs block_ipc_defs = { |
|---|
| 1327 | | - "ipc", {true, true, true}, false, 0, |
|---|
| 1328 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1329 | | - 0, 0, 0, 0, 0, |
|---|
| 1330 | | - true, false, DBG_RESET_REG_MISCS_PL_UA, 8 |
|---|
| 1331 | | -}; |
|---|
| 1332 | | - |
|---|
| 1333 | | -static struct block_defs block_nwm_defs = { |
|---|
| 1334 | | - "nwm", |
|---|
| 1335 | | - {false, true, true}, false, 0, |
|---|
| 1336 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCW, DBG_BUS_CLIENT_RBCW}, |
|---|
| 1337 | | - NWM_REG_DBG_SELECT_K2_E5, NWM_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 1338 | | - NWM_REG_DBG_SHIFT_K2_E5, NWM_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 1339 | | - NWM_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 1340 | | - true, false, DBG_RESET_REG_MISCS_PL_HV_2, 0 |
|---|
| 1341 | | -}; |
|---|
| 1342 | | - |
|---|
| 1343 | | -static struct block_defs block_nws_defs = { |
|---|
| 1344 | | - "nws", |
|---|
| 1345 | | - {false, true, true}, false, 0, |
|---|
| 1346 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCW, DBG_BUS_CLIENT_RBCW}, |
|---|
| 1347 | | - NWS_REG_DBG_SELECT_K2_E5, NWS_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 1348 | | - NWS_REG_DBG_SHIFT_K2_E5, NWS_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 1349 | | - NWS_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 1350 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 12 |
|---|
| 1351 | | -}; |
|---|
| 1352 | | - |
|---|
| 1353 | | -static struct block_defs block_ms_defs = { |
|---|
| 1354 | | - "ms", |
|---|
| 1355 | | - {false, true, true}, false, 0, |
|---|
| 1356 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCZ, DBG_BUS_CLIENT_RBCZ}, |
|---|
| 1357 | | - MS_REG_DBG_SELECT_K2_E5, MS_REG_DBG_DWORD_ENABLE_K2_E5, |
|---|
| 1358 | | - MS_REG_DBG_SHIFT_K2_E5, MS_REG_DBG_FORCE_VALID_K2_E5, |
|---|
| 1359 | | - MS_REG_DBG_FORCE_FRAME_K2_E5, |
|---|
| 1360 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 13 |
|---|
| 1361 | | -}; |
|---|
| 1362 | | - |
|---|
| 1363 | | -static struct block_defs block_phy_pcie_defs = { |
|---|
| 1364 | | - "phy_pcie", |
|---|
| 1365 | | - {false, true, true}, false, 0, |
|---|
| 1366 | | - {MAX_DBG_BUS_CLIENTS, DBG_BUS_CLIENT_RBCH, |
|---|
| 1367 | | - DBG_BUS_CLIENT_RBCH}, |
|---|
| 1368 | | - PCIE_REG_DBG_COMMON_SELECT_K2_E5, |
|---|
| 1369 | | - PCIE_REG_DBG_COMMON_DWORD_ENABLE_K2_E5, |
|---|
| 1370 | | - PCIE_REG_DBG_COMMON_SHIFT_K2_E5, |
|---|
| 1371 | | - PCIE_REG_DBG_COMMON_FORCE_VALID_K2_E5, |
|---|
| 1372 | | - PCIE_REG_DBG_COMMON_FORCE_FRAME_K2_E5, |
|---|
| 1373 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 1374 | | -}; |
|---|
| 1375 | | - |
|---|
| 1376 | | -static struct block_defs block_led_defs = { |
|---|
| 1377 | | - "led", {false, true, true}, false, 0, |
|---|
| 1378 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1379 | | - 0, 0, 0, 0, 0, |
|---|
| 1380 | | - true, false, DBG_RESET_REG_MISCS_PL_HV, 14 |
|---|
| 1381 | | -}; |
|---|
| 1382 | | - |
|---|
| 1383 | | -static struct block_defs block_avs_wrap_defs = { |
|---|
| 1384 | | - "avs_wrap", {false, true, false}, false, 0, |
|---|
| 1385 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1386 | | - 0, 0, 0, 0, 0, |
|---|
| 1387 | | - true, false, DBG_RESET_REG_MISCS_PL_UA, 11 |
|---|
| 1388 | | -}; |
|---|
| 1389 | | - |
|---|
| 1390 | | -static struct block_defs block_pxpreqbus_defs = { |
|---|
| 1391 | | - "pxpreqbus", {false, false, false}, false, 0, |
|---|
| 1392 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1393 | | - 0, 0, 0, 0, 0, |
|---|
| 1394 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 1395 | | -}; |
|---|
| 1396 | | - |
|---|
| 1397 | | -static struct block_defs block_misc_aeu_defs = { |
|---|
| 1398 | | - "misc_aeu", {true, true, true}, false, 0, |
|---|
| 1399 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1400 | | - 0, 0, 0, 0, 0, |
|---|
| 1401 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 1402 | | -}; |
|---|
| 1403 | | - |
|---|
| 1404 | | -static struct block_defs block_bar0_map_defs = { |
|---|
| 1405 | | - "bar0_map", {true, true, true}, false, 0, |
|---|
| 1406 | | - {MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS, MAX_DBG_BUS_CLIENTS}, |
|---|
| 1407 | | - 0, 0, 0, 0, 0, |
|---|
| 1408 | | - false, false, MAX_DBG_RESET_REGS, 0 |
|---|
| 1409 | | -}; |
|---|
| 1410 | | - |
|---|
| 1411 | | -static struct block_defs *s_block_defs[MAX_BLOCK_ID] = { |
|---|
| 1412 | | - &block_grc_defs, |
|---|
| 1413 | | - &block_miscs_defs, |
|---|
| 1414 | | - &block_misc_defs, |
|---|
| 1415 | | - &block_dbu_defs, |
|---|
| 1416 | | - &block_pglue_b_defs, |
|---|
| 1417 | | - &block_cnig_defs, |
|---|
| 1418 | | - &block_cpmu_defs, |
|---|
| 1419 | | - &block_ncsi_defs, |
|---|
| 1420 | | - &block_opte_defs, |
|---|
| 1421 | | - &block_bmb_defs, |
|---|
| 1422 | | - &block_pcie_defs, |
|---|
| 1423 | | - &block_mcp_defs, |
|---|
| 1424 | | - &block_mcp2_defs, |
|---|
| 1425 | | - &block_pswhst_defs, |
|---|
| 1426 | | - &block_pswhst2_defs, |
|---|
| 1427 | | - &block_pswrd_defs, |
|---|
| 1428 | | - &block_pswrd2_defs, |
|---|
| 1429 | | - &block_pswwr_defs, |
|---|
| 1430 | | - &block_pswwr2_defs, |
|---|
| 1431 | | - &block_pswrq_defs, |
|---|
| 1432 | | - &block_pswrq2_defs, |
|---|
| 1433 | | - &block_pglcs_defs, |
|---|
| 1434 | | - &block_dmae_defs, |
|---|
| 1435 | | - &block_ptu_defs, |
|---|
| 1436 | | - &block_tcm_defs, |
|---|
| 1437 | | - &block_mcm_defs, |
|---|
| 1438 | | - &block_ucm_defs, |
|---|
| 1439 | | - &block_xcm_defs, |
|---|
| 1440 | | - &block_ycm_defs, |
|---|
| 1441 | | - &block_pcm_defs, |
|---|
| 1442 | | - &block_qm_defs, |
|---|
| 1443 | | - &block_tm_defs, |
|---|
| 1444 | | - &block_dorq_defs, |
|---|
| 1445 | | - &block_brb_defs, |
|---|
| 1446 | | - &block_src_defs, |
|---|
| 1447 | | - &block_prs_defs, |
|---|
| 1448 | | - &block_tsdm_defs, |
|---|
| 1449 | | - &block_msdm_defs, |
|---|
| 1450 | | - &block_usdm_defs, |
|---|
| 1451 | | - &block_xsdm_defs, |
|---|
| 1452 | | - &block_ysdm_defs, |
|---|
| 1453 | | - &block_psdm_defs, |
|---|
| 1454 | | - &block_tsem_defs, |
|---|
| 1455 | | - &block_msem_defs, |
|---|
| 1456 | | - &block_usem_defs, |
|---|
| 1457 | | - &block_xsem_defs, |
|---|
| 1458 | | - &block_ysem_defs, |
|---|
| 1459 | | - &block_psem_defs, |
|---|
| 1460 | | - &block_rss_defs, |
|---|
| 1461 | | - &block_tmld_defs, |
|---|
| 1462 | | - &block_muld_defs, |
|---|
| 1463 | | - &block_yuld_defs, |
|---|
| 1464 | | - &block_xyld_defs, |
|---|
| 1465 | | - &block_ptld_defs, |
|---|
| 1466 | | - &block_ypld_defs, |
|---|
| 1467 | | - &block_prm_defs, |
|---|
| 1468 | | - &block_pbf_pb1_defs, |
|---|
| 1469 | | - &block_pbf_pb2_defs, |
|---|
| 1470 | | - &block_rpb_defs, |
|---|
| 1471 | | - &block_btb_defs, |
|---|
| 1472 | | - &block_pbf_defs, |
|---|
| 1473 | | - &block_rdif_defs, |
|---|
| 1474 | | - &block_tdif_defs, |
|---|
| 1475 | | - &block_cdu_defs, |
|---|
| 1476 | | - &block_ccfc_defs, |
|---|
| 1477 | | - &block_tcfc_defs, |
|---|
| 1478 | | - &block_igu_defs, |
|---|
| 1479 | | - &block_cau_defs, |
|---|
| 1480 | | - &block_rgfs_defs, |
|---|
| 1481 | | - &block_rgsrc_defs, |
|---|
| 1482 | | - &block_tgfs_defs, |
|---|
| 1483 | | - &block_tgsrc_defs, |
|---|
| 1484 | | - &block_umac_defs, |
|---|
| 1485 | | - &block_xmac_defs, |
|---|
| 1486 | | - &block_dbg_defs, |
|---|
| 1487 | | - &block_nig_defs, |
|---|
| 1488 | | - &block_wol_defs, |
|---|
| 1489 | | - &block_bmbn_defs, |
|---|
| 1490 | | - &block_ipc_defs, |
|---|
| 1491 | | - &block_nwm_defs, |
|---|
| 1492 | | - &block_nws_defs, |
|---|
| 1493 | | - &block_ms_defs, |
|---|
| 1494 | | - &block_phy_pcie_defs, |
|---|
| 1495 | | - &block_led_defs, |
|---|
| 1496 | | - &block_avs_wrap_defs, |
|---|
| 1497 | | - &block_pxpreqbus_defs, |
|---|
| 1498 | | - &block_misc_aeu_defs, |
|---|
| 1499 | | - &block_bar0_map_defs, |
|---|
| 1500 | | -}; |
|---|
| 1501 | | - |
|---|
| 1502 | | -static struct platform_defs s_platform_defs[] = { |
|---|
| 573 | +static struct hw_type_defs s_hw_type_defs[] = { |
|---|
| 574 | + /* HW_TYPE_ASIC */ |
|---|
| 1503 | 575 | {"asic", 1, 256, 32768}, |
|---|
| 1504 | 576 | {"reserved", 0, 0, 0}, |
|---|
| 1505 | 577 | {"reserved2", 0, 0, 0}, |
|---|
| .. | .. |
|---|
| 1508 | 580 | |
|---|
| 1509 | 581 | static struct grc_param_defs s_grc_param_defs[] = { |
|---|
| 1510 | 582 | /* DBG_GRC_PARAM_DUMP_TSTORM */ |
|---|
| 1511 | | - {{1, 1, 1}, 0, 1, false, false, 1, 1}, |
|---|
| 583 | + {{1, 1}, 0, 1, false, false, 1, {1, 1}}, |
|---|
| 1512 | 584 | |
|---|
| 1513 | 585 | /* DBG_GRC_PARAM_DUMP_MSTORM */ |
|---|
| 1514 | | - {{1, 1, 1}, 0, 1, false, false, 1, 1}, |
|---|
| 586 | + {{1, 1}, 0, 1, false, false, 1, {1, 1}}, |
|---|
| 1515 | 587 | |
|---|
| 1516 | 588 | /* DBG_GRC_PARAM_DUMP_USTORM */ |
|---|
| 1517 | | - {{1, 1, 1}, 0, 1, false, false, 1, 1}, |
|---|
| 589 | + {{1, 1}, 0, 1, false, false, 1, {1, 1}}, |
|---|
| 1518 | 590 | |
|---|
| 1519 | 591 | /* DBG_GRC_PARAM_DUMP_XSTORM */ |
|---|
| 1520 | | - {{1, 1, 1}, 0, 1, false, false, 1, 1}, |
|---|
| 592 | + {{1, 1}, 0, 1, false, false, 1, {1, 1}}, |
|---|
| 1521 | 593 | |
|---|
| 1522 | 594 | /* DBG_GRC_PARAM_DUMP_YSTORM */ |
|---|
| 1523 | | - {{1, 1, 1}, 0, 1, false, false, 1, 1}, |
|---|
| 595 | + {{1, 1}, 0, 1, false, false, 1, {1, 1}}, |
|---|
| 1524 | 596 | |
|---|
| 1525 | 597 | /* DBG_GRC_PARAM_DUMP_PSTORM */ |
|---|
| 1526 | | - {{1, 1, 1}, 0, 1, false, false, 1, 1}, |
|---|
| 598 | + {{1, 1}, 0, 1, false, false, 1, {1, 1}}, |
|---|
| 1527 | 599 | |
|---|
| 1528 | 600 | /* DBG_GRC_PARAM_DUMP_REGS */ |
|---|
| 1529 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 601 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1530 | 602 | |
|---|
| 1531 | 603 | /* DBG_GRC_PARAM_DUMP_RAM */ |
|---|
| 1532 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 604 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1533 | 605 | |
|---|
| 1534 | 606 | /* DBG_GRC_PARAM_DUMP_PBUF */ |
|---|
| 1535 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 607 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1536 | 608 | |
|---|
| 1537 | 609 | /* DBG_GRC_PARAM_DUMP_IOR */ |
|---|
| 1538 | | - {{0, 0, 0}, 0, 1, false, false, 0, 1}, |
|---|
| 610 | + {{0, 0}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1539 | 611 | |
|---|
| 1540 | 612 | /* DBG_GRC_PARAM_DUMP_VFC */ |
|---|
| 1541 | | - {{0, 0, 0}, 0, 1, false, false, 0, 1}, |
|---|
| 613 | + {{0, 0}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1542 | 614 | |
|---|
| 1543 | 615 | /* DBG_GRC_PARAM_DUMP_CM_CTX */ |
|---|
| 1544 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 616 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1545 | 617 | |
|---|
| 1546 | 618 | /* DBG_GRC_PARAM_DUMP_ILT */ |
|---|
| 1547 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 619 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1548 | 620 | |
|---|
| 1549 | 621 | /* DBG_GRC_PARAM_DUMP_RSS */ |
|---|
| 1550 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 622 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1551 | 623 | |
|---|
| 1552 | 624 | /* DBG_GRC_PARAM_DUMP_CAU */ |
|---|
| 1553 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 625 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1554 | 626 | |
|---|
| 1555 | 627 | /* DBG_GRC_PARAM_DUMP_QM */ |
|---|
| 1556 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 628 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1557 | 629 | |
|---|
| 1558 | 630 | /* DBG_GRC_PARAM_DUMP_MCP */ |
|---|
| 1559 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 631 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1560 | 632 | |
|---|
| 1561 | | - /* DBG_GRC_PARAM_MCP_TRACE_META_SIZE */ |
|---|
| 1562 | | - {{1, 1, 1}, 1, 0xffffffff, false, true, 0, 1}, |
|---|
| 633 | + /* DBG_GRC_PARAM_DUMP_DORQ */ |
|---|
| 634 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1563 | 635 | |
|---|
| 1564 | 636 | /* DBG_GRC_PARAM_DUMP_CFC */ |
|---|
| 1565 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 637 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1566 | 638 | |
|---|
| 1567 | 639 | /* DBG_GRC_PARAM_DUMP_IGU */ |
|---|
| 1568 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 640 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1569 | 641 | |
|---|
| 1570 | 642 | /* DBG_GRC_PARAM_DUMP_BRB */ |
|---|
| 1571 | | - {{0, 0, 0}, 0, 1, false, false, 0, 1}, |
|---|
| 643 | + {{0, 0}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1572 | 644 | |
|---|
| 1573 | 645 | /* DBG_GRC_PARAM_DUMP_BTB */ |
|---|
| 1574 | | - {{0, 0, 0}, 0, 1, false, false, 0, 1}, |
|---|
| 646 | + {{0, 0}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1575 | 647 | |
|---|
| 1576 | 648 | /* DBG_GRC_PARAM_DUMP_BMB */ |
|---|
| 1577 | | - {{0, 0, 0}, 0, 1, false, false, 0, 0}, |
|---|
| 649 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1578 | 650 | |
|---|
| 1579 | | - /* DBG_GRC_PARAM_DUMP_NIG */ |
|---|
| 1580 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 651 | + /* DBG_GRC_PARAM_RESERVED1 */ |
|---|
| 652 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1581 | 653 | |
|---|
| 1582 | 654 | /* DBG_GRC_PARAM_DUMP_MULD */ |
|---|
| 1583 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 655 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1584 | 656 | |
|---|
| 1585 | 657 | /* DBG_GRC_PARAM_DUMP_PRS */ |
|---|
| 1586 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 658 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1587 | 659 | |
|---|
| 1588 | 660 | /* DBG_GRC_PARAM_DUMP_DMAE */ |
|---|
| 1589 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 661 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1590 | 662 | |
|---|
| 1591 | 663 | /* DBG_GRC_PARAM_DUMP_TM */ |
|---|
| 1592 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 664 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1593 | 665 | |
|---|
| 1594 | 666 | /* DBG_GRC_PARAM_DUMP_SDM */ |
|---|
| 1595 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 667 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1596 | 668 | |
|---|
| 1597 | 669 | /* DBG_GRC_PARAM_DUMP_DIF */ |
|---|
| 1598 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 670 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1599 | 671 | |
|---|
| 1600 | 672 | /* DBG_GRC_PARAM_DUMP_STATIC */ |
|---|
| 1601 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 673 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1602 | 674 | |
|---|
| 1603 | 675 | /* DBG_GRC_PARAM_UNSTALL */ |
|---|
| 1604 | | - {{0, 0, 0}, 0, 1, false, false, 0, 0}, |
|---|
| 676 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1605 | 677 | |
|---|
| 1606 | | - /* DBG_GRC_PARAM_NUM_LCIDS */ |
|---|
| 1607 | | - {{MAX_LCIDS, MAX_LCIDS, MAX_LCIDS}, 1, MAX_LCIDS, false, false, |
|---|
| 1608 | | - MAX_LCIDS, MAX_LCIDS}, |
|---|
| 678 | + /* DBG_GRC_PARAM_RESERVED2 */ |
|---|
| 679 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1609 | 680 | |
|---|
| 1610 | | - /* DBG_GRC_PARAM_NUM_LTIDS */ |
|---|
| 1611 | | - {{MAX_LTIDS, MAX_LTIDS, MAX_LTIDS}, 1, MAX_LTIDS, false, false, |
|---|
| 1612 | | - MAX_LTIDS, MAX_LTIDS}, |
|---|
| 681 | + /* DBG_GRC_PARAM_MCP_TRACE_META_SIZE */ |
|---|
| 682 | + {{0, 0}, 1, 0xffffffff, false, true, 0, {0, 0}}, |
|---|
| 1613 | 683 | |
|---|
| 1614 | 684 | /* DBG_GRC_PARAM_EXCLUDE_ALL */ |
|---|
| 1615 | | - {{0, 0, 0}, 0, 1, true, false, 0, 0}, |
|---|
| 685 | + {{0, 0}, 0, 1, true, false, 0, {0, 0}}, |
|---|
| 1616 | 686 | |
|---|
| 1617 | 687 | /* DBG_GRC_PARAM_CRASH */ |
|---|
| 1618 | | - {{0, 0, 0}, 0, 1, true, false, 0, 0}, |
|---|
| 688 | + {{0, 0}, 0, 1, true, false, 0, {0, 0}}, |
|---|
| 1619 | 689 | |
|---|
| 1620 | 690 | /* DBG_GRC_PARAM_PARITY_SAFE */ |
|---|
| 1621 | | - {{0, 0, 0}, 0, 1, false, false, 1, 0}, |
|---|
| 691 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1622 | 692 | |
|---|
| 1623 | 693 | /* DBG_GRC_PARAM_DUMP_CM */ |
|---|
| 1624 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 694 | + {{1, 1}, 0, 1, false, false, 0, {1, 1}}, |
|---|
| 1625 | 695 | |
|---|
| 1626 | 696 | /* DBG_GRC_PARAM_DUMP_PHY */ |
|---|
| 1627 | | - {{1, 1, 1}, 0, 1, false, false, 0, 1}, |
|---|
| 697 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1628 | 698 | |
|---|
| 1629 | 699 | /* DBG_GRC_PARAM_NO_MCP */ |
|---|
| 1630 | | - {{0, 0, 0}, 0, 1, false, false, 0, 0}, |
|---|
| 700 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 1631 | 701 | |
|---|
| 1632 | 702 | /* DBG_GRC_PARAM_NO_FW_VER */ |
|---|
| 1633 | | - {{0, 0, 0}, 0, 1, false, false, 0, 0} |
|---|
| 703 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 704 | + |
|---|
| 705 | + /* DBG_GRC_PARAM_RESERVED3 */ |
|---|
| 706 | + {{0, 0}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 707 | + |
|---|
| 708 | + /* DBG_GRC_PARAM_DUMP_MCP_HW_DUMP */ |
|---|
| 709 | + {{0, 1}, 0, 1, false, false, 0, {0, 1}}, |
|---|
| 710 | + |
|---|
| 711 | + /* DBG_GRC_PARAM_DUMP_ILT_CDUC */ |
|---|
| 712 | + {{1, 1}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 713 | + |
|---|
| 714 | + /* DBG_GRC_PARAM_DUMP_ILT_CDUT */ |
|---|
| 715 | + {{1, 1}, 0, 1, false, false, 0, {0, 0}}, |
|---|
| 716 | + |
|---|
| 717 | + /* DBG_GRC_PARAM_DUMP_CAU_EXT */ |
|---|
| 718 | + {{0, 0}, 0, 1, false, false, 0, {1, 1}} |
|---|
| 1634 | 719 | }; |
|---|
| 1635 | 720 | |
|---|
| 1636 | 721 | static struct rss_mem_defs s_rss_mem_defs[] = { |
|---|
| 1637 | | - { "rss_mem_cid", "rss_cid", 0, 32, |
|---|
| 1638 | | - {256, 320, 512} }, |
|---|
| 722 | + {"rss_mem_cid", "rss_cid", 0, 32, |
|---|
| 723 | + {256, 320}}, |
|---|
| 1639 | 724 | |
|---|
| 1640 | | - { "rss_mem_key_msb", "rss_key", 1024, 256, |
|---|
| 1641 | | - {128, 208, 257} }, |
|---|
| 725 | + {"rss_mem_key_msb", "rss_key", 1024, 256, |
|---|
| 726 | + {128, 208}}, |
|---|
| 1642 | 727 | |
|---|
| 1643 | | - { "rss_mem_key_lsb", "rss_key", 2048, 64, |
|---|
| 1644 | | - {128, 208, 257} }, |
|---|
| 728 | + {"rss_mem_key_lsb", "rss_key", 2048, 64, |
|---|
| 729 | + {128, 208}}, |
|---|
| 1645 | 730 | |
|---|
| 1646 | | - { "rss_mem_info", "rss_info", 3072, 16, |
|---|
| 1647 | | - {128, 208, 256} }, |
|---|
| 731 | + {"rss_mem_info", "rss_info", 3072, 16, |
|---|
| 732 | + {128, 208}}, |
|---|
| 1648 | 733 | |
|---|
| 1649 | | - { "rss_mem_ind", "rss_ind", 4096, 16, |
|---|
| 1650 | | - {16384, 26624, 32768} } |
|---|
| 734 | + {"rss_mem_ind", "rss_ind", 4096, 16, |
|---|
| 735 | + {16384, 26624}} |
|---|
| 1651 | 736 | }; |
|---|
| 1652 | 737 | |
|---|
| 1653 | 738 | static struct vfc_ram_defs s_vfc_ram_defs[] = { |
|---|
| .. | .. |
|---|
| 1658 | 743 | }; |
|---|
| 1659 | 744 | |
|---|
| 1660 | 745 | static struct big_ram_defs s_big_ram_defs[] = { |
|---|
| 1661 | | - { "BRB", MEM_GROUP_BRB_MEM, MEM_GROUP_BRB_RAM, DBG_GRC_PARAM_DUMP_BRB, |
|---|
| 1662 | | - BRB_REG_BIG_RAM_ADDRESS, BRB_REG_BIG_RAM_DATA, |
|---|
| 1663 | | - MISC_REG_BLOCK_256B_EN, {0, 0, 0}, |
|---|
| 1664 | | - {153600, 180224, 282624} }, |
|---|
| 746 | + {"BRB", MEM_GROUP_BRB_MEM, MEM_GROUP_BRB_RAM, DBG_GRC_PARAM_DUMP_BRB, |
|---|
| 747 | + BRB_REG_BIG_RAM_ADDRESS, BRB_REG_BIG_RAM_DATA, |
|---|
| 748 | + MISC_REG_BLOCK_256B_EN, {0, 0}, |
|---|
| 749 | + {153600, 180224}}, |
|---|
| 1665 | 750 | |
|---|
| 1666 | | - { "BTB", MEM_GROUP_BTB_MEM, MEM_GROUP_BTB_RAM, DBG_GRC_PARAM_DUMP_BTB, |
|---|
| 1667 | | - BTB_REG_BIG_RAM_ADDRESS, BTB_REG_BIG_RAM_DATA, |
|---|
| 1668 | | - MISC_REG_BLOCK_256B_EN, {0, 1, 1}, |
|---|
| 1669 | | - {92160, 117760, 168960} }, |
|---|
| 751 | + {"BTB", MEM_GROUP_BTB_MEM, MEM_GROUP_BTB_RAM, DBG_GRC_PARAM_DUMP_BTB, |
|---|
| 752 | + BTB_REG_BIG_RAM_ADDRESS, BTB_REG_BIG_RAM_DATA, |
|---|
| 753 | + MISC_REG_BLOCK_256B_EN, {0, 1}, |
|---|
| 754 | + {92160, 117760}}, |
|---|
| 1670 | 755 | |
|---|
| 1671 | | - { "BMB", MEM_GROUP_BMB_MEM, MEM_GROUP_BMB_RAM, DBG_GRC_PARAM_DUMP_BMB, |
|---|
| 1672 | | - BMB_REG_BIG_RAM_ADDRESS, BMB_REG_BIG_RAM_DATA, |
|---|
| 1673 | | - MISCS_REG_BLOCK_256B_EN, {0, 0, 0}, |
|---|
| 1674 | | - {36864, 36864, 36864} } |
|---|
| 756 | + {"BMB", MEM_GROUP_BMB_MEM, MEM_GROUP_BMB_RAM, DBG_GRC_PARAM_DUMP_BMB, |
|---|
| 757 | + BMB_REG_BIG_RAM_ADDRESS, BMB_REG_BIG_RAM_DATA, |
|---|
| 758 | + MISCS_REG_BLOCK_256B_EN, {0, 0}, |
|---|
| 759 | + {36864, 36864}} |
|---|
| 1675 | 760 | }; |
|---|
| 1676 | 761 | |
|---|
| 1677 | | -static struct reset_reg_defs s_reset_regs_defs[] = { |
|---|
| 1678 | | - /* DBG_RESET_REG_MISCS_PL_UA */ |
|---|
| 1679 | | - { MISCS_REG_RESET_PL_UA, |
|---|
| 1680 | | - {true, true, true}, {0x0, 0x0, 0x0} }, |
|---|
| 1681 | | - |
|---|
| 1682 | | - /* DBG_RESET_REG_MISCS_PL_HV */ |
|---|
| 1683 | | - { MISCS_REG_RESET_PL_HV, |
|---|
| 1684 | | - {true, true, true}, {0x0, 0x400, 0x600} }, |
|---|
| 1685 | | - |
|---|
| 1686 | | - /* DBG_RESET_REG_MISCS_PL_HV_2 */ |
|---|
| 1687 | | - { MISCS_REG_RESET_PL_HV_2_K2_E5, |
|---|
| 1688 | | - {false, true, true}, {0x0, 0x0, 0x0} }, |
|---|
| 1689 | | - |
|---|
| 1690 | | - /* DBG_RESET_REG_MISC_PL_UA */ |
|---|
| 1691 | | - { MISC_REG_RESET_PL_UA, |
|---|
| 1692 | | - {true, true, true}, {0x0, 0x0, 0x0} }, |
|---|
| 1693 | | - |
|---|
| 1694 | | - /* DBG_RESET_REG_MISC_PL_HV */ |
|---|
| 1695 | | - { MISC_REG_RESET_PL_HV, |
|---|
| 1696 | | - {true, true, true}, {0x0, 0x0, 0x0} }, |
|---|
| 1697 | | - |
|---|
| 1698 | | - /* DBG_RESET_REG_MISC_PL_PDA_VMAIN_1 */ |
|---|
| 1699 | | - { MISC_REG_RESET_PL_PDA_VMAIN_1, |
|---|
| 1700 | | - {true, true, true}, {0x4404040, 0x4404040, 0x404040} }, |
|---|
| 1701 | | - |
|---|
| 1702 | | - /* DBG_RESET_REG_MISC_PL_PDA_VMAIN_2 */ |
|---|
| 1703 | | - { MISC_REG_RESET_PL_PDA_VMAIN_2, |
|---|
| 1704 | | - {true, true, true}, {0x7, 0x7c00007, 0x5c08007} }, |
|---|
| 1705 | | - |
|---|
| 1706 | | - /* DBG_RESET_REG_MISC_PL_PDA_VAUX */ |
|---|
| 1707 | | - { MISC_REG_RESET_PL_PDA_VAUX, |
|---|
| 1708 | | - {true, true, true}, {0x2, 0x2, 0x2} }, |
|---|
| 762 | +static struct rbc_reset_defs s_rbc_reset_defs[] = { |
|---|
| 763 | + {MISCS_REG_RESET_PL_HV, |
|---|
| 764 | + {0x0, 0x400}}, |
|---|
| 765 | + {MISC_REG_RESET_PL_PDA_VMAIN_1, |
|---|
| 766 | + {0x4404040, 0x4404040}}, |
|---|
| 767 | + {MISC_REG_RESET_PL_PDA_VMAIN_2, |
|---|
| 768 | + {0x7, 0x7c00007}}, |
|---|
| 769 | + {MISC_REG_RESET_PL_PDA_VAUX, |
|---|
| 770 | + {0x2, 0x2}}, |
|---|
| 1709 | 771 | }; |
|---|
| 1710 | 772 | |
|---|
| 1711 | 773 | static struct phy_defs s_phy_defs[] = { |
|---|
| .. | .. |
|---|
| 1759 | 821 | return dword; |
|---|
| 1760 | 822 | } |
|---|
| 1761 | 823 | |
|---|
| 824 | +/* Sets the value of the specified GRC param */ |
|---|
| 825 | +static void qed_grc_set_param(struct qed_hwfn *p_hwfn, |
|---|
| 826 | + enum dbg_grc_params grc_param, u32 val) |
|---|
| 827 | +{ |
|---|
| 828 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 829 | + |
|---|
| 830 | + dev_data->grc.param_val[grc_param] = val; |
|---|
| 831 | +} |
|---|
| 832 | + |
|---|
| 1762 | 833 | /* Returns the value of the specified GRC param */ |
|---|
| 1763 | 834 | static u32 qed_grc_get_param(struct qed_hwfn *p_hwfn, |
|---|
| 1764 | 835 | enum dbg_grc_params grc_param) |
|---|
| .. | .. |
|---|
| 1779 | 850 | } |
|---|
| 1780 | 851 | } |
|---|
| 1781 | 852 | |
|---|
| 853 | +/* Sets pointer and size for the specified binary buffer type */ |
|---|
| 854 | +static void qed_set_dbg_bin_buf(struct qed_hwfn *p_hwfn, |
|---|
| 855 | + enum bin_dbg_buffer_type buf_type, |
|---|
| 856 | + const u32 *ptr, u32 size) |
|---|
| 857 | +{ |
|---|
| 858 | + struct virt_mem_desc *buf = &p_hwfn->dbg_arrays[buf_type]; |
|---|
| 859 | + |
|---|
| 860 | + buf->ptr = (void *)ptr; |
|---|
| 861 | + buf->size = size; |
|---|
| 862 | +} |
|---|
| 863 | + |
|---|
| 1782 | 864 | /* Initializes debug data for the specified device */ |
|---|
| 1783 | | -static enum dbg_status qed_dbg_dev_init(struct qed_hwfn *p_hwfn, |
|---|
| 1784 | | - struct qed_ptt *p_ptt) |
|---|
| 865 | +static enum dbg_status qed_dbg_dev_init(struct qed_hwfn *p_hwfn) |
|---|
| 1785 | 866 | { |
|---|
| 1786 | 867 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 1787 | 868 | u8 num_pfs = 0, max_pfs_per_port = 0; |
|---|
| .. | .. |
|---|
| 1806 | 887 | return DBG_STATUS_UNKNOWN_CHIP; |
|---|
| 1807 | 888 | } |
|---|
| 1808 | 889 | |
|---|
| 1809 | | - /* Set platofrm */ |
|---|
| 1810 | | - dev_data->platform_id = PLATFORM_ASIC; |
|---|
| 890 | + /* Set HW type */ |
|---|
| 891 | + dev_data->hw_type = HW_TYPE_ASIC; |
|---|
| 1811 | 892 | dev_data->mode_enable[MODE_ASIC] = 1; |
|---|
| 1812 | 893 | |
|---|
| 1813 | 894 | /* Set port mode */ |
|---|
| 1814 | | - switch (qed_rd(p_hwfn, p_ptt, MISC_REG_PORT_MODE)) { |
|---|
| 1815 | | - case 0: |
|---|
| 895 | + switch (p_hwfn->cdev->num_ports_in_engine) { |
|---|
| 896 | + case 1: |
|---|
| 1816 | 897 | dev_data->mode_enable[MODE_PORTS_PER_ENG_1] = 1; |
|---|
| 1817 | 898 | break; |
|---|
| 1818 | | - case 1: |
|---|
| 899 | + case 2: |
|---|
| 1819 | 900 | dev_data->mode_enable[MODE_PORTS_PER_ENG_2] = 1; |
|---|
| 1820 | 901 | break; |
|---|
| 1821 | | - case 2: |
|---|
| 902 | + case 4: |
|---|
| 1822 | 903 | dev_data->mode_enable[MODE_PORTS_PER_ENG_4] = 1; |
|---|
| 1823 | 904 | break; |
|---|
| 1824 | 905 | } |
|---|
| 1825 | 906 | |
|---|
| 1826 | 907 | /* Set 100G mode */ |
|---|
| 1827 | | - if (dev_data->chip_id == CHIP_BB && |
|---|
| 1828 | | - qed_rd(p_hwfn, p_ptt, CNIG_REG_NW_PORT_MODE_BB) == 2) |
|---|
| 908 | + if (QED_IS_CMT(p_hwfn->cdev)) |
|---|
| 1829 | 909 | dev_data->mode_enable[MODE_100G] = 1; |
|---|
| 1830 | 910 | |
|---|
| 1831 | 911 | /* Set number of ports */ |
|---|
| .. | .. |
|---|
| 1851 | 931 | return DBG_STATUS_OK; |
|---|
| 1852 | 932 | } |
|---|
| 1853 | 933 | |
|---|
| 1854 | | -static struct dbg_bus_block *get_dbg_bus_block_desc(struct qed_hwfn *p_hwfn, |
|---|
| 1855 | | - enum block_id block_id) |
|---|
| 934 | +static const struct dbg_block *get_dbg_block(struct qed_hwfn *p_hwfn, |
|---|
| 935 | + enum block_id block_id) |
|---|
| 936 | +{ |
|---|
| 937 | + const struct dbg_block *dbg_block; |
|---|
| 938 | + |
|---|
| 939 | + dbg_block = p_hwfn->dbg_arrays[BIN_BUF_DBG_BLOCKS].ptr; |
|---|
| 940 | + return dbg_block + block_id; |
|---|
| 941 | +} |
|---|
| 942 | + |
|---|
| 943 | +static const struct dbg_block_chip *qed_get_dbg_block_per_chip(struct qed_hwfn |
|---|
| 944 | + *p_hwfn, |
|---|
| 945 | + enum block_id |
|---|
| 946 | + block_id) |
|---|
| 1856 | 947 | { |
|---|
| 1857 | 948 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 1858 | 949 | |
|---|
| 1859 | | - return (struct dbg_bus_block *)&dbg_bus_blocks[block_id * |
|---|
| 1860 | | - MAX_CHIP_IDS + |
|---|
| 1861 | | - dev_data->chip_id]; |
|---|
| 950 | + return (const struct dbg_block_chip *) |
|---|
| 951 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_BLOCKS_CHIP_DATA].ptr + |
|---|
| 952 | + block_id * MAX_CHIP_IDS + dev_data->chip_id; |
|---|
| 953 | +} |
|---|
| 954 | + |
|---|
| 955 | +static const struct dbg_reset_reg *qed_get_dbg_reset_reg(struct qed_hwfn |
|---|
| 956 | + *p_hwfn, |
|---|
| 957 | + u8 reset_reg_id) |
|---|
| 958 | +{ |
|---|
| 959 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 960 | + |
|---|
| 961 | + return (const struct dbg_reset_reg *) |
|---|
| 962 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_RESET_REGS].ptr + |
|---|
| 963 | + reset_reg_id * MAX_CHIP_IDS + dev_data->chip_id; |
|---|
| 1862 | 964 | } |
|---|
| 1863 | 965 | |
|---|
| 1864 | 966 | /* Reads the FW info structure for the specified Storm from the chip, |
|---|
| .. | .. |
|---|
| 1870 | 972 | { |
|---|
| 1871 | 973 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 1872 | 974 | struct fw_info_location fw_info_location; |
|---|
| 1873 | | - u32 addr, i, *dest; |
|---|
| 975 | + u32 addr, i, size, *dest; |
|---|
| 1874 | 976 | |
|---|
| 1875 | 977 | memset(&fw_info_location, 0, sizeof(fw_info_location)); |
|---|
| 1876 | 978 | memset(fw_info, 0, sizeof(*fw_info)); |
|---|
| .. | .. |
|---|
| 1879 | 981 | * The address is located in the last line of the Storm RAM. |
|---|
| 1880 | 982 | */ |
|---|
| 1881 | 983 | addr = storm->sem_fast_mem_addr + SEM_FAST_REG_INT_RAM + |
|---|
| 1882 | | - DWORDS_TO_BYTES(SEM_FAST_REG_INT_RAM_SIZE_BB_K2) - |
|---|
| 1883 | | - sizeof(fw_info_location); |
|---|
| 1884 | | - dest = (u32 *)&fw_info_location; |
|---|
| 984 | + DWORDS_TO_BYTES(SEM_FAST_REG_INT_RAM_SIZE) - |
|---|
| 985 | + sizeof(fw_info_location); |
|---|
| 1885 | 986 | |
|---|
| 1886 | | - for (i = 0; i < BYTES_TO_DWORDS(sizeof(fw_info_location)); |
|---|
| 1887 | | - i++, addr += BYTES_IN_DWORD) |
|---|
| 987 | + dest = (u32 *)&fw_info_location; |
|---|
| 988 | + size = BYTES_TO_DWORDS(sizeof(fw_info_location)); |
|---|
| 989 | + |
|---|
| 990 | + for (i = 0; i < size; i++, addr += BYTES_IN_DWORD) |
|---|
| 1888 | 991 | dest[i] = qed_rd(p_hwfn, p_ptt, addr); |
|---|
| 1889 | 992 | |
|---|
| 993 | + /* qed_rq() fetches data in CPU byteorder. Swap it back to |
|---|
| 994 | + * the device's to get right structure layout. |
|---|
| 995 | + */ |
|---|
| 996 | + cpu_to_le32_array(dest, size); |
|---|
| 997 | + |
|---|
| 1890 | 998 | /* Read FW version info from Storm RAM */ |
|---|
| 1891 | | - if (fw_info_location.size > 0 && fw_info_location.size <= |
|---|
| 1892 | | - sizeof(*fw_info)) { |
|---|
| 1893 | | - addr = fw_info_location.grc_addr; |
|---|
| 1894 | | - dest = (u32 *)fw_info; |
|---|
| 1895 | | - for (i = 0; i < BYTES_TO_DWORDS(fw_info_location.size); |
|---|
| 1896 | | - i++, addr += BYTES_IN_DWORD) |
|---|
| 1897 | | - dest[i] = qed_rd(p_hwfn, p_ptt, addr); |
|---|
| 1898 | | - } |
|---|
| 999 | + size = le32_to_cpu(fw_info_location.size); |
|---|
| 1000 | + if (!size || size > sizeof(*fw_info)) |
|---|
| 1001 | + return; |
|---|
| 1002 | + |
|---|
| 1003 | + addr = le32_to_cpu(fw_info_location.grc_addr); |
|---|
| 1004 | + dest = (u32 *)fw_info; |
|---|
| 1005 | + size = BYTES_TO_DWORDS(size); |
|---|
| 1006 | + |
|---|
| 1007 | + for (i = 0; i < size; i++, addr += BYTES_IN_DWORD) |
|---|
| 1008 | + dest[i] = qed_rd(p_hwfn, p_ptt, addr); |
|---|
| 1009 | + |
|---|
| 1010 | + cpu_to_le32_array(dest, size); |
|---|
| 1899 | 1011 | } |
|---|
| 1900 | 1012 | |
|---|
| 1901 | 1013 | /* Dumps the specified string to the specified buffer. |
|---|
| .. | .. |
|---|
| 2019 | 1131 | dump, "fw-version", fw_ver_str); |
|---|
| 2020 | 1132 | offset += qed_dump_str_param(dump_buf + offset, |
|---|
| 2021 | 1133 | dump, "fw-image", fw_img_str); |
|---|
| 2022 | | - offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 2023 | | - dump, |
|---|
| 2024 | | - "fw-timestamp", fw_info.ver.timestamp); |
|---|
| 1134 | + offset += qed_dump_num_param(dump_buf + offset, dump, "fw-timestamp", |
|---|
| 1135 | + le32_to_cpu(fw_info.ver.timestamp)); |
|---|
| 2025 | 1136 | |
|---|
| 2026 | 1137 | return offset; |
|---|
| 2027 | 1138 | } |
|---|
| .. | .. |
|---|
| 2075 | 1186 | return qed_dump_str_param(dump_buf, dump, "mfw-version", mfw_ver_str); |
|---|
| 2076 | 1187 | } |
|---|
| 2077 | 1188 | |
|---|
| 1189 | +/* Reads the chip revision from the chip and writes it as a param to the |
|---|
| 1190 | + * specified buffer. Returns the dumped size in dwords. |
|---|
| 1191 | + */ |
|---|
| 1192 | +static u32 qed_dump_chip_revision_param(struct qed_hwfn *p_hwfn, |
|---|
| 1193 | + struct qed_ptt *p_ptt, |
|---|
| 1194 | + u32 *dump_buf, bool dump) |
|---|
| 1195 | +{ |
|---|
| 1196 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 1197 | + char param_str[3] = "??"; |
|---|
| 1198 | + |
|---|
| 1199 | + if (dev_data->hw_type == HW_TYPE_ASIC) { |
|---|
| 1200 | + u32 chip_rev, chip_metal; |
|---|
| 1201 | + |
|---|
| 1202 | + chip_rev = qed_rd(p_hwfn, p_ptt, MISCS_REG_CHIP_REV); |
|---|
| 1203 | + chip_metal = qed_rd(p_hwfn, p_ptt, MISCS_REG_CHIP_METAL); |
|---|
| 1204 | + |
|---|
| 1205 | + param_str[0] = 'a' + (u8)chip_rev; |
|---|
| 1206 | + param_str[1] = '0' + (u8)chip_metal; |
|---|
| 1207 | + } |
|---|
| 1208 | + |
|---|
| 1209 | + return qed_dump_str_param(dump_buf, dump, "chip-revision", param_str); |
|---|
| 1210 | +} |
|---|
| 1211 | + |
|---|
| 2078 | 1212 | /* Writes a section header to the specified buffer. |
|---|
| 2079 | 1213 | * Returns the dumped size in dwords. |
|---|
| 2080 | 1214 | */ |
|---|
| .. | .. |
|---|
| 2098 | 1232 | u8 num_params; |
|---|
| 2099 | 1233 | |
|---|
| 2100 | 1234 | /* Dump global params section header */ |
|---|
| 2101 | | - num_params = NUM_COMMON_GLOBAL_PARAMS + num_specific_global_params; |
|---|
| 1235 | + num_params = NUM_COMMON_GLOBAL_PARAMS + num_specific_global_params + |
|---|
| 1236 | + (dev_data->chip_id == CHIP_BB ? 1 : 0); |
|---|
| 2102 | 1237 | offset += qed_dump_section_hdr(dump_buf + offset, |
|---|
| 2103 | 1238 | dump, "global_params", num_params); |
|---|
| 2104 | 1239 | |
|---|
| .. | .. |
|---|
| 2106 | 1241 | offset += qed_dump_fw_ver_param(p_hwfn, p_ptt, dump_buf + offset, dump); |
|---|
| 2107 | 1242 | offset += qed_dump_mfw_ver_param(p_hwfn, |
|---|
| 2108 | 1243 | p_ptt, dump_buf + offset, dump); |
|---|
| 1244 | + offset += qed_dump_chip_revision_param(p_hwfn, |
|---|
| 1245 | + p_ptt, dump_buf + offset, dump); |
|---|
| 2109 | 1246 | offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 2110 | 1247 | dump, "tools-version", TOOLS_VERSION); |
|---|
| 2111 | 1248 | offset += qed_dump_str_param(dump_buf + offset, |
|---|
| .. | .. |
|---|
| 2115 | 1252 | offset += qed_dump_str_param(dump_buf + offset, |
|---|
| 2116 | 1253 | dump, |
|---|
| 2117 | 1254 | "platform", |
|---|
| 2118 | | - s_platform_defs[dev_data->platform_id]. |
|---|
| 2119 | | - name); |
|---|
| 2120 | | - offset += |
|---|
| 2121 | | - qed_dump_num_param(dump_buf + offset, dump, "pci-func", |
|---|
| 2122 | | - p_hwfn->abs_pf_id); |
|---|
| 1255 | + s_hw_type_defs[dev_data->hw_type].name); |
|---|
| 1256 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 1257 | + dump, "pci-func", p_hwfn->abs_pf_id); |
|---|
| 1258 | + if (dev_data->chip_id == CHIP_BB) |
|---|
| 1259 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 1260 | + dump, "path", QED_PATH_ID(p_hwfn)); |
|---|
| 2123 | 1261 | |
|---|
| 2124 | 1262 | return offset; |
|---|
| 2125 | 1263 | } |
|---|
| .. | .. |
|---|
| 2150 | 1288 | struct qed_ptt *p_ptt) |
|---|
| 2151 | 1289 | { |
|---|
| 2152 | 1290 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2153 | | - u32 reg_val[MAX_DBG_RESET_REGS] = { 0 }; |
|---|
| 2154 | | - u32 i; |
|---|
| 1291 | + u32 reg_val[NUM_DBG_RESET_REGS] = { 0 }; |
|---|
| 1292 | + u8 rst_reg_id; |
|---|
| 1293 | + u32 blk_id; |
|---|
| 2155 | 1294 | |
|---|
| 2156 | 1295 | /* Read reset registers */ |
|---|
| 2157 | | - for (i = 0; i < MAX_DBG_RESET_REGS; i++) |
|---|
| 2158 | | - if (s_reset_regs_defs[i].exists[dev_data->chip_id]) |
|---|
| 2159 | | - reg_val[i] = qed_rd(p_hwfn, |
|---|
| 2160 | | - p_ptt, s_reset_regs_defs[i].addr); |
|---|
| 1296 | + for (rst_reg_id = 0; rst_reg_id < NUM_DBG_RESET_REGS; rst_reg_id++) { |
|---|
| 1297 | + const struct dbg_reset_reg *rst_reg; |
|---|
| 1298 | + bool rst_reg_removed; |
|---|
| 1299 | + u32 rst_reg_addr; |
|---|
| 1300 | + |
|---|
| 1301 | + rst_reg = qed_get_dbg_reset_reg(p_hwfn, rst_reg_id); |
|---|
| 1302 | + rst_reg_removed = GET_FIELD(rst_reg->data, |
|---|
| 1303 | + DBG_RESET_REG_IS_REMOVED); |
|---|
| 1304 | + rst_reg_addr = DWORDS_TO_BYTES(GET_FIELD(rst_reg->data, |
|---|
| 1305 | + DBG_RESET_REG_ADDR)); |
|---|
| 1306 | + |
|---|
| 1307 | + if (!rst_reg_removed) |
|---|
| 1308 | + reg_val[rst_reg_id] = qed_rd(p_hwfn, p_ptt, |
|---|
| 1309 | + rst_reg_addr); |
|---|
| 1310 | + } |
|---|
| 2161 | 1311 | |
|---|
| 2162 | 1312 | /* Check if blocks are in reset */ |
|---|
| 2163 | | - for (i = 0; i < MAX_BLOCK_ID; i++) { |
|---|
| 2164 | | - struct block_defs *block = s_block_defs[i]; |
|---|
| 1313 | + for (blk_id = 0; blk_id < NUM_PHYS_BLOCKS; blk_id++) { |
|---|
| 1314 | + const struct dbg_block_chip *blk; |
|---|
| 1315 | + bool has_rst_reg; |
|---|
| 1316 | + bool is_removed; |
|---|
| 2165 | 1317 | |
|---|
| 2166 | | - dev_data->block_in_reset[i] = block->has_reset_bit && |
|---|
| 2167 | | - !(reg_val[block->reset_reg] & BIT(block->reset_bit_offset)); |
|---|
| 1318 | + blk = qed_get_dbg_block_per_chip(p_hwfn, (enum block_id)blk_id); |
|---|
| 1319 | + is_removed = GET_FIELD(blk->flags, DBG_BLOCK_CHIP_IS_REMOVED); |
|---|
| 1320 | + has_rst_reg = GET_FIELD(blk->flags, |
|---|
| 1321 | + DBG_BLOCK_CHIP_HAS_RESET_REG); |
|---|
| 1322 | + |
|---|
| 1323 | + if (!is_removed && has_rst_reg) |
|---|
| 1324 | + dev_data->block_in_reset[blk_id] = |
|---|
| 1325 | + !(reg_val[blk->reset_reg_id] & |
|---|
| 1326 | + BIT(blk->reset_reg_bit_offset)); |
|---|
| 2168 | 1327 | } |
|---|
| 1328 | +} |
|---|
| 1329 | + |
|---|
| 1330 | +/* is_mode_match recursive function */ |
|---|
| 1331 | +static bool qed_is_mode_match_rec(struct qed_hwfn *p_hwfn, |
|---|
| 1332 | + u16 *modes_buf_offset, u8 rec_depth) |
|---|
| 1333 | +{ |
|---|
| 1334 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 1335 | + u8 *dbg_array; |
|---|
| 1336 | + bool arg1, arg2; |
|---|
| 1337 | + u8 tree_val; |
|---|
| 1338 | + |
|---|
| 1339 | + if (rec_depth > MAX_RECURSION_DEPTH) { |
|---|
| 1340 | + DP_NOTICE(p_hwfn, |
|---|
| 1341 | + "Unexpected error: is_mode_match_rec exceeded the max recursion depth. This is probably due to a corrupt init/debug buffer.\n"); |
|---|
| 1342 | + return false; |
|---|
| 1343 | + } |
|---|
| 1344 | + |
|---|
| 1345 | + /* Get next element from modes tree buffer */ |
|---|
| 1346 | + dbg_array = p_hwfn->dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr; |
|---|
| 1347 | + tree_val = dbg_array[(*modes_buf_offset)++]; |
|---|
| 1348 | + |
|---|
| 1349 | + switch (tree_val) { |
|---|
| 1350 | + case INIT_MODE_OP_NOT: |
|---|
| 1351 | + return !qed_is_mode_match_rec(p_hwfn, |
|---|
| 1352 | + modes_buf_offset, rec_depth + 1); |
|---|
| 1353 | + case INIT_MODE_OP_OR: |
|---|
| 1354 | + case INIT_MODE_OP_AND: |
|---|
| 1355 | + arg1 = qed_is_mode_match_rec(p_hwfn, |
|---|
| 1356 | + modes_buf_offset, rec_depth + 1); |
|---|
| 1357 | + arg2 = qed_is_mode_match_rec(p_hwfn, |
|---|
| 1358 | + modes_buf_offset, rec_depth + 1); |
|---|
| 1359 | + return (tree_val == INIT_MODE_OP_OR) ? (arg1 || |
|---|
| 1360 | + arg2) : (arg1 && arg2); |
|---|
| 1361 | + default: |
|---|
| 1362 | + return dev_data->mode_enable[tree_val - MAX_INIT_MODE_OPS] > 0; |
|---|
| 1363 | + } |
|---|
| 1364 | +} |
|---|
| 1365 | + |
|---|
| 1366 | +/* Returns true if the mode (specified using modes_buf_offset) is enabled */ |
|---|
| 1367 | +static bool qed_is_mode_match(struct qed_hwfn *p_hwfn, u16 *modes_buf_offset) |
|---|
| 1368 | +{ |
|---|
| 1369 | + return qed_is_mode_match_rec(p_hwfn, modes_buf_offset, 0); |
|---|
| 2169 | 1370 | } |
|---|
| 2170 | 1371 | |
|---|
| 2171 | 1372 | /* Enable / disable the Debug block */ |
|---|
| .. | .. |
|---|
| 2179 | 1380 | static void qed_bus_reset_dbg_block(struct qed_hwfn *p_hwfn, |
|---|
| 2180 | 1381 | struct qed_ptt *p_ptt) |
|---|
| 2181 | 1382 | { |
|---|
| 2182 | | - u32 dbg_reset_reg_addr, old_reset_reg_val, new_reset_reg_val; |
|---|
| 2183 | | - struct block_defs *dbg_block = s_block_defs[BLOCK_DBG]; |
|---|
| 1383 | + u32 reset_reg_addr, old_reset_reg_val, new_reset_reg_val; |
|---|
| 1384 | + const struct dbg_reset_reg *reset_reg; |
|---|
| 1385 | + const struct dbg_block_chip *block; |
|---|
| 2184 | 1386 | |
|---|
| 2185 | | - dbg_reset_reg_addr = s_reset_regs_defs[dbg_block->reset_reg].addr; |
|---|
| 2186 | | - old_reset_reg_val = qed_rd(p_hwfn, p_ptt, dbg_reset_reg_addr); |
|---|
| 1387 | + block = qed_get_dbg_block_per_chip(p_hwfn, BLOCK_DBG); |
|---|
| 1388 | + reset_reg = qed_get_dbg_reset_reg(p_hwfn, block->reset_reg_id); |
|---|
| 1389 | + reset_reg_addr = |
|---|
| 1390 | + DWORDS_TO_BYTES(GET_FIELD(reset_reg->data, DBG_RESET_REG_ADDR)); |
|---|
| 1391 | + |
|---|
| 1392 | + old_reset_reg_val = qed_rd(p_hwfn, p_ptt, reset_reg_addr); |
|---|
| 2187 | 1393 | new_reset_reg_val = |
|---|
| 2188 | | - old_reset_reg_val & ~BIT(dbg_block->reset_bit_offset); |
|---|
| 1394 | + old_reset_reg_val & ~BIT(block->reset_reg_bit_offset); |
|---|
| 2189 | 1395 | |
|---|
| 2190 | | - qed_wr(p_hwfn, p_ptt, dbg_reset_reg_addr, new_reset_reg_val); |
|---|
| 2191 | | - qed_wr(p_hwfn, p_ptt, dbg_reset_reg_addr, old_reset_reg_val); |
|---|
| 2192 | | -} |
|---|
| 2193 | | - |
|---|
| 2194 | | -static void qed_bus_set_framing_mode(struct qed_hwfn *p_hwfn, |
|---|
| 2195 | | - struct qed_ptt *p_ptt, |
|---|
| 2196 | | - enum dbg_bus_frame_modes mode) |
|---|
| 2197 | | -{ |
|---|
| 2198 | | - qed_wr(p_hwfn, p_ptt, DBG_REG_FRAMING_MODE, (u8)mode); |
|---|
| 1396 | + qed_wr(p_hwfn, p_ptt, reset_reg_addr, new_reset_reg_val); |
|---|
| 1397 | + qed_wr(p_hwfn, p_ptt, reset_reg_addr, old_reset_reg_val); |
|---|
| 2199 | 1398 | } |
|---|
| 2200 | 1399 | |
|---|
| 2201 | 1400 | /* Enable / disable Debug Bus clients according to the specified mask |
|---|
| .. | .. |
|---|
| 2207 | 1406 | qed_wr(p_hwfn, p_ptt, DBG_REG_CLIENT_ENABLE, client_mask); |
|---|
| 2208 | 1407 | } |
|---|
| 2209 | 1408 | |
|---|
| 2210 | | -static bool qed_is_mode_match(struct qed_hwfn *p_hwfn, u16 *modes_buf_offset) |
|---|
| 1409 | +static void qed_bus_config_dbg_line(struct qed_hwfn *p_hwfn, |
|---|
| 1410 | + struct qed_ptt *p_ptt, |
|---|
| 1411 | + enum block_id block_id, |
|---|
| 1412 | + u8 line_id, |
|---|
| 1413 | + u8 enable_mask, |
|---|
| 1414 | + u8 right_shift, |
|---|
| 1415 | + u8 force_valid_mask, u8 force_frame_mask) |
|---|
| 1416 | +{ |
|---|
| 1417 | + const struct dbg_block_chip *block = |
|---|
| 1418 | + qed_get_dbg_block_per_chip(p_hwfn, block_id); |
|---|
| 1419 | + |
|---|
| 1420 | + qed_wr(p_hwfn, p_ptt, DWORDS_TO_BYTES(block->dbg_select_reg_addr), |
|---|
| 1421 | + line_id); |
|---|
| 1422 | + qed_wr(p_hwfn, p_ptt, DWORDS_TO_BYTES(block->dbg_dword_enable_reg_addr), |
|---|
| 1423 | + enable_mask); |
|---|
| 1424 | + qed_wr(p_hwfn, p_ptt, DWORDS_TO_BYTES(block->dbg_shift_reg_addr), |
|---|
| 1425 | + right_shift); |
|---|
| 1426 | + qed_wr(p_hwfn, p_ptt, DWORDS_TO_BYTES(block->dbg_force_valid_reg_addr), |
|---|
| 1427 | + force_valid_mask); |
|---|
| 1428 | + qed_wr(p_hwfn, p_ptt, DWORDS_TO_BYTES(block->dbg_force_frame_reg_addr), |
|---|
| 1429 | + force_frame_mask); |
|---|
| 1430 | +} |
|---|
| 1431 | + |
|---|
| 1432 | +/* Disable debug bus in all blocks */ |
|---|
| 1433 | +static void qed_bus_disable_blocks(struct qed_hwfn *p_hwfn, |
|---|
| 1434 | + struct qed_ptt *p_ptt) |
|---|
| 2211 | 1435 | { |
|---|
| 2212 | 1436 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2213 | | - bool arg1, arg2; |
|---|
| 2214 | | - const u32 *ptr; |
|---|
| 2215 | | - u8 tree_val; |
|---|
| 1437 | + u32 block_id; |
|---|
| 2216 | 1438 | |
|---|
| 2217 | | - /* Get next element from modes tree buffer */ |
|---|
| 2218 | | - ptr = s_dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr; |
|---|
| 2219 | | - tree_val = ((u8 *)ptr)[(*modes_buf_offset)++]; |
|---|
| 1439 | + /* Disable all blocks */ |
|---|
| 1440 | + for (block_id = 0; block_id < MAX_BLOCK_ID; block_id++) { |
|---|
| 1441 | + const struct dbg_block_chip *block_per_chip = |
|---|
| 1442 | + qed_get_dbg_block_per_chip(p_hwfn, |
|---|
| 1443 | + (enum block_id)block_id); |
|---|
| 2220 | 1444 | |
|---|
| 2221 | | - switch (tree_val) { |
|---|
| 2222 | | - case INIT_MODE_OP_NOT: |
|---|
| 2223 | | - return !qed_is_mode_match(p_hwfn, modes_buf_offset); |
|---|
| 2224 | | - case INIT_MODE_OP_OR: |
|---|
| 2225 | | - case INIT_MODE_OP_AND: |
|---|
| 2226 | | - arg1 = qed_is_mode_match(p_hwfn, modes_buf_offset); |
|---|
| 2227 | | - arg2 = qed_is_mode_match(p_hwfn, modes_buf_offset); |
|---|
| 2228 | | - return (tree_val == INIT_MODE_OP_OR) ? (arg1 || |
|---|
| 2229 | | - arg2) : (arg1 && arg2); |
|---|
| 2230 | | - default: |
|---|
| 2231 | | - return dev_data->mode_enable[tree_val - MAX_INIT_MODE_OPS] > 0; |
|---|
| 1445 | + if (GET_FIELD(block_per_chip->flags, |
|---|
| 1446 | + DBG_BLOCK_CHIP_IS_REMOVED) || |
|---|
| 1447 | + dev_data->block_in_reset[block_id]) |
|---|
| 1448 | + continue; |
|---|
| 1449 | + |
|---|
| 1450 | + /* Disable debug bus */ |
|---|
| 1451 | + if (GET_FIELD(block_per_chip->flags, |
|---|
| 1452 | + DBG_BLOCK_CHIP_HAS_DBG_BUS)) { |
|---|
| 1453 | + u32 dbg_en_addr = |
|---|
| 1454 | + block_per_chip->dbg_dword_enable_reg_addr; |
|---|
| 1455 | + u16 modes_buf_offset = |
|---|
| 1456 | + GET_FIELD(block_per_chip->dbg_bus_mode.data, |
|---|
| 1457 | + DBG_MODE_HDR_MODES_BUF_OFFSET); |
|---|
| 1458 | + bool eval_mode = |
|---|
| 1459 | + GET_FIELD(block_per_chip->dbg_bus_mode.data, |
|---|
| 1460 | + DBG_MODE_HDR_EVAL_MODE) > 0; |
|---|
| 1461 | + |
|---|
| 1462 | + if (!eval_mode || |
|---|
| 1463 | + qed_is_mode_match(p_hwfn, &modes_buf_offset)) |
|---|
| 1464 | + qed_wr(p_hwfn, p_ptt, |
|---|
| 1465 | + DWORDS_TO_BYTES(dbg_en_addr), |
|---|
| 1466 | + 0); |
|---|
| 1467 | + } |
|---|
| 2232 | 1468 | } |
|---|
| 2233 | 1469 | } |
|---|
| 2234 | 1470 | |
|---|
| .. | .. |
|---|
| 2239 | 1475 | enum dbg_grc_params grc_param) |
|---|
| 2240 | 1476 | { |
|---|
| 2241 | 1477 | return qed_grc_get_param(p_hwfn, grc_param) > 0; |
|---|
| 1478 | +} |
|---|
| 1479 | + |
|---|
| 1480 | +/* Returns the storm_id that matches the specified Storm letter, |
|---|
| 1481 | + * or MAX_DBG_STORMS if invalid storm letter. |
|---|
| 1482 | + */ |
|---|
| 1483 | +static enum dbg_storms qed_get_id_from_letter(char storm_letter) |
|---|
| 1484 | +{ |
|---|
| 1485 | + u8 storm_id; |
|---|
| 1486 | + |
|---|
| 1487 | + for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) |
|---|
| 1488 | + if (s_storm_defs[storm_id].letter == storm_letter) |
|---|
| 1489 | + return (enum dbg_storms)storm_id; |
|---|
| 1490 | + |
|---|
| 1491 | + return MAX_DBG_STORMS; |
|---|
| 2242 | 1492 | } |
|---|
| 2243 | 1493 | |
|---|
| 2244 | 1494 | /* Returns true of the specified Storm should be included in the dump, false |
|---|
| .. | .. |
|---|
| 2256 | 1506 | static bool qed_grc_is_mem_included(struct qed_hwfn *p_hwfn, |
|---|
| 2257 | 1507 | enum block_id block_id, u8 mem_group_id) |
|---|
| 2258 | 1508 | { |
|---|
| 2259 | | - struct block_defs *block = s_block_defs[block_id]; |
|---|
| 1509 | + const struct dbg_block *block; |
|---|
| 2260 | 1510 | u8 i; |
|---|
| 2261 | 1511 | |
|---|
| 2262 | | - /* Check Storm match */ |
|---|
| 2263 | | - if (block->associated_to_storm && |
|---|
| 2264 | | - !qed_grc_is_storm_included(p_hwfn, |
|---|
| 2265 | | - (enum dbg_storms)block->storm_id)) |
|---|
| 2266 | | - return false; |
|---|
| 1512 | + block = get_dbg_block(p_hwfn, block_id); |
|---|
| 1513 | + |
|---|
| 1514 | + /* If the block is associated with a Storm, check Storm match */ |
|---|
| 1515 | + if (block->associated_storm_letter) { |
|---|
| 1516 | + enum dbg_storms associated_storm_id = |
|---|
| 1517 | + qed_get_id_from_letter(block->associated_storm_letter); |
|---|
| 1518 | + |
|---|
| 1519 | + if (associated_storm_id == MAX_DBG_STORMS || |
|---|
| 1520 | + !qed_grc_is_storm_included(p_hwfn, associated_storm_id)) |
|---|
| 1521 | + return false; |
|---|
| 1522 | + } |
|---|
| 2267 | 1523 | |
|---|
| 2268 | 1524 | for (i = 0; i < NUM_BIG_RAM_TYPES; i++) { |
|---|
| 2269 | 1525 | struct big_ram_defs *big_ram = &s_big_ram_defs[i]; |
|---|
| .. | .. |
|---|
| 2285 | 1541 | case MEM_GROUP_CAU_SB: |
|---|
| 2286 | 1542 | case MEM_GROUP_CAU_PI: |
|---|
| 2287 | 1543 | return qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_CAU); |
|---|
| 1544 | + case MEM_GROUP_CAU_MEM_EXT: |
|---|
| 1545 | + return qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_CAU_EXT); |
|---|
| 2288 | 1546 | case MEM_GROUP_QM_MEM: |
|---|
| 2289 | 1547 | return qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_QM); |
|---|
| 2290 | 1548 | case MEM_GROUP_CFC_MEM: |
|---|
| .. | .. |
|---|
| 2292 | 1550 | case MEM_GROUP_TASK_CFC_MEM: |
|---|
| 2293 | 1551 | return qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_CFC) || |
|---|
| 2294 | 1552 | qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_CM_CTX); |
|---|
| 1553 | + case MEM_GROUP_DORQ_MEM: |
|---|
| 1554 | + return qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_DORQ); |
|---|
| 2295 | 1555 | case MEM_GROUP_IGU_MEM: |
|---|
| 2296 | 1556 | case MEM_GROUP_IGU_MSIX: |
|---|
| 2297 | 1557 | return qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_IGU); |
|---|
| .. | .. |
|---|
| 2337 | 1597 | msleep(STALL_DELAY_MS); |
|---|
| 2338 | 1598 | } |
|---|
| 2339 | 1599 | |
|---|
| 2340 | | -/* Takes all blocks out of reset */ |
|---|
| 1600 | +/* Takes all blocks out of reset. If rbc_only is true, only RBC clients are |
|---|
| 1601 | + * taken out of reset. |
|---|
| 1602 | + */ |
|---|
| 2341 | 1603 | static void qed_grc_unreset_blocks(struct qed_hwfn *p_hwfn, |
|---|
| 2342 | | - struct qed_ptt *p_ptt) |
|---|
| 1604 | + struct qed_ptt *p_ptt, bool rbc_only) |
|---|
| 2343 | 1605 | { |
|---|
| 2344 | 1606 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2345 | | - u32 reg_val[MAX_DBG_RESET_REGS] = { 0 }; |
|---|
| 2346 | | - u32 block_id, i; |
|---|
| 1607 | + u8 chip_id = dev_data->chip_id; |
|---|
| 1608 | + u32 i; |
|---|
| 2347 | 1609 | |
|---|
| 2348 | | - /* Fill reset regs values */ |
|---|
| 2349 | | - for (block_id = 0; block_id < MAX_BLOCK_ID; block_id++) { |
|---|
| 2350 | | - struct block_defs *block = s_block_defs[block_id]; |
|---|
| 2351 | | - |
|---|
| 2352 | | - if (block->exists[dev_data->chip_id] && block->has_reset_bit && |
|---|
| 2353 | | - block->unreset) |
|---|
| 2354 | | - reg_val[block->reset_reg] |= |
|---|
| 2355 | | - BIT(block->reset_bit_offset); |
|---|
| 2356 | | - } |
|---|
| 2357 | | - |
|---|
| 2358 | | - /* Write reset registers */ |
|---|
| 2359 | | - for (i = 0; i < MAX_DBG_RESET_REGS; i++) { |
|---|
| 2360 | | - if (!s_reset_regs_defs[i].exists[dev_data->chip_id]) |
|---|
| 2361 | | - continue; |
|---|
| 2362 | | - |
|---|
| 2363 | | - reg_val[i] |= |
|---|
| 2364 | | - s_reset_regs_defs[i].unreset_val[dev_data->chip_id]; |
|---|
| 2365 | | - |
|---|
| 2366 | | - if (reg_val[i]) |
|---|
| 1610 | + /* Take RBCs out of reset */ |
|---|
| 1611 | + for (i = 0; i < ARRAY_SIZE(s_rbc_reset_defs); i++) |
|---|
| 1612 | + if (s_rbc_reset_defs[i].reset_val[dev_data->chip_id]) |
|---|
| 2367 | 1613 | qed_wr(p_hwfn, |
|---|
| 2368 | 1614 | p_ptt, |
|---|
| 2369 | | - s_reset_regs_defs[i].addr + |
|---|
| 2370 | | - RESET_REG_UNRESET_OFFSET, reg_val[i]); |
|---|
| 1615 | + s_rbc_reset_defs[i].reset_reg_addr + |
|---|
| 1616 | + RESET_REG_UNRESET_OFFSET, |
|---|
| 1617 | + s_rbc_reset_defs[i].reset_val[chip_id]); |
|---|
| 1618 | + |
|---|
| 1619 | + if (!rbc_only) { |
|---|
| 1620 | + u32 reg_val[NUM_DBG_RESET_REGS] = { 0 }; |
|---|
| 1621 | + u8 reset_reg_id; |
|---|
| 1622 | + u32 block_id; |
|---|
| 1623 | + |
|---|
| 1624 | + /* Fill reset regs values */ |
|---|
| 1625 | + for (block_id = 0; block_id < NUM_PHYS_BLOCKS; block_id++) { |
|---|
| 1626 | + bool is_removed, has_reset_reg, unreset_before_dump; |
|---|
| 1627 | + const struct dbg_block_chip *block; |
|---|
| 1628 | + |
|---|
| 1629 | + block = qed_get_dbg_block_per_chip(p_hwfn, |
|---|
| 1630 | + (enum block_id) |
|---|
| 1631 | + block_id); |
|---|
| 1632 | + is_removed = |
|---|
| 1633 | + GET_FIELD(block->flags, DBG_BLOCK_CHIP_IS_REMOVED); |
|---|
| 1634 | + has_reset_reg = |
|---|
| 1635 | + GET_FIELD(block->flags, |
|---|
| 1636 | + DBG_BLOCK_CHIP_HAS_RESET_REG); |
|---|
| 1637 | + unreset_before_dump = |
|---|
| 1638 | + GET_FIELD(block->flags, |
|---|
| 1639 | + DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP); |
|---|
| 1640 | + |
|---|
| 1641 | + if (!is_removed && has_reset_reg && unreset_before_dump) |
|---|
| 1642 | + reg_val[block->reset_reg_id] |= |
|---|
| 1643 | + BIT(block->reset_reg_bit_offset); |
|---|
| 1644 | + } |
|---|
| 1645 | + |
|---|
| 1646 | + /* Write reset registers */ |
|---|
| 1647 | + for (reset_reg_id = 0; reset_reg_id < NUM_DBG_RESET_REGS; |
|---|
| 1648 | + reset_reg_id++) { |
|---|
| 1649 | + const struct dbg_reset_reg *reset_reg; |
|---|
| 1650 | + u32 reset_reg_addr; |
|---|
| 1651 | + |
|---|
| 1652 | + reset_reg = qed_get_dbg_reset_reg(p_hwfn, reset_reg_id); |
|---|
| 1653 | + |
|---|
| 1654 | + if (GET_FIELD |
|---|
| 1655 | + (reset_reg->data, DBG_RESET_REG_IS_REMOVED)) |
|---|
| 1656 | + continue; |
|---|
| 1657 | + |
|---|
| 1658 | + if (reg_val[reset_reg_id]) { |
|---|
| 1659 | + reset_reg_addr = |
|---|
| 1660 | + GET_FIELD(reset_reg->data, |
|---|
| 1661 | + DBG_RESET_REG_ADDR); |
|---|
| 1662 | + qed_wr(p_hwfn, |
|---|
| 1663 | + p_ptt, |
|---|
| 1664 | + DWORDS_TO_BYTES(reset_reg_addr) + |
|---|
| 1665 | + RESET_REG_UNRESET_OFFSET, |
|---|
| 1666 | + reg_val[reset_reg_id]); |
|---|
| 1667 | + } |
|---|
| 1668 | + } |
|---|
| 2371 | 1669 | } |
|---|
| 2372 | 1670 | } |
|---|
| 2373 | 1671 | |
|---|
| 2374 | 1672 | /* Returns the attention block data of the specified block */ |
|---|
| 2375 | 1673 | static const struct dbg_attn_block_type_data * |
|---|
| 2376 | | -qed_get_block_attn_data(enum block_id block_id, enum dbg_attn_type attn_type) |
|---|
| 1674 | +qed_get_block_attn_data(struct qed_hwfn *p_hwfn, |
|---|
| 1675 | + enum block_id block_id, enum dbg_attn_type attn_type) |
|---|
| 2377 | 1676 | { |
|---|
| 2378 | 1677 | const struct dbg_attn_block *base_attn_block_arr = |
|---|
| 2379 | | - (const struct dbg_attn_block *) |
|---|
| 2380 | | - s_dbg_arrays[BIN_BUF_DBG_ATTN_BLOCKS].ptr; |
|---|
| 1678 | + (const struct dbg_attn_block *) |
|---|
| 1679 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_BLOCKS].ptr; |
|---|
| 2381 | 1680 | |
|---|
| 2382 | 1681 | return &base_attn_block_arr[block_id].per_type_data[attn_type]; |
|---|
| 2383 | 1682 | } |
|---|
| 2384 | 1683 | |
|---|
| 2385 | 1684 | /* Returns the attention registers of the specified block */ |
|---|
| 2386 | 1685 | static const struct dbg_attn_reg * |
|---|
| 2387 | | -qed_get_block_attn_regs(enum block_id block_id, enum dbg_attn_type attn_type, |
|---|
| 1686 | +qed_get_block_attn_regs(struct qed_hwfn *p_hwfn, |
|---|
| 1687 | + enum block_id block_id, enum dbg_attn_type attn_type, |
|---|
| 2388 | 1688 | u8 *num_attn_regs) |
|---|
| 2389 | 1689 | { |
|---|
| 2390 | 1690 | const struct dbg_attn_block_type_data *block_type_data = |
|---|
| 2391 | | - qed_get_block_attn_data(block_id, attn_type); |
|---|
| 1691 | + qed_get_block_attn_data(p_hwfn, block_id, attn_type); |
|---|
| 2392 | 1692 | |
|---|
| 2393 | 1693 | *num_attn_regs = block_type_data->num_regs; |
|---|
| 2394 | 1694 | |
|---|
| 2395 | | - return &((const struct dbg_attn_reg *) |
|---|
| 2396 | | - s_dbg_arrays[BIN_BUF_DBG_ATTN_REGS].ptr)[block_type_data-> |
|---|
| 2397 | | - regs_offset]; |
|---|
| 1695 | + return (const struct dbg_attn_reg *) |
|---|
| 1696 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_REGS].ptr + |
|---|
| 1697 | + block_type_data->regs_offset; |
|---|
| 2398 | 1698 | } |
|---|
| 2399 | 1699 | |
|---|
| 2400 | 1700 | /* For each block, clear the status of all parities */ |
|---|
| .. | .. |
|---|
| 2406 | 1706 | u8 reg_idx, num_attn_regs; |
|---|
| 2407 | 1707 | u32 block_id; |
|---|
| 2408 | 1708 | |
|---|
| 2409 | | - for (block_id = 0; block_id < MAX_BLOCK_ID; block_id++) { |
|---|
| 1709 | + for (block_id = 0; block_id < NUM_PHYS_BLOCKS; block_id++) { |
|---|
| 2410 | 1710 | if (dev_data->block_in_reset[block_id]) |
|---|
| 2411 | 1711 | continue; |
|---|
| 2412 | 1712 | |
|---|
| 2413 | | - attn_reg_arr = qed_get_block_attn_regs((enum block_id)block_id, |
|---|
| 1713 | + attn_reg_arr = qed_get_block_attn_regs(p_hwfn, |
|---|
| 1714 | + (enum block_id)block_id, |
|---|
| 2414 | 1715 | ATTN_TYPE_PARITY, |
|---|
| 2415 | 1716 | &num_attn_regs); |
|---|
| 2416 | 1717 | |
|---|
| .. | .. |
|---|
| 2438 | 1739 | } |
|---|
| 2439 | 1740 | |
|---|
| 2440 | 1741 | /* Dumps GRC registers section header. Returns the dumped size in dwords. |
|---|
| 2441 | | - * The following parameters are dumped: |
|---|
| 1742 | + * the following parameters are dumped: |
|---|
| 2442 | 1743 | * - count: no. of dumped entries |
|---|
| 2443 | 1744 | * - split_type: split type |
|---|
| 2444 | 1745 | * - split_id: split ID (dumped only if split_id != SPLIT_TYPE_NONE) |
|---|
| 2445 | | - * - param_name: user parameter value (dumped only if param_name != NULL |
|---|
| 2446 | | - * and param_val != NULL). |
|---|
| 1746 | + * - reg_type_name: register type name (dumped only if reg_type_name != NULL) |
|---|
| 2447 | 1747 | */ |
|---|
| 2448 | 1748 | static u32 qed_grc_dump_regs_hdr(u32 *dump_buf, |
|---|
| 2449 | 1749 | bool dump, |
|---|
| 2450 | 1750 | u32 num_reg_entries, |
|---|
| 2451 | 1751 | enum init_split_types split_type, |
|---|
| 2452 | | - u8 split_id, |
|---|
| 2453 | | - const char *param_name, const char *param_val) |
|---|
| 1752 | + u8 split_id, const char *reg_type_name) |
|---|
| 2454 | 1753 | { |
|---|
| 2455 | 1754 | u8 num_params = 2 + |
|---|
| 2456 | | - (split_type != SPLIT_TYPE_NONE ? 1 : 0) + (param_name ? 1 : 0); |
|---|
| 1755 | + (split_type != SPLIT_TYPE_NONE ? 1 : 0) + (reg_type_name ? 1 : 0); |
|---|
| 2457 | 1756 | u32 offset = 0; |
|---|
| 2458 | 1757 | |
|---|
| 2459 | 1758 | offset += qed_dump_section_hdr(dump_buf + offset, |
|---|
| .. | .. |
|---|
| 2466 | 1765 | if (split_type != SPLIT_TYPE_NONE) |
|---|
| 2467 | 1766 | offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 2468 | 1767 | dump, "id", split_id); |
|---|
| 2469 | | - if (param_name && param_val) |
|---|
| 1768 | + if (reg_type_name) |
|---|
| 2470 | 1769 | offset += qed_dump_str_param(dump_buf + offset, |
|---|
| 2471 | | - dump, param_name, param_val); |
|---|
| 1770 | + dump, "type", reg_type_name); |
|---|
| 2472 | 1771 | |
|---|
| 2473 | 1772 | return offset; |
|---|
| 2474 | 1773 | } |
|---|
| .. | .. |
|---|
| 2497 | 1796 | u8 split_id) |
|---|
| 2498 | 1797 | { |
|---|
| 2499 | 1798 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2500 | | - u8 port_id = 0, pf_id = 0, vf_id = 0, fid = 0; |
|---|
| 1799 | + u8 port_id = 0, pf_id = 0, vf_id = 0; |
|---|
| 1800 | + bool read_using_dmae = false; |
|---|
| 1801 | + u32 thresh; |
|---|
| 1802 | + u16 fid; |
|---|
| 2501 | 1803 | |
|---|
| 2502 | 1804 | if (!dump) |
|---|
| 2503 | 1805 | return len; |
|---|
| 2504 | | - |
|---|
| 2505 | | - /* Print log if needed */ |
|---|
| 2506 | | - dev_data->num_regs_read += len; |
|---|
| 2507 | | - if (dev_data->num_regs_read >= |
|---|
| 2508 | | - s_platform_defs[dev_data->platform_id].log_thresh) { |
|---|
| 2509 | | - DP_VERBOSE(p_hwfn, |
|---|
| 2510 | | - QED_MSG_DEBUG, |
|---|
| 2511 | | - "Dumping %d registers...\n", |
|---|
| 2512 | | - dev_data->num_regs_read); |
|---|
| 2513 | | - dev_data->num_regs_read = 0; |
|---|
| 2514 | | - } |
|---|
| 2515 | 1806 | |
|---|
| 2516 | 1807 | switch (split_type) { |
|---|
| 2517 | 1808 | case SPLIT_TYPE_PORT: |
|---|
| .. | .. |
|---|
| 2533 | 1824 | } |
|---|
| 2534 | 1825 | |
|---|
| 2535 | 1826 | /* Try reading using DMAE */ |
|---|
| 2536 | | - if (dev_data->use_dmae && split_type == SPLIT_TYPE_NONE && |
|---|
| 2537 | | - (len >= s_platform_defs[dev_data->platform_id].dmae_thresh || |
|---|
| 2538 | | - wide_bus)) { |
|---|
| 2539 | | - if (!qed_dmae_grc2host(p_hwfn, p_ptt, DWORDS_TO_BYTES(addr), |
|---|
| 2540 | | - (u64)(uintptr_t)(dump_buf), len, 0)) |
|---|
| 2541 | | - return len; |
|---|
| 2542 | | - dev_data->use_dmae = 0; |
|---|
| 2543 | | - DP_VERBOSE(p_hwfn, |
|---|
| 2544 | | - QED_MSG_DEBUG, |
|---|
| 2545 | | - "Failed reading from chip using DMAE, using GRC instead\n"); |
|---|
| 1827 | + if (dev_data->use_dmae && split_type != SPLIT_TYPE_VF && |
|---|
| 1828 | + (len >= s_hw_type_defs[dev_data->hw_type].dmae_thresh || |
|---|
| 1829 | + (PROTECT_WIDE_BUS && wide_bus))) { |
|---|
| 1830 | + struct qed_dmae_params dmae_params; |
|---|
| 1831 | + |
|---|
| 1832 | + /* Set DMAE params */ |
|---|
| 1833 | + memset(&dmae_params, 0, sizeof(dmae_params)); |
|---|
| 1834 | + SET_FIELD(dmae_params.flags, QED_DMAE_PARAMS_COMPLETION_DST, 1); |
|---|
| 1835 | + switch (split_type) { |
|---|
| 1836 | + case SPLIT_TYPE_PORT: |
|---|
| 1837 | + SET_FIELD(dmae_params.flags, QED_DMAE_PARAMS_PORT_VALID, |
|---|
| 1838 | + 1); |
|---|
| 1839 | + dmae_params.port_id = port_id; |
|---|
| 1840 | + break; |
|---|
| 1841 | + case SPLIT_TYPE_PF: |
|---|
| 1842 | + SET_FIELD(dmae_params.flags, |
|---|
| 1843 | + QED_DMAE_PARAMS_SRC_PF_VALID, 1); |
|---|
| 1844 | + dmae_params.src_pfid = pf_id; |
|---|
| 1845 | + break; |
|---|
| 1846 | + case SPLIT_TYPE_PORT_PF: |
|---|
| 1847 | + SET_FIELD(dmae_params.flags, QED_DMAE_PARAMS_PORT_VALID, |
|---|
| 1848 | + 1); |
|---|
| 1849 | + SET_FIELD(dmae_params.flags, |
|---|
| 1850 | + QED_DMAE_PARAMS_SRC_PF_VALID, 1); |
|---|
| 1851 | + dmae_params.port_id = port_id; |
|---|
| 1852 | + dmae_params.src_pfid = pf_id; |
|---|
| 1853 | + break; |
|---|
| 1854 | + default: |
|---|
| 1855 | + break; |
|---|
| 1856 | + } |
|---|
| 1857 | + |
|---|
| 1858 | + /* Execute DMAE command */ |
|---|
| 1859 | + read_using_dmae = !qed_dmae_grc2host(p_hwfn, |
|---|
| 1860 | + p_ptt, |
|---|
| 1861 | + DWORDS_TO_BYTES(addr), |
|---|
| 1862 | + (u64)(uintptr_t)(dump_buf), |
|---|
| 1863 | + len, &dmae_params); |
|---|
| 1864 | + if (!read_using_dmae) { |
|---|
| 1865 | + dev_data->use_dmae = 0; |
|---|
| 1866 | + DP_VERBOSE(p_hwfn, |
|---|
| 1867 | + QED_MSG_DEBUG, |
|---|
| 1868 | + "Failed reading from chip using DMAE, using GRC instead\n"); |
|---|
| 1869 | + } |
|---|
| 2546 | 1870 | } |
|---|
| 1871 | + |
|---|
| 1872 | + if (read_using_dmae) |
|---|
| 1873 | + goto print_log; |
|---|
| 2547 | 1874 | |
|---|
| 2548 | 1875 | /* If not read using DMAE, read using GRC */ |
|---|
| 2549 | 1876 | |
|---|
| 2550 | 1877 | /* Set pretend */ |
|---|
| 2551 | | - if (split_type != dev_data->pretend.split_type || split_id != |
|---|
| 2552 | | - dev_data->pretend.split_id) { |
|---|
| 1878 | + if (split_type != dev_data->pretend.split_type || |
|---|
| 1879 | + split_id != dev_data->pretend.split_id) { |
|---|
| 2553 | 1880 | switch (split_type) { |
|---|
| 2554 | 1881 | case SPLIT_TYPE_PORT: |
|---|
| 2555 | 1882 | qed_port_pretend(p_hwfn, p_ptt, port_id); |
|---|
| 2556 | 1883 | break; |
|---|
| 2557 | 1884 | case SPLIT_TYPE_PF: |
|---|
| 2558 | | - fid = pf_id << PXP_PRETEND_CONCRETE_FID_PFID_SHIFT; |
|---|
| 1885 | + fid = FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_PFID, |
|---|
| 1886 | + pf_id); |
|---|
| 2559 | 1887 | qed_fid_pretend(p_hwfn, p_ptt, fid); |
|---|
| 2560 | 1888 | break; |
|---|
| 2561 | 1889 | case SPLIT_TYPE_PORT_PF: |
|---|
| 2562 | | - fid = pf_id << PXP_PRETEND_CONCRETE_FID_PFID_SHIFT; |
|---|
| 1890 | + fid = FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_PFID, |
|---|
| 1891 | + pf_id); |
|---|
| 2563 | 1892 | qed_port_fid_pretend(p_hwfn, p_ptt, port_id, fid); |
|---|
| 2564 | 1893 | break; |
|---|
| 2565 | 1894 | case SPLIT_TYPE_VF: |
|---|
| 2566 | | - fid = BIT(PXP_PRETEND_CONCRETE_FID_VFVALID_SHIFT) | |
|---|
| 2567 | | - (vf_id << PXP_PRETEND_CONCRETE_FID_VFID_SHIFT); |
|---|
| 1895 | + fid = FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_VFVALID, 1) |
|---|
| 1896 | + | FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_VFID, |
|---|
| 1897 | + vf_id); |
|---|
| 2568 | 1898 | qed_fid_pretend(p_hwfn, p_ptt, fid); |
|---|
| 2569 | 1899 | break; |
|---|
| 2570 | 1900 | default: |
|---|
| .. | .. |
|---|
| 2577 | 1907 | |
|---|
| 2578 | 1908 | /* Read registers using GRC */ |
|---|
| 2579 | 1909 | qed_read_regs(p_hwfn, p_ptt, dump_buf, addr, len); |
|---|
| 1910 | + |
|---|
| 1911 | +print_log: |
|---|
| 1912 | + /* Print log */ |
|---|
| 1913 | + dev_data->num_regs_read += len; |
|---|
| 1914 | + thresh = s_hw_type_defs[dev_data->hw_type].log_thresh; |
|---|
| 1915 | + if ((dev_data->num_regs_read / thresh) > |
|---|
| 1916 | + ((dev_data->num_regs_read - len) / thresh)) |
|---|
| 1917 | + DP_VERBOSE(p_hwfn, |
|---|
| 1918 | + QED_MSG_DEBUG, |
|---|
| 1919 | + "Dumped %d registers...\n", dev_data->num_regs_read); |
|---|
| 2580 | 1920 | |
|---|
| 2581 | 1921 | return len; |
|---|
| 2582 | 1922 | } |
|---|
| .. | .. |
|---|
| 2662 | 2002 | /* Dumps GRC registers entries. Returns the dumped size in dwords. */ |
|---|
| 2663 | 2003 | static u32 qed_grc_dump_regs_entries(struct qed_hwfn *p_hwfn, |
|---|
| 2664 | 2004 | struct qed_ptt *p_ptt, |
|---|
| 2665 | | - struct dbg_array input_regs_arr, |
|---|
| 2005 | + struct virt_mem_desc input_regs_arr, |
|---|
| 2666 | 2006 | u32 *dump_buf, |
|---|
| 2667 | 2007 | bool dump, |
|---|
| 2668 | 2008 | enum init_split_types split_type, |
|---|
| .. | .. |
|---|
| 2675 | 2015 | |
|---|
| 2676 | 2016 | *num_dumped_reg_entries = 0; |
|---|
| 2677 | 2017 | |
|---|
| 2678 | | - while (input_offset < input_regs_arr.size_in_dwords) { |
|---|
| 2018 | + while (input_offset < BYTES_TO_DWORDS(input_regs_arr.size)) { |
|---|
| 2679 | 2019 | const struct dbg_dump_cond_hdr *cond_hdr = |
|---|
| 2680 | 2020 | (const struct dbg_dump_cond_hdr *) |
|---|
| 2681 | | - &input_regs_arr.ptr[input_offset++]; |
|---|
| 2021 | + input_regs_arr.ptr + input_offset++; |
|---|
| 2682 | 2022 | u16 modes_buf_offset; |
|---|
| 2683 | 2023 | bool eval_mode; |
|---|
| 2684 | 2024 | |
|---|
| .. | .. |
|---|
| 2701 | 2041 | for (i = 0; i < cond_hdr->data_size; i++, input_offset++) { |
|---|
| 2702 | 2042 | const struct dbg_dump_reg *reg = |
|---|
| 2703 | 2043 | (const struct dbg_dump_reg *) |
|---|
| 2704 | | - &input_regs_arr.ptr[input_offset]; |
|---|
| 2044 | + input_regs_arr.ptr + input_offset; |
|---|
| 2705 | 2045 | u32 addr, len; |
|---|
| 2706 | 2046 | bool wide_bus; |
|---|
| 2707 | 2047 | |
|---|
| .. | .. |
|---|
| 2726 | 2066 | /* Dumps GRC registers entries. Returns the dumped size in dwords. */ |
|---|
| 2727 | 2067 | static u32 qed_grc_dump_split_data(struct qed_hwfn *p_hwfn, |
|---|
| 2728 | 2068 | struct qed_ptt *p_ptt, |
|---|
| 2729 | | - struct dbg_array input_regs_arr, |
|---|
| 2069 | + struct virt_mem_desc input_regs_arr, |
|---|
| 2730 | 2070 | u32 *dump_buf, |
|---|
| 2731 | 2071 | bool dump, |
|---|
| 2732 | 2072 | bool block_enable[MAX_BLOCK_ID], |
|---|
| 2733 | 2073 | enum init_split_types split_type, |
|---|
| 2734 | | - u8 split_id, |
|---|
| 2735 | | - const char *param_name, |
|---|
| 2736 | | - const char *param_val) |
|---|
| 2074 | + u8 split_id, const char *reg_type_name) |
|---|
| 2737 | 2075 | { |
|---|
| 2738 | 2076 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2739 | 2077 | enum init_split_types hdr_split_type = split_type; |
|---|
| .. | .. |
|---|
| 2751 | 2089 | false, |
|---|
| 2752 | 2090 | 0, |
|---|
| 2753 | 2091 | hdr_split_type, |
|---|
| 2754 | | - hdr_split_id, param_name, param_val); |
|---|
| 2092 | + hdr_split_id, reg_type_name); |
|---|
| 2755 | 2093 | |
|---|
| 2756 | 2094 | /* Dump registers */ |
|---|
| 2757 | 2095 | offset += qed_grc_dump_regs_entries(p_hwfn, |
|---|
| .. | .. |
|---|
| 2770 | 2108 | dump, |
|---|
| 2771 | 2109 | num_dumped_reg_entries, |
|---|
| 2772 | 2110 | hdr_split_type, |
|---|
| 2773 | | - hdr_split_id, param_name, param_val); |
|---|
| 2111 | + hdr_split_id, reg_type_name); |
|---|
| 2774 | 2112 | |
|---|
| 2775 | 2113 | return num_dumped_reg_entries > 0 ? offset : 0; |
|---|
| 2776 | 2114 | } |
|---|
| .. | .. |
|---|
| 2783 | 2121 | u32 *dump_buf, |
|---|
| 2784 | 2122 | bool dump, |
|---|
| 2785 | 2123 | bool block_enable[MAX_BLOCK_ID], |
|---|
| 2786 | | - const char *param_name, const char *param_val) |
|---|
| 2124 | + const char *reg_type_name) |
|---|
| 2787 | 2125 | { |
|---|
| 2126 | + struct virt_mem_desc *dbg_buf = |
|---|
| 2127 | + &p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG]; |
|---|
| 2788 | 2128 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2789 | 2129 | u32 offset = 0, input_offset = 0; |
|---|
| 2790 | | - u16 fid; |
|---|
| 2791 | | - while (input_offset < |
|---|
| 2792 | | - s_dbg_arrays[BIN_BUF_DBG_DUMP_REG].size_in_dwords) { |
|---|
| 2130 | + |
|---|
| 2131 | + while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) { |
|---|
| 2793 | 2132 | const struct dbg_dump_split_hdr *split_hdr; |
|---|
| 2794 | | - struct dbg_array curr_input_regs_arr; |
|---|
| 2133 | + struct virt_mem_desc curr_input_regs_arr; |
|---|
| 2795 | 2134 | enum init_split_types split_type; |
|---|
| 2796 | 2135 | u16 split_count = 0; |
|---|
| 2797 | 2136 | u32 split_data_size; |
|---|
| 2798 | 2137 | u8 split_id; |
|---|
| 2799 | 2138 | |
|---|
| 2800 | 2139 | split_hdr = |
|---|
| 2801 | | - (const struct dbg_dump_split_hdr *) |
|---|
| 2802 | | - &s_dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr[input_offset++]; |
|---|
| 2140 | + (const struct dbg_dump_split_hdr *) |
|---|
| 2141 | + dbg_buf->ptr + input_offset++; |
|---|
| 2803 | 2142 | split_type = |
|---|
| 2804 | | - GET_FIELD(split_hdr->hdr, |
|---|
| 2805 | | - DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID); |
|---|
| 2806 | | - split_data_size = |
|---|
| 2807 | | - GET_FIELD(split_hdr->hdr, |
|---|
| 2808 | | - DBG_DUMP_SPLIT_HDR_DATA_SIZE); |
|---|
| 2143 | + GET_FIELD(split_hdr->hdr, |
|---|
| 2144 | + DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID); |
|---|
| 2145 | + split_data_size = GET_FIELD(split_hdr->hdr, |
|---|
| 2146 | + DBG_DUMP_SPLIT_HDR_DATA_SIZE); |
|---|
| 2809 | 2147 | curr_input_regs_arr.ptr = |
|---|
| 2810 | | - &s_dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr[input_offset]; |
|---|
| 2811 | | - curr_input_regs_arr.size_in_dwords = split_data_size; |
|---|
| 2148 | + (u32 *)p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr + |
|---|
| 2149 | + input_offset; |
|---|
| 2150 | + curr_input_regs_arr.size = DWORDS_TO_BYTES(split_data_size); |
|---|
| 2812 | 2151 | |
|---|
| 2813 | 2152 | switch (split_type) { |
|---|
| 2814 | 2153 | case SPLIT_TYPE_NONE: |
|---|
| .. | .. |
|---|
| 2836 | 2175 | dump, block_enable, |
|---|
| 2837 | 2176 | split_type, |
|---|
| 2838 | 2177 | split_id, |
|---|
| 2839 | | - param_name, |
|---|
| 2840 | | - param_val); |
|---|
| 2178 | + reg_type_name); |
|---|
| 2841 | 2179 | |
|---|
| 2842 | 2180 | input_offset += split_data_size; |
|---|
| 2843 | 2181 | } |
|---|
| 2844 | 2182 | |
|---|
| 2845 | 2183 | /* Cancel pretends (pretend to original PF) */ |
|---|
| 2846 | 2184 | if (dump) { |
|---|
| 2847 | | - fid = p_hwfn->rel_pf_id << PXP_PRETEND_CONCRETE_FID_PFID_SHIFT; |
|---|
| 2848 | | - qed_fid_pretend(p_hwfn, p_ptt, fid); |
|---|
| 2185 | + qed_fid_pretend(p_hwfn, p_ptt, |
|---|
| 2186 | + FIELD_VALUE(PXP_PRETEND_CONCRETE_FID_PFID, |
|---|
| 2187 | + p_hwfn->rel_pf_id)); |
|---|
| 2849 | 2188 | dev_data->pretend.split_type = SPLIT_TYPE_NONE; |
|---|
| 2850 | 2189 | dev_data->pretend.split_id = 0; |
|---|
| 2851 | 2190 | } |
|---|
| .. | .. |
|---|
| 2858 | 2197 | struct qed_ptt *p_ptt, |
|---|
| 2859 | 2198 | u32 *dump_buf, bool dump) |
|---|
| 2860 | 2199 | { |
|---|
| 2861 | | - struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2862 | | - u32 i, offset = 0, num_regs = 0; |
|---|
| 2200 | + u32 offset = 0, num_regs = 0; |
|---|
| 2201 | + u8 reset_reg_id; |
|---|
| 2863 | 2202 | |
|---|
| 2864 | 2203 | /* Calculate header size */ |
|---|
| 2865 | 2204 | offset += qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2866 | | - false, 0, |
|---|
| 2867 | | - SPLIT_TYPE_NONE, 0, NULL, NULL); |
|---|
| 2205 | + false, |
|---|
| 2206 | + 0, SPLIT_TYPE_NONE, 0, "RESET_REGS"); |
|---|
| 2868 | 2207 | |
|---|
| 2869 | 2208 | /* Write reset registers */ |
|---|
| 2870 | | - for (i = 0; i < MAX_DBG_RESET_REGS; i++) { |
|---|
| 2871 | | - if (!s_reset_regs_defs[i].exists[dev_data->chip_id]) |
|---|
| 2209 | + for (reset_reg_id = 0; reset_reg_id < NUM_DBG_RESET_REGS; |
|---|
| 2210 | + reset_reg_id++) { |
|---|
| 2211 | + const struct dbg_reset_reg *reset_reg; |
|---|
| 2212 | + u32 reset_reg_addr; |
|---|
| 2213 | + |
|---|
| 2214 | + reset_reg = qed_get_dbg_reset_reg(p_hwfn, reset_reg_id); |
|---|
| 2215 | + |
|---|
| 2216 | + if (GET_FIELD(reset_reg->data, DBG_RESET_REG_IS_REMOVED)) |
|---|
| 2872 | 2217 | continue; |
|---|
| 2873 | 2218 | |
|---|
| 2219 | + reset_reg_addr = GET_FIELD(reset_reg->data, DBG_RESET_REG_ADDR); |
|---|
| 2874 | 2220 | offset += qed_grc_dump_reg_entry(p_hwfn, |
|---|
| 2875 | 2221 | p_ptt, |
|---|
| 2876 | 2222 | dump_buf + offset, |
|---|
| 2877 | 2223 | dump, |
|---|
| 2878 | | - BYTES_TO_DWORDS |
|---|
| 2879 | | - (s_reset_regs_defs[i].addr), 1, |
|---|
| 2880 | | - false, SPLIT_TYPE_NONE, 0); |
|---|
| 2224 | + reset_reg_addr, |
|---|
| 2225 | + 1, false, SPLIT_TYPE_NONE, 0); |
|---|
| 2881 | 2226 | num_regs++; |
|---|
| 2882 | 2227 | } |
|---|
| 2883 | 2228 | |
|---|
| .. | .. |
|---|
| 2885 | 2230 | if (dump) |
|---|
| 2886 | 2231 | qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2887 | 2232 | true, num_regs, SPLIT_TYPE_NONE, |
|---|
| 2888 | | - 0, NULL, NULL); |
|---|
| 2233 | + 0, "RESET_REGS"); |
|---|
| 2889 | 2234 | |
|---|
| 2890 | 2235 | return offset; |
|---|
| 2891 | 2236 | } |
|---|
| .. | .. |
|---|
| 2898 | 2243 | u32 *dump_buf, bool dump) |
|---|
| 2899 | 2244 | { |
|---|
| 2900 | 2245 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2901 | | - u32 block_id, offset = 0, num_reg_entries = 0; |
|---|
| 2246 | + u32 block_id, offset = 0, stall_regs_offset; |
|---|
| 2902 | 2247 | const struct dbg_attn_reg *attn_reg_arr; |
|---|
| 2903 | 2248 | u8 storm_id, reg_idx, num_attn_regs; |
|---|
| 2249 | + u32 num_reg_entries = 0; |
|---|
| 2904 | 2250 | |
|---|
| 2905 | | - /* Calculate header size */ |
|---|
| 2251 | + /* Write empty header for attention registers */ |
|---|
| 2906 | 2252 | offset += qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2907 | | - false, 0, SPLIT_TYPE_NONE, |
|---|
| 2908 | | - 0, NULL, NULL); |
|---|
| 2253 | + false, |
|---|
| 2254 | + 0, SPLIT_TYPE_NONE, 0, "ATTN_REGS"); |
|---|
| 2909 | 2255 | |
|---|
| 2910 | 2256 | /* Write parity registers */ |
|---|
| 2911 | | - for (block_id = 0; block_id < MAX_BLOCK_ID; block_id++) { |
|---|
| 2257 | + for (block_id = 0; block_id < NUM_PHYS_BLOCKS; block_id++) { |
|---|
| 2912 | 2258 | if (dev_data->block_in_reset[block_id] && dump) |
|---|
| 2913 | 2259 | continue; |
|---|
| 2914 | 2260 | |
|---|
| 2915 | | - attn_reg_arr = qed_get_block_attn_regs((enum block_id)block_id, |
|---|
| 2261 | + attn_reg_arr = qed_get_block_attn_regs(p_hwfn, |
|---|
| 2262 | + (enum block_id)block_id, |
|---|
| 2916 | 2263 | ATTN_TYPE_PARITY, |
|---|
| 2917 | 2264 | &num_attn_regs); |
|---|
| 2918 | 2265 | |
|---|
| .. | .. |
|---|
| 2955 | 2302 | } |
|---|
| 2956 | 2303 | } |
|---|
| 2957 | 2304 | |
|---|
| 2305 | + /* Overwrite header for attention registers */ |
|---|
| 2306 | + if (dump) |
|---|
| 2307 | + qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2308 | + true, |
|---|
| 2309 | + num_reg_entries, |
|---|
| 2310 | + SPLIT_TYPE_NONE, 0, "ATTN_REGS"); |
|---|
| 2311 | + |
|---|
| 2312 | + /* Write empty header for stall registers */ |
|---|
| 2313 | + stall_regs_offset = offset; |
|---|
| 2314 | + offset += qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2315 | + false, 0, SPLIT_TYPE_NONE, 0, "REGS"); |
|---|
| 2316 | + |
|---|
| 2958 | 2317 | /* Write Storm stall status registers */ |
|---|
| 2959 | | - for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) { |
|---|
| 2318 | + for (storm_id = 0, num_reg_entries = 0; storm_id < MAX_DBG_STORMS; |
|---|
| 2319 | + storm_id++) { |
|---|
| 2960 | 2320 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 2961 | 2321 | u32 addr; |
|---|
| 2962 | 2322 | |
|---|
| 2963 | | - if (dev_data->block_in_reset[storm->block_id] && dump) |
|---|
| 2323 | + if (dev_data->block_in_reset[storm->sem_block_id] && dump) |
|---|
| 2964 | 2324 | continue; |
|---|
| 2965 | 2325 | |
|---|
| 2966 | 2326 | addr = |
|---|
| 2967 | | - BYTES_TO_DWORDS(s_storm_defs[storm_id].sem_fast_mem_addr + |
|---|
| 2327 | + BYTES_TO_DWORDS(storm->sem_fast_mem_addr + |
|---|
| 2968 | 2328 | SEM_FAST_REG_STALLED); |
|---|
| 2969 | 2329 | offset += qed_grc_dump_reg_entry(p_hwfn, |
|---|
| 2970 | 2330 | p_ptt, |
|---|
| .. | .. |
|---|
| 2976 | 2336 | num_reg_entries++; |
|---|
| 2977 | 2337 | } |
|---|
| 2978 | 2338 | |
|---|
| 2979 | | - /* Write header */ |
|---|
| 2339 | + /* Overwrite header for stall registers */ |
|---|
| 2980 | 2340 | if (dump) |
|---|
| 2981 | | - qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2341 | + qed_grc_dump_regs_hdr(dump_buf + stall_regs_offset, |
|---|
| 2982 | 2342 | true, |
|---|
| 2983 | | - num_reg_entries, SPLIT_TYPE_NONE, |
|---|
| 2984 | | - 0, NULL, NULL); |
|---|
| 2343 | + num_reg_entries, |
|---|
| 2344 | + SPLIT_TYPE_NONE, 0, "REGS"); |
|---|
| 2985 | 2345 | |
|---|
| 2986 | 2346 | return offset; |
|---|
| 2987 | 2347 | } |
|---|
| .. | .. |
|---|
| 2994 | 2354 | u32 offset = 0, addr; |
|---|
| 2995 | 2355 | |
|---|
| 2996 | 2356 | offset += qed_grc_dump_regs_hdr(dump_buf, |
|---|
| 2997 | | - dump, 2, SPLIT_TYPE_NONE, 0, |
|---|
| 2998 | | - NULL, NULL); |
|---|
| 2357 | + dump, 2, SPLIT_TYPE_NONE, 0, "REGS"); |
|---|
| 2999 | 2358 | |
|---|
| 3000 | 2359 | /* Dump R/TDIF_REG_DEBUG_ERROR_INFO_SIZE (every 8'th register should be |
|---|
| 3001 | 2360 | * skipped). |
|---|
| .. | .. |
|---|
| 3043 | 2402 | u32 len, |
|---|
| 3044 | 2403 | u32 bit_width, |
|---|
| 3045 | 2404 | bool packed, |
|---|
| 3046 | | - const char *mem_group, |
|---|
| 3047 | | - bool is_storm, char storm_letter) |
|---|
| 2405 | + const char *mem_group, char storm_letter) |
|---|
| 3048 | 2406 | { |
|---|
| 3049 | 2407 | u8 num_params = 3; |
|---|
| 3050 | 2408 | u32 offset = 0; |
|---|
| .. | .. |
|---|
| 3065 | 2423 | |
|---|
| 3066 | 2424 | if (name) { |
|---|
| 3067 | 2425 | /* Dump name */ |
|---|
| 3068 | | - if (is_storm) { |
|---|
| 2426 | + if (storm_letter) { |
|---|
| 3069 | 2427 | strcpy(buf, "?STORM_"); |
|---|
| 3070 | 2428 | buf[0] = storm_letter; |
|---|
| 3071 | 2429 | strcpy(buf + strlen(buf), name); |
|---|
| .. | .. |
|---|
| 3097 | 2455 | dump, "packed", 1); |
|---|
| 3098 | 2456 | |
|---|
| 3099 | 2457 | /* Dump reg type */ |
|---|
| 3100 | | - if (is_storm) { |
|---|
| 2458 | + if (storm_letter) { |
|---|
| 3101 | 2459 | strcpy(buf, "?STORM_"); |
|---|
| 3102 | 2460 | buf[0] = storm_letter; |
|---|
| 3103 | 2461 | strcpy(buf + strlen(buf), mem_group); |
|---|
| .. | .. |
|---|
| 3124 | 2482 | bool wide_bus, |
|---|
| 3125 | 2483 | u32 bit_width, |
|---|
| 3126 | 2484 | bool packed, |
|---|
| 3127 | | - const char *mem_group, |
|---|
| 3128 | | - bool is_storm, char storm_letter) |
|---|
| 2485 | + const char *mem_group, char storm_letter) |
|---|
| 3129 | 2486 | { |
|---|
| 3130 | 2487 | u32 offset = 0; |
|---|
| 3131 | 2488 | |
|---|
| .. | .. |
|---|
| 3136 | 2493 | addr, |
|---|
| 3137 | 2494 | len, |
|---|
| 3138 | 2495 | bit_width, |
|---|
| 3139 | | - packed, |
|---|
| 3140 | | - mem_group, is_storm, storm_letter); |
|---|
| 2496 | + packed, mem_group, storm_letter); |
|---|
| 3141 | 2497 | offset += qed_grc_dump_addr_range(p_hwfn, |
|---|
| 3142 | 2498 | p_ptt, |
|---|
| 3143 | 2499 | dump_buf + offset, |
|---|
| .. | .. |
|---|
| 3150 | 2506 | /* Dumps GRC memories entries. Returns the dumped size in dwords. */ |
|---|
| 3151 | 2507 | static u32 qed_grc_dump_mem_entries(struct qed_hwfn *p_hwfn, |
|---|
| 3152 | 2508 | struct qed_ptt *p_ptt, |
|---|
| 3153 | | - struct dbg_array input_mems_arr, |
|---|
| 2509 | + struct virt_mem_desc input_mems_arr, |
|---|
| 3154 | 2510 | u32 *dump_buf, bool dump) |
|---|
| 3155 | 2511 | { |
|---|
| 3156 | 2512 | u32 i, offset = 0, input_offset = 0; |
|---|
| 3157 | 2513 | bool mode_match = true; |
|---|
| 3158 | 2514 | |
|---|
| 3159 | | - while (input_offset < input_mems_arr.size_in_dwords) { |
|---|
| 2515 | + while (input_offset < BYTES_TO_DWORDS(input_mems_arr.size)) { |
|---|
| 3160 | 2516 | const struct dbg_dump_cond_hdr *cond_hdr; |
|---|
| 3161 | 2517 | u16 modes_buf_offset; |
|---|
| 3162 | 2518 | u32 num_entries; |
|---|
| 3163 | 2519 | bool eval_mode; |
|---|
| 3164 | 2520 | |
|---|
| 3165 | | - cond_hdr = (const struct dbg_dump_cond_hdr *) |
|---|
| 3166 | | - &input_mems_arr.ptr[input_offset++]; |
|---|
| 2521 | + cond_hdr = |
|---|
| 2522 | + (const struct dbg_dump_cond_hdr *)input_mems_arr.ptr + |
|---|
| 2523 | + input_offset++; |
|---|
| 3167 | 2524 | num_entries = cond_hdr->data_size / MEM_DUMP_ENTRY_SIZE_DWORDS; |
|---|
| 3168 | 2525 | |
|---|
| 3169 | 2526 | /* Check required mode */ |
|---|
| .. | .. |
|---|
| 3185 | 2542 | for (i = 0; i < num_entries; |
|---|
| 3186 | 2543 | i++, input_offset += MEM_DUMP_ENTRY_SIZE_DWORDS) { |
|---|
| 3187 | 2544 | const struct dbg_dump_mem *mem = |
|---|
| 3188 | | - (const struct dbg_dump_mem *) |
|---|
| 3189 | | - &input_mems_arr.ptr[input_offset]; |
|---|
| 3190 | | - u8 mem_group_id = GET_FIELD(mem->dword0, |
|---|
| 3191 | | - DBG_DUMP_MEM_MEM_GROUP_ID); |
|---|
| 3192 | | - bool is_storm = false, mem_wide_bus; |
|---|
| 3193 | | - enum dbg_grc_params grc_param; |
|---|
| 3194 | | - char storm_letter = 'a'; |
|---|
| 3195 | | - enum block_id block_id; |
|---|
| 2545 | + (const struct dbg_dump_mem *)((u32 *) |
|---|
| 2546 | + input_mems_arr.ptr |
|---|
| 2547 | + + input_offset); |
|---|
| 2548 | + const struct dbg_block *block; |
|---|
| 2549 | + char storm_letter = 0; |
|---|
| 3196 | 2550 | u32 mem_addr, mem_len; |
|---|
| 2551 | + bool mem_wide_bus; |
|---|
| 2552 | + u8 mem_group_id; |
|---|
| 3197 | 2553 | |
|---|
| 2554 | + mem_group_id = GET_FIELD(mem->dword0, |
|---|
| 2555 | + DBG_DUMP_MEM_MEM_GROUP_ID); |
|---|
| 3198 | 2556 | if (mem_group_id >= MEM_GROUPS_NUM) { |
|---|
| 3199 | 2557 | DP_NOTICE(p_hwfn, "Invalid mem_group_id\n"); |
|---|
| 3200 | 2558 | return 0; |
|---|
| 3201 | 2559 | } |
|---|
| 3202 | 2560 | |
|---|
| 3203 | | - block_id = (enum block_id)cond_hdr->block_id; |
|---|
| 3204 | 2561 | if (!qed_grc_is_mem_included(p_hwfn, |
|---|
| 3205 | | - block_id, |
|---|
| 2562 | + (enum block_id) |
|---|
| 2563 | + cond_hdr->block_id, |
|---|
| 3206 | 2564 | mem_group_id)) |
|---|
| 3207 | 2565 | continue; |
|---|
| 3208 | 2566 | |
|---|
| .. | .. |
|---|
| 3211 | 2569 | mem_wide_bus = GET_FIELD(mem->dword1, |
|---|
| 3212 | 2570 | DBG_DUMP_MEM_WIDE_BUS); |
|---|
| 3213 | 2571 | |
|---|
| 3214 | | - /* Update memory length for CCFC/TCFC memories |
|---|
| 3215 | | - * according to number of LCIDs/LTIDs. |
|---|
| 2572 | + block = get_dbg_block(p_hwfn, |
|---|
| 2573 | + cond_hdr->block_id); |
|---|
| 2574 | + |
|---|
| 2575 | + /* If memory is associated with Storm, |
|---|
| 2576 | + * update storm details |
|---|
| 3216 | 2577 | */ |
|---|
| 3217 | | - if (mem_group_id == MEM_GROUP_CONN_CFC_MEM) { |
|---|
| 3218 | | - if (mem_len % MAX_LCIDS) { |
|---|
| 3219 | | - DP_NOTICE(p_hwfn, |
|---|
| 3220 | | - "Invalid CCFC connection memory size\n"); |
|---|
| 3221 | | - return 0; |
|---|
| 3222 | | - } |
|---|
| 3223 | | - |
|---|
| 3224 | | - grc_param = DBG_GRC_PARAM_NUM_LCIDS; |
|---|
| 3225 | | - mem_len = qed_grc_get_param(p_hwfn, grc_param) * |
|---|
| 3226 | | - (mem_len / MAX_LCIDS); |
|---|
| 3227 | | - } else if (mem_group_id == MEM_GROUP_TASK_CFC_MEM) { |
|---|
| 3228 | | - if (mem_len % MAX_LTIDS) { |
|---|
| 3229 | | - DP_NOTICE(p_hwfn, |
|---|
| 3230 | | - "Invalid TCFC task memory size\n"); |
|---|
| 3231 | | - return 0; |
|---|
| 3232 | | - } |
|---|
| 3233 | | - |
|---|
| 3234 | | - grc_param = DBG_GRC_PARAM_NUM_LTIDS; |
|---|
| 3235 | | - mem_len = qed_grc_get_param(p_hwfn, grc_param) * |
|---|
| 3236 | | - (mem_len / MAX_LTIDS); |
|---|
| 3237 | | - } |
|---|
| 3238 | | - |
|---|
| 3239 | | - /* If memory is associated with Storm, update Storm |
|---|
| 3240 | | - * details. |
|---|
| 3241 | | - */ |
|---|
| 3242 | | - if (s_block_defs |
|---|
| 3243 | | - [cond_hdr->block_id]->associated_to_storm) { |
|---|
| 3244 | | - is_storm = true; |
|---|
| 3245 | | - storm_letter = |
|---|
| 3246 | | - s_storm_defs[s_block_defs |
|---|
| 3247 | | - [cond_hdr->block_id]-> |
|---|
| 3248 | | - storm_id].letter; |
|---|
| 3249 | | - } |
|---|
| 2578 | + if (block->associated_storm_letter) |
|---|
| 2579 | + storm_letter = block->associated_storm_letter; |
|---|
| 3250 | 2580 | |
|---|
| 3251 | 2581 | /* Dump memory */ |
|---|
| 3252 | 2582 | offset += qed_grc_dump_mem(p_hwfn, |
|---|
| .. | .. |
|---|
| 3260 | 2590 | 0, |
|---|
| 3261 | 2591 | false, |
|---|
| 3262 | 2592 | s_mem_group_names[mem_group_id], |
|---|
| 3263 | | - is_storm, |
|---|
| 3264 | 2593 | storm_letter); |
|---|
| 3265 | 2594 | } |
|---|
| 3266 | 2595 | } |
|---|
| .. | .. |
|---|
| 3275 | 2604 | struct qed_ptt *p_ptt, |
|---|
| 3276 | 2605 | u32 *dump_buf, bool dump) |
|---|
| 3277 | 2606 | { |
|---|
| 2607 | + struct virt_mem_desc *dbg_buf = |
|---|
| 2608 | + &p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_MEM]; |
|---|
| 3278 | 2609 | u32 offset = 0, input_offset = 0; |
|---|
| 3279 | 2610 | |
|---|
| 3280 | | - while (input_offset < |
|---|
| 3281 | | - s_dbg_arrays[BIN_BUF_DBG_DUMP_MEM].size_in_dwords) { |
|---|
| 2611 | + while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) { |
|---|
| 3282 | 2612 | const struct dbg_dump_split_hdr *split_hdr; |
|---|
| 3283 | | - struct dbg_array curr_input_mems_arr; |
|---|
| 2613 | + struct virt_mem_desc curr_input_mems_arr; |
|---|
| 3284 | 2614 | enum init_split_types split_type; |
|---|
| 3285 | 2615 | u32 split_data_size; |
|---|
| 3286 | 2616 | |
|---|
| 3287 | | - split_hdr = (const struct dbg_dump_split_hdr *) |
|---|
| 3288 | | - &s_dbg_arrays[BIN_BUF_DBG_DUMP_MEM].ptr[input_offset++]; |
|---|
| 3289 | | - split_type = |
|---|
| 3290 | | - GET_FIELD(split_hdr->hdr, |
|---|
| 3291 | | - DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID); |
|---|
| 3292 | | - split_data_size = |
|---|
| 3293 | | - GET_FIELD(split_hdr->hdr, |
|---|
| 3294 | | - DBG_DUMP_SPLIT_HDR_DATA_SIZE); |
|---|
| 3295 | | - curr_input_mems_arr.ptr = |
|---|
| 3296 | | - &s_dbg_arrays[BIN_BUF_DBG_DUMP_MEM].ptr[input_offset]; |
|---|
| 3297 | | - curr_input_mems_arr.size_in_dwords = split_data_size; |
|---|
| 2617 | + split_hdr = |
|---|
| 2618 | + (const struct dbg_dump_split_hdr *)dbg_buf->ptr + |
|---|
| 2619 | + input_offset++; |
|---|
| 2620 | + split_type = GET_FIELD(split_hdr->hdr, |
|---|
| 2621 | + DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID); |
|---|
| 2622 | + split_data_size = GET_FIELD(split_hdr->hdr, |
|---|
| 2623 | + DBG_DUMP_SPLIT_HDR_DATA_SIZE); |
|---|
| 2624 | + curr_input_mems_arr.ptr = (u32 *)dbg_buf->ptr + input_offset; |
|---|
| 2625 | + curr_input_mems_arr.size = DWORDS_TO_BYTES(split_data_size); |
|---|
| 3298 | 2626 | |
|---|
| 3299 | 2627 | if (split_type == SPLIT_TYPE_NONE) |
|---|
| 3300 | 2628 | offset += qed_grc_dump_mem_entries(p_hwfn, |
|---|
| .. | .. |
|---|
| 3322 | 2650 | bool dump, |
|---|
| 3323 | 2651 | const char *name, |
|---|
| 3324 | 2652 | u32 num_lids, |
|---|
| 3325 | | - u32 lid_size, |
|---|
| 3326 | | - u32 rd_reg_addr, |
|---|
| 3327 | | - u8 storm_id) |
|---|
| 2653 | + enum cm_ctx_types ctx_type, u8 storm_id) |
|---|
| 3328 | 2654 | { |
|---|
| 2655 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 3329 | 2656 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 3330 | | - u32 i, lid, total_size, offset = 0; |
|---|
| 2657 | + u32 i, lid, lid_size, total_size; |
|---|
| 2658 | + u32 rd_reg_addr, offset = 0; |
|---|
| 2659 | + |
|---|
| 2660 | + /* Convert quad-regs to dwords */ |
|---|
| 2661 | + lid_size = storm->cm_ctx_lid_sizes[dev_data->chip_id][ctx_type] * 4; |
|---|
| 3331 | 2662 | |
|---|
| 3332 | 2663 | if (!lid_size) |
|---|
| 3333 | 2664 | return 0; |
|---|
| 3334 | 2665 | |
|---|
| 3335 | | - lid_size *= BYTES_IN_DWORD; |
|---|
| 3336 | 2666 | total_size = num_lids * lid_size; |
|---|
| 3337 | 2667 | |
|---|
| 3338 | 2668 | offset += qed_grc_dump_mem_hdr(p_hwfn, |
|---|
| .. | .. |
|---|
| 3342 | 2672 | 0, |
|---|
| 3343 | 2673 | total_size, |
|---|
| 3344 | 2674 | lid_size * 32, |
|---|
| 3345 | | - false, name, true, storm->letter); |
|---|
| 2675 | + false, name, storm->letter); |
|---|
| 3346 | 2676 | |
|---|
| 3347 | 2677 | if (!dump) |
|---|
| 3348 | 2678 | return offset + total_size; |
|---|
| 3349 | 2679 | |
|---|
| 2680 | + rd_reg_addr = BYTES_TO_DWORDS(storm->cm_ctx_rd_addr[ctx_type]); |
|---|
| 2681 | + |
|---|
| 3350 | 2682 | /* Dump context data */ |
|---|
| 3351 | 2683 | for (lid = 0; lid < num_lids; lid++) { |
|---|
| 3352 | | - for (i = 0; i < lid_size; i++, offset++) { |
|---|
| 2684 | + for (i = 0; i < lid_size; i++) { |
|---|
| 3353 | 2685 | qed_wr(p_hwfn, |
|---|
| 3354 | 2686 | p_ptt, storm->cm_ctx_wr_addr, (i << 9) | lid); |
|---|
| 3355 | | - *(dump_buf + offset) = qed_rd(p_hwfn, |
|---|
| 3356 | | - p_ptt, rd_reg_addr); |
|---|
| 2687 | + offset += qed_grc_dump_addr_range(p_hwfn, |
|---|
| 2688 | + p_ptt, |
|---|
| 2689 | + dump_buf + offset, |
|---|
| 2690 | + dump, |
|---|
| 2691 | + rd_reg_addr, |
|---|
| 2692 | + 1, |
|---|
| 2693 | + false, |
|---|
| 2694 | + SPLIT_TYPE_NONE, 0); |
|---|
| 3357 | 2695 | } |
|---|
| 3358 | 2696 | } |
|---|
| 3359 | 2697 | |
|---|
| .. | .. |
|---|
| 3364 | 2702 | static u32 qed_grc_dump_ctx(struct qed_hwfn *p_hwfn, |
|---|
| 3365 | 2703 | struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 3366 | 2704 | { |
|---|
| 3367 | | - enum dbg_grc_params grc_param; |
|---|
| 3368 | 2705 | u32 offset = 0; |
|---|
| 3369 | 2706 | u8 storm_id; |
|---|
| 3370 | 2707 | |
|---|
| 3371 | 2708 | for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) { |
|---|
| 3372 | | - struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 3373 | | - |
|---|
| 3374 | 2709 | if (!qed_grc_is_storm_included(p_hwfn, |
|---|
| 3375 | 2710 | (enum dbg_storms)storm_id)) |
|---|
| 3376 | 2711 | continue; |
|---|
| 3377 | 2712 | |
|---|
| 3378 | 2713 | /* Dump Conn AG context size */ |
|---|
| 3379 | | - grc_param = DBG_GRC_PARAM_NUM_LCIDS; |
|---|
| 3380 | | - offset += |
|---|
| 3381 | | - qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 3382 | | - p_ptt, |
|---|
| 3383 | | - dump_buf + offset, |
|---|
| 3384 | | - dump, |
|---|
| 3385 | | - "CONN_AG_CTX", |
|---|
| 3386 | | - qed_grc_get_param(p_hwfn, |
|---|
| 3387 | | - grc_param), |
|---|
| 3388 | | - storm->cm_conn_ag_ctx_lid_size, |
|---|
| 3389 | | - storm->cm_conn_ag_ctx_rd_addr, |
|---|
| 3390 | | - storm_id); |
|---|
| 2714 | + offset += qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 2715 | + p_ptt, |
|---|
| 2716 | + dump_buf + offset, |
|---|
| 2717 | + dump, |
|---|
| 2718 | + "CONN_AG_CTX", |
|---|
| 2719 | + NUM_OF_LCIDS, |
|---|
| 2720 | + CM_CTX_CONN_AG, storm_id); |
|---|
| 3391 | 2721 | |
|---|
| 3392 | 2722 | /* Dump Conn ST context size */ |
|---|
| 3393 | | - grc_param = DBG_GRC_PARAM_NUM_LCIDS; |
|---|
| 3394 | | - offset += |
|---|
| 3395 | | - qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 3396 | | - p_ptt, |
|---|
| 3397 | | - dump_buf + offset, |
|---|
| 3398 | | - dump, |
|---|
| 3399 | | - "CONN_ST_CTX", |
|---|
| 3400 | | - qed_grc_get_param(p_hwfn, |
|---|
| 3401 | | - grc_param), |
|---|
| 3402 | | - storm->cm_conn_st_ctx_lid_size, |
|---|
| 3403 | | - storm->cm_conn_st_ctx_rd_addr, |
|---|
| 3404 | | - storm_id); |
|---|
| 2723 | + offset += qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 2724 | + p_ptt, |
|---|
| 2725 | + dump_buf + offset, |
|---|
| 2726 | + dump, |
|---|
| 2727 | + "CONN_ST_CTX", |
|---|
| 2728 | + NUM_OF_LCIDS, |
|---|
| 2729 | + CM_CTX_CONN_ST, storm_id); |
|---|
| 3405 | 2730 | |
|---|
| 3406 | 2731 | /* Dump Task AG context size */ |
|---|
| 3407 | | - grc_param = DBG_GRC_PARAM_NUM_LTIDS; |
|---|
| 3408 | | - offset += |
|---|
| 3409 | | - qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 3410 | | - p_ptt, |
|---|
| 3411 | | - dump_buf + offset, |
|---|
| 3412 | | - dump, |
|---|
| 3413 | | - "TASK_AG_CTX", |
|---|
| 3414 | | - qed_grc_get_param(p_hwfn, |
|---|
| 3415 | | - grc_param), |
|---|
| 3416 | | - storm->cm_task_ag_ctx_lid_size, |
|---|
| 3417 | | - storm->cm_task_ag_ctx_rd_addr, |
|---|
| 3418 | | - storm_id); |
|---|
| 2732 | + offset += qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 2733 | + p_ptt, |
|---|
| 2734 | + dump_buf + offset, |
|---|
| 2735 | + dump, |
|---|
| 2736 | + "TASK_AG_CTX", |
|---|
| 2737 | + NUM_OF_LTIDS, |
|---|
| 2738 | + CM_CTX_TASK_AG, storm_id); |
|---|
| 3419 | 2739 | |
|---|
| 3420 | 2740 | /* Dump Task ST context size */ |
|---|
| 3421 | | - grc_param = DBG_GRC_PARAM_NUM_LTIDS; |
|---|
| 3422 | | - offset += |
|---|
| 3423 | | - qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 3424 | | - p_ptt, |
|---|
| 3425 | | - dump_buf + offset, |
|---|
| 3426 | | - dump, |
|---|
| 3427 | | - "TASK_ST_CTX", |
|---|
| 3428 | | - qed_grc_get_param(p_hwfn, |
|---|
| 3429 | | - grc_param), |
|---|
| 3430 | | - storm->cm_task_st_ctx_lid_size, |
|---|
| 3431 | | - storm->cm_task_st_ctx_rd_addr, |
|---|
| 3432 | | - storm_id); |
|---|
| 2741 | + offset += qed_grc_dump_ctx_data(p_hwfn, |
|---|
| 2742 | + p_ptt, |
|---|
| 2743 | + dump_buf + offset, |
|---|
| 2744 | + dump, |
|---|
| 2745 | + "TASK_ST_CTX", |
|---|
| 2746 | + NUM_OF_LTIDS, |
|---|
| 2747 | + CM_CTX_TASK_ST, storm_id); |
|---|
| 3433 | 2748 | } |
|---|
| 3434 | 2749 | |
|---|
| 3435 | 2750 | return offset; |
|---|
| 3436 | 2751 | } |
|---|
| 3437 | 2752 | |
|---|
| 3438 | | -/* Dumps GRC IORs data. Returns the dumped size in dwords. */ |
|---|
| 3439 | | -static u32 qed_grc_dump_iors(struct qed_hwfn *p_hwfn, |
|---|
| 3440 | | - struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 2753 | +#define VFC_STATUS_RESP_READY_BIT 0 |
|---|
| 2754 | +#define VFC_STATUS_BUSY_BIT 1 |
|---|
| 2755 | +#define VFC_STATUS_SENDING_CMD_BIT 2 |
|---|
| 2756 | + |
|---|
| 2757 | +#define VFC_POLLING_DELAY_MS 1 |
|---|
| 2758 | +#define VFC_POLLING_COUNT 20 |
|---|
| 2759 | + |
|---|
| 2760 | +/* Reads data from VFC. Returns the number of dwords read (0 on error). |
|---|
| 2761 | + * Sizes are specified in dwords. |
|---|
| 2762 | + */ |
|---|
| 2763 | +static u32 qed_grc_dump_read_from_vfc(struct qed_hwfn *p_hwfn, |
|---|
| 2764 | + struct qed_ptt *p_ptt, |
|---|
| 2765 | + struct storm_defs *storm, |
|---|
| 2766 | + u32 *cmd_data, |
|---|
| 2767 | + u32 cmd_size, |
|---|
| 2768 | + u32 *addr_data, |
|---|
| 2769 | + u32 addr_size, |
|---|
| 2770 | + u32 resp_size, u32 *dump_buf) |
|---|
| 3441 | 2771 | { |
|---|
| 3442 | | - char buf[10] = "IOR_SET_?"; |
|---|
| 3443 | | - u32 addr, offset = 0; |
|---|
| 3444 | | - u8 storm_id, set_id; |
|---|
| 2772 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 2773 | + u32 vfc_status, polling_ms, polling_count = 0, i; |
|---|
| 2774 | + u32 reg_addr, sem_base; |
|---|
| 2775 | + bool is_ready = false; |
|---|
| 3445 | 2776 | |
|---|
| 3446 | | - for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) { |
|---|
| 3447 | | - struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 2777 | + sem_base = storm->sem_fast_mem_addr; |
|---|
| 2778 | + polling_ms = VFC_POLLING_DELAY_MS * |
|---|
| 2779 | + s_hw_type_defs[dev_data->hw_type].delay_factor; |
|---|
| 3448 | 2780 | |
|---|
| 3449 | | - if (!qed_grc_is_storm_included(p_hwfn, |
|---|
| 3450 | | - (enum dbg_storms)storm_id)) |
|---|
| 3451 | | - continue; |
|---|
| 2781 | + /* Write VFC command */ |
|---|
| 2782 | + ARR_REG_WR(p_hwfn, |
|---|
| 2783 | + p_ptt, |
|---|
| 2784 | + sem_base + SEM_FAST_REG_VFC_DATA_WR, |
|---|
| 2785 | + cmd_data, cmd_size); |
|---|
| 3452 | 2786 | |
|---|
| 3453 | | - for (set_id = 0; set_id < NUM_IOR_SETS; set_id++) { |
|---|
| 3454 | | - addr = BYTES_TO_DWORDS(storm->sem_fast_mem_addr + |
|---|
| 3455 | | - SEM_FAST_REG_STORM_REG_FILE) + |
|---|
| 3456 | | - IOR_SET_OFFSET(set_id); |
|---|
| 3457 | | - buf[strlen(buf) - 1] = '0' + set_id; |
|---|
| 3458 | | - offset += qed_grc_dump_mem(p_hwfn, |
|---|
| 3459 | | - p_ptt, |
|---|
| 3460 | | - dump_buf + offset, |
|---|
| 3461 | | - dump, |
|---|
| 3462 | | - buf, |
|---|
| 3463 | | - addr, |
|---|
| 3464 | | - IORS_PER_SET, |
|---|
| 3465 | | - false, |
|---|
| 3466 | | - 32, |
|---|
| 3467 | | - false, |
|---|
| 3468 | | - "ior", |
|---|
| 3469 | | - true, |
|---|
| 3470 | | - storm->letter); |
|---|
| 3471 | | - } |
|---|
| 2787 | + /* Write VFC address */ |
|---|
| 2788 | + ARR_REG_WR(p_hwfn, |
|---|
| 2789 | + p_ptt, |
|---|
| 2790 | + sem_base + SEM_FAST_REG_VFC_ADDR, |
|---|
| 2791 | + addr_data, addr_size); |
|---|
| 2792 | + |
|---|
| 2793 | + /* Read response */ |
|---|
| 2794 | + for (i = 0; i < resp_size; i++) { |
|---|
| 2795 | + /* Poll until ready */ |
|---|
| 2796 | + do { |
|---|
| 2797 | + reg_addr = sem_base + SEM_FAST_REG_VFC_STATUS; |
|---|
| 2798 | + qed_grc_dump_addr_range(p_hwfn, |
|---|
| 2799 | + p_ptt, |
|---|
| 2800 | + &vfc_status, |
|---|
| 2801 | + true, |
|---|
| 2802 | + BYTES_TO_DWORDS(reg_addr), |
|---|
| 2803 | + 1, |
|---|
| 2804 | + false, SPLIT_TYPE_NONE, 0); |
|---|
| 2805 | + is_ready = vfc_status & BIT(VFC_STATUS_RESP_READY_BIT); |
|---|
| 2806 | + |
|---|
| 2807 | + if (!is_ready) { |
|---|
| 2808 | + if (polling_count++ == VFC_POLLING_COUNT) |
|---|
| 2809 | + return 0; |
|---|
| 2810 | + |
|---|
| 2811 | + msleep(polling_ms); |
|---|
| 2812 | + } |
|---|
| 2813 | + } while (!is_ready); |
|---|
| 2814 | + |
|---|
| 2815 | + reg_addr = sem_base + SEM_FAST_REG_VFC_DATA_RD; |
|---|
| 2816 | + qed_grc_dump_addr_range(p_hwfn, |
|---|
| 2817 | + p_ptt, |
|---|
| 2818 | + dump_buf + i, |
|---|
| 2819 | + true, |
|---|
| 2820 | + BYTES_TO_DWORDS(reg_addr), |
|---|
| 2821 | + 1, false, SPLIT_TYPE_NONE, 0); |
|---|
| 3472 | 2822 | } |
|---|
| 3473 | 2823 | |
|---|
| 3474 | | - return offset; |
|---|
| 2824 | + return resp_size; |
|---|
| 3475 | 2825 | } |
|---|
| 3476 | 2826 | |
|---|
| 3477 | 2827 | /* Dump VFC CAM. Returns the dumped size in dwords. */ |
|---|
| .. | .. |
|---|
| 3483 | 2833 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 3484 | 2834 | u32 cam_addr[VFC_CAM_ADDR_DWORDS] = { 0 }; |
|---|
| 3485 | 2835 | u32 cam_cmd[VFC_CAM_CMD_DWORDS] = { 0 }; |
|---|
| 3486 | | - u32 row, i, offset = 0; |
|---|
| 2836 | + u32 row, offset = 0; |
|---|
| 3487 | 2837 | |
|---|
| 3488 | 2838 | offset += qed_grc_dump_mem_hdr(p_hwfn, |
|---|
| 3489 | 2839 | dump_buf + offset, |
|---|
| .. | .. |
|---|
| 3492 | 2842 | 0, |
|---|
| 3493 | 2843 | total_size, |
|---|
| 3494 | 2844 | 256, |
|---|
| 3495 | | - false, "vfc_cam", true, storm->letter); |
|---|
| 2845 | + false, "vfc_cam", storm->letter); |
|---|
| 3496 | 2846 | |
|---|
| 3497 | 2847 | if (!dump) |
|---|
| 3498 | 2848 | return offset + total_size; |
|---|
| .. | .. |
|---|
| 3500 | 2850 | /* Prepare CAM address */ |
|---|
| 3501 | 2851 | SET_VAR_FIELD(cam_addr, VFC_CAM_ADDR, OP, VFC_OPCODE_CAM_RD); |
|---|
| 3502 | 2852 | |
|---|
| 3503 | | - for (row = 0; row < VFC_CAM_NUM_ROWS; |
|---|
| 3504 | | - row++, offset += VFC_CAM_RESP_DWORDS) { |
|---|
| 3505 | | - /* Write VFC CAM command */ |
|---|
| 2853 | + /* Read VFC CAM data */ |
|---|
| 2854 | + for (row = 0; row < VFC_CAM_NUM_ROWS; row++) { |
|---|
| 3506 | 2855 | SET_VAR_FIELD(cam_cmd, VFC_CAM_CMD, ROW, row); |
|---|
| 3507 | | - ARR_REG_WR(p_hwfn, |
|---|
| 3508 | | - p_ptt, |
|---|
| 3509 | | - storm->sem_fast_mem_addr + SEM_FAST_REG_VFC_DATA_WR, |
|---|
| 3510 | | - cam_cmd, VFC_CAM_CMD_DWORDS); |
|---|
| 3511 | | - |
|---|
| 3512 | | - /* Write VFC CAM address */ |
|---|
| 3513 | | - ARR_REG_WR(p_hwfn, |
|---|
| 3514 | | - p_ptt, |
|---|
| 3515 | | - storm->sem_fast_mem_addr + SEM_FAST_REG_VFC_ADDR, |
|---|
| 3516 | | - cam_addr, VFC_CAM_ADDR_DWORDS); |
|---|
| 3517 | | - |
|---|
| 3518 | | - /* Read VFC CAM read response */ |
|---|
| 3519 | | - ARR_REG_RD(p_hwfn, |
|---|
| 3520 | | - p_ptt, |
|---|
| 3521 | | - storm->sem_fast_mem_addr + SEM_FAST_REG_VFC_DATA_RD, |
|---|
| 3522 | | - dump_buf + offset, VFC_CAM_RESP_DWORDS); |
|---|
| 2856 | + offset += qed_grc_dump_read_from_vfc(p_hwfn, |
|---|
| 2857 | + p_ptt, |
|---|
| 2858 | + storm, |
|---|
| 2859 | + cam_cmd, |
|---|
| 2860 | + VFC_CAM_CMD_DWORDS, |
|---|
| 2861 | + cam_addr, |
|---|
| 2862 | + VFC_CAM_ADDR_DWORDS, |
|---|
| 2863 | + VFC_CAM_RESP_DWORDS, |
|---|
| 2864 | + dump_buf + offset); |
|---|
| 3523 | 2865 | } |
|---|
| 3524 | 2866 | |
|---|
| 3525 | 2867 | return offset; |
|---|
| .. | .. |
|---|
| 3536 | 2878 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 3537 | 2879 | u32 ram_addr[VFC_RAM_ADDR_DWORDS] = { 0 }; |
|---|
| 3538 | 2880 | u32 ram_cmd[VFC_RAM_CMD_DWORDS] = { 0 }; |
|---|
| 3539 | | - u32 row, i, offset = 0; |
|---|
| 2881 | + u32 row, offset = 0; |
|---|
| 3540 | 2882 | |
|---|
| 3541 | 2883 | offset += qed_grc_dump_mem_hdr(p_hwfn, |
|---|
| 3542 | 2884 | dump_buf + offset, |
|---|
| .. | .. |
|---|
| 3547 | 2889 | 256, |
|---|
| 3548 | 2890 | false, |
|---|
| 3549 | 2891 | ram_defs->type_name, |
|---|
| 3550 | | - true, storm->letter); |
|---|
| 3551 | | - |
|---|
| 3552 | | - /* Prepare RAM address */ |
|---|
| 3553 | | - SET_VAR_FIELD(ram_addr, VFC_RAM_ADDR, OP, VFC_OPCODE_RAM_RD); |
|---|
| 2892 | + storm->letter); |
|---|
| 3554 | 2893 | |
|---|
| 3555 | 2894 | if (!dump) |
|---|
| 3556 | 2895 | return offset + total_size; |
|---|
| 3557 | 2896 | |
|---|
| 2897 | + /* Prepare RAM address */ |
|---|
| 2898 | + SET_VAR_FIELD(ram_addr, VFC_RAM_ADDR, OP, VFC_OPCODE_RAM_RD); |
|---|
| 2899 | + |
|---|
| 2900 | + /* Read VFC RAM data */ |
|---|
| 3558 | 2901 | for (row = ram_defs->base_row; |
|---|
| 3559 | | - row < ram_defs->base_row + ram_defs->num_rows; |
|---|
| 3560 | | - row++, offset += VFC_RAM_RESP_DWORDS) { |
|---|
| 3561 | | - /* Write VFC RAM command */ |
|---|
| 3562 | | - ARR_REG_WR(p_hwfn, |
|---|
| 3563 | | - p_ptt, |
|---|
| 3564 | | - storm->sem_fast_mem_addr + SEM_FAST_REG_VFC_DATA_WR, |
|---|
| 3565 | | - ram_cmd, VFC_RAM_CMD_DWORDS); |
|---|
| 3566 | | - |
|---|
| 3567 | | - /* Write VFC RAM address */ |
|---|
| 2902 | + row < ram_defs->base_row + ram_defs->num_rows; row++) { |
|---|
| 3568 | 2903 | SET_VAR_FIELD(ram_addr, VFC_RAM_ADDR, ROW, row); |
|---|
| 3569 | | - ARR_REG_WR(p_hwfn, |
|---|
| 3570 | | - p_ptt, |
|---|
| 3571 | | - storm->sem_fast_mem_addr + SEM_FAST_REG_VFC_ADDR, |
|---|
| 3572 | | - ram_addr, VFC_RAM_ADDR_DWORDS); |
|---|
| 3573 | | - |
|---|
| 3574 | | - /* Read VFC RAM read response */ |
|---|
| 3575 | | - ARR_REG_RD(p_hwfn, |
|---|
| 3576 | | - p_ptt, |
|---|
| 3577 | | - storm->sem_fast_mem_addr + SEM_FAST_REG_VFC_DATA_RD, |
|---|
| 3578 | | - dump_buf + offset, VFC_RAM_RESP_DWORDS); |
|---|
| 2904 | + offset += qed_grc_dump_read_from_vfc(p_hwfn, |
|---|
| 2905 | + p_ptt, |
|---|
| 2906 | + storm, |
|---|
| 2907 | + ram_cmd, |
|---|
| 2908 | + VFC_RAM_CMD_DWORDS, |
|---|
| 2909 | + ram_addr, |
|---|
| 2910 | + VFC_RAM_ADDR_DWORDS, |
|---|
| 2911 | + VFC_RAM_RESP_DWORDS, |
|---|
| 2912 | + dump_buf + offset); |
|---|
| 3579 | 2913 | } |
|---|
| 3580 | 2914 | |
|---|
| 3581 | 2915 | return offset; |
|---|
| .. | .. |
|---|
| 3585 | 2919 | static u32 qed_grc_dump_vfc(struct qed_hwfn *p_hwfn, |
|---|
| 3586 | 2920 | struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 3587 | 2921 | { |
|---|
| 3588 | | - struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 3589 | 2922 | u8 storm_id, i; |
|---|
| 3590 | 2923 | u32 offset = 0; |
|---|
| 3591 | 2924 | |
|---|
| 3592 | 2925 | for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) { |
|---|
| 3593 | 2926 | if (!qed_grc_is_storm_included(p_hwfn, |
|---|
| 3594 | 2927 | (enum dbg_storms)storm_id) || |
|---|
| 3595 | | - !s_storm_defs[storm_id].has_vfc || |
|---|
| 3596 | | - (storm_id == DBG_PSTORM_ID && dev_data->platform_id != |
|---|
| 3597 | | - PLATFORM_ASIC)) |
|---|
| 2928 | + !s_storm_defs[storm_id].has_vfc) |
|---|
| 3598 | 2929 | continue; |
|---|
| 3599 | 2930 | |
|---|
| 3600 | 2931 | /* Read CAM */ |
|---|
| .. | .. |
|---|
| 3644 | 2975 | total_dwords, |
|---|
| 3645 | 2976 | rss_defs->entry_width, |
|---|
| 3646 | 2977 | packed, |
|---|
| 3647 | | - rss_defs->type_name, false, 0); |
|---|
| 2978 | + rss_defs->type_name, 0); |
|---|
| 3648 | 2979 | |
|---|
| 3649 | 2980 | /* Dump RSS data */ |
|---|
| 3650 | 2981 | if (!dump) { |
|---|
| .. | .. |
|---|
| 3704 | 3035 | 0, |
|---|
| 3705 | 3036 | ram_size, |
|---|
| 3706 | 3037 | block_size * 8, |
|---|
| 3707 | | - false, type_name, false, 0); |
|---|
| 3038 | + false, type_name, 0); |
|---|
| 3708 | 3039 | |
|---|
| 3709 | 3040 | /* Read and dump Big RAM data */ |
|---|
| 3710 | 3041 | if (!dump) |
|---|
| .. | .. |
|---|
| 3730 | 3061 | return offset; |
|---|
| 3731 | 3062 | } |
|---|
| 3732 | 3063 | |
|---|
| 3064 | +/* Dumps MCP scratchpad. Returns the dumped size in dwords. */ |
|---|
| 3733 | 3065 | static u32 qed_grc_dump_mcp(struct qed_hwfn *p_hwfn, |
|---|
| 3734 | 3066 | struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 3735 | 3067 | { |
|---|
| .. | .. |
|---|
| 3751 | 3083 | dump, |
|---|
| 3752 | 3084 | NULL, |
|---|
| 3753 | 3085 | BYTES_TO_DWORDS(MCP_REG_SCRATCH), |
|---|
| 3754 | | - MCP_REG_SCRATCH_SIZE_BB_K2, |
|---|
| 3755 | | - false, 0, false, "MCP", false, 0); |
|---|
| 3086 | + MCP_REG_SCRATCH_SIZE, |
|---|
| 3087 | + false, 0, false, "MCP", 0); |
|---|
| 3756 | 3088 | |
|---|
| 3757 | 3089 | /* Dump MCP cpu_reg_file */ |
|---|
| 3758 | 3090 | offset += qed_grc_dump_mem(p_hwfn, |
|---|
| .. | .. |
|---|
| 3762 | 3094 | NULL, |
|---|
| 3763 | 3095 | BYTES_TO_DWORDS(MCP_REG_CPU_REG_FILE), |
|---|
| 3764 | 3096 | MCP_REG_CPU_REG_FILE_SIZE, |
|---|
| 3765 | | - false, 0, false, "MCP", false, 0); |
|---|
| 3097 | + false, 0, false, "MCP", 0); |
|---|
| 3766 | 3098 | |
|---|
| 3767 | 3099 | /* Dump MCP registers */ |
|---|
| 3768 | 3100 | block_enable[BLOCK_MCP] = true; |
|---|
| 3769 | 3101 | offset += qed_grc_dump_registers(p_hwfn, |
|---|
| 3770 | 3102 | p_ptt, |
|---|
| 3771 | 3103 | dump_buf + offset, |
|---|
| 3772 | | - dump, block_enable, "block", "MCP"); |
|---|
| 3104 | + dump, block_enable, "MCP"); |
|---|
| 3773 | 3105 | |
|---|
| 3774 | 3106 | /* Dump required non-MCP registers */ |
|---|
| 3775 | 3107 | offset += qed_grc_dump_regs_hdr(dump_buf + offset, |
|---|
| 3776 | 3108 | dump, 1, SPLIT_TYPE_NONE, 0, |
|---|
| 3777 | | - "block", "MCP"); |
|---|
| 3109 | + "MCP"); |
|---|
| 3778 | 3110 | addr = BYTES_TO_DWORDS(MISC_REG_SHARED_MEM_ADDR); |
|---|
| 3779 | 3111 | offset += qed_grc_dump_reg_entry(p_hwfn, |
|---|
| 3780 | 3112 | p_ptt, |
|---|
| .. | .. |
|---|
| 3791 | 3123 | return offset; |
|---|
| 3792 | 3124 | } |
|---|
| 3793 | 3125 | |
|---|
| 3794 | | -/* Dumps the tbus indirect memory for all PHYs. */ |
|---|
| 3126 | +/* Dumps the tbus indirect memory for all PHYs. |
|---|
| 3127 | + * Returns the dumped size in dwords. |
|---|
| 3128 | + */ |
|---|
| 3795 | 3129 | static u32 qed_grc_dump_phy(struct qed_hwfn *p_hwfn, |
|---|
| 3796 | 3130 | struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 3797 | 3131 | { |
|---|
| .. | .. |
|---|
| 3825 | 3159 | mem_name, |
|---|
| 3826 | 3160 | 0, |
|---|
| 3827 | 3161 | PHY_DUMP_SIZE_DWORDS, |
|---|
| 3828 | | - 16, true, mem_name, false, 0); |
|---|
| 3162 | + 16, true, mem_name, 0); |
|---|
| 3829 | 3163 | |
|---|
| 3830 | 3164 | if (!dump) { |
|---|
| 3831 | 3165 | offset += PHY_DUMP_SIZE_DWORDS; |
|---|
| .. | .. |
|---|
| 3856 | 3190 | return offset; |
|---|
| 3857 | 3191 | } |
|---|
| 3858 | 3192 | |
|---|
| 3859 | | -static void qed_config_dbg_line(struct qed_hwfn *p_hwfn, |
|---|
| 3860 | | - struct qed_ptt *p_ptt, |
|---|
| 3861 | | - enum block_id block_id, |
|---|
| 3862 | | - u8 line_id, |
|---|
| 3863 | | - u8 enable_mask, |
|---|
| 3864 | | - u8 right_shift, |
|---|
| 3865 | | - u8 force_valid_mask, u8 force_frame_mask) |
|---|
| 3866 | | -{ |
|---|
| 3867 | | - struct block_defs *block = s_block_defs[block_id]; |
|---|
| 3193 | +static enum dbg_status qed_find_nvram_image(struct qed_hwfn *p_hwfn, |
|---|
| 3194 | + struct qed_ptt *p_ptt, |
|---|
| 3195 | + u32 image_type, |
|---|
| 3196 | + u32 *nvram_offset_bytes, |
|---|
| 3197 | + u32 *nvram_size_bytes); |
|---|
| 3868 | 3198 | |
|---|
| 3869 | | - qed_wr(p_hwfn, p_ptt, block->dbg_select_addr, line_id); |
|---|
| 3870 | | - qed_wr(p_hwfn, p_ptt, block->dbg_enable_addr, enable_mask); |
|---|
| 3871 | | - qed_wr(p_hwfn, p_ptt, block->dbg_shift_addr, right_shift); |
|---|
| 3872 | | - qed_wr(p_hwfn, p_ptt, block->dbg_force_valid_addr, force_valid_mask); |
|---|
| 3873 | | - qed_wr(p_hwfn, p_ptt, block->dbg_force_frame_addr, force_frame_mask); |
|---|
| 3199 | +static enum dbg_status qed_nvram_read(struct qed_hwfn *p_hwfn, |
|---|
| 3200 | + struct qed_ptt *p_ptt, |
|---|
| 3201 | + u32 nvram_offset_bytes, |
|---|
| 3202 | + u32 nvram_size_bytes, u32 *ret_buf); |
|---|
| 3203 | + |
|---|
| 3204 | +/* Dumps the MCP HW dump from NVRAM. Returns the dumped size in dwords. */ |
|---|
| 3205 | +static u32 qed_grc_dump_mcp_hw_dump(struct qed_hwfn *p_hwfn, |
|---|
| 3206 | + struct qed_ptt *p_ptt, |
|---|
| 3207 | + u32 *dump_buf, bool dump) |
|---|
| 3208 | +{ |
|---|
| 3209 | + u32 hw_dump_offset_bytes = 0, hw_dump_size_bytes = 0; |
|---|
| 3210 | + u32 hw_dump_size_dwords = 0, offset = 0; |
|---|
| 3211 | + enum dbg_status status; |
|---|
| 3212 | + |
|---|
| 3213 | + /* Read HW dump image from NVRAM */ |
|---|
| 3214 | + status = qed_find_nvram_image(p_hwfn, |
|---|
| 3215 | + p_ptt, |
|---|
| 3216 | + NVM_TYPE_HW_DUMP_OUT, |
|---|
| 3217 | + &hw_dump_offset_bytes, |
|---|
| 3218 | + &hw_dump_size_bytes); |
|---|
| 3219 | + if (status != DBG_STATUS_OK) |
|---|
| 3220 | + return 0; |
|---|
| 3221 | + |
|---|
| 3222 | + hw_dump_size_dwords = BYTES_TO_DWORDS(hw_dump_size_bytes); |
|---|
| 3223 | + |
|---|
| 3224 | + /* Dump HW dump image section */ |
|---|
| 3225 | + offset += qed_dump_section_hdr(dump_buf + offset, |
|---|
| 3226 | + dump, "mcp_hw_dump", 1); |
|---|
| 3227 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 3228 | + dump, "size", hw_dump_size_dwords); |
|---|
| 3229 | + |
|---|
| 3230 | + /* Read MCP HW dump image into dump buffer */ |
|---|
| 3231 | + if (dump && hw_dump_size_dwords) { |
|---|
| 3232 | + status = qed_nvram_read(p_hwfn, |
|---|
| 3233 | + p_ptt, |
|---|
| 3234 | + hw_dump_offset_bytes, |
|---|
| 3235 | + hw_dump_size_bytes, dump_buf + offset); |
|---|
| 3236 | + if (status != DBG_STATUS_OK) { |
|---|
| 3237 | + DP_NOTICE(p_hwfn, |
|---|
| 3238 | + "Failed to read MCP HW Dump image from NVRAM\n"); |
|---|
| 3239 | + return 0; |
|---|
| 3240 | + } |
|---|
| 3241 | + } |
|---|
| 3242 | + offset += hw_dump_size_dwords; |
|---|
| 3243 | + |
|---|
| 3244 | + return offset; |
|---|
| 3874 | 3245 | } |
|---|
| 3875 | 3246 | |
|---|
| 3876 | 3247 | /* Dumps Static Debug data. Returns the dumped size in dwords. */ |
|---|
| .. | .. |
|---|
| 3879 | 3250 | u32 *dump_buf, bool dump) |
|---|
| 3880 | 3251 | { |
|---|
| 3881 | 3252 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 3882 | | - u32 block_id, line_id, offset = 0; |
|---|
| 3253 | + u32 block_id, line_id, offset = 0, addr, len; |
|---|
| 3883 | 3254 | |
|---|
| 3884 | 3255 | /* Don't dump static debug if a debug bus recording is in progress */ |
|---|
| 3885 | 3256 | if (dump && qed_rd(p_hwfn, p_ptt, DBG_REG_DBG_BLOCK_ON)) |
|---|
| 3886 | 3257 | return 0; |
|---|
| 3887 | 3258 | |
|---|
| 3888 | 3259 | if (dump) { |
|---|
| 3889 | | - /* Disable all blocks debug output */ |
|---|
| 3890 | | - for (block_id = 0; block_id < MAX_BLOCK_ID; block_id++) { |
|---|
| 3891 | | - struct block_defs *block = s_block_defs[block_id]; |
|---|
| 3892 | | - |
|---|
| 3893 | | - if (block->dbg_client_id[dev_data->chip_id] != |
|---|
| 3894 | | - MAX_DBG_BUS_CLIENTS) |
|---|
| 3895 | | - qed_wr(p_hwfn, p_ptt, block->dbg_enable_addr, |
|---|
| 3896 | | - 0); |
|---|
| 3897 | | - } |
|---|
| 3260 | + /* Disable debug bus in all blocks */ |
|---|
| 3261 | + qed_bus_disable_blocks(p_hwfn, p_ptt); |
|---|
| 3898 | 3262 | |
|---|
| 3899 | 3263 | qed_bus_reset_dbg_block(p_hwfn, p_ptt); |
|---|
| 3900 | | - qed_bus_set_framing_mode(p_hwfn, |
|---|
| 3901 | | - p_ptt, DBG_BUS_FRAME_MODE_8HW_0ST); |
|---|
| 3264 | + qed_wr(p_hwfn, |
|---|
| 3265 | + p_ptt, DBG_REG_FRAMING_MODE, DBG_BUS_FRAME_MODE_8HW); |
|---|
| 3902 | 3266 | qed_wr(p_hwfn, |
|---|
| 3903 | 3267 | p_ptt, DBG_REG_DEBUG_TARGET, DBG_BUS_TARGET_ID_INT_BUF); |
|---|
| 3904 | 3268 | qed_wr(p_hwfn, p_ptt, DBG_REG_FULL_MODE, 1); |
|---|
| .. | .. |
|---|
| 3907 | 3271 | |
|---|
| 3908 | 3272 | /* Dump all static debug lines for each relevant block */ |
|---|
| 3909 | 3273 | for (block_id = 0; block_id < MAX_BLOCK_ID; block_id++) { |
|---|
| 3910 | | - struct block_defs *block = s_block_defs[block_id]; |
|---|
| 3911 | | - struct dbg_bus_block *block_desc; |
|---|
| 3912 | | - u32 block_dwords, addr, len; |
|---|
| 3913 | | - u8 dbg_client_id; |
|---|
| 3274 | + const struct dbg_block_chip *block_per_chip; |
|---|
| 3275 | + const struct dbg_block *block; |
|---|
| 3276 | + bool is_removed, has_dbg_bus; |
|---|
| 3277 | + u16 modes_buf_offset; |
|---|
| 3278 | + u32 block_dwords; |
|---|
| 3914 | 3279 | |
|---|
| 3915 | | - if (block->dbg_client_id[dev_data->chip_id] == |
|---|
| 3916 | | - MAX_DBG_BUS_CLIENTS) |
|---|
| 3280 | + block_per_chip = |
|---|
| 3281 | + qed_get_dbg_block_per_chip(p_hwfn, (enum block_id)block_id); |
|---|
| 3282 | + is_removed = GET_FIELD(block_per_chip->flags, |
|---|
| 3283 | + DBG_BLOCK_CHIP_IS_REMOVED); |
|---|
| 3284 | + has_dbg_bus = GET_FIELD(block_per_chip->flags, |
|---|
| 3285 | + DBG_BLOCK_CHIP_HAS_DBG_BUS); |
|---|
| 3286 | + |
|---|
| 3287 | + /* read+clear for NWS parity is not working, skip NWS block */ |
|---|
| 3288 | + if (block_id == BLOCK_NWS) |
|---|
| 3917 | 3289 | continue; |
|---|
| 3918 | 3290 | |
|---|
| 3919 | | - block_desc = get_dbg_bus_block_desc(p_hwfn, |
|---|
| 3920 | | - (enum block_id)block_id); |
|---|
| 3921 | | - block_dwords = NUM_DBG_LINES(block_desc) * |
|---|
| 3291 | + if (!is_removed && has_dbg_bus && |
|---|
| 3292 | + GET_FIELD(block_per_chip->dbg_bus_mode.data, |
|---|
| 3293 | + DBG_MODE_HDR_EVAL_MODE) > 0) { |
|---|
| 3294 | + modes_buf_offset = |
|---|
| 3295 | + GET_FIELD(block_per_chip->dbg_bus_mode.data, |
|---|
| 3296 | + DBG_MODE_HDR_MODES_BUF_OFFSET); |
|---|
| 3297 | + if (!qed_is_mode_match(p_hwfn, &modes_buf_offset)) |
|---|
| 3298 | + has_dbg_bus = false; |
|---|
| 3299 | + } |
|---|
| 3300 | + |
|---|
| 3301 | + if (is_removed || !has_dbg_bus) |
|---|
| 3302 | + continue; |
|---|
| 3303 | + |
|---|
| 3304 | + block_dwords = NUM_DBG_LINES(block_per_chip) * |
|---|
| 3922 | 3305 | STATIC_DEBUG_LINE_DWORDS; |
|---|
| 3923 | 3306 | |
|---|
| 3924 | 3307 | /* Dump static section params */ |
|---|
| 3308 | + block = get_dbg_block(p_hwfn, (enum block_id)block_id); |
|---|
| 3925 | 3309 | offset += qed_grc_dump_mem_hdr(p_hwfn, |
|---|
| 3926 | 3310 | dump_buf + offset, |
|---|
| 3927 | 3311 | dump, |
|---|
| 3928 | 3312 | block->name, |
|---|
| 3929 | 3313 | 0, |
|---|
| 3930 | 3314 | block_dwords, |
|---|
| 3931 | | - 32, false, "STATIC", false, 0); |
|---|
| 3315 | + 32, false, "STATIC", 0); |
|---|
| 3932 | 3316 | |
|---|
| 3933 | 3317 | if (!dump) { |
|---|
| 3934 | 3318 | offset += block_dwords; |
|---|
| .. | .. |
|---|
| 3944 | 3328 | } |
|---|
| 3945 | 3329 | |
|---|
| 3946 | 3330 | /* Enable block's client */ |
|---|
| 3947 | | - dbg_client_id = block->dbg_client_id[dev_data->chip_id]; |
|---|
| 3948 | 3331 | qed_bus_enable_clients(p_hwfn, |
|---|
| 3949 | 3332 | p_ptt, |
|---|
| 3950 | | - BIT(dbg_client_id)); |
|---|
| 3333 | + BIT(block_per_chip->dbg_client_id)); |
|---|
| 3951 | 3334 | |
|---|
| 3952 | 3335 | addr = BYTES_TO_DWORDS(DBG_REG_CALENDAR_OUT_DATA); |
|---|
| 3953 | 3336 | len = STATIC_DEBUG_LINE_DWORDS; |
|---|
| 3954 | | - for (line_id = 0; line_id < (u32)NUM_DBG_LINES(block_desc); |
|---|
| 3337 | + for (line_id = 0; line_id < (u32)NUM_DBG_LINES(block_per_chip); |
|---|
| 3955 | 3338 | line_id++) { |
|---|
| 3956 | 3339 | /* Configure debug line ID */ |
|---|
| 3957 | | - qed_config_dbg_line(p_hwfn, |
|---|
| 3958 | | - p_ptt, |
|---|
| 3959 | | - (enum block_id)block_id, |
|---|
| 3960 | | - (u8)line_id, 0xf, 0, 0, 0); |
|---|
| 3340 | + qed_bus_config_dbg_line(p_hwfn, |
|---|
| 3341 | + p_ptt, |
|---|
| 3342 | + (enum block_id)block_id, |
|---|
| 3343 | + (u8)line_id, 0xf, 0, 0, 0); |
|---|
| 3961 | 3344 | |
|---|
| 3962 | 3345 | /* Read debug line info */ |
|---|
| 3963 | 3346 | offset += qed_grc_dump_addr_range(p_hwfn, |
|---|
| .. | .. |
|---|
| 3972 | 3355 | |
|---|
| 3973 | 3356 | /* Disable block's client and debug output */ |
|---|
| 3974 | 3357 | qed_bus_enable_clients(p_hwfn, p_ptt, 0); |
|---|
| 3975 | | - qed_wr(p_hwfn, p_ptt, block->dbg_enable_addr, 0); |
|---|
| 3358 | + qed_bus_config_dbg_line(p_hwfn, p_ptt, |
|---|
| 3359 | + (enum block_id)block_id, 0, 0, 0, 0, 0); |
|---|
| 3976 | 3360 | } |
|---|
| 3977 | 3361 | |
|---|
| 3978 | 3362 | if (dump) { |
|---|
| .. | .. |
|---|
| 3992 | 3376 | bool dump, u32 *num_dumped_dwords) |
|---|
| 3993 | 3377 | { |
|---|
| 3994 | 3378 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 3379 | + u32 dwords_read, offset = 0; |
|---|
| 3995 | 3380 | bool parities_masked = false; |
|---|
| 3996 | | - u32 offset = 0; |
|---|
| 3997 | 3381 | u8 i; |
|---|
| 3998 | 3382 | |
|---|
| 3999 | 3383 | *num_dumped_dwords = 0; |
|---|
| .. | .. |
|---|
| 4012 | 3396 | offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4013 | 3397 | dump, |
|---|
| 4014 | 3398 | "num-lcids", |
|---|
| 4015 | | - qed_grc_get_param(p_hwfn, |
|---|
| 4016 | | - DBG_GRC_PARAM_NUM_LCIDS)); |
|---|
| 3399 | + NUM_OF_LCIDS); |
|---|
| 4017 | 3400 | offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4018 | 3401 | dump, |
|---|
| 4019 | 3402 | "num-ltids", |
|---|
| 4020 | | - qed_grc_get_param(p_hwfn, |
|---|
| 4021 | | - DBG_GRC_PARAM_NUM_LTIDS)); |
|---|
| 3403 | + NUM_OF_LTIDS); |
|---|
| 4022 | 3404 | offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4023 | 3405 | dump, "num-ports", dev_data->num_ports); |
|---|
| 4024 | 3406 | |
|---|
| .. | .. |
|---|
| 4030 | 3412 | |
|---|
| 4031 | 3413 | /* Take all blocks out of reset (using reset registers) */ |
|---|
| 4032 | 3414 | if (dump) { |
|---|
| 4033 | | - qed_grc_unreset_blocks(p_hwfn, p_ptt); |
|---|
| 3415 | + qed_grc_unreset_blocks(p_hwfn, p_ptt, false); |
|---|
| 4034 | 3416 | qed_update_blocks_reset_state(p_hwfn, p_ptt); |
|---|
| 4035 | 3417 | } |
|---|
| 4036 | 3418 | |
|---|
| .. | .. |
|---|
| 4073 | 3455 | dump_buf + |
|---|
| 4074 | 3456 | offset, |
|---|
| 4075 | 3457 | dump, |
|---|
| 4076 | | - block_enable, NULL, NULL); |
|---|
| 3458 | + block_enable, NULL); |
|---|
| 4077 | 3459 | |
|---|
| 4078 | 3460 | /* Dump special registers */ |
|---|
| 4079 | 3461 | offset += qed_grc_dump_special_regs(p_hwfn, |
|---|
| .. | .. |
|---|
| 4107 | 3489 | dump_buf + offset, |
|---|
| 4108 | 3490 | dump, i); |
|---|
| 4109 | 3491 | |
|---|
| 4110 | | - /* Dump IORs */ |
|---|
| 4111 | | - if (qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_IOR)) |
|---|
| 4112 | | - offset += qed_grc_dump_iors(p_hwfn, |
|---|
| 4113 | | - p_ptt, dump_buf + offset, dump); |
|---|
| 4114 | | - |
|---|
| 4115 | 3492 | /* Dump VFC */ |
|---|
| 4116 | | - if (qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_VFC)) |
|---|
| 4117 | | - offset += qed_grc_dump_vfc(p_hwfn, |
|---|
| 4118 | | - p_ptt, dump_buf + offset, dump); |
|---|
| 3493 | + if (qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_VFC)) { |
|---|
| 3494 | + dwords_read = qed_grc_dump_vfc(p_hwfn, |
|---|
| 3495 | + p_ptt, dump_buf + offset, dump); |
|---|
| 3496 | + offset += dwords_read; |
|---|
| 3497 | + if (!dwords_read) |
|---|
| 3498 | + return DBG_STATUS_VFC_READ_ERROR; |
|---|
| 3499 | + } |
|---|
| 4119 | 3500 | |
|---|
| 4120 | 3501 | /* Dump PHY tbus */ |
|---|
| 4121 | 3502 | if (qed_grc_is_included(p_hwfn, |
|---|
| 4122 | 3503 | DBG_GRC_PARAM_DUMP_PHY) && dev_data->chip_id == |
|---|
| 4123 | | - CHIP_K2 && dev_data->platform_id == PLATFORM_ASIC) |
|---|
| 3504 | + CHIP_K2 && dev_data->hw_type == HW_TYPE_ASIC) |
|---|
| 4124 | 3505 | offset += qed_grc_dump_phy(p_hwfn, |
|---|
| 4125 | 3506 | p_ptt, dump_buf + offset, dump); |
|---|
| 3507 | + |
|---|
| 3508 | + /* Dump MCP HW Dump */ |
|---|
| 3509 | + if (qed_grc_is_included(p_hwfn, DBG_GRC_PARAM_DUMP_MCP_HW_DUMP) && |
|---|
| 3510 | + !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_MCP) && 1) |
|---|
| 3511 | + offset += qed_grc_dump_mcp_hw_dump(p_hwfn, |
|---|
| 3512 | + p_ptt, |
|---|
| 3513 | + dump_buf + offset, dump); |
|---|
| 4126 | 3514 | |
|---|
| 4127 | 3515 | /* Dump static debug data (only if not during debug bus recording) */ |
|---|
| 4128 | 3516 | if (qed_grc_is_included(p_hwfn, |
|---|
| .. | .. |
|---|
| 4174 | 3562 | u8 reg_id; |
|---|
| 4175 | 3563 | |
|---|
| 4176 | 3564 | hdr = (struct dbg_idle_chk_result_hdr *)dump_buf; |
|---|
| 4177 | | - regs = &((const union dbg_idle_chk_reg *) |
|---|
| 4178 | | - s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_REGS].ptr)[rule->reg_offset]; |
|---|
| 3565 | + regs = (const union dbg_idle_chk_reg *) |
|---|
| 3566 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_REGS].ptr + |
|---|
| 3567 | + rule->reg_offset; |
|---|
| 4179 | 3568 | cond_regs = ®s[0].cond_reg; |
|---|
| 4180 | 3569 | info_regs = ®s[rule->num_cond_regs].info_reg; |
|---|
| 4181 | 3570 | |
|---|
| .. | .. |
|---|
| 4195 | 3584 | const struct dbg_idle_chk_cond_reg *reg = &cond_regs[reg_id]; |
|---|
| 4196 | 3585 | struct dbg_idle_chk_result_reg_hdr *reg_hdr; |
|---|
| 4197 | 3586 | |
|---|
| 4198 | | - reg_hdr = (struct dbg_idle_chk_result_reg_hdr *) |
|---|
| 4199 | | - (dump_buf + offset); |
|---|
| 3587 | + reg_hdr = |
|---|
| 3588 | + (struct dbg_idle_chk_result_reg_hdr *)(dump_buf + offset); |
|---|
| 4200 | 3589 | |
|---|
| 4201 | 3590 | /* Write register header */ |
|---|
| 4202 | 3591 | if (!dump) { |
|---|
| .. | .. |
|---|
| 4313 | 3702 | const u32 *imm_values; |
|---|
| 4314 | 3703 | |
|---|
| 4315 | 3704 | rule = &input_rules[i]; |
|---|
| 4316 | | - regs = &((const union dbg_idle_chk_reg *) |
|---|
| 4317 | | - s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_REGS].ptr) |
|---|
| 4318 | | - [rule->reg_offset]; |
|---|
| 3705 | + regs = (const union dbg_idle_chk_reg *) |
|---|
| 3706 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_REGS].ptr + |
|---|
| 3707 | + rule->reg_offset; |
|---|
| 4319 | 3708 | cond_regs = ®s[0].cond_reg; |
|---|
| 4320 | | - imm_values = &s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_IMMS].ptr |
|---|
| 4321 | | - [rule->imm_offset]; |
|---|
| 3709 | + imm_values = |
|---|
| 3710 | + (u32 *)p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_IMMS].ptr + |
|---|
| 3711 | + rule->imm_offset; |
|---|
| 4322 | 3712 | |
|---|
| 4323 | 3713 | /* Check if all condition register blocks are out of reset, and |
|---|
| 4324 | 3714 | * find maximal number of entries (all condition registers that |
|---|
| .. | .. |
|---|
| 4436 | 3826 | static u32 qed_idle_chk_dump(struct qed_hwfn *p_hwfn, |
|---|
| 4437 | 3827 | struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 4438 | 3828 | { |
|---|
| 4439 | | - u32 num_failing_rules_offset, offset = 0, input_offset = 0; |
|---|
| 4440 | | - u32 num_failing_rules = 0; |
|---|
| 3829 | + struct virt_mem_desc *dbg_buf = |
|---|
| 3830 | + &p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES]; |
|---|
| 3831 | + u32 num_failing_rules_offset, offset = 0, |
|---|
| 3832 | + input_offset = 0, num_failing_rules = 0; |
|---|
| 4441 | 3833 | |
|---|
| 4442 | | - /* Dump global params */ |
|---|
| 3834 | + /* Dump global params - 1 must match below amount of params */ |
|---|
| 4443 | 3835 | offset += qed_dump_common_global_params(p_hwfn, |
|---|
| 4444 | 3836 | p_ptt, |
|---|
| 4445 | 3837 | dump_buf + offset, dump, 1); |
|---|
| .. | .. |
|---|
| 4451 | 3843 | num_failing_rules_offset = offset; |
|---|
| 4452 | 3844 | offset += qed_dump_num_param(dump_buf + offset, dump, "num_rules", 0); |
|---|
| 4453 | 3845 | |
|---|
| 4454 | | - while (input_offset < |
|---|
| 4455 | | - s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].size_in_dwords) { |
|---|
| 3846 | + while (input_offset < BYTES_TO_DWORDS(dbg_buf->size)) { |
|---|
| 4456 | 3847 | const struct dbg_idle_chk_cond_hdr *cond_hdr = |
|---|
| 4457 | | - (const struct dbg_idle_chk_cond_hdr *) |
|---|
| 4458 | | - &s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].ptr |
|---|
| 4459 | | - [input_offset++]; |
|---|
| 3848 | + (const struct dbg_idle_chk_cond_hdr *)dbg_buf->ptr + |
|---|
| 3849 | + input_offset++; |
|---|
| 4460 | 3850 | bool eval_mode, mode_match = true; |
|---|
| 4461 | 3851 | u32 curr_failing_rules; |
|---|
| 4462 | 3852 | u16 modes_buf_offset; |
|---|
| .. | .. |
|---|
| 4473 | 3863 | } |
|---|
| 4474 | 3864 | |
|---|
| 4475 | 3865 | if (mode_match) { |
|---|
| 3866 | + const struct dbg_idle_chk_rule *rule = |
|---|
| 3867 | + (const struct dbg_idle_chk_rule *)((u32 *) |
|---|
| 3868 | + dbg_buf->ptr |
|---|
| 3869 | + + input_offset); |
|---|
| 3870 | + u32 num_input_rules = |
|---|
| 3871 | + cond_hdr->data_size / IDLE_CHK_RULE_SIZE_DWORDS; |
|---|
| 4476 | 3872 | offset += |
|---|
| 4477 | 3873 | qed_idle_chk_dump_rule_entries(p_hwfn, |
|---|
| 4478 | | - p_ptt, |
|---|
| 4479 | | - dump_buf + offset, |
|---|
| 4480 | | - dump, |
|---|
| 4481 | | - (const struct dbg_idle_chk_rule *) |
|---|
| 4482 | | - &s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES]. |
|---|
| 4483 | | - ptr[input_offset], |
|---|
| 4484 | | - cond_hdr->data_size / IDLE_CHK_RULE_SIZE_DWORDS, |
|---|
| 4485 | | - &curr_failing_rules); |
|---|
| 3874 | + p_ptt, |
|---|
| 3875 | + dump_buf + |
|---|
| 3876 | + offset, |
|---|
| 3877 | + dump, |
|---|
| 3878 | + rule, |
|---|
| 3879 | + num_input_rules, |
|---|
| 3880 | + &curr_failing_rules); |
|---|
| 4486 | 3881 | num_failing_rules += curr_failing_rules; |
|---|
| 4487 | 3882 | } |
|---|
| 4488 | 3883 | |
|---|
| .. | .. |
|---|
| 4549 | 3944 | { |
|---|
| 4550 | 3945 | u32 ret_mcp_resp, ret_mcp_param, ret_read_size, bytes_to_copy; |
|---|
| 4551 | 3946 | s32 bytes_left = nvram_size_bytes; |
|---|
| 4552 | | - u32 read_offset = 0; |
|---|
| 3947 | + u32 read_offset = 0, param = 0; |
|---|
| 4553 | 3948 | |
|---|
| 4554 | 3949 | DP_VERBOSE(p_hwfn, |
|---|
| 4555 | 3950 | QED_MSG_DEBUG, |
|---|
| .. | .. |
|---|
| 4562 | 3957 | MCP_DRV_NVM_BUF_LEN) ? MCP_DRV_NVM_BUF_LEN : bytes_left; |
|---|
| 4563 | 3958 | |
|---|
| 4564 | 3959 | /* Call NVRAM read command */ |
|---|
| 3960 | + SET_MFW_FIELD(param, |
|---|
| 3961 | + DRV_MB_PARAM_NVM_OFFSET, |
|---|
| 3962 | + nvram_offset_bytes + read_offset); |
|---|
| 3963 | + SET_MFW_FIELD(param, DRV_MB_PARAM_NVM_LEN, bytes_to_copy); |
|---|
| 4565 | 3964 | if (qed_mcp_nvm_rd_cmd(p_hwfn, p_ptt, |
|---|
| 4566 | | - DRV_MSG_CODE_NVM_READ_NVRAM, |
|---|
| 4567 | | - (nvram_offset_bytes + |
|---|
| 4568 | | - read_offset) | |
|---|
| 4569 | | - (bytes_to_copy << |
|---|
| 4570 | | - DRV_MB_PARAM_NVM_LEN_OFFSET), |
|---|
| 4571 | | - &ret_mcp_resp, &ret_mcp_param, |
|---|
| 4572 | | - &ret_read_size, |
|---|
| 3965 | + DRV_MSG_CODE_NVM_READ_NVRAM, param, |
|---|
| 3966 | + &ret_mcp_resp, |
|---|
| 3967 | + &ret_mcp_param, &ret_read_size, |
|---|
| 4573 | 3968 | (u32 *)((u8 *)ret_buf + read_offset))) |
|---|
| 4574 | 3969 | return DBG_STATUS_NVRAM_READ_FAILED; |
|---|
| 4575 | 3970 | |
|---|
| .. | .. |
|---|
| 4707 | 4102 | u32 trace_meta_size_dwords = 0, running_bundle_id, offset = 0; |
|---|
| 4708 | 4103 | u32 trace_meta_offset_bytes = 0, trace_meta_size_bytes = 0; |
|---|
| 4709 | 4104 | enum dbg_status status; |
|---|
| 4710 | | - bool mcp_access; |
|---|
| 4711 | 4105 | int halted = 0; |
|---|
| 4106 | + bool use_mfw; |
|---|
| 4712 | 4107 | |
|---|
| 4713 | 4108 | *num_dumped_dwords = 0; |
|---|
| 4714 | 4109 | |
|---|
| 4715 | | - mcp_access = !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_MCP); |
|---|
| 4110 | + use_mfw = !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_MCP); |
|---|
| 4716 | 4111 | |
|---|
| 4717 | 4112 | /* Get trace data info */ |
|---|
| 4718 | 4113 | status = qed_mcp_trace_get_data_info(p_hwfn, |
|---|
| .. | .. |
|---|
| 4733 | 4128 | * consistent. if halt fails, MCP trace is taken anyway, with a small |
|---|
| 4734 | 4129 | * risk that it may be corrupt. |
|---|
| 4735 | 4130 | */ |
|---|
| 4736 | | - if (dump && mcp_access) { |
|---|
| 4131 | + if (dump && use_mfw) { |
|---|
| 4737 | 4132 | halted = !qed_mcp_halt(p_hwfn, p_ptt); |
|---|
| 4738 | 4133 | if (!halted) |
|---|
| 4739 | 4134 | DP_NOTICE(p_hwfn, "MCP halt failed!\n"); |
|---|
| .. | .. |
|---|
| 4773 | 4168 | */ |
|---|
| 4774 | 4169 | trace_meta_size_bytes = |
|---|
| 4775 | 4170 | qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_MCP_TRACE_META_SIZE); |
|---|
| 4776 | | - if ((!trace_meta_size_bytes || dump) && mcp_access) { |
|---|
| 4171 | + if ((!trace_meta_size_bytes || dump) && use_mfw) |
|---|
| 4777 | 4172 | status = qed_mcp_trace_get_meta_info(p_hwfn, |
|---|
| 4778 | 4173 | p_ptt, |
|---|
| 4779 | 4174 | trace_data_size_bytes, |
|---|
| 4780 | 4175 | &running_bundle_id, |
|---|
| 4781 | 4176 | &trace_meta_offset_bytes, |
|---|
| 4782 | 4177 | &trace_meta_size_bytes); |
|---|
| 4783 | | - if (status == DBG_STATUS_OK) |
|---|
| 4784 | | - trace_meta_size_dwords = |
|---|
| 4785 | | - BYTES_TO_DWORDS(trace_meta_size_bytes); |
|---|
| 4786 | | - } |
|---|
| 4178 | + if (status == DBG_STATUS_OK) |
|---|
| 4179 | + trace_meta_size_dwords = BYTES_TO_DWORDS(trace_meta_size_bytes); |
|---|
| 4787 | 4180 | |
|---|
| 4788 | 4181 | /* Dump trace meta size param */ |
|---|
| 4789 | 4182 | offset += qed_dump_num_param(dump_buf + offset, |
|---|
| .. | .. |
|---|
| 4807 | 4200 | /* If no mcp access, indicate that the dump doesn't contain the meta |
|---|
| 4808 | 4201 | * data from NVRAM. |
|---|
| 4809 | 4202 | */ |
|---|
| 4810 | | - return mcp_access ? status : DBG_STATUS_NVRAM_GET_IMAGE_FAILED; |
|---|
| 4203 | + return use_mfw ? status : DBG_STATUS_NVRAM_GET_IMAGE_FAILED; |
|---|
| 4811 | 4204 | } |
|---|
| 4812 | 4205 | |
|---|
| 4813 | 4206 | /* Dump GRC FIFO */ |
|---|
| .. | .. |
|---|
| 4985 | 4378 | override_window_dwords = |
|---|
| 4986 | 4379 | qed_rd(p_hwfn, p_ptt, GRC_REG_NUMBER_VALID_OVERRIDE_WINDOW) * |
|---|
| 4987 | 4380 | PROTECTION_OVERRIDE_ELEMENT_DWORDS; |
|---|
| 4988 | | - addr = BYTES_TO_DWORDS(GRC_REG_PROTECTION_OVERRIDE_WINDOW); |
|---|
| 4989 | | - offset += qed_grc_dump_addr_range(p_hwfn, |
|---|
| 4990 | | - p_ptt, |
|---|
| 4991 | | - dump_buf + offset, |
|---|
| 4992 | | - true, |
|---|
| 4993 | | - addr, |
|---|
| 4994 | | - override_window_dwords, |
|---|
| 4995 | | - true, SPLIT_TYPE_NONE, 0); |
|---|
| 4996 | | - qed_dump_num_param(dump_buf + size_param_offset, dump, "size", |
|---|
| 4997 | | - override_window_dwords); |
|---|
| 4381 | + if (override_window_dwords) { |
|---|
| 4382 | + addr = BYTES_TO_DWORDS(GRC_REG_PROTECTION_OVERRIDE_WINDOW); |
|---|
| 4383 | + offset += qed_grc_dump_addr_range(p_hwfn, |
|---|
| 4384 | + p_ptt, |
|---|
| 4385 | + dump_buf + offset, |
|---|
| 4386 | + true, |
|---|
| 4387 | + addr, |
|---|
| 4388 | + override_window_dwords, |
|---|
| 4389 | + true, SPLIT_TYPE_NONE, 0); |
|---|
| 4390 | + qed_dump_num_param(dump_buf + size_param_offset, dump, "size", |
|---|
| 4391 | + override_window_dwords); |
|---|
| 4392 | + } |
|---|
| 4998 | 4393 | out: |
|---|
| 4999 | 4394 | /* Dump last section */ |
|---|
| 5000 | 4395 | offset += qed_dump_last_section(dump_buf, offset, dump); |
|---|
| .. | .. |
|---|
| 5030 | 4425 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 5031 | 4426 | u32 last_list_idx, addr; |
|---|
| 5032 | 4427 | |
|---|
| 5033 | | - if (dev_data->block_in_reset[storm->block_id]) |
|---|
| 4428 | + if (dev_data->block_in_reset[storm->sem_block_id]) |
|---|
| 5034 | 4429 | continue; |
|---|
| 5035 | 4430 | |
|---|
| 5036 | 4431 | /* Read FW info for the current Storm */ |
|---|
| .. | .. |
|---|
| 5055 | 4450 | continue; |
|---|
| 5056 | 4451 | } |
|---|
| 5057 | 4452 | |
|---|
| 4453 | + addr = le16_to_cpu(asserts->section_ram_line_offset); |
|---|
| 5058 | 4454 | fw_asserts_section_addr = storm->sem_fast_mem_addr + |
|---|
| 5059 | | - SEM_FAST_REG_INT_RAM + |
|---|
| 5060 | | - RAM_LINES_TO_BYTES(asserts->section_ram_line_offset); |
|---|
| 4455 | + SEM_FAST_REG_INT_RAM + |
|---|
| 4456 | + RAM_LINES_TO_BYTES(addr); |
|---|
| 4457 | + |
|---|
| 5061 | 4458 | next_list_idx_addr = fw_asserts_section_addr + |
|---|
| 5062 | 4459 | DWORDS_TO_BYTES(asserts->list_next_index_dword_offset); |
|---|
| 5063 | 4460 | next_list_idx = qed_rd(p_hwfn, p_ptt, next_list_idx_addr); |
|---|
| .. | .. |
|---|
| 5081 | 4478 | return offset; |
|---|
| 5082 | 4479 | } |
|---|
| 5083 | 4480 | |
|---|
| 4481 | +/* Dumps the specified ILT pages to the specified buffer. |
|---|
| 4482 | + * Returns the dumped size in dwords. |
|---|
| 4483 | + */ |
|---|
| 4484 | +static u32 qed_ilt_dump_pages_range(u32 *dump_buf, |
|---|
| 4485 | + bool dump, |
|---|
| 4486 | + u32 start_page_id, |
|---|
| 4487 | + u32 num_pages, |
|---|
| 4488 | + struct phys_mem_desc *ilt_pages, |
|---|
| 4489 | + bool dump_page_ids) |
|---|
| 4490 | +{ |
|---|
| 4491 | + u32 page_id, end_page_id, offset = 0; |
|---|
| 4492 | + |
|---|
| 4493 | + if (num_pages == 0) |
|---|
| 4494 | + return offset; |
|---|
| 4495 | + |
|---|
| 4496 | + end_page_id = start_page_id + num_pages - 1; |
|---|
| 4497 | + |
|---|
| 4498 | + for (page_id = start_page_id; page_id <= end_page_id; page_id++) { |
|---|
| 4499 | + struct phys_mem_desc *mem_desc = &ilt_pages[page_id]; |
|---|
| 4500 | + |
|---|
| 4501 | + /** |
|---|
| 4502 | + * |
|---|
| 4503 | + * if (page_id >= ->p_cxt_mngr->ilt_shadow_size) |
|---|
| 4504 | + * break; |
|---|
| 4505 | + */ |
|---|
| 4506 | + |
|---|
| 4507 | + if (!ilt_pages[page_id].virt_addr) |
|---|
| 4508 | + continue; |
|---|
| 4509 | + |
|---|
| 4510 | + if (dump_page_ids) { |
|---|
| 4511 | + /* Copy page ID to dump buffer */ |
|---|
| 4512 | + if (dump) |
|---|
| 4513 | + *(dump_buf + offset) = page_id; |
|---|
| 4514 | + offset++; |
|---|
| 4515 | + } else { |
|---|
| 4516 | + /* Copy page memory to dump buffer */ |
|---|
| 4517 | + if (dump) |
|---|
| 4518 | + memcpy(dump_buf + offset, |
|---|
| 4519 | + mem_desc->virt_addr, mem_desc->size); |
|---|
| 4520 | + offset += BYTES_TO_DWORDS(mem_desc->size); |
|---|
| 4521 | + } |
|---|
| 4522 | + } |
|---|
| 4523 | + |
|---|
| 4524 | + return offset; |
|---|
| 4525 | +} |
|---|
| 4526 | + |
|---|
| 4527 | +/* Dumps a section containing the dumped ILT pages. |
|---|
| 4528 | + * Returns the dumped size in dwords. |
|---|
| 4529 | + */ |
|---|
| 4530 | +static u32 qed_ilt_dump_pages_section(struct qed_hwfn *p_hwfn, |
|---|
| 4531 | + u32 *dump_buf, |
|---|
| 4532 | + bool dump, |
|---|
| 4533 | + u32 valid_conn_pf_pages, |
|---|
| 4534 | + u32 valid_conn_vf_pages, |
|---|
| 4535 | + struct phys_mem_desc *ilt_pages, |
|---|
| 4536 | + bool dump_page_ids) |
|---|
| 4537 | +{ |
|---|
| 4538 | + struct qed_ilt_client_cfg *clients = p_hwfn->p_cxt_mngr->clients; |
|---|
| 4539 | + u32 pf_start_line, start_page_id, offset = 0; |
|---|
| 4540 | + u32 cdut_pf_init_pages, cdut_vf_init_pages; |
|---|
| 4541 | + u32 cdut_pf_work_pages, cdut_vf_work_pages; |
|---|
| 4542 | + u32 base_data_offset, size_param_offset; |
|---|
| 4543 | + u32 cdut_pf_pages, cdut_vf_pages; |
|---|
| 4544 | + const char *section_name; |
|---|
| 4545 | + u8 i; |
|---|
| 4546 | + |
|---|
| 4547 | + section_name = dump_page_ids ? "ilt_page_ids" : "ilt_page_mem"; |
|---|
| 4548 | + cdut_pf_init_pages = qed_get_cdut_num_pf_init_pages(p_hwfn); |
|---|
| 4549 | + cdut_vf_init_pages = qed_get_cdut_num_vf_init_pages(p_hwfn); |
|---|
| 4550 | + cdut_pf_work_pages = qed_get_cdut_num_pf_work_pages(p_hwfn); |
|---|
| 4551 | + cdut_vf_work_pages = qed_get_cdut_num_vf_work_pages(p_hwfn); |
|---|
| 4552 | + cdut_pf_pages = cdut_pf_init_pages + cdut_pf_work_pages; |
|---|
| 4553 | + cdut_vf_pages = cdut_vf_init_pages + cdut_vf_work_pages; |
|---|
| 4554 | + pf_start_line = p_hwfn->p_cxt_mngr->pf_start_line; |
|---|
| 4555 | + |
|---|
| 4556 | + offset += |
|---|
| 4557 | + qed_dump_section_hdr(dump_buf + offset, dump, section_name, 1); |
|---|
| 4558 | + |
|---|
| 4559 | + /* Dump size parameter (0 for now, overwritten with real size later) */ |
|---|
| 4560 | + size_param_offset = offset; |
|---|
| 4561 | + offset += qed_dump_num_param(dump_buf + offset, dump, "size", 0); |
|---|
| 4562 | + base_data_offset = offset; |
|---|
| 4563 | + |
|---|
| 4564 | + /* CDUC pages are ordered as follows: |
|---|
| 4565 | + * - PF pages - valid section (included in PF connection type mapping) |
|---|
| 4566 | + * - PF pages - invalid section (not dumped) |
|---|
| 4567 | + * - For each VF in the PF: |
|---|
| 4568 | + * - VF pages - valid section (included in VF connection type mapping) |
|---|
| 4569 | + * - VF pages - invalid section (not dumped) |
|---|
| 4570 | + */ |
|---|
| 4571 | + if (qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_DUMP_ILT_CDUC)) { |
|---|
| 4572 | + /* Dump connection PF pages */ |
|---|
| 4573 | + start_page_id = clients[ILT_CLI_CDUC].first.val - pf_start_line; |
|---|
| 4574 | + offset += qed_ilt_dump_pages_range(dump_buf + offset, |
|---|
| 4575 | + dump, |
|---|
| 4576 | + start_page_id, |
|---|
| 4577 | + valid_conn_pf_pages, |
|---|
| 4578 | + ilt_pages, dump_page_ids); |
|---|
| 4579 | + |
|---|
| 4580 | + /* Dump connection VF pages */ |
|---|
| 4581 | + start_page_id += clients[ILT_CLI_CDUC].pf_total_lines; |
|---|
| 4582 | + for (i = 0; i < p_hwfn->p_cxt_mngr->vf_count; |
|---|
| 4583 | + i++, start_page_id += clients[ILT_CLI_CDUC].vf_total_lines) |
|---|
| 4584 | + offset += qed_ilt_dump_pages_range(dump_buf + offset, |
|---|
| 4585 | + dump, |
|---|
| 4586 | + start_page_id, |
|---|
| 4587 | + valid_conn_vf_pages, |
|---|
| 4588 | + ilt_pages, |
|---|
| 4589 | + dump_page_ids); |
|---|
| 4590 | + } |
|---|
| 4591 | + |
|---|
| 4592 | + /* CDUT pages are ordered as follows: |
|---|
| 4593 | + * - PF init pages (not dumped) |
|---|
| 4594 | + * - PF work pages |
|---|
| 4595 | + * - For each VF in the PF: |
|---|
| 4596 | + * - VF init pages (not dumped) |
|---|
| 4597 | + * - VF work pages |
|---|
| 4598 | + */ |
|---|
| 4599 | + if (qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_DUMP_ILT_CDUT)) { |
|---|
| 4600 | + /* Dump task PF pages */ |
|---|
| 4601 | + start_page_id = clients[ILT_CLI_CDUT].first.val + |
|---|
| 4602 | + cdut_pf_init_pages - pf_start_line; |
|---|
| 4603 | + offset += qed_ilt_dump_pages_range(dump_buf + offset, |
|---|
| 4604 | + dump, |
|---|
| 4605 | + start_page_id, |
|---|
| 4606 | + cdut_pf_work_pages, |
|---|
| 4607 | + ilt_pages, dump_page_ids); |
|---|
| 4608 | + |
|---|
| 4609 | + /* Dump task VF pages */ |
|---|
| 4610 | + start_page_id = clients[ILT_CLI_CDUT].first.val + |
|---|
| 4611 | + cdut_pf_pages + cdut_vf_init_pages - pf_start_line; |
|---|
| 4612 | + for (i = 0; i < p_hwfn->p_cxt_mngr->vf_count; |
|---|
| 4613 | + i++, start_page_id += cdut_vf_pages) |
|---|
| 4614 | + offset += qed_ilt_dump_pages_range(dump_buf + offset, |
|---|
| 4615 | + dump, |
|---|
| 4616 | + start_page_id, |
|---|
| 4617 | + cdut_vf_work_pages, |
|---|
| 4618 | + ilt_pages, |
|---|
| 4619 | + dump_page_ids); |
|---|
| 4620 | + } |
|---|
| 4621 | + |
|---|
| 4622 | + /* Overwrite size param */ |
|---|
| 4623 | + if (dump) |
|---|
| 4624 | + qed_dump_num_param(dump_buf + size_param_offset, |
|---|
| 4625 | + dump, "size", offset - base_data_offset); |
|---|
| 4626 | + |
|---|
| 4627 | + return offset; |
|---|
| 4628 | +} |
|---|
| 4629 | + |
|---|
| 4630 | +/* Performs ILT Dump to the specified buffer. |
|---|
| 4631 | + * Returns the dumped size in dwords. |
|---|
| 4632 | + */ |
|---|
| 4633 | +static u32 qed_ilt_dump(struct qed_hwfn *p_hwfn, |
|---|
| 4634 | + struct qed_ptt *p_ptt, u32 *dump_buf, bool dump) |
|---|
| 4635 | +{ |
|---|
| 4636 | + struct qed_ilt_client_cfg *clients = p_hwfn->p_cxt_mngr->clients; |
|---|
| 4637 | + u32 valid_conn_vf_cids, valid_conn_vf_pages, offset = 0; |
|---|
| 4638 | + u32 valid_conn_pf_cids, valid_conn_pf_pages, num_pages; |
|---|
| 4639 | + u32 num_cids_per_page, conn_ctx_size; |
|---|
| 4640 | + u32 cduc_page_size, cdut_page_size; |
|---|
| 4641 | + struct phys_mem_desc *ilt_pages; |
|---|
| 4642 | + u8 conn_type; |
|---|
| 4643 | + |
|---|
| 4644 | + cduc_page_size = 1 << |
|---|
| 4645 | + (clients[ILT_CLI_CDUC].p_size.val + PXP_ILT_PAGE_SIZE_NUM_BITS_MIN); |
|---|
| 4646 | + cdut_page_size = 1 << |
|---|
| 4647 | + (clients[ILT_CLI_CDUT].p_size.val + PXP_ILT_PAGE_SIZE_NUM_BITS_MIN); |
|---|
| 4648 | + conn_ctx_size = p_hwfn->p_cxt_mngr->conn_ctx_size; |
|---|
| 4649 | + num_cids_per_page = (int)(cduc_page_size / conn_ctx_size); |
|---|
| 4650 | + ilt_pages = p_hwfn->p_cxt_mngr->ilt_shadow; |
|---|
| 4651 | + |
|---|
| 4652 | + /* Dump global params - 22 must match number of params below */ |
|---|
| 4653 | + offset += qed_dump_common_global_params(p_hwfn, p_ptt, |
|---|
| 4654 | + dump_buf + offset, dump, 22); |
|---|
| 4655 | + offset += qed_dump_str_param(dump_buf + offset, |
|---|
| 4656 | + dump, "dump-type", "ilt-dump"); |
|---|
| 4657 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4658 | + dump, |
|---|
| 4659 | + "cduc-page-size", cduc_page_size); |
|---|
| 4660 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4661 | + dump, |
|---|
| 4662 | + "cduc-first-page-id", |
|---|
| 4663 | + clients[ILT_CLI_CDUC].first.val); |
|---|
| 4664 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4665 | + dump, |
|---|
| 4666 | + "cduc-last-page-id", |
|---|
| 4667 | + clients[ILT_CLI_CDUC].last.val); |
|---|
| 4668 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4669 | + dump, |
|---|
| 4670 | + "cduc-num-pf-pages", |
|---|
| 4671 | + clients |
|---|
| 4672 | + [ILT_CLI_CDUC].pf_total_lines); |
|---|
| 4673 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4674 | + dump, |
|---|
| 4675 | + "cduc-num-vf-pages", |
|---|
| 4676 | + clients |
|---|
| 4677 | + [ILT_CLI_CDUC].vf_total_lines); |
|---|
| 4678 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4679 | + dump, |
|---|
| 4680 | + "max-conn-ctx-size", |
|---|
| 4681 | + conn_ctx_size); |
|---|
| 4682 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4683 | + dump, |
|---|
| 4684 | + "cdut-page-size", cdut_page_size); |
|---|
| 4685 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4686 | + dump, |
|---|
| 4687 | + "cdut-first-page-id", |
|---|
| 4688 | + clients[ILT_CLI_CDUT].first.val); |
|---|
| 4689 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4690 | + dump, |
|---|
| 4691 | + "cdut-last-page-id", |
|---|
| 4692 | + clients[ILT_CLI_CDUT].last.val); |
|---|
| 4693 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4694 | + dump, |
|---|
| 4695 | + "cdut-num-pf-init-pages", |
|---|
| 4696 | + qed_get_cdut_num_pf_init_pages(p_hwfn)); |
|---|
| 4697 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4698 | + dump, |
|---|
| 4699 | + "cdut-num-vf-init-pages", |
|---|
| 4700 | + qed_get_cdut_num_vf_init_pages(p_hwfn)); |
|---|
| 4701 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4702 | + dump, |
|---|
| 4703 | + "cdut-num-pf-work-pages", |
|---|
| 4704 | + qed_get_cdut_num_pf_work_pages(p_hwfn)); |
|---|
| 4705 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4706 | + dump, |
|---|
| 4707 | + "cdut-num-vf-work-pages", |
|---|
| 4708 | + qed_get_cdut_num_vf_work_pages(p_hwfn)); |
|---|
| 4709 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4710 | + dump, |
|---|
| 4711 | + "max-task-ctx-size", |
|---|
| 4712 | + p_hwfn->p_cxt_mngr->task_ctx_size); |
|---|
| 4713 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4714 | + dump, |
|---|
| 4715 | + "task-type-id", |
|---|
| 4716 | + p_hwfn->p_cxt_mngr->task_type_id); |
|---|
| 4717 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4718 | + dump, |
|---|
| 4719 | + "first-vf-id-in-pf", |
|---|
| 4720 | + p_hwfn->p_cxt_mngr->first_vf_in_pf); |
|---|
| 4721 | + offset += /* 18 */ qed_dump_num_param(dump_buf + offset, |
|---|
| 4722 | + dump, |
|---|
| 4723 | + "num-vfs-in-pf", |
|---|
| 4724 | + p_hwfn->p_cxt_mngr->vf_count); |
|---|
| 4725 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4726 | + dump, |
|---|
| 4727 | + "ptr-size-bytes", sizeof(void *)); |
|---|
| 4728 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4729 | + dump, |
|---|
| 4730 | + "pf-start-line", |
|---|
| 4731 | + p_hwfn->p_cxt_mngr->pf_start_line); |
|---|
| 4732 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4733 | + dump, |
|---|
| 4734 | + "page-mem-desc-size-dwords", |
|---|
| 4735 | + PAGE_MEM_DESC_SIZE_DWORDS); |
|---|
| 4736 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4737 | + dump, |
|---|
| 4738 | + "ilt-shadow-size", |
|---|
| 4739 | + p_hwfn->p_cxt_mngr->ilt_shadow_size); |
|---|
| 4740 | + /* Additional/Less parameters require matching of number in call to |
|---|
| 4741 | + * dump_common_global_params() |
|---|
| 4742 | + */ |
|---|
| 4743 | + |
|---|
| 4744 | + /* Dump section containing number of PF CIDs per connection type */ |
|---|
| 4745 | + offset += qed_dump_section_hdr(dump_buf + offset, |
|---|
| 4746 | + dump, "num_pf_cids_per_conn_type", 1); |
|---|
| 4747 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4748 | + dump, "size", NUM_OF_CONNECTION_TYPES_E4); |
|---|
| 4749 | + for (conn_type = 0, valid_conn_pf_cids = 0; |
|---|
| 4750 | + conn_type < NUM_OF_CONNECTION_TYPES_E4; conn_type++, offset++) { |
|---|
| 4751 | + u32 num_pf_cids = |
|---|
| 4752 | + p_hwfn->p_cxt_mngr->conn_cfg[conn_type].cid_count; |
|---|
| 4753 | + |
|---|
| 4754 | + if (dump) |
|---|
| 4755 | + *(dump_buf + offset) = num_pf_cids; |
|---|
| 4756 | + valid_conn_pf_cids += num_pf_cids; |
|---|
| 4757 | + } |
|---|
| 4758 | + |
|---|
| 4759 | + /* Dump section containing number of VF CIDs per connection type */ |
|---|
| 4760 | + offset += qed_dump_section_hdr(dump_buf + offset, |
|---|
| 4761 | + dump, "num_vf_cids_per_conn_type", 1); |
|---|
| 4762 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4763 | + dump, "size", NUM_OF_CONNECTION_TYPES_E4); |
|---|
| 4764 | + for (conn_type = 0, valid_conn_vf_cids = 0; |
|---|
| 4765 | + conn_type < NUM_OF_CONNECTION_TYPES_E4; conn_type++, offset++) { |
|---|
| 4766 | + u32 num_vf_cids = |
|---|
| 4767 | + p_hwfn->p_cxt_mngr->conn_cfg[conn_type].cids_per_vf; |
|---|
| 4768 | + |
|---|
| 4769 | + if (dump) |
|---|
| 4770 | + *(dump_buf + offset) = num_vf_cids; |
|---|
| 4771 | + valid_conn_vf_cids += num_vf_cids; |
|---|
| 4772 | + } |
|---|
| 4773 | + |
|---|
| 4774 | + /* Dump section containing physical memory descs for each ILT page */ |
|---|
| 4775 | + num_pages = p_hwfn->p_cxt_mngr->ilt_shadow_size; |
|---|
| 4776 | + offset += qed_dump_section_hdr(dump_buf + offset, |
|---|
| 4777 | + dump, "ilt_page_desc", 1); |
|---|
| 4778 | + offset += qed_dump_num_param(dump_buf + offset, |
|---|
| 4779 | + dump, |
|---|
| 4780 | + "size", |
|---|
| 4781 | + num_pages * PAGE_MEM_DESC_SIZE_DWORDS); |
|---|
| 4782 | + |
|---|
| 4783 | + /* Copy memory descriptors to dump buffer */ |
|---|
| 4784 | + if (dump) { |
|---|
| 4785 | + u32 page_id; |
|---|
| 4786 | + |
|---|
| 4787 | + for (page_id = 0; page_id < num_pages; |
|---|
| 4788 | + page_id++, offset += PAGE_MEM_DESC_SIZE_DWORDS) |
|---|
| 4789 | + memcpy(dump_buf + offset, |
|---|
| 4790 | + &ilt_pages[page_id], |
|---|
| 4791 | + DWORDS_TO_BYTES(PAGE_MEM_DESC_SIZE_DWORDS)); |
|---|
| 4792 | + } else { |
|---|
| 4793 | + offset += num_pages * PAGE_MEM_DESC_SIZE_DWORDS; |
|---|
| 4794 | + } |
|---|
| 4795 | + |
|---|
| 4796 | + valid_conn_pf_pages = DIV_ROUND_UP(valid_conn_pf_cids, |
|---|
| 4797 | + num_cids_per_page); |
|---|
| 4798 | + valid_conn_vf_pages = DIV_ROUND_UP(valid_conn_vf_cids, |
|---|
| 4799 | + num_cids_per_page); |
|---|
| 4800 | + |
|---|
| 4801 | + /* Dump ILT pages IDs */ |
|---|
| 4802 | + offset += qed_ilt_dump_pages_section(p_hwfn, |
|---|
| 4803 | + dump_buf + offset, |
|---|
| 4804 | + dump, |
|---|
| 4805 | + valid_conn_pf_pages, |
|---|
| 4806 | + valid_conn_vf_pages, |
|---|
| 4807 | + ilt_pages, true); |
|---|
| 4808 | + |
|---|
| 4809 | + /* Dump ILT pages memory */ |
|---|
| 4810 | + offset += qed_ilt_dump_pages_section(p_hwfn, |
|---|
| 4811 | + dump_buf + offset, |
|---|
| 4812 | + dump, |
|---|
| 4813 | + valid_conn_pf_pages, |
|---|
| 4814 | + valid_conn_vf_pages, |
|---|
| 4815 | + ilt_pages, false); |
|---|
| 4816 | + |
|---|
| 4817 | + /* Dump last section */ |
|---|
| 4818 | + offset += qed_dump_last_section(dump_buf, offset, dump); |
|---|
| 4819 | + |
|---|
| 4820 | + return offset; |
|---|
| 4821 | +} |
|---|
| 4822 | + |
|---|
| 5084 | 4823 | /***************************** Public Functions *******************************/ |
|---|
| 5085 | 4824 | |
|---|
| 5086 | | -enum dbg_status qed_dbg_set_bin_ptr(const u8 * const bin_ptr) |
|---|
| 4825 | +enum dbg_status qed_dbg_set_bin_ptr(struct qed_hwfn *p_hwfn, |
|---|
| 4826 | + const u8 * const bin_ptr) |
|---|
| 5087 | 4827 | { |
|---|
| 5088 | | - struct bin_buffer_hdr *buf_array = (struct bin_buffer_hdr *)bin_ptr; |
|---|
| 4828 | + struct bin_buffer_hdr *buf_hdrs = (struct bin_buffer_hdr *)bin_ptr; |
|---|
| 5089 | 4829 | u8 buf_id; |
|---|
| 5090 | 4830 | |
|---|
| 5091 | | - /* convert binary data to debug arrays */ |
|---|
| 5092 | | - for (buf_id = 0; buf_id < MAX_BIN_DBG_BUFFER_TYPE; buf_id++) { |
|---|
| 5093 | | - s_dbg_arrays[buf_id].ptr = |
|---|
| 5094 | | - (u32 *)(bin_ptr + buf_array[buf_id].offset); |
|---|
| 5095 | | - s_dbg_arrays[buf_id].size_in_dwords = |
|---|
| 5096 | | - BYTES_TO_DWORDS(buf_array[buf_id].length); |
|---|
| 5097 | | - } |
|---|
| 4831 | + /* Convert binary data to debug arrays */ |
|---|
| 4832 | + for (buf_id = 0; buf_id < MAX_BIN_DBG_BUFFER_TYPE; buf_id++) |
|---|
| 4833 | + qed_set_dbg_bin_buf(p_hwfn, |
|---|
| 4834 | + buf_id, |
|---|
| 4835 | + (u32 *)(bin_ptr + buf_hdrs[buf_id].offset), |
|---|
| 4836 | + buf_hdrs[buf_id].length); |
|---|
| 5098 | 4837 | |
|---|
| 5099 | 4838 | return DBG_STATUS_OK; |
|---|
| 5100 | 4839 | } |
|---|
| .. | .. |
|---|
| 5109 | 4848 | struct storm_defs *storm = &s_storm_defs[storm_id]; |
|---|
| 5110 | 4849 | |
|---|
| 5111 | 4850 | /* Skip Storm if it's in reset */ |
|---|
| 5112 | | - if (dev_data->block_in_reset[storm->block_id]) |
|---|
| 4851 | + if (dev_data->block_in_reset[storm->sem_block_id]) |
|---|
| 5113 | 4852 | continue; |
|---|
| 5114 | 4853 | |
|---|
| 5115 | 4854 | /* Read FW info for the current Storm */ |
|---|
| .. | .. |
|---|
| 5119 | 4858 | } |
|---|
| 5120 | 4859 | |
|---|
| 5121 | 4860 | return false; |
|---|
| 4861 | +} |
|---|
| 4862 | + |
|---|
| 4863 | +enum dbg_status qed_dbg_grc_config(struct qed_hwfn *p_hwfn, |
|---|
| 4864 | + enum dbg_grc_params grc_param, u32 val) |
|---|
| 4865 | +{ |
|---|
| 4866 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 4867 | + enum dbg_status status; |
|---|
| 4868 | + int i; |
|---|
| 4869 | + |
|---|
| 4870 | + DP_VERBOSE(p_hwfn, |
|---|
| 4871 | + QED_MSG_DEBUG, |
|---|
| 4872 | + "dbg_grc_config: paramId = %d, val = %d\n", grc_param, val); |
|---|
| 4873 | + |
|---|
| 4874 | + status = qed_dbg_dev_init(p_hwfn); |
|---|
| 4875 | + if (status != DBG_STATUS_OK) |
|---|
| 4876 | + return status; |
|---|
| 4877 | + |
|---|
| 4878 | + /* Initializes the GRC parameters (if not initialized). Needed in order |
|---|
| 4879 | + * to set the default parameter values for the first time. |
|---|
| 4880 | + */ |
|---|
| 4881 | + qed_dbg_grc_init_params(p_hwfn); |
|---|
| 4882 | + |
|---|
| 4883 | + if (grc_param >= MAX_DBG_GRC_PARAMS) |
|---|
| 4884 | + return DBG_STATUS_INVALID_ARGS; |
|---|
| 4885 | + if (val < s_grc_param_defs[grc_param].min || |
|---|
| 4886 | + val > s_grc_param_defs[grc_param].max) |
|---|
| 4887 | + return DBG_STATUS_INVALID_ARGS; |
|---|
| 4888 | + |
|---|
| 4889 | + if (s_grc_param_defs[grc_param].is_preset) { |
|---|
| 4890 | + /* Preset param */ |
|---|
| 4891 | + |
|---|
| 4892 | + /* Disabling a preset is not allowed. Call |
|---|
| 4893 | + * dbg_grc_set_params_default instead. |
|---|
| 4894 | + */ |
|---|
| 4895 | + if (!val) |
|---|
| 4896 | + return DBG_STATUS_INVALID_ARGS; |
|---|
| 4897 | + |
|---|
| 4898 | + /* Update all params with the preset values */ |
|---|
| 4899 | + for (i = 0; i < MAX_DBG_GRC_PARAMS; i++) { |
|---|
| 4900 | + struct grc_param_defs *defs = &s_grc_param_defs[i]; |
|---|
| 4901 | + u32 preset_val; |
|---|
| 4902 | + /* Skip persistent params */ |
|---|
| 4903 | + if (defs->is_persistent) |
|---|
| 4904 | + continue; |
|---|
| 4905 | + |
|---|
| 4906 | + /* Find preset value */ |
|---|
| 4907 | + if (grc_param == DBG_GRC_PARAM_EXCLUDE_ALL) |
|---|
| 4908 | + preset_val = |
|---|
| 4909 | + defs->exclude_all_preset_val; |
|---|
| 4910 | + else if (grc_param == DBG_GRC_PARAM_CRASH) |
|---|
| 4911 | + preset_val = |
|---|
| 4912 | + defs->crash_preset_val[dev_data->chip_id]; |
|---|
| 4913 | + else |
|---|
| 4914 | + return DBG_STATUS_INVALID_ARGS; |
|---|
| 4915 | + |
|---|
| 4916 | + qed_grc_set_param(p_hwfn, i, preset_val); |
|---|
| 4917 | + } |
|---|
| 4918 | + } else { |
|---|
| 4919 | + /* Regular param - set its value */ |
|---|
| 4920 | + qed_grc_set_param(p_hwfn, grc_param, val); |
|---|
| 4921 | + } |
|---|
| 4922 | + |
|---|
| 4923 | + return DBG_STATUS_OK; |
|---|
| 5122 | 4924 | } |
|---|
| 5123 | 4925 | |
|---|
| 5124 | 4926 | /* Assign default GRC param values */ |
|---|
| .. | .. |
|---|
| 5137 | 4939 | struct qed_ptt *p_ptt, |
|---|
| 5138 | 4940 | u32 *buf_size) |
|---|
| 5139 | 4941 | { |
|---|
| 5140 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 4942 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5141 | 4943 | |
|---|
| 5142 | 4944 | *buf_size = 0; |
|---|
| 5143 | 4945 | |
|---|
| 5144 | 4946 | if (status != DBG_STATUS_OK) |
|---|
| 5145 | 4947 | return status; |
|---|
| 5146 | 4948 | |
|---|
| 5147 | | - if (!s_dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr || |
|---|
| 5148 | | - !s_dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr || |
|---|
| 5149 | | - !s_dbg_arrays[BIN_BUF_DBG_DUMP_MEM].ptr || |
|---|
| 5150 | | - !s_dbg_arrays[BIN_BUF_DBG_ATTN_BLOCKS].ptr || |
|---|
| 5151 | | - !s_dbg_arrays[BIN_BUF_DBG_ATTN_REGS].ptr) |
|---|
| 4949 | + if (!p_hwfn->dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr || |
|---|
| 4950 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_REG].ptr || |
|---|
| 4951 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_DUMP_MEM].ptr || |
|---|
| 4952 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_BLOCKS].ptr || |
|---|
| 4953 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_REGS].ptr) |
|---|
| 5152 | 4954 | return DBG_STATUS_DBG_ARRAY_NOT_SET; |
|---|
| 5153 | 4955 | |
|---|
| 5154 | 4956 | return qed_grc_dump(p_hwfn, p_ptt, NULL, false, buf_size); |
|---|
| .. | .. |
|---|
| 5188 | 4990 | u32 *buf_size) |
|---|
| 5189 | 4991 | { |
|---|
| 5190 | 4992 | struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 5191 | | - struct idle_chk_data *idle_chk; |
|---|
| 4993 | + struct idle_chk_data *idle_chk = &dev_data->idle_chk; |
|---|
| 5192 | 4994 | enum dbg_status status; |
|---|
| 5193 | 4995 | |
|---|
| 5194 | | - idle_chk = &dev_data->idle_chk; |
|---|
| 5195 | 4996 | *buf_size = 0; |
|---|
| 5196 | 4997 | |
|---|
| 5197 | | - status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 4998 | + status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5198 | 4999 | if (status != DBG_STATUS_OK) |
|---|
| 5199 | 5000 | return status; |
|---|
| 5200 | 5001 | |
|---|
| 5201 | | - if (!s_dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr || |
|---|
| 5202 | | - !s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_REGS].ptr || |
|---|
| 5203 | | - !s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_IMMS].ptr || |
|---|
| 5204 | | - !s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].ptr) |
|---|
| 5002 | + if (!p_hwfn->dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr || |
|---|
| 5003 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_REGS].ptr || |
|---|
| 5004 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_IMMS].ptr || |
|---|
| 5005 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].ptr) |
|---|
| 5205 | 5006 | return DBG_STATUS_DBG_ARRAY_NOT_SET; |
|---|
| 5206 | 5007 | |
|---|
| 5207 | 5008 | if (!idle_chk->buf_size_set) { |
|---|
| .. | .. |
|---|
| 5236 | 5037 | return DBG_STATUS_DUMP_BUF_TOO_SMALL; |
|---|
| 5237 | 5038 | |
|---|
| 5238 | 5039 | /* Update reset state */ |
|---|
| 5040 | + qed_grc_unreset_blocks(p_hwfn, p_ptt, true); |
|---|
| 5239 | 5041 | qed_update_blocks_reset_state(p_hwfn, p_ptt); |
|---|
| 5240 | 5042 | |
|---|
| 5241 | 5043 | /* Idle Check Dump */ |
|---|
| .. | .. |
|---|
| 5251 | 5053 | struct qed_ptt *p_ptt, |
|---|
| 5252 | 5054 | u32 *buf_size) |
|---|
| 5253 | 5055 | { |
|---|
| 5254 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 5056 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5255 | 5057 | |
|---|
| 5256 | 5058 | *buf_size = 0; |
|---|
| 5257 | 5059 | |
|---|
| .. | .. |
|---|
| 5298 | 5100 | struct qed_ptt *p_ptt, |
|---|
| 5299 | 5101 | u32 *buf_size) |
|---|
| 5300 | 5102 | { |
|---|
| 5301 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 5103 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5302 | 5104 | |
|---|
| 5303 | 5105 | *buf_size = 0; |
|---|
| 5304 | 5106 | |
|---|
| .. | .. |
|---|
| 5344 | 5146 | struct qed_ptt *p_ptt, |
|---|
| 5345 | 5147 | u32 *buf_size) |
|---|
| 5346 | 5148 | { |
|---|
| 5347 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 5149 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5348 | 5150 | |
|---|
| 5349 | 5151 | *buf_size = 0; |
|---|
| 5350 | 5152 | |
|---|
| .. | .. |
|---|
| 5390 | 5192 | struct qed_ptt *p_ptt, |
|---|
| 5391 | 5193 | u32 *buf_size) |
|---|
| 5392 | 5194 | { |
|---|
| 5393 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 5195 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5394 | 5196 | |
|---|
| 5395 | 5197 | *buf_size = 0; |
|---|
| 5396 | 5198 | |
|---|
| .. | .. |
|---|
| 5440 | 5242 | struct qed_ptt *p_ptt, |
|---|
| 5441 | 5243 | u32 *buf_size) |
|---|
| 5442 | 5244 | { |
|---|
| 5443 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 5245 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5444 | 5246 | |
|---|
| 5445 | 5247 | *buf_size = 0; |
|---|
| 5446 | 5248 | |
|---|
| .. | .. |
|---|
| 5484 | 5286 | return DBG_STATUS_OK; |
|---|
| 5485 | 5287 | } |
|---|
| 5486 | 5288 | |
|---|
| 5289 | +static enum dbg_status qed_dbg_ilt_get_dump_buf_size(struct qed_hwfn *p_hwfn, |
|---|
| 5290 | + struct qed_ptt *p_ptt, |
|---|
| 5291 | + u32 *buf_size) |
|---|
| 5292 | +{ |
|---|
| 5293 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5294 | + |
|---|
| 5295 | + *buf_size = 0; |
|---|
| 5296 | + |
|---|
| 5297 | + if (status != DBG_STATUS_OK) |
|---|
| 5298 | + return status; |
|---|
| 5299 | + |
|---|
| 5300 | + *buf_size = qed_ilt_dump(p_hwfn, p_ptt, NULL, false); |
|---|
| 5301 | + |
|---|
| 5302 | + return DBG_STATUS_OK; |
|---|
| 5303 | +} |
|---|
| 5304 | + |
|---|
| 5305 | +static enum dbg_status qed_dbg_ilt_dump(struct qed_hwfn *p_hwfn, |
|---|
| 5306 | + struct qed_ptt *p_ptt, |
|---|
| 5307 | + u32 *dump_buf, |
|---|
| 5308 | + u32 buf_size_in_dwords, |
|---|
| 5309 | + u32 *num_dumped_dwords) |
|---|
| 5310 | +{ |
|---|
| 5311 | + u32 needed_buf_size_in_dwords; |
|---|
| 5312 | + enum dbg_status status; |
|---|
| 5313 | + |
|---|
| 5314 | + *num_dumped_dwords = 0; |
|---|
| 5315 | + |
|---|
| 5316 | + status = qed_dbg_ilt_get_dump_buf_size(p_hwfn, |
|---|
| 5317 | + p_ptt, |
|---|
| 5318 | + &needed_buf_size_in_dwords); |
|---|
| 5319 | + if (status != DBG_STATUS_OK) |
|---|
| 5320 | + return status; |
|---|
| 5321 | + |
|---|
| 5322 | + if (buf_size_in_dwords < needed_buf_size_in_dwords) |
|---|
| 5323 | + return DBG_STATUS_DUMP_BUF_TOO_SMALL; |
|---|
| 5324 | + |
|---|
| 5325 | + *num_dumped_dwords = qed_ilt_dump(p_hwfn, p_ptt, dump_buf, true); |
|---|
| 5326 | + |
|---|
| 5327 | + /* Reveret GRC params to their default */ |
|---|
| 5328 | + qed_dbg_grc_set_params_default(p_hwfn); |
|---|
| 5329 | + |
|---|
| 5330 | + return DBG_STATUS_OK; |
|---|
| 5331 | +} |
|---|
| 5332 | + |
|---|
| 5487 | 5333 | enum dbg_status qed_dbg_read_attn(struct qed_hwfn *p_hwfn, |
|---|
| 5488 | 5334 | struct qed_ptt *p_ptt, |
|---|
| 5489 | 5335 | enum block_id block_id, |
|---|
| .. | .. |
|---|
| 5491 | 5337 | bool clear_status, |
|---|
| 5492 | 5338 | struct dbg_attn_block_result *results) |
|---|
| 5493 | 5339 | { |
|---|
| 5494 | | - enum dbg_status status = qed_dbg_dev_init(p_hwfn, p_ptt); |
|---|
| 5340 | + enum dbg_status status = qed_dbg_dev_init(p_hwfn); |
|---|
| 5495 | 5341 | u8 reg_idx, num_attn_regs, num_result_regs = 0; |
|---|
| 5496 | 5342 | const struct dbg_attn_reg *attn_reg_arr; |
|---|
| 5497 | 5343 | |
|---|
| 5498 | 5344 | if (status != DBG_STATUS_OK) |
|---|
| 5499 | 5345 | return status; |
|---|
| 5500 | 5346 | |
|---|
| 5501 | | - if (!s_dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr || |
|---|
| 5502 | | - !s_dbg_arrays[BIN_BUF_DBG_ATTN_BLOCKS].ptr || |
|---|
| 5503 | | - !s_dbg_arrays[BIN_BUF_DBG_ATTN_REGS].ptr) |
|---|
| 5347 | + if (!p_hwfn->dbg_arrays[BIN_BUF_DBG_MODE_TREE].ptr || |
|---|
| 5348 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_BLOCKS].ptr || |
|---|
| 5349 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_REGS].ptr) |
|---|
| 5504 | 5350 | return DBG_STATUS_DBG_ARRAY_NOT_SET; |
|---|
| 5505 | 5351 | |
|---|
| 5506 | | - attn_reg_arr = qed_get_block_attn_regs(block_id, |
|---|
| 5352 | + attn_reg_arr = qed_get_block_attn_regs(p_hwfn, |
|---|
| 5353 | + block_id, |
|---|
| 5507 | 5354 | attn_type, &num_attn_regs); |
|---|
| 5508 | 5355 | |
|---|
| 5509 | 5356 | for (reg_idx = 0; reg_idx < num_attn_regs; reg_idx++) { |
|---|
| .. | .. |
|---|
| 5548 | 5395 | |
|---|
| 5549 | 5396 | results->block_id = (u8)block_id; |
|---|
| 5550 | 5397 | results->names_offset = |
|---|
| 5551 | | - qed_get_block_attn_data(block_id, attn_type)->names_offset; |
|---|
| 5398 | + qed_get_block_attn_data(p_hwfn, block_id, attn_type)->names_offset; |
|---|
| 5552 | 5399 | SET_FIELD(results->data, DBG_ATTN_BLOCK_RESULT_ATTN_TYPE, attn_type); |
|---|
| 5553 | 5400 | SET_FIELD(results->data, |
|---|
| 5554 | 5401 | DBG_ATTN_BLOCK_RESULT_NUM_REGS, num_result_regs); |
|---|
| .. | .. |
|---|
| 5557 | 5404 | } |
|---|
| 5558 | 5405 | |
|---|
| 5559 | 5406 | /******************************* Data Types **********************************/ |
|---|
| 5560 | | - |
|---|
| 5561 | | -struct block_info { |
|---|
| 5562 | | - const char *name; |
|---|
| 5563 | | - enum block_id id; |
|---|
| 5564 | | -}; |
|---|
| 5565 | | - |
|---|
| 5566 | | -struct mcp_trace_format { |
|---|
| 5567 | | - u32 data; |
|---|
| 5568 | | -#define MCP_TRACE_FORMAT_MODULE_MASK 0x0000ffff |
|---|
| 5569 | | -#define MCP_TRACE_FORMAT_MODULE_SHIFT 0 |
|---|
| 5570 | | -#define MCP_TRACE_FORMAT_LEVEL_MASK 0x00030000 |
|---|
| 5571 | | -#define MCP_TRACE_FORMAT_LEVEL_SHIFT 16 |
|---|
| 5572 | | -#define MCP_TRACE_FORMAT_P1_SIZE_MASK 0x000c0000 |
|---|
| 5573 | | -#define MCP_TRACE_FORMAT_P1_SIZE_SHIFT 18 |
|---|
| 5574 | | -#define MCP_TRACE_FORMAT_P2_SIZE_MASK 0x00300000 |
|---|
| 5575 | | -#define MCP_TRACE_FORMAT_P2_SIZE_SHIFT 20 |
|---|
| 5576 | | -#define MCP_TRACE_FORMAT_P3_SIZE_MASK 0x00c00000 |
|---|
| 5577 | | -#define MCP_TRACE_FORMAT_P3_SIZE_SHIFT 22 |
|---|
| 5578 | | -#define MCP_TRACE_FORMAT_LEN_MASK 0xff000000 |
|---|
| 5579 | | -#define MCP_TRACE_FORMAT_LEN_SHIFT 24 |
|---|
| 5580 | | - |
|---|
| 5581 | | - char *format_str; |
|---|
| 5582 | | -}; |
|---|
| 5583 | | - |
|---|
| 5584 | | -/* Meta data structure, generated by a perl script during MFW build. therefore, |
|---|
| 5585 | | - * the structs mcp_trace_meta and mcp_trace_format are duplicated in the perl |
|---|
| 5586 | | - * script. |
|---|
| 5587 | | - */ |
|---|
| 5588 | | -struct mcp_trace_meta { |
|---|
| 5589 | | - u32 modules_num; |
|---|
| 5590 | | - char **modules; |
|---|
| 5591 | | - u32 formats_num; |
|---|
| 5592 | | - struct mcp_trace_format *formats; |
|---|
| 5593 | | -}; |
|---|
| 5594 | 5407 | |
|---|
| 5595 | 5408 | /* REG fifo element */ |
|---|
| 5596 | 5409 | struct reg_fifo_element { |
|---|
| .. | .. |
|---|
| 5613 | 5426 | #define REG_FIFO_ELEMENT_MASTER_MASK 0xf |
|---|
| 5614 | 5427 | #define REG_FIFO_ELEMENT_ERROR_SHIFT 47 |
|---|
| 5615 | 5428 | #define REG_FIFO_ELEMENT_ERROR_MASK 0x1f |
|---|
| 5429 | +}; |
|---|
| 5430 | + |
|---|
| 5431 | +/* REG fifo error element */ |
|---|
| 5432 | +struct reg_fifo_err { |
|---|
| 5433 | + u32 err_code; |
|---|
| 5434 | + const char *err_msg; |
|---|
| 5616 | 5435 | }; |
|---|
| 5617 | 5436 | |
|---|
| 5618 | 5437 | /* IGU fifo element */ |
|---|
| .. | .. |
|---|
| 5721 | 5540 | #define MCP_TRACE_MAX_MODULE_LEN 8 |
|---|
| 5722 | 5541 | #define MCP_TRACE_FORMAT_MAX_PARAMS 3 |
|---|
| 5723 | 5542 | #define MCP_TRACE_FORMAT_PARAM_WIDTH \ |
|---|
| 5724 | | - (MCP_TRACE_FORMAT_P2_SIZE_SHIFT - MCP_TRACE_FORMAT_P1_SIZE_SHIFT) |
|---|
| 5543 | + (MCP_TRACE_FORMAT_P2_SIZE_OFFSET - MCP_TRACE_FORMAT_P1_SIZE_OFFSET) |
|---|
| 5725 | 5544 | |
|---|
| 5726 | 5545 | #define REG_FIFO_ELEMENT_ADDR_FACTOR 4 |
|---|
| 5727 | 5546 | #define REG_FIFO_ELEMENT_IS_PF_VF_VAL 127 |
|---|
| .. | .. |
|---|
| 5729 | 5548 | #define PROTECTION_OVERRIDE_ELEMENT_ADDR_FACTOR 4 |
|---|
| 5730 | 5549 | |
|---|
| 5731 | 5550 | /***************************** Constant Arrays *******************************/ |
|---|
| 5732 | | - |
|---|
| 5733 | | -struct user_dbg_array { |
|---|
| 5734 | | - const u32 *ptr; |
|---|
| 5735 | | - u32 size_in_dwords; |
|---|
| 5736 | | -}; |
|---|
| 5737 | | - |
|---|
| 5738 | | -/* Debug arrays */ |
|---|
| 5739 | | -static struct user_dbg_array |
|---|
| 5740 | | -s_user_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {NULL} }; |
|---|
| 5741 | | - |
|---|
| 5742 | | -/* Block names array */ |
|---|
| 5743 | | -static struct block_info s_block_info_arr[] = { |
|---|
| 5744 | | - {"grc", BLOCK_GRC}, |
|---|
| 5745 | | - {"miscs", BLOCK_MISCS}, |
|---|
| 5746 | | - {"misc", BLOCK_MISC}, |
|---|
| 5747 | | - {"dbu", BLOCK_DBU}, |
|---|
| 5748 | | - {"pglue_b", BLOCK_PGLUE_B}, |
|---|
| 5749 | | - {"cnig", BLOCK_CNIG}, |
|---|
| 5750 | | - {"cpmu", BLOCK_CPMU}, |
|---|
| 5751 | | - {"ncsi", BLOCK_NCSI}, |
|---|
| 5752 | | - {"opte", BLOCK_OPTE}, |
|---|
| 5753 | | - {"bmb", BLOCK_BMB}, |
|---|
| 5754 | | - {"pcie", BLOCK_PCIE}, |
|---|
| 5755 | | - {"mcp", BLOCK_MCP}, |
|---|
| 5756 | | - {"mcp2", BLOCK_MCP2}, |
|---|
| 5757 | | - {"pswhst", BLOCK_PSWHST}, |
|---|
| 5758 | | - {"pswhst2", BLOCK_PSWHST2}, |
|---|
| 5759 | | - {"pswrd", BLOCK_PSWRD}, |
|---|
| 5760 | | - {"pswrd2", BLOCK_PSWRD2}, |
|---|
| 5761 | | - {"pswwr", BLOCK_PSWWR}, |
|---|
| 5762 | | - {"pswwr2", BLOCK_PSWWR2}, |
|---|
| 5763 | | - {"pswrq", BLOCK_PSWRQ}, |
|---|
| 5764 | | - {"pswrq2", BLOCK_PSWRQ2}, |
|---|
| 5765 | | - {"pglcs", BLOCK_PGLCS}, |
|---|
| 5766 | | - {"ptu", BLOCK_PTU}, |
|---|
| 5767 | | - {"dmae", BLOCK_DMAE}, |
|---|
| 5768 | | - {"tcm", BLOCK_TCM}, |
|---|
| 5769 | | - {"mcm", BLOCK_MCM}, |
|---|
| 5770 | | - {"ucm", BLOCK_UCM}, |
|---|
| 5771 | | - {"xcm", BLOCK_XCM}, |
|---|
| 5772 | | - {"ycm", BLOCK_YCM}, |
|---|
| 5773 | | - {"pcm", BLOCK_PCM}, |
|---|
| 5774 | | - {"qm", BLOCK_QM}, |
|---|
| 5775 | | - {"tm", BLOCK_TM}, |
|---|
| 5776 | | - {"dorq", BLOCK_DORQ}, |
|---|
| 5777 | | - {"brb", BLOCK_BRB}, |
|---|
| 5778 | | - {"src", BLOCK_SRC}, |
|---|
| 5779 | | - {"prs", BLOCK_PRS}, |
|---|
| 5780 | | - {"tsdm", BLOCK_TSDM}, |
|---|
| 5781 | | - {"msdm", BLOCK_MSDM}, |
|---|
| 5782 | | - {"usdm", BLOCK_USDM}, |
|---|
| 5783 | | - {"xsdm", BLOCK_XSDM}, |
|---|
| 5784 | | - {"ysdm", BLOCK_YSDM}, |
|---|
| 5785 | | - {"psdm", BLOCK_PSDM}, |
|---|
| 5786 | | - {"tsem", BLOCK_TSEM}, |
|---|
| 5787 | | - {"msem", BLOCK_MSEM}, |
|---|
| 5788 | | - {"usem", BLOCK_USEM}, |
|---|
| 5789 | | - {"xsem", BLOCK_XSEM}, |
|---|
| 5790 | | - {"ysem", BLOCK_YSEM}, |
|---|
| 5791 | | - {"psem", BLOCK_PSEM}, |
|---|
| 5792 | | - {"rss", BLOCK_RSS}, |
|---|
| 5793 | | - {"tmld", BLOCK_TMLD}, |
|---|
| 5794 | | - {"muld", BLOCK_MULD}, |
|---|
| 5795 | | - {"yuld", BLOCK_YULD}, |
|---|
| 5796 | | - {"xyld", BLOCK_XYLD}, |
|---|
| 5797 | | - {"ptld", BLOCK_PTLD}, |
|---|
| 5798 | | - {"ypld", BLOCK_YPLD}, |
|---|
| 5799 | | - {"prm", BLOCK_PRM}, |
|---|
| 5800 | | - {"pbf_pb1", BLOCK_PBF_PB1}, |
|---|
| 5801 | | - {"pbf_pb2", BLOCK_PBF_PB2}, |
|---|
| 5802 | | - {"rpb", BLOCK_RPB}, |
|---|
| 5803 | | - {"btb", BLOCK_BTB}, |
|---|
| 5804 | | - {"pbf", BLOCK_PBF}, |
|---|
| 5805 | | - {"rdif", BLOCK_RDIF}, |
|---|
| 5806 | | - {"tdif", BLOCK_TDIF}, |
|---|
| 5807 | | - {"cdu", BLOCK_CDU}, |
|---|
| 5808 | | - {"ccfc", BLOCK_CCFC}, |
|---|
| 5809 | | - {"tcfc", BLOCK_TCFC}, |
|---|
| 5810 | | - {"igu", BLOCK_IGU}, |
|---|
| 5811 | | - {"cau", BLOCK_CAU}, |
|---|
| 5812 | | - {"rgfs", BLOCK_RGFS}, |
|---|
| 5813 | | - {"rgsrc", BLOCK_RGSRC}, |
|---|
| 5814 | | - {"tgfs", BLOCK_TGFS}, |
|---|
| 5815 | | - {"tgsrc", BLOCK_TGSRC}, |
|---|
| 5816 | | - {"umac", BLOCK_UMAC}, |
|---|
| 5817 | | - {"xmac", BLOCK_XMAC}, |
|---|
| 5818 | | - {"dbg", BLOCK_DBG}, |
|---|
| 5819 | | - {"nig", BLOCK_NIG}, |
|---|
| 5820 | | - {"wol", BLOCK_WOL}, |
|---|
| 5821 | | - {"bmbn", BLOCK_BMBN}, |
|---|
| 5822 | | - {"ipc", BLOCK_IPC}, |
|---|
| 5823 | | - {"nwm", BLOCK_NWM}, |
|---|
| 5824 | | - {"nws", BLOCK_NWS}, |
|---|
| 5825 | | - {"ms", BLOCK_MS}, |
|---|
| 5826 | | - {"phy_pcie", BLOCK_PHY_PCIE}, |
|---|
| 5827 | | - {"led", BLOCK_LED}, |
|---|
| 5828 | | - {"avs_wrap", BLOCK_AVS_WRAP}, |
|---|
| 5829 | | - {"pxpreqbus", BLOCK_PXPREQBUS}, |
|---|
| 5830 | | - {"misc_aeu", BLOCK_MISC_AEU}, |
|---|
| 5831 | | - {"bar0_map", BLOCK_BAR0_MAP} |
|---|
| 5832 | | -}; |
|---|
| 5833 | 5551 | |
|---|
| 5834 | 5552 | /* Status string array */ |
|---|
| 5835 | 5553 | static const char * const s_status_str[] = { |
|---|
| .. | .. |
|---|
| 5860 | 5578 | /* DBG_STATUS_PCI_BUF_NOT_ALLOCATED */ |
|---|
| 5861 | 5579 | "A PCI buffer wasn't allocated", |
|---|
| 5862 | 5580 | |
|---|
| 5863 | | - /* DBG_STATUS_TOO_MANY_INPUTS */ |
|---|
| 5864 | | - "Too many inputs were enabled. Enabled less inputs, or set 'unifyInputs' to true", |
|---|
| 5581 | + /* DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS */ |
|---|
| 5582 | + "The filter/trigger constraint dword offsets are not enabled for recording", |
|---|
| 5583 | + /* DBG_STATUS_NO_MATCHING_FRAMING_MODE */ |
|---|
| 5584 | + "No matching framing mode", |
|---|
| 5865 | 5585 | |
|---|
| 5866 | | - /* DBG_STATUS_INPUT_OVERLAP */ |
|---|
| 5867 | | - "Overlapping debug bus inputs", |
|---|
| 5868 | | - |
|---|
| 5869 | | - /* DBG_STATUS_HW_ONLY_RECORDING */ |
|---|
| 5870 | | - "Cannot record Storm data since the entire recording cycle is used by HW", |
|---|
| 5586 | + /* DBG_STATUS_VFC_READ_ERROR */ |
|---|
| 5587 | + "Error reading from VFC", |
|---|
| 5871 | 5588 | |
|---|
| 5872 | 5589 | /* DBG_STATUS_STORM_ALREADY_ENABLED */ |
|---|
| 5873 | 5590 | "The Storm was already enabled", |
|---|
| .. | .. |
|---|
| 5884 | 5601 | /* DBG_STATUS_NO_INPUT_ENABLED */ |
|---|
| 5885 | 5602 | "No input was enabled for recording", |
|---|
| 5886 | 5603 | |
|---|
| 5887 | | - /* DBG_STATUS_NO_FILTER_TRIGGER_64B */ |
|---|
| 5888 | | - "Filters and triggers are not allowed when recording in 64b units", |
|---|
| 5604 | + /* DBG_STATUS_NO_FILTER_TRIGGER_256B */ |
|---|
| 5605 | + "Filters and triggers are not allowed in E4 256-bit mode", |
|---|
| 5889 | 5606 | |
|---|
| 5890 | 5607 | /* DBG_STATUS_FILTER_ALREADY_ENABLED */ |
|---|
| 5891 | 5608 | "The filter was already enabled", |
|---|
| .. | .. |
|---|
| 5959 | 5676 | /* DBG_STATUS_MCP_COULD_NOT_RESUME */ |
|---|
| 5960 | 5677 | "Failed to resume MCP after halt", |
|---|
| 5961 | 5678 | |
|---|
| 5962 | | - /* DBG_STATUS_RESERVED2 */ |
|---|
| 5963 | | - "Reserved debug status - shouldn't be returned", |
|---|
| 5679 | + /* DBG_STATUS_RESERVED0 */ |
|---|
| 5680 | + "", |
|---|
| 5964 | 5681 | |
|---|
| 5965 | 5682 | /* DBG_STATUS_SEMI_FIFO_NOT_EMPTY */ |
|---|
| 5966 | 5683 | "Failed to empty SEMI sync FIFO", |
|---|
| .. | .. |
|---|
| 5983 | 5700 | /* DBG_STATUS_DBG_ARRAY_NOT_SET */ |
|---|
| 5984 | 5701 | "Debug arrays were not set (when using binary files, dbg_set_bin_ptr must be called)", |
|---|
| 5985 | 5702 | |
|---|
| 5986 | | - /* DBG_STATUS_FILTER_BUG */ |
|---|
| 5987 | | - "Debug Bus filtering requires the -unifyInputs option (due to a HW bug)", |
|---|
| 5703 | + /* DBG_STATUS_RESERVED1 */ |
|---|
| 5704 | + "", |
|---|
| 5988 | 5705 | |
|---|
| 5989 | 5706 | /* DBG_STATUS_NON_MATCHING_LINES */ |
|---|
| 5990 | | - "Non-matching debug lines - all lines must be of the same type (either 128b or 256b)", |
|---|
| 5707 | + "Non-matching debug lines - in E4, all lines must be of the same type (either 128b or 256b)", |
|---|
| 5991 | 5708 | |
|---|
| 5992 | | - /* DBG_STATUS_INVALID_TRIGGER_DWORD_OFFSET */ |
|---|
| 5993 | | - "The selected trigger dword offset wasn't enabled in the recorded HW block", |
|---|
| 5709 | + /* DBG_STATUS_INSUFFICIENT_HW_IDS */ |
|---|
| 5710 | + "Insufficient HW IDs. Try to record less Storms/blocks", |
|---|
| 5994 | 5711 | |
|---|
| 5995 | 5712 | /* DBG_STATUS_DBG_BUS_IN_USE */ |
|---|
| 5996 | | - "The debug bus is in use" |
|---|
| 5713 | + "The debug bus is in use", |
|---|
| 5714 | + |
|---|
| 5715 | + /* DBG_STATUS_INVALID_STORM_DBG_MODE */ |
|---|
| 5716 | + "The storm debug mode is not supported in the current chip", |
|---|
| 5717 | + |
|---|
| 5718 | + /* DBG_STATUS_OTHER_ENGINE_BB_ONLY */ |
|---|
| 5719 | + "Other engine is supported only in BB", |
|---|
| 5720 | + |
|---|
| 5721 | + /* DBG_STATUS_FILTER_SINGLE_HW_ID */ |
|---|
| 5722 | + "The configured filter mode requires a single Storm/block input", |
|---|
| 5723 | + |
|---|
| 5724 | + /* DBG_STATUS_TRIGGER_SINGLE_HW_ID */ |
|---|
| 5725 | + "The configured filter mode requires that all the constraints of a single trigger state will be defined on a single Storm/block input", |
|---|
| 5726 | + |
|---|
| 5727 | + /* DBG_STATUS_MISSING_TRIGGER_STATE_STORM */ |
|---|
| 5728 | + "When triggering on Storm data, the Storm to trigger on must be specified" |
|---|
| 5997 | 5729 | }; |
|---|
| 5998 | 5730 | |
|---|
| 5999 | 5731 | /* Idle check severity names array */ |
|---|
| .. | .. |
|---|
| 6049 | 5781 | "xsdm", |
|---|
| 6050 | 5782 | "dbu", |
|---|
| 6051 | 5783 | "dmae", |
|---|
| 6052 | | - "???", |
|---|
| 5784 | + "jdap", |
|---|
| 6053 | 5785 | "???", |
|---|
| 6054 | 5786 | "???", |
|---|
| 6055 | 5787 | "???", |
|---|
| .. | .. |
|---|
| 6057 | 5789 | }; |
|---|
| 6058 | 5790 | |
|---|
| 6059 | 5791 | /* REG FIFO error messages array */ |
|---|
| 6060 | | -static const char * const s_reg_fifo_error_strs[] = { |
|---|
| 6061 | | - "grc timeout", |
|---|
| 6062 | | - "address doesn't belong to any block", |
|---|
| 6063 | | - "reserved address in block or write to read-only address", |
|---|
| 6064 | | - "privilege/protection mismatch", |
|---|
| 6065 | | - "path isolation error" |
|---|
| 5792 | +static struct reg_fifo_err s_reg_fifo_errors[] = { |
|---|
| 5793 | + {1, "grc timeout"}, |
|---|
| 5794 | + {2, "address doesn't belong to any block"}, |
|---|
| 5795 | + {4, "reserved address in block or write to read-only address"}, |
|---|
| 5796 | + {8, "privilege/protection mismatch"}, |
|---|
| 5797 | + {16, "path isolation error"}, |
|---|
| 5798 | + {17, "RSL error"} |
|---|
| 6066 | 5799 | }; |
|---|
| 6067 | 5800 | |
|---|
| 6068 | 5801 | /* IGU FIFO sources array */ |
|---|
| .. | .. |
|---|
| 6085 | 5818 | "no error", |
|---|
| 6086 | 5819 | "length error", |
|---|
| 6087 | 5820 | "function disabled", |
|---|
| 6088 | | - "VF sent command to attnetion address", |
|---|
| 5821 | + "VF sent command to attention address", |
|---|
| 6089 | 5822 | "host sent prod update command", |
|---|
| 6090 | 5823 | "read of during interrupt register while in MIMD mode", |
|---|
| 6091 | 5824 | "access to PXP BAR reserved address", |
|---|
| .. | .. |
|---|
| 6136 | 5869 | }; |
|---|
| 6137 | 5870 | |
|---|
| 6138 | 5871 | /******************************** Variables **********************************/ |
|---|
| 6139 | | - |
|---|
| 6140 | | -/* MCP Trace meta data array - used in case the dump doesn't contain the |
|---|
| 6141 | | - * meta data (e.g. due to no NVRAM access). |
|---|
| 6142 | | - */ |
|---|
| 6143 | | -static struct user_dbg_array s_mcp_trace_meta_arr = { NULL, 0 }; |
|---|
| 6144 | | - |
|---|
| 6145 | | -/* Parsed MCP Trace meta data info, based on MCP trace meta array */ |
|---|
| 6146 | | -static struct mcp_trace_meta s_mcp_trace_meta; |
|---|
| 6147 | | -static bool s_mcp_trace_meta_valid; |
|---|
| 6148 | 5872 | |
|---|
| 6149 | 5873 | /* Temporary buffer, used for print size calculations */ |
|---|
| 6150 | 5874 | static char s_temp_buf[MAX_MSG_LEN]; |
|---|
| .. | .. |
|---|
| 6311 | 6035 | return dump_offset; |
|---|
| 6312 | 6036 | } |
|---|
| 6313 | 6037 | |
|---|
| 6038 | +/* Returns the block name that matches the specified block ID, |
|---|
| 6039 | + * or NULL if not found. |
|---|
| 6040 | + */ |
|---|
| 6041 | +static const char *qed_dbg_get_block_name(struct qed_hwfn *p_hwfn, |
|---|
| 6042 | + enum block_id block_id) |
|---|
| 6043 | +{ |
|---|
| 6044 | + const struct dbg_block_user *block = |
|---|
| 6045 | + (const struct dbg_block_user *) |
|---|
| 6046 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_BLOCKS_USER_DATA].ptr + block_id; |
|---|
| 6047 | + |
|---|
| 6048 | + return (const char *)block->name; |
|---|
| 6049 | +} |
|---|
| 6050 | + |
|---|
| 6051 | +static struct dbg_tools_user_data *qed_dbg_get_user_data(struct qed_hwfn |
|---|
| 6052 | + *p_hwfn) |
|---|
| 6053 | +{ |
|---|
| 6054 | + return (struct dbg_tools_user_data *)p_hwfn->dbg_user_info; |
|---|
| 6055 | +} |
|---|
| 6056 | + |
|---|
| 6314 | 6057 | /* Parses the idle check rules and returns the number of characters printed. |
|---|
| 6315 | 6058 | * In case of parsing error, returns 0. |
|---|
| 6316 | 6059 | */ |
|---|
| 6317 | | -static u32 qed_parse_idle_chk_dump_rules(u32 *dump_buf, |
|---|
| 6060 | +static u32 qed_parse_idle_chk_dump_rules(struct qed_hwfn *p_hwfn, |
|---|
| 6061 | + u32 *dump_buf, |
|---|
| 6318 | 6062 | u32 *dump_buf_end, |
|---|
| 6319 | 6063 | u32 num_rules, |
|---|
| 6320 | 6064 | bool print_fw_idle_chk, |
|---|
| .. | .. |
|---|
| 6342 | 6086 | |
|---|
| 6343 | 6087 | hdr = (struct dbg_idle_chk_result_hdr *)dump_buf; |
|---|
| 6344 | 6088 | rule_parsing_data = |
|---|
| 6345 | | - (const struct dbg_idle_chk_rule_parsing_data *) |
|---|
| 6346 | | - &s_user_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_PARSING_DATA]. |
|---|
| 6347 | | - ptr[hdr->rule_id]; |
|---|
| 6089 | + (const struct dbg_idle_chk_rule_parsing_data *) |
|---|
| 6090 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_PARSING_DATA].ptr + |
|---|
| 6091 | + hdr->rule_id; |
|---|
| 6348 | 6092 | parsing_str_offset = |
|---|
| 6349 | | - GET_FIELD(rule_parsing_data->data, |
|---|
| 6350 | | - DBG_IDLE_CHK_RULE_PARSING_DATA_STR_OFFSET); |
|---|
| 6093 | + GET_FIELD(rule_parsing_data->data, |
|---|
| 6094 | + DBG_IDLE_CHK_RULE_PARSING_DATA_STR_OFFSET); |
|---|
| 6351 | 6095 | has_fw_msg = |
|---|
| 6352 | | - GET_FIELD(rule_parsing_data->data, |
|---|
| 6353 | | - DBG_IDLE_CHK_RULE_PARSING_DATA_HAS_FW_MSG) > 0; |
|---|
| 6354 | | - parsing_str = |
|---|
| 6355 | | - &((const char *) |
|---|
| 6356 | | - s_user_dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr) |
|---|
| 6357 | | - [parsing_str_offset]; |
|---|
| 6096 | + GET_FIELD(rule_parsing_data->data, |
|---|
| 6097 | + DBG_IDLE_CHK_RULE_PARSING_DATA_HAS_FW_MSG) > 0; |
|---|
| 6098 | + parsing_str = (const char *) |
|---|
| 6099 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr + |
|---|
| 6100 | + parsing_str_offset; |
|---|
| 6358 | 6101 | lsi_msg = parsing_str; |
|---|
| 6359 | 6102 | curr_reg_id = 0; |
|---|
| 6360 | 6103 | |
|---|
| .. | .. |
|---|
| 6458 | 6201 | * parsed_results_bytes. |
|---|
| 6459 | 6202 | * The parsing status is returned. |
|---|
| 6460 | 6203 | */ |
|---|
| 6461 | | -static enum dbg_status qed_parse_idle_chk_dump(u32 *dump_buf, |
|---|
| 6204 | +static enum dbg_status qed_parse_idle_chk_dump(struct qed_hwfn *p_hwfn, |
|---|
| 6205 | + u32 *dump_buf, |
|---|
| 6462 | 6206 | u32 num_dumped_dwords, |
|---|
| 6463 | 6207 | char *results_buf, |
|---|
| 6464 | 6208 | u32 *parsed_results_bytes, |
|---|
| .. | .. |
|---|
| 6476 | 6220 | *num_errors = 0; |
|---|
| 6477 | 6221 | *num_warnings = 0; |
|---|
| 6478 | 6222 | |
|---|
| 6479 | | - if (!s_user_dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr || |
|---|
| 6480 | | - !s_user_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_PARSING_DATA].ptr) |
|---|
| 6223 | + if (!p_hwfn->dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr || |
|---|
| 6224 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_IDLE_CHK_PARSING_DATA].ptr) |
|---|
| 6481 | 6225 | return DBG_STATUS_DBG_ARRAY_NOT_SET; |
|---|
| 6482 | 6226 | |
|---|
| 6483 | 6227 | /* Read global_params section */ |
|---|
| .. | .. |
|---|
| 6510 | 6254 | results_offset), |
|---|
| 6511 | 6255 | "FW_IDLE_CHECK:\n"); |
|---|
| 6512 | 6256 | rules_print_size = |
|---|
| 6513 | | - qed_parse_idle_chk_dump_rules(dump_buf, |
|---|
| 6257 | + qed_parse_idle_chk_dump_rules(p_hwfn, |
|---|
| 6258 | + dump_buf, |
|---|
| 6514 | 6259 | dump_buf_end, |
|---|
| 6515 | 6260 | num_rules, |
|---|
| 6516 | 6261 | true, |
|---|
| .. | .. |
|---|
| 6530 | 6275 | results_offset), |
|---|
| 6531 | 6276 | "\nLSI_IDLE_CHECK:\n"); |
|---|
| 6532 | 6277 | rules_print_size = |
|---|
| 6533 | | - qed_parse_idle_chk_dump_rules(dump_buf, |
|---|
| 6278 | + qed_parse_idle_chk_dump_rules(p_hwfn, |
|---|
| 6279 | + dump_buf, |
|---|
| 6534 | 6280 | dump_buf_end, |
|---|
| 6535 | 6281 | num_rules, |
|---|
| 6536 | 6282 | false, |
|---|
| .. | .. |
|---|
| 6570 | 6316 | return DBG_STATUS_OK; |
|---|
| 6571 | 6317 | } |
|---|
| 6572 | 6318 | |
|---|
| 6573 | | -/* Frees the specified MCP Trace meta data */ |
|---|
| 6574 | | -static void qed_mcp_trace_free_meta(struct qed_hwfn *p_hwfn, |
|---|
| 6575 | | - struct mcp_trace_meta *meta) |
|---|
| 6576 | | -{ |
|---|
| 6577 | | - u32 i; |
|---|
| 6578 | | - |
|---|
| 6579 | | - s_mcp_trace_meta_valid = false; |
|---|
| 6580 | | - |
|---|
| 6581 | | - /* Release modules */ |
|---|
| 6582 | | - if (meta->modules) { |
|---|
| 6583 | | - for (i = 0; i < meta->modules_num; i++) |
|---|
| 6584 | | - kfree(meta->modules[i]); |
|---|
| 6585 | | - kfree(meta->modules); |
|---|
| 6586 | | - } |
|---|
| 6587 | | - |
|---|
| 6588 | | - /* Release formats */ |
|---|
| 6589 | | - if (meta->formats) { |
|---|
| 6590 | | - for (i = 0; i < meta->formats_num; i++) |
|---|
| 6591 | | - kfree(meta->formats[i].format_str); |
|---|
| 6592 | | - kfree(meta->formats); |
|---|
| 6593 | | - } |
|---|
| 6594 | | -} |
|---|
| 6595 | | - |
|---|
| 6596 | 6319 | /* Allocates and fills MCP Trace meta data based on the specified meta data |
|---|
| 6597 | 6320 | * dump buffer. |
|---|
| 6598 | 6321 | * Returns debug status code. |
|---|
| 6599 | 6322 | */ |
|---|
| 6600 | | -static enum dbg_status qed_mcp_trace_alloc_meta(struct qed_hwfn *p_hwfn, |
|---|
| 6601 | | - const u32 *meta_buf, |
|---|
| 6602 | | - struct mcp_trace_meta *meta) |
|---|
| 6323 | +static enum dbg_status |
|---|
| 6324 | +qed_mcp_trace_alloc_meta_data(struct qed_hwfn *p_hwfn, |
|---|
| 6325 | + const u32 *meta_buf) |
|---|
| 6603 | 6326 | { |
|---|
| 6604 | | - u8 *meta_buf_bytes = (u8 *)meta_buf; |
|---|
| 6327 | + struct dbg_tools_user_data *dev_user_data; |
|---|
| 6605 | 6328 | u32 offset = 0, signature, i; |
|---|
| 6329 | + struct mcp_trace_meta *meta; |
|---|
| 6330 | + u8 *meta_buf_bytes; |
|---|
| 6331 | + |
|---|
| 6332 | + dev_user_data = qed_dbg_get_user_data(p_hwfn); |
|---|
| 6333 | + meta = &dev_user_data->mcp_trace_meta; |
|---|
| 6334 | + meta_buf_bytes = (u8 *)meta_buf; |
|---|
| 6606 | 6335 | |
|---|
| 6607 | 6336 | /* Free the previous meta before loading a new one. */ |
|---|
| 6608 | | - if (s_mcp_trace_meta_valid) |
|---|
| 6609 | | - qed_mcp_trace_free_meta(p_hwfn, meta); |
|---|
| 6337 | + if (meta->is_allocated) |
|---|
| 6338 | + qed_mcp_trace_free_meta_data(p_hwfn); |
|---|
| 6610 | 6339 | |
|---|
| 6611 | 6340 | memset(meta, 0, sizeof(*meta)); |
|---|
| 6612 | 6341 | |
|---|
| .. | .. |
|---|
| 6659 | 6388 | |
|---|
| 6660 | 6389 | format_ptr->data = qed_read_dword_from_buf(meta_buf_bytes, |
|---|
| 6661 | 6390 | &offset); |
|---|
| 6662 | | - format_len = |
|---|
| 6663 | | - (format_ptr->data & |
|---|
| 6664 | | - MCP_TRACE_FORMAT_LEN_MASK) >> MCP_TRACE_FORMAT_LEN_SHIFT; |
|---|
| 6391 | + format_len = GET_MFW_FIELD(format_ptr->data, |
|---|
| 6392 | + MCP_TRACE_FORMAT_LEN); |
|---|
| 6665 | 6393 | format_ptr->format_str = kzalloc(format_len, GFP_KERNEL); |
|---|
| 6666 | 6394 | if (!format_ptr->format_str) { |
|---|
| 6667 | 6395 | /* Update number of modules to be released */ |
|---|
| .. | .. |
|---|
| 6674 | 6402 | format_len, format_ptr->format_str); |
|---|
| 6675 | 6403 | } |
|---|
| 6676 | 6404 | |
|---|
| 6677 | | - s_mcp_trace_meta_valid = true; |
|---|
| 6405 | + meta->is_allocated = true; |
|---|
| 6678 | 6406 | return DBG_STATUS_OK; |
|---|
| 6679 | 6407 | } |
|---|
| 6680 | 6408 | |
|---|
| .. | .. |
|---|
| 6684 | 6412 | * trace_buf - MCP trace cyclic buffer |
|---|
| 6685 | 6413 | * trace_buf_size - MCP trace cyclic buffer size in bytes |
|---|
| 6686 | 6414 | * data_offset - offset in bytes of the data to parse in the MCP trace cyclic |
|---|
| 6687 | | - * buffer. |
|---|
| 6415 | + * buffer. |
|---|
| 6688 | 6416 | * data_size - size in bytes of data to parse. |
|---|
| 6689 | 6417 | * parsed_buf - destination buffer for parsed data. |
|---|
| 6690 | | - * parsed_bytes - size of parsed data in bytes. |
|---|
| 6418 | + * parsed_results_bytes - size of parsed data in bytes. |
|---|
| 6691 | 6419 | */ |
|---|
| 6692 | | -static enum dbg_status qed_parse_mcp_trace_buf(u8 *trace_buf, |
|---|
| 6420 | +static enum dbg_status qed_parse_mcp_trace_buf(struct qed_hwfn *p_hwfn, |
|---|
| 6421 | + u8 *trace_buf, |
|---|
| 6693 | 6422 | u32 trace_buf_size, |
|---|
| 6694 | 6423 | u32 data_offset, |
|---|
| 6695 | 6424 | u32 data_size, |
|---|
| 6696 | 6425 | char *parsed_buf, |
|---|
| 6697 | | - u32 *parsed_bytes) |
|---|
| 6426 | + u32 *parsed_results_bytes) |
|---|
| 6698 | 6427 | { |
|---|
| 6428 | + struct dbg_tools_user_data *dev_user_data; |
|---|
| 6429 | + struct mcp_trace_meta *meta; |
|---|
| 6699 | 6430 | u32 param_mask, param_shift; |
|---|
| 6700 | 6431 | enum dbg_status status; |
|---|
| 6701 | 6432 | |
|---|
| 6702 | | - *parsed_bytes = 0; |
|---|
| 6433 | + dev_user_data = qed_dbg_get_user_data(p_hwfn); |
|---|
| 6434 | + meta = &dev_user_data->mcp_trace_meta; |
|---|
| 6435 | + *parsed_results_bytes = 0; |
|---|
| 6703 | 6436 | |
|---|
| 6704 | | - if (!s_mcp_trace_meta_valid) |
|---|
| 6437 | + if (!meta->is_allocated) |
|---|
| 6705 | 6438 | return DBG_STATUS_MCP_TRACE_BAD_DATA; |
|---|
| 6706 | 6439 | |
|---|
| 6707 | 6440 | status = DBG_STATUS_OK; |
|---|
| .. | .. |
|---|
| 6723 | 6456 | format_idx = header & MFW_TRACE_EVENTID_MASK; |
|---|
| 6724 | 6457 | |
|---|
| 6725 | 6458 | /* Skip message if its index doesn't exist in the meta data */ |
|---|
| 6726 | | - if (format_idx >= s_mcp_trace_meta.formats_num) { |
|---|
| 6727 | | - u8 format_size = |
|---|
| 6728 | | - (u8)((header & MFW_TRACE_PRM_SIZE_MASK) >> |
|---|
| 6729 | | - MFW_TRACE_PRM_SIZE_SHIFT); |
|---|
| 6459 | + if (format_idx >= meta->formats_num) { |
|---|
| 6460 | + u8 format_size = (u8)GET_MFW_FIELD(header, |
|---|
| 6461 | + MFW_TRACE_PRM_SIZE); |
|---|
| 6730 | 6462 | |
|---|
| 6731 | 6463 | if (data_size < format_size) |
|---|
| 6732 | 6464 | return DBG_STATUS_MCP_TRACE_BAD_DATA; |
|---|
| .. | .. |
|---|
| 6738 | 6470 | continue; |
|---|
| 6739 | 6471 | } |
|---|
| 6740 | 6472 | |
|---|
| 6741 | | - format_ptr = &s_mcp_trace_meta.formats[format_idx]; |
|---|
| 6473 | + format_ptr = &meta->formats[format_idx]; |
|---|
| 6742 | 6474 | |
|---|
| 6743 | 6475 | for (i = 0, |
|---|
| 6744 | | - param_mask = MCP_TRACE_FORMAT_P1_SIZE_MASK, |
|---|
| 6745 | | - param_shift = MCP_TRACE_FORMAT_P1_SIZE_SHIFT; |
|---|
| 6476 | + param_mask = MCP_TRACE_FORMAT_P1_SIZE_MASK, param_shift = |
|---|
| 6477 | + MCP_TRACE_FORMAT_P1_SIZE_OFFSET; |
|---|
| 6746 | 6478 | i < MCP_TRACE_FORMAT_MAX_PARAMS; |
|---|
| 6747 | | - i++, |
|---|
| 6748 | | - param_mask <<= MCP_TRACE_FORMAT_PARAM_WIDTH, |
|---|
| 6479 | + i++, param_mask <<= MCP_TRACE_FORMAT_PARAM_WIDTH, |
|---|
| 6749 | 6480 | param_shift += MCP_TRACE_FORMAT_PARAM_WIDTH) { |
|---|
| 6750 | 6481 | /* Extract param size (0..3) */ |
|---|
| 6751 | 6482 | u8 param_size = (u8)((format_ptr->data & param_mask) >> |
|---|
| .. | .. |
|---|
| 6773 | 6504 | data_size -= param_size; |
|---|
| 6774 | 6505 | } |
|---|
| 6775 | 6506 | |
|---|
| 6776 | | - format_level = (u8)((format_ptr->data & |
|---|
| 6777 | | - MCP_TRACE_FORMAT_LEVEL_MASK) >> |
|---|
| 6778 | | - MCP_TRACE_FORMAT_LEVEL_SHIFT); |
|---|
| 6779 | | - format_module = (u8)((format_ptr->data & |
|---|
| 6780 | | - MCP_TRACE_FORMAT_MODULE_MASK) >> |
|---|
| 6781 | | - MCP_TRACE_FORMAT_MODULE_SHIFT); |
|---|
| 6507 | + format_level = (u8)GET_MFW_FIELD(format_ptr->data, |
|---|
| 6508 | + MCP_TRACE_FORMAT_LEVEL); |
|---|
| 6509 | + format_module = (u8)GET_MFW_FIELD(format_ptr->data, |
|---|
| 6510 | + MCP_TRACE_FORMAT_MODULE); |
|---|
| 6782 | 6511 | if (format_level >= ARRAY_SIZE(s_mcp_trace_level_str)) |
|---|
| 6783 | 6512 | return DBG_STATUS_MCP_TRACE_BAD_DATA; |
|---|
| 6784 | 6513 | |
|---|
| 6785 | 6514 | /* Print current message to results buffer */ |
|---|
| 6786 | | - *parsed_bytes += |
|---|
| 6787 | | - sprintf(qed_get_buf_ptr(parsed_buf, *parsed_bytes), |
|---|
| 6515 | + *parsed_results_bytes += |
|---|
| 6516 | + sprintf(qed_get_buf_ptr(parsed_buf, |
|---|
| 6517 | + *parsed_results_bytes), |
|---|
| 6788 | 6518 | "%s %-8s: ", |
|---|
| 6789 | 6519 | s_mcp_trace_level_str[format_level], |
|---|
| 6790 | | - s_mcp_trace_meta.modules[format_module]); |
|---|
| 6791 | | - *parsed_bytes += |
|---|
| 6792 | | - sprintf(qed_get_buf_ptr(parsed_buf, *parsed_bytes), |
|---|
| 6520 | + meta->modules[format_module]); |
|---|
| 6521 | + *parsed_results_bytes += |
|---|
| 6522 | + sprintf(qed_get_buf_ptr(parsed_buf, *parsed_results_bytes), |
|---|
| 6793 | 6523 | format_ptr->format_str, |
|---|
| 6794 | 6524 | params[0], params[1], params[2]); |
|---|
| 6795 | 6525 | } |
|---|
| 6796 | 6526 | |
|---|
| 6797 | 6527 | /* Add string NULL terminator */ |
|---|
| 6798 | | - (*parsed_bytes)++; |
|---|
| 6528 | + (*parsed_results_bytes)++; |
|---|
| 6799 | 6529 | |
|---|
| 6800 | 6530 | return status; |
|---|
| 6801 | 6531 | } |
|---|
| .. | .. |
|---|
| 6803 | 6533 | /* Parses an MCP Trace dump buffer. |
|---|
| 6804 | 6534 | * If result_buf is not NULL, the MCP Trace results are printed to it. |
|---|
| 6805 | 6535 | * In any case, the required results buffer size is assigned to |
|---|
| 6806 | | - * parsed_bytes. |
|---|
| 6536 | + * parsed_results_bytes. |
|---|
| 6807 | 6537 | * The parsing status is returned. |
|---|
| 6808 | 6538 | */ |
|---|
| 6809 | 6539 | static enum dbg_status qed_parse_mcp_trace_dump(struct qed_hwfn *p_hwfn, |
|---|
| 6810 | 6540 | u32 *dump_buf, |
|---|
| 6811 | | - char *parsed_buf, |
|---|
| 6812 | | - u32 *parsed_bytes) |
|---|
| 6541 | + char *results_buf, |
|---|
| 6542 | + u32 *parsed_results_bytes, |
|---|
| 6543 | + bool free_meta_data) |
|---|
| 6813 | 6544 | { |
|---|
| 6814 | 6545 | const char *section_name, *param_name, *param_str_val; |
|---|
| 6815 | 6546 | u32 data_size, trace_data_dwords, trace_meta_dwords; |
|---|
| 6816 | | - u32 offset, results_offset, parsed_buf_bytes; |
|---|
| 6547 | + u32 offset, results_offset, results_buf_bytes; |
|---|
| 6817 | 6548 | u32 param_num_val, num_section_params; |
|---|
| 6818 | 6549 | struct mcp_trace *trace; |
|---|
| 6819 | 6550 | enum dbg_status status; |
|---|
| 6820 | 6551 | const u32 *meta_buf; |
|---|
| 6821 | 6552 | u8 *trace_buf; |
|---|
| 6822 | 6553 | |
|---|
| 6823 | | - *parsed_bytes = 0; |
|---|
| 6554 | + *parsed_results_bytes = 0; |
|---|
| 6824 | 6555 | |
|---|
| 6825 | 6556 | /* Read global_params section */ |
|---|
| 6826 | 6557 | dump_buf += qed_read_section_hdr(dump_buf, |
|---|
| .. | .. |
|---|
| 6831 | 6562 | /* Print global params */ |
|---|
| 6832 | 6563 | dump_buf += qed_print_section_params(dump_buf, |
|---|
| 6833 | 6564 | num_section_params, |
|---|
| 6834 | | - parsed_buf, &results_offset); |
|---|
| 6565 | + results_buf, &results_offset); |
|---|
| 6835 | 6566 | |
|---|
| 6836 | 6567 | /* Read trace_data section */ |
|---|
| 6837 | 6568 | dump_buf += qed_read_section_hdr(dump_buf, |
|---|
| .. | .. |
|---|
| 6846 | 6577 | |
|---|
| 6847 | 6578 | /* Prepare trace info */ |
|---|
| 6848 | 6579 | trace = (struct mcp_trace *)dump_buf; |
|---|
| 6580 | + if (trace->signature != MFW_TRACE_SIGNATURE || !trace->size) |
|---|
| 6581 | + return DBG_STATUS_MCP_TRACE_BAD_DATA; |
|---|
| 6582 | + |
|---|
| 6849 | 6583 | trace_buf = (u8 *)dump_buf + sizeof(*trace); |
|---|
| 6850 | 6584 | offset = trace->trace_oldest; |
|---|
| 6851 | 6585 | data_size = qed_cyclic_sub(trace->trace_prod, offset, trace->size); |
|---|
| .. | .. |
|---|
| 6865 | 6599 | /* Choose meta data buffer */ |
|---|
| 6866 | 6600 | if (!trace_meta_dwords) { |
|---|
| 6867 | 6601 | /* Dump doesn't include meta data */ |
|---|
| 6868 | | - if (!s_mcp_trace_meta_arr.ptr) |
|---|
| 6602 | + struct dbg_tools_user_data *dev_user_data = |
|---|
| 6603 | + qed_dbg_get_user_data(p_hwfn); |
|---|
| 6604 | + |
|---|
| 6605 | + if (!dev_user_data->mcp_trace_user_meta_buf) |
|---|
| 6869 | 6606 | return DBG_STATUS_MCP_TRACE_NO_META; |
|---|
| 6870 | | - meta_buf = s_mcp_trace_meta_arr.ptr; |
|---|
| 6607 | + |
|---|
| 6608 | + meta_buf = dev_user_data->mcp_trace_user_meta_buf; |
|---|
| 6871 | 6609 | } else { |
|---|
| 6872 | 6610 | /* Dump includes meta data */ |
|---|
| 6873 | 6611 | meta_buf = dump_buf; |
|---|
| 6874 | 6612 | } |
|---|
| 6875 | 6613 | |
|---|
| 6876 | 6614 | /* Allocate meta data memory */ |
|---|
| 6877 | | - status = qed_mcp_trace_alloc_meta(p_hwfn, meta_buf, &s_mcp_trace_meta); |
|---|
| 6615 | + status = qed_mcp_trace_alloc_meta_data(p_hwfn, meta_buf); |
|---|
| 6878 | 6616 | if (status != DBG_STATUS_OK) |
|---|
| 6879 | 6617 | return status; |
|---|
| 6880 | 6618 | |
|---|
| 6881 | | - status = qed_parse_mcp_trace_buf(trace_buf, |
|---|
| 6619 | + status = qed_parse_mcp_trace_buf(p_hwfn, |
|---|
| 6620 | + trace_buf, |
|---|
| 6882 | 6621 | trace->size, |
|---|
| 6883 | 6622 | offset, |
|---|
| 6884 | 6623 | data_size, |
|---|
| 6885 | | - parsed_buf ? |
|---|
| 6886 | | - parsed_buf + results_offset : |
|---|
| 6624 | + results_buf ? |
|---|
| 6625 | + results_buf + results_offset : |
|---|
| 6887 | 6626 | NULL, |
|---|
| 6888 | | - &parsed_buf_bytes); |
|---|
| 6627 | + &results_buf_bytes); |
|---|
| 6889 | 6628 | if (status != DBG_STATUS_OK) |
|---|
| 6890 | 6629 | return status; |
|---|
| 6891 | 6630 | |
|---|
| 6892 | | - *parsed_bytes = results_offset + parsed_buf_bytes; |
|---|
| 6631 | + if (free_meta_data) |
|---|
| 6632 | + qed_mcp_trace_free_meta_data(p_hwfn); |
|---|
| 6633 | + |
|---|
| 6634 | + *parsed_results_bytes = results_offset + results_buf_bytes; |
|---|
| 6893 | 6635 | |
|---|
| 6894 | 6636 | return DBG_STATUS_OK; |
|---|
| 6895 | 6637 | } |
|---|
| .. | .. |
|---|
| 6907 | 6649 | const char *section_name, *param_name, *param_str_val; |
|---|
| 6908 | 6650 | u32 param_num_val, num_section_params, num_elements; |
|---|
| 6909 | 6651 | struct reg_fifo_element *elements; |
|---|
| 6910 | | - u8 i, j, err_val, vf_val; |
|---|
| 6652 | + u8 i, j, err_code, vf_val; |
|---|
| 6911 | 6653 | u32 results_offset = 0; |
|---|
| 6912 | 6654 | char vf_str[4]; |
|---|
| 6913 | 6655 | |
|---|
| .. | .. |
|---|
| 6938 | 6680 | |
|---|
| 6939 | 6681 | /* Decode elements */ |
|---|
| 6940 | 6682 | for (i = 0; i < num_elements; i++) { |
|---|
| 6941 | | - bool err_printed = false; |
|---|
| 6683 | + const char *err_msg = NULL; |
|---|
| 6942 | 6684 | |
|---|
| 6943 | 6685 | /* Discover if element belongs to a VF or a PF */ |
|---|
| 6944 | 6686 | vf_val = GET_FIELD(elements[i].data, REG_FIFO_ELEMENT_VF); |
|---|
| .. | .. |
|---|
| 6947 | 6689 | else |
|---|
| 6948 | 6690 | sprintf(vf_str, "%d", vf_val); |
|---|
| 6949 | 6691 | |
|---|
| 6692 | + /* Find error message */ |
|---|
| 6693 | + err_code = GET_FIELD(elements[i].data, REG_FIFO_ELEMENT_ERROR); |
|---|
| 6694 | + for (j = 0; j < ARRAY_SIZE(s_reg_fifo_errors) && !err_msg; j++) |
|---|
| 6695 | + if (err_code == s_reg_fifo_errors[j].err_code) |
|---|
| 6696 | + err_msg = s_reg_fifo_errors[j].err_msg; |
|---|
| 6697 | + |
|---|
| 6950 | 6698 | /* Add parsed element to parsed buffer */ |
|---|
| 6951 | 6699 | results_offset += |
|---|
| 6952 | 6700 | sprintf(qed_get_buf_ptr(results_buf, |
|---|
| 6953 | 6701 | results_offset), |
|---|
| 6954 | | - "raw: 0x%016llx, address: 0x%07x, access: %-5s, pf: %2d, vf: %s, port: %d, privilege: %-3s, protection: %-12s, master: %-4s, errors: ", |
|---|
| 6702 | + "raw: 0x%016llx, address: 0x%07x, access: %-5s, pf: %2d, vf: %s, port: %d, privilege: %-3s, protection: %-12s, master: %-4s, error: %s\n", |
|---|
| 6955 | 6703 | elements[i].data, |
|---|
| 6956 | 6704 | (u32)GET_FIELD(elements[i].data, |
|---|
| 6957 | 6705 | REG_FIFO_ELEMENT_ADDRESS) * |
|---|
| .. | .. |
|---|
| 6968 | 6716 | s_protection_strs[GET_FIELD(elements[i].data, |
|---|
| 6969 | 6717 | REG_FIFO_ELEMENT_PROTECTION)], |
|---|
| 6970 | 6718 | s_master_strs[GET_FIELD(elements[i].data, |
|---|
| 6971 | | - REG_FIFO_ELEMENT_MASTER)]); |
|---|
| 6972 | | - |
|---|
| 6973 | | - /* Print errors */ |
|---|
| 6974 | | - for (j = 0, |
|---|
| 6975 | | - err_val = GET_FIELD(elements[i].data, |
|---|
| 6976 | | - REG_FIFO_ELEMENT_ERROR); |
|---|
| 6977 | | - j < ARRAY_SIZE(s_reg_fifo_error_strs); |
|---|
| 6978 | | - j++, err_val >>= 1) { |
|---|
| 6979 | | - if (err_val & 0x1) { |
|---|
| 6980 | | - if (err_printed) |
|---|
| 6981 | | - results_offset += |
|---|
| 6982 | | - sprintf(qed_get_buf_ptr |
|---|
| 6983 | | - (results_buf, |
|---|
| 6984 | | - results_offset), ", "); |
|---|
| 6985 | | - results_offset += |
|---|
| 6986 | | - sprintf(qed_get_buf_ptr |
|---|
| 6987 | | - (results_buf, results_offset), "%s", |
|---|
| 6988 | | - s_reg_fifo_error_strs[j]); |
|---|
| 6989 | | - err_printed = true; |
|---|
| 6990 | | - } |
|---|
| 6991 | | - } |
|---|
| 6992 | | - |
|---|
| 6993 | | - results_offset += |
|---|
| 6994 | | - sprintf(qed_get_buf_ptr(results_buf, results_offset), "\n"); |
|---|
| 6719 | + REG_FIFO_ELEMENT_MASTER)], |
|---|
| 6720 | + err_msg ? err_msg : "unknown error code"); |
|---|
| 6995 | 6721 | } |
|---|
| 6996 | 6722 | |
|---|
| 6997 | 6723 | results_offset += sprintf(qed_get_buf_ptr(results_buf, |
|---|
| .. | .. |
|---|
| 7345 | 7071 | |
|---|
| 7346 | 7072 | /***************************** Public Functions *******************************/ |
|---|
| 7347 | 7073 | |
|---|
| 7348 | | -enum dbg_status qed_dbg_user_set_bin_ptr(const u8 * const bin_ptr) |
|---|
| 7074 | +enum dbg_status qed_dbg_user_set_bin_ptr(struct qed_hwfn *p_hwfn, |
|---|
| 7075 | + const u8 * const bin_ptr) |
|---|
| 7349 | 7076 | { |
|---|
| 7350 | | - struct bin_buffer_hdr *buf_array = (struct bin_buffer_hdr *)bin_ptr; |
|---|
| 7077 | + struct bin_buffer_hdr *buf_hdrs = (struct bin_buffer_hdr *)bin_ptr; |
|---|
| 7351 | 7078 | u8 buf_id; |
|---|
| 7352 | 7079 | |
|---|
| 7353 | 7080 | /* Convert binary data to debug arrays */ |
|---|
| 7354 | | - for (buf_id = 0; buf_id < MAX_BIN_DBG_BUFFER_TYPE; buf_id++) { |
|---|
| 7355 | | - s_user_dbg_arrays[buf_id].ptr = |
|---|
| 7356 | | - (u32 *)(bin_ptr + buf_array[buf_id].offset); |
|---|
| 7357 | | - s_user_dbg_arrays[buf_id].size_in_dwords = |
|---|
| 7358 | | - BYTES_TO_DWORDS(buf_array[buf_id].length); |
|---|
| 7359 | | - } |
|---|
| 7081 | + for (buf_id = 0; buf_id < MAX_BIN_DBG_BUFFER_TYPE; buf_id++) |
|---|
| 7082 | + qed_set_dbg_bin_buf(p_hwfn, |
|---|
| 7083 | + (enum bin_dbg_buffer_type)buf_id, |
|---|
| 7084 | + (u32 *)(bin_ptr + buf_hdrs[buf_id].offset), |
|---|
| 7085 | + buf_hdrs[buf_id].length); |
|---|
| 7086 | + |
|---|
| 7087 | + return DBG_STATUS_OK; |
|---|
| 7088 | +} |
|---|
| 7089 | + |
|---|
| 7090 | +enum dbg_status qed_dbg_alloc_user_data(struct qed_hwfn *p_hwfn, |
|---|
| 7091 | + void **user_data_ptr) |
|---|
| 7092 | +{ |
|---|
| 7093 | + *user_data_ptr = kzalloc(sizeof(struct dbg_tools_user_data), |
|---|
| 7094 | + GFP_KERNEL); |
|---|
| 7095 | + if (!(*user_data_ptr)) |
|---|
| 7096 | + return DBG_STATUS_VIRT_MEM_ALLOC_FAILED; |
|---|
| 7360 | 7097 | |
|---|
| 7361 | 7098 | return DBG_STATUS_OK; |
|---|
| 7362 | 7099 | } |
|---|
| .. | .. |
|---|
| 7374 | 7111 | { |
|---|
| 7375 | 7112 | u32 num_errors, num_warnings; |
|---|
| 7376 | 7113 | |
|---|
| 7377 | | - return qed_parse_idle_chk_dump(dump_buf, |
|---|
| 7114 | + return qed_parse_idle_chk_dump(p_hwfn, |
|---|
| 7115 | + dump_buf, |
|---|
| 7378 | 7116 | num_dumped_dwords, |
|---|
| 7379 | 7117 | NULL, |
|---|
| 7380 | 7118 | results_buf_size, |
|---|
| .. | .. |
|---|
| 7390 | 7128 | { |
|---|
| 7391 | 7129 | u32 parsed_buf_size; |
|---|
| 7392 | 7130 | |
|---|
| 7393 | | - return qed_parse_idle_chk_dump(dump_buf, |
|---|
| 7131 | + return qed_parse_idle_chk_dump(p_hwfn, |
|---|
| 7132 | + dump_buf, |
|---|
| 7394 | 7133 | num_dumped_dwords, |
|---|
| 7395 | 7134 | results_buf, |
|---|
| 7396 | 7135 | &parsed_buf_size, |
|---|
| 7397 | 7136 | num_errors, num_warnings); |
|---|
| 7398 | 7137 | } |
|---|
| 7399 | 7138 | |
|---|
| 7400 | | -void qed_dbg_mcp_trace_set_meta_data(u32 *data, u32 size) |
|---|
| 7139 | +void qed_dbg_mcp_trace_set_meta_data(struct qed_hwfn *p_hwfn, |
|---|
| 7140 | + const u32 *meta_buf) |
|---|
| 7401 | 7141 | { |
|---|
| 7402 | | - s_mcp_trace_meta_arr.ptr = data; |
|---|
| 7403 | | - s_mcp_trace_meta_arr.size_in_dwords = size; |
|---|
| 7142 | + struct dbg_tools_user_data *dev_user_data = |
|---|
| 7143 | + qed_dbg_get_user_data(p_hwfn); |
|---|
| 7144 | + |
|---|
| 7145 | + dev_user_data->mcp_trace_user_meta_buf = meta_buf; |
|---|
| 7404 | 7146 | } |
|---|
| 7405 | 7147 | |
|---|
| 7406 | 7148 | enum dbg_status qed_get_mcp_trace_results_buf_size(struct qed_hwfn *p_hwfn, |
|---|
| .. | .. |
|---|
| 7409 | 7151 | u32 *results_buf_size) |
|---|
| 7410 | 7152 | { |
|---|
| 7411 | 7153 | return qed_parse_mcp_trace_dump(p_hwfn, |
|---|
| 7412 | | - dump_buf, NULL, results_buf_size); |
|---|
| 7154 | + dump_buf, NULL, results_buf_size, true); |
|---|
| 7413 | 7155 | } |
|---|
| 7414 | 7156 | |
|---|
| 7415 | 7157 | enum dbg_status qed_print_mcp_trace_results(struct qed_hwfn *p_hwfn, |
|---|
| .. | .. |
|---|
| 7421 | 7163 | |
|---|
| 7422 | 7164 | return qed_parse_mcp_trace_dump(p_hwfn, |
|---|
| 7423 | 7165 | dump_buf, |
|---|
| 7424 | | - results_buf, &parsed_buf_size); |
|---|
| 7166 | + results_buf, &parsed_buf_size, true); |
|---|
| 7425 | 7167 | } |
|---|
| 7426 | 7168 | |
|---|
| 7427 | | -enum dbg_status qed_print_mcp_trace_line(u8 *dump_buf, |
|---|
| 7169 | +enum dbg_status qed_print_mcp_trace_results_cont(struct qed_hwfn *p_hwfn, |
|---|
| 7170 | + u32 *dump_buf, |
|---|
| 7171 | + char *results_buf) |
|---|
| 7172 | +{ |
|---|
| 7173 | + u32 parsed_buf_size; |
|---|
| 7174 | + |
|---|
| 7175 | + return qed_parse_mcp_trace_dump(p_hwfn, dump_buf, results_buf, |
|---|
| 7176 | + &parsed_buf_size, false); |
|---|
| 7177 | +} |
|---|
| 7178 | + |
|---|
| 7179 | +enum dbg_status qed_print_mcp_trace_line(struct qed_hwfn *p_hwfn, |
|---|
| 7180 | + u8 *dump_buf, |
|---|
| 7428 | 7181 | u32 num_dumped_bytes, |
|---|
| 7429 | 7182 | char *results_buf) |
|---|
| 7430 | 7183 | { |
|---|
| 7431 | | - u32 parsed_bytes; |
|---|
| 7184 | + u32 parsed_results_bytes; |
|---|
| 7432 | 7185 | |
|---|
| 7433 | | - return qed_parse_mcp_trace_buf(dump_buf, |
|---|
| 7186 | + return qed_parse_mcp_trace_buf(p_hwfn, |
|---|
| 7187 | + dump_buf, |
|---|
| 7434 | 7188 | num_dumped_bytes, |
|---|
| 7435 | 7189 | 0, |
|---|
| 7436 | 7190 | num_dumped_bytes, |
|---|
| 7437 | | - results_buf, &parsed_bytes); |
|---|
| 7191 | + results_buf, &parsed_results_bytes); |
|---|
| 7192 | +} |
|---|
| 7193 | + |
|---|
| 7194 | +/* Frees the specified MCP Trace meta data */ |
|---|
| 7195 | +void qed_mcp_trace_free_meta_data(struct qed_hwfn *p_hwfn) |
|---|
| 7196 | +{ |
|---|
| 7197 | + struct dbg_tools_user_data *dev_user_data; |
|---|
| 7198 | + struct mcp_trace_meta *meta; |
|---|
| 7199 | + u32 i; |
|---|
| 7200 | + |
|---|
| 7201 | + dev_user_data = qed_dbg_get_user_data(p_hwfn); |
|---|
| 7202 | + meta = &dev_user_data->mcp_trace_meta; |
|---|
| 7203 | + if (!meta->is_allocated) |
|---|
| 7204 | + return; |
|---|
| 7205 | + |
|---|
| 7206 | + /* Release modules */ |
|---|
| 7207 | + if (meta->modules) { |
|---|
| 7208 | + for (i = 0; i < meta->modules_num; i++) |
|---|
| 7209 | + kfree(meta->modules[i]); |
|---|
| 7210 | + kfree(meta->modules); |
|---|
| 7211 | + } |
|---|
| 7212 | + |
|---|
| 7213 | + /* Release formats */ |
|---|
| 7214 | + if (meta->formats) { |
|---|
| 7215 | + for (i = 0; i < meta->formats_num; i++) |
|---|
| 7216 | + kfree(meta->formats[i].format_str); |
|---|
| 7217 | + kfree(meta->formats); |
|---|
| 7218 | + } |
|---|
| 7219 | + |
|---|
| 7220 | + meta->is_allocated = false; |
|---|
| 7438 | 7221 | } |
|---|
| 7439 | 7222 | |
|---|
| 7440 | 7223 | enum dbg_status qed_get_reg_fifo_results_buf_size(struct qed_hwfn *p_hwfn, |
|---|
| .. | .. |
|---|
| 7517 | 7300 | enum dbg_status qed_dbg_parse_attn(struct qed_hwfn *p_hwfn, |
|---|
| 7518 | 7301 | struct dbg_attn_block_result *results) |
|---|
| 7519 | 7302 | { |
|---|
| 7520 | | - struct user_dbg_array *block_attn, *pstrings; |
|---|
| 7521 | 7303 | const u32 *block_attn_name_offsets; |
|---|
| 7522 | | - enum dbg_attn_type attn_type; |
|---|
| 7304 | + const char *attn_name_base; |
|---|
| 7523 | 7305 | const char *block_name; |
|---|
| 7306 | + enum dbg_attn_type attn_type; |
|---|
| 7524 | 7307 | u8 num_regs, i, j; |
|---|
| 7525 | 7308 | |
|---|
| 7526 | 7309 | num_regs = GET_FIELD(results->data, DBG_ATTN_BLOCK_RESULT_NUM_REGS); |
|---|
| 7527 | | - attn_type = (enum dbg_attn_type) |
|---|
| 7528 | | - GET_FIELD(results->data, |
|---|
| 7529 | | - DBG_ATTN_BLOCK_RESULT_ATTN_TYPE); |
|---|
| 7530 | | - block_name = s_block_info_arr[results->block_id].name; |
|---|
| 7310 | + attn_type = GET_FIELD(results->data, DBG_ATTN_BLOCK_RESULT_ATTN_TYPE); |
|---|
| 7311 | + block_name = qed_dbg_get_block_name(p_hwfn, results->block_id); |
|---|
| 7312 | + if (!block_name) |
|---|
| 7313 | + return DBG_STATUS_INVALID_ARGS; |
|---|
| 7531 | 7314 | |
|---|
| 7532 | | - if (!s_user_dbg_arrays[BIN_BUF_DBG_ATTN_INDEXES].ptr || |
|---|
| 7533 | | - !s_user_dbg_arrays[BIN_BUF_DBG_ATTN_NAME_OFFSETS].ptr || |
|---|
| 7534 | | - !s_user_dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr) |
|---|
| 7315 | + if (!p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_INDEXES].ptr || |
|---|
| 7316 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_NAME_OFFSETS].ptr || |
|---|
| 7317 | + !p_hwfn->dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr) |
|---|
| 7535 | 7318 | return DBG_STATUS_DBG_ARRAY_NOT_SET; |
|---|
| 7536 | 7319 | |
|---|
| 7537 | | - block_attn = &s_user_dbg_arrays[BIN_BUF_DBG_ATTN_NAME_OFFSETS]; |
|---|
| 7538 | | - block_attn_name_offsets = &block_attn->ptr[results->names_offset]; |
|---|
| 7320 | + block_attn_name_offsets = |
|---|
| 7321 | + (u32 *)p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_NAME_OFFSETS].ptr + |
|---|
| 7322 | + results->names_offset; |
|---|
| 7323 | + |
|---|
| 7324 | + attn_name_base = p_hwfn->dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS].ptr; |
|---|
| 7539 | 7325 | |
|---|
| 7540 | 7326 | /* Go over registers with a non-zero attention status */ |
|---|
| 7541 | 7327 | for (i = 0; i < num_regs; i++) { |
|---|
| .. | .. |
|---|
| 7546 | 7332 | reg_result = &results->reg_results[i]; |
|---|
| 7547 | 7333 | num_reg_attn = GET_FIELD(reg_result->data, |
|---|
| 7548 | 7334 | DBG_ATTN_REG_RESULT_NUM_REG_ATTN); |
|---|
| 7549 | | - block_attn = &s_user_dbg_arrays[BIN_BUF_DBG_ATTN_INDEXES]; |
|---|
| 7550 | | - bit_mapping = &((struct dbg_attn_bit_mapping *) |
|---|
| 7551 | | - block_attn->ptr)[reg_result->block_attn_offset]; |
|---|
| 7552 | | - |
|---|
| 7553 | | - pstrings = &s_user_dbg_arrays[BIN_BUF_DBG_PARSING_STRINGS]; |
|---|
| 7335 | + bit_mapping = (struct dbg_attn_bit_mapping *) |
|---|
| 7336 | + p_hwfn->dbg_arrays[BIN_BUF_DBG_ATTN_INDEXES].ptr + |
|---|
| 7337 | + reg_result->block_attn_offset; |
|---|
| 7554 | 7338 | |
|---|
| 7555 | 7339 | /* Go over attention status bits */ |
|---|
| 7556 | | - for (j = 0; j < num_reg_attn; j++) { |
|---|
| 7340 | + for (j = 0; j < num_reg_attn; j++, bit_idx++) { |
|---|
| 7557 | 7341 | u16 attn_idx_val = GET_FIELD(bit_mapping[j].data, |
|---|
| 7558 | 7342 | DBG_ATTN_BIT_MAPPING_VAL); |
|---|
| 7559 | 7343 | const char *attn_name, *attn_type_str, *masked_str; |
|---|
| 7560 | | - u32 attn_name_offset, sts_addr; |
|---|
| 7344 | + u32 attn_name_offset; |
|---|
| 7345 | + u32 sts_addr; |
|---|
| 7561 | 7346 | |
|---|
| 7562 | 7347 | /* Check if bit mask should be advanced (due to unused |
|---|
| 7563 | 7348 | * bits). |
|---|
| .. | .. |
|---|
| 7569 | 7354 | } |
|---|
| 7570 | 7355 | |
|---|
| 7571 | 7356 | /* Check current bit index */ |
|---|
| 7572 | | - if (!(reg_result->sts_val & BIT(bit_idx))) { |
|---|
| 7573 | | - bit_idx++; |
|---|
| 7357 | + if (!(reg_result->sts_val & BIT(bit_idx))) |
|---|
| 7574 | 7358 | continue; |
|---|
| 7575 | | - } |
|---|
| 7576 | 7359 | |
|---|
| 7577 | | - /* Find attention name */ |
|---|
| 7360 | + /* An attention bit with value=1 was found |
|---|
| 7361 | + * Find attention name |
|---|
| 7362 | + */ |
|---|
| 7578 | 7363 | attn_name_offset = |
|---|
| 7579 | 7364 | block_attn_name_offsets[attn_idx_val]; |
|---|
| 7580 | | - attn_name = &((const char *) |
|---|
| 7581 | | - pstrings->ptr)[attn_name_offset]; |
|---|
| 7582 | | - attn_type_str = attn_type == ATTN_TYPE_INTERRUPT ? |
|---|
| 7583 | | - "Interrupt" : "Parity"; |
|---|
| 7365 | + attn_name = attn_name_base + attn_name_offset; |
|---|
| 7366 | + attn_type_str = |
|---|
| 7367 | + (attn_type == |
|---|
| 7368 | + ATTN_TYPE_INTERRUPT ? "Interrupt" : |
|---|
| 7369 | + "Parity"); |
|---|
| 7584 | 7370 | masked_str = reg_result->mask_val & BIT(bit_idx) ? |
|---|
| 7585 | 7371 | " [masked]" : ""; |
|---|
| 7586 | 7372 | sts_addr = GET_FIELD(reg_result->data, |
|---|
| .. | .. |
|---|
| 7588 | 7374 | DP_NOTICE(p_hwfn, |
|---|
| 7589 | 7375 | "%s (%s) : %s [address 0x%08x, bit %d]%s\n", |
|---|
| 7590 | 7376 | block_name, attn_type_str, attn_name, |
|---|
| 7591 | | - sts_addr, bit_idx, masked_str); |
|---|
| 7592 | | - |
|---|
| 7593 | | - bit_idx++; |
|---|
| 7377 | + sts_addr * 4, bit_idx, masked_str); |
|---|
| 7594 | 7378 | } |
|---|
| 7595 | 7379 | } |
|---|
| 7596 | 7380 | |
|---|
| 7597 | 7381 | return DBG_STATUS_OK; |
|---|
| 7598 | 7382 | } |
|---|
| 7383 | + |
|---|
| 7384 | +static DEFINE_MUTEX(qed_dbg_lock); |
|---|
| 7599 | 7385 | |
|---|
| 7600 | 7386 | /* Wrapper for unifying the idle_chk and mcp_trace api */ |
|---|
| 7601 | 7387 | static enum dbg_status |
|---|
| .. | .. |
|---|
| 7656 | 7442 | qed_dbg_fw_asserts_get_dump_buf_size, |
|---|
| 7657 | 7443 | qed_dbg_fw_asserts_dump, |
|---|
| 7658 | 7444 | qed_print_fw_asserts_results, |
|---|
| 7659 | | - qed_get_fw_asserts_results_buf_size},}; |
|---|
| 7445 | + qed_get_fw_asserts_results_buf_size}, { |
|---|
| 7446 | + "ilt", |
|---|
| 7447 | + qed_dbg_ilt_get_dump_buf_size, |
|---|
| 7448 | + qed_dbg_ilt_dump, NULL, NULL},}; |
|---|
| 7660 | 7449 | |
|---|
| 7661 | 7450 | static void qed_dbg_print_feature(u8 *p_text_buf, u32 text_size) |
|---|
| 7662 | 7451 | { |
|---|
| .. | .. |
|---|
| 7677 | 7466 | enum qed_dbg_features feature_idx) |
|---|
| 7678 | 7467 | { |
|---|
| 7679 | 7468 | struct qed_dbg_feature *feature = |
|---|
| 7680 | | - &p_hwfn->cdev->dbg_params.features[feature_idx]; |
|---|
| 7469 | + &p_hwfn->cdev->dbg_features[feature_idx]; |
|---|
| 7681 | 7470 | u32 text_size_bytes, null_char_pos, i; |
|---|
| 7682 | 7471 | enum dbg_status rc; |
|---|
| 7683 | 7472 | char *text_buf; |
|---|
| .. | .. |
|---|
| 7726 | 7515 | text_buf[i] = '\n'; |
|---|
| 7727 | 7516 | |
|---|
| 7728 | 7517 | /* Dump printable feature to log */ |
|---|
| 7729 | | - if (p_hwfn->cdev->dbg_params.print_data) |
|---|
| 7518 | + if (p_hwfn->cdev->print_dbg_data) |
|---|
| 7730 | 7519 | qed_dbg_print_feature(text_buf, text_size_bytes); |
|---|
| 7520 | + |
|---|
| 7521 | + /* Just return the original binary buffer if requested */ |
|---|
| 7522 | + if (p_hwfn->cdev->dbg_bin_dump) { |
|---|
| 7523 | + vfree(text_buf); |
|---|
| 7524 | + return DBG_STATUS_OK; |
|---|
| 7525 | + } |
|---|
| 7731 | 7526 | |
|---|
| 7732 | 7527 | /* Free the old dump_buf and point the dump_buf to the newly allocagted |
|---|
| 7733 | 7528 | * and formatted text buffer. |
|---|
| .. | .. |
|---|
| 7739 | 7534 | return rc; |
|---|
| 7740 | 7535 | } |
|---|
| 7741 | 7536 | |
|---|
| 7537 | +#define MAX_DBG_FEATURE_SIZE_DWORDS 0x3FFFFFFF |
|---|
| 7538 | + |
|---|
| 7742 | 7539 | /* Generic function for performing the dump of a debug feature. */ |
|---|
| 7743 | 7540 | static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn, |
|---|
| 7744 | 7541 | struct qed_ptt *p_ptt, |
|---|
| 7745 | 7542 | enum qed_dbg_features feature_idx) |
|---|
| 7746 | 7543 | { |
|---|
| 7747 | 7544 | struct qed_dbg_feature *feature = |
|---|
| 7748 | | - &p_hwfn->cdev->dbg_params.features[feature_idx]; |
|---|
| 7545 | + &p_hwfn->cdev->dbg_features[feature_idx]; |
|---|
| 7749 | 7546 | u32 buf_size_dwords; |
|---|
| 7750 | 7547 | enum dbg_status rc; |
|---|
| 7751 | 7548 | |
|---|
| .. | .. |
|---|
| 7768 | 7565 | &buf_size_dwords); |
|---|
| 7769 | 7566 | if (rc != DBG_STATUS_OK && rc != DBG_STATUS_NVRAM_GET_IMAGE_FAILED) |
|---|
| 7770 | 7567 | return rc; |
|---|
| 7568 | + |
|---|
| 7569 | + if (buf_size_dwords > MAX_DBG_FEATURE_SIZE_DWORDS) { |
|---|
| 7570 | + feature->buf_size = 0; |
|---|
| 7571 | + DP_NOTICE(p_hwfn->cdev, |
|---|
| 7572 | + "Debug feature [\"%s\"] size (0x%x dwords) exceeds maximum size (0x%x dwords)\n", |
|---|
| 7573 | + qed_features_lookup[feature_idx].name, |
|---|
| 7574 | + buf_size_dwords, MAX_DBG_FEATURE_SIZE_DWORDS); |
|---|
| 7575 | + |
|---|
| 7576 | + return DBG_STATUS_OK; |
|---|
| 7577 | + } |
|---|
| 7578 | + |
|---|
| 7771 | 7579 | feature->buf_size = buf_size_dwords * sizeof(u32); |
|---|
| 7772 | 7580 | feature->dump_buf = vmalloc(feature->buf_size); |
|---|
| 7773 | 7581 | if (!feature->dump_buf) |
|---|
| .. | .. |
|---|
| 7859 | 7667 | enum qed_nvm_images image_id) |
|---|
| 7860 | 7668 | { |
|---|
| 7861 | 7669 | struct qed_hwfn *p_hwfn = |
|---|
| 7862 | | - &cdev->hwfns[cdev->dbg_params.engine_for_debug]; |
|---|
| 7863 | | - u32 len_rounded, i; |
|---|
| 7864 | | - __be32 val; |
|---|
| 7670 | + &cdev->hwfns[cdev->engine_for_debug]; |
|---|
| 7671 | + u32 len_rounded; |
|---|
| 7865 | 7672 | int rc; |
|---|
| 7866 | 7673 | |
|---|
| 7867 | 7674 | *num_dumped_bytes = 0; |
|---|
| .. | .. |
|---|
| 7880 | 7687 | |
|---|
| 7881 | 7688 | /* QED_NVM_IMAGE_NVM_META image is not swapped like other images */ |
|---|
| 7882 | 7689 | if (image_id != QED_NVM_IMAGE_NVM_META) |
|---|
| 7883 | | - for (i = 0; i < len_rounded; i += 4) { |
|---|
| 7884 | | - val = cpu_to_be32(*(u32 *)(buffer + i)); |
|---|
| 7885 | | - *(u32 *)(buffer + i) = val; |
|---|
| 7886 | | - } |
|---|
| 7690 | + cpu_to_be32_array((__force __be32 *)buffer, |
|---|
| 7691 | + (const u32 *)buffer, |
|---|
| 7692 | + len_rounded / sizeof(u32)); |
|---|
| 7887 | 7693 | |
|---|
| 7888 | 7694 | *num_dumped_bytes = len_rounded; |
|---|
| 7889 | 7695 | |
|---|
| .. | .. |
|---|
| 7914 | 7720 | return qed_dbg_feature_size(cdev, DBG_FEATURE_FW_ASSERTS); |
|---|
| 7915 | 7721 | } |
|---|
| 7916 | 7722 | |
|---|
| 7723 | +int qed_dbg_ilt(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes) |
|---|
| 7724 | +{ |
|---|
| 7725 | + return qed_dbg_feature(cdev, buffer, DBG_FEATURE_ILT, num_dumped_bytes); |
|---|
| 7726 | +} |
|---|
| 7727 | + |
|---|
| 7728 | +int qed_dbg_ilt_size(struct qed_dev *cdev) |
|---|
| 7729 | +{ |
|---|
| 7730 | + return qed_dbg_feature_size(cdev, DBG_FEATURE_ILT); |
|---|
| 7731 | +} |
|---|
| 7732 | + |
|---|
| 7917 | 7733 | int qed_dbg_mcp_trace(struct qed_dev *cdev, void *buffer, |
|---|
| 7918 | 7734 | u32 *num_dumped_bytes) |
|---|
| 7919 | 7735 | { |
|---|
| .. | .. |
|---|
| 7930 | 7746 | * feature buffer. |
|---|
| 7931 | 7747 | */ |
|---|
| 7932 | 7748 | #define REGDUMP_HEADER_SIZE sizeof(u32) |
|---|
| 7749 | +#define REGDUMP_HEADER_SIZE_SHIFT 0 |
|---|
| 7750 | +#define REGDUMP_HEADER_SIZE_MASK 0xffffff |
|---|
| 7933 | 7751 | #define REGDUMP_HEADER_FEATURE_SHIFT 24 |
|---|
| 7934 | | -#define REGDUMP_HEADER_ENGINE_SHIFT 31 |
|---|
| 7752 | +#define REGDUMP_HEADER_FEATURE_MASK 0x1f |
|---|
| 7753 | +#define REGDUMP_HEADER_BIN_DUMP_SHIFT 29 |
|---|
| 7754 | +#define REGDUMP_HEADER_BIN_DUMP_MASK 0x1 |
|---|
| 7935 | 7755 | #define REGDUMP_HEADER_OMIT_ENGINE_SHIFT 30 |
|---|
| 7756 | +#define REGDUMP_HEADER_OMIT_ENGINE_MASK 0x1 |
|---|
| 7757 | +#define REGDUMP_HEADER_ENGINE_SHIFT 31 |
|---|
| 7758 | +#define REGDUMP_HEADER_ENGINE_MASK 0x1 |
|---|
| 7759 | +#define REGDUMP_MAX_SIZE 0x1000000 |
|---|
| 7760 | +#define ILT_DUMP_MAX_SIZE (1024 * 1024 * 15) |
|---|
| 7761 | + |
|---|
| 7936 | 7762 | enum debug_print_features { |
|---|
| 7937 | 7763 | OLD_MODE = 0, |
|---|
| 7938 | 7764 | IDLE_CHK = 1, |
|---|
| .. | .. |
|---|
| 7946 | 7772 | NVM_CFG1 = 9, |
|---|
| 7947 | 7773 | DEFAULT_CFG = 10, |
|---|
| 7948 | 7774 | NVM_META = 11, |
|---|
| 7775 | + MDUMP = 12, |
|---|
| 7776 | + ILT_DUMP = 13, |
|---|
| 7949 | 7777 | }; |
|---|
| 7950 | 7778 | |
|---|
| 7951 | | -static u32 qed_calc_regdump_header(enum debug_print_features feature, |
|---|
| 7779 | +static u32 qed_calc_regdump_header(struct qed_dev *cdev, |
|---|
| 7780 | + enum debug_print_features feature, |
|---|
| 7952 | 7781 | int engine, u32 feature_size, u8 omit_engine) |
|---|
| 7953 | 7782 | { |
|---|
| 7954 | | - /* Insert the engine, feature and mode inside the header and combine it |
|---|
| 7955 | | - * with feature size. |
|---|
| 7956 | | - */ |
|---|
| 7957 | | - return feature_size | (feature << REGDUMP_HEADER_FEATURE_SHIFT) | |
|---|
| 7958 | | - (omit_engine << REGDUMP_HEADER_OMIT_ENGINE_SHIFT) | |
|---|
| 7959 | | - (engine << REGDUMP_HEADER_ENGINE_SHIFT); |
|---|
| 7783 | + u32 res = 0; |
|---|
| 7784 | + |
|---|
| 7785 | + SET_FIELD(res, REGDUMP_HEADER_SIZE, feature_size); |
|---|
| 7786 | + if (res != feature_size) |
|---|
| 7787 | + DP_NOTICE(cdev, |
|---|
| 7788 | + "Feature %d is too large (size 0x%x) and will corrupt the dump\n", |
|---|
| 7789 | + feature, feature_size); |
|---|
| 7790 | + |
|---|
| 7791 | + SET_FIELD(res, REGDUMP_HEADER_FEATURE, feature); |
|---|
| 7792 | + SET_FIELD(res, REGDUMP_HEADER_BIN_DUMP, 1); |
|---|
| 7793 | + SET_FIELD(res, REGDUMP_HEADER_OMIT_ENGINE, omit_engine); |
|---|
| 7794 | + SET_FIELD(res, REGDUMP_HEADER_ENGINE, engine); |
|---|
| 7795 | + |
|---|
| 7796 | + return res; |
|---|
| 7960 | 7797 | } |
|---|
| 7961 | 7798 | |
|---|
| 7962 | 7799 | int qed_dbg_all_data(struct qed_dev *cdev, void *buffer) |
|---|
| 7963 | 7800 | { |
|---|
| 7964 | 7801 | u8 cur_engine, omit_engine = 0, org_engine; |
|---|
| 7802 | + struct qed_hwfn *p_hwfn = |
|---|
| 7803 | + &cdev->hwfns[cdev->engine_for_debug]; |
|---|
| 7804 | + struct dbg_tools_data *dev_data = &p_hwfn->dbg_info; |
|---|
| 7805 | + int grc_params[MAX_DBG_GRC_PARAMS], i; |
|---|
| 7965 | 7806 | u32 offset = 0, feature_size; |
|---|
| 7966 | 7807 | int rc; |
|---|
| 7967 | 7808 | |
|---|
| 7968 | | - if (cdev->num_hwfns == 1) |
|---|
| 7809 | + for (i = 0; i < MAX_DBG_GRC_PARAMS; i++) |
|---|
| 7810 | + grc_params[i] = dev_data->grc.param_val[i]; |
|---|
| 7811 | + |
|---|
| 7812 | + if (!QED_IS_CMT(cdev)) |
|---|
| 7969 | 7813 | omit_engine = 1; |
|---|
| 7814 | + |
|---|
| 7815 | + mutex_lock(&qed_dbg_lock); |
|---|
| 7816 | + cdev->dbg_bin_dump = true; |
|---|
| 7970 | 7817 | |
|---|
| 7971 | 7818 | org_engine = qed_get_debug_engine(cdev); |
|---|
| 7972 | 7819 | for (cur_engine = 0; cur_engine < cdev->num_hwfns; cur_engine++) { |
|---|
| .. | .. |
|---|
| 7980 | 7827 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 7981 | 7828 | if (!rc) { |
|---|
| 7982 | 7829 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 7983 | | - qed_calc_regdump_header(IDLE_CHK, cur_engine, |
|---|
| 7830 | + qed_calc_regdump_header(cdev, IDLE_CHK, cur_engine, |
|---|
| 7984 | 7831 | feature_size, omit_engine); |
|---|
| 7985 | 7832 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 7986 | 7833 | } else { |
|---|
| .. | .. |
|---|
| 7992 | 7839 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 7993 | 7840 | if (!rc) { |
|---|
| 7994 | 7841 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 7995 | | - qed_calc_regdump_header(IDLE_CHK, cur_engine, |
|---|
| 7842 | + qed_calc_regdump_header(cdev, IDLE_CHK, cur_engine, |
|---|
| 7996 | 7843 | feature_size, omit_engine); |
|---|
| 7997 | 7844 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 7998 | 7845 | } else { |
|---|
| .. | .. |
|---|
| 8004 | 7851 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 8005 | 7852 | if (!rc) { |
|---|
| 8006 | 7853 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8007 | | - qed_calc_regdump_header(REG_FIFO, cur_engine, |
|---|
| 7854 | + qed_calc_regdump_header(cdev, REG_FIFO, cur_engine, |
|---|
| 8008 | 7855 | feature_size, omit_engine); |
|---|
| 8009 | 7856 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8010 | 7857 | } else { |
|---|
| .. | .. |
|---|
| 8016 | 7863 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 8017 | 7864 | if (!rc) { |
|---|
| 8018 | 7865 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8019 | | - qed_calc_regdump_header(IGU_FIFO, cur_engine, |
|---|
| 7866 | + qed_calc_regdump_header(cdev, IGU_FIFO, cur_engine, |
|---|
| 8020 | 7867 | feature_size, omit_engine); |
|---|
| 8021 | 7868 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8022 | 7869 | } else { |
|---|
| .. | .. |
|---|
| 8029 | 7876 | &feature_size); |
|---|
| 8030 | 7877 | if (!rc) { |
|---|
| 8031 | 7878 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8032 | | - qed_calc_regdump_header(PROTECTION_OVERRIDE, |
|---|
| 7879 | + qed_calc_regdump_header(cdev, PROTECTION_OVERRIDE, |
|---|
| 8033 | 7880 | cur_engine, |
|---|
| 8034 | 7881 | feature_size, omit_engine); |
|---|
| 8035 | 7882 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| .. | .. |
|---|
| 8044 | 7891 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 8045 | 7892 | if (!rc) { |
|---|
| 8046 | 7893 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8047 | | - qed_calc_regdump_header(FW_ASSERTS, cur_engine, |
|---|
| 8048 | | - feature_size, omit_engine); |
|---|
| 7894 | + qed_calc_regdump_header(cdev, FW_ASSERTS, |
|---|
| 7895 | + cur_engine, feature_size, |
|---|
| 7896 | + omit_engine); |
|---|
| 8049 | 7897 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8050 | 7898 | } else { |
|---|
| 8051 | 7899 | DP_ERR(cdev, "qed_dbg_fw_asserts failed. rc = %d\n", |
|---|
| 8052 | 7900 | rc); |
|---|
| 8053 | 7901 | } |
|---|
| 8054 | 7902 | |
|---|
| 7903 | + feature_size = qed_dbg_ilt_size(cdev); |
|---|
| 7904 | + if (!cdev->disable_ilt_dump && |
|---|
| 7905 | + feature_size < ILT_DUMP_MAX_SIZE) { |
|---|
| 7906 | + rc = qed_dbg_ilt(cdev, (u8 *)buffer + offset + |
|---|
| 7907 | + REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 7908 | + if (!rc) { |
|---|
| 7909 | + *(u32 *)((u8 *)buffer + offset) = |
|---|
| 7910 | + qed_calc_regdump_header(cdev, ILT_DUMP, |
|---|
| 7911 | + cur_engine, |
|---|
| 7912 | + feature_size, |
|---|
| 7913 | + omit_engine); |
|---|
| 7914 | + offset += feature_size + REGDUMP_HEADER_SIZE; |
|---|
| 7915 | + } else { |
|---|
| 7916 | + DP_ERR(cdev, "qed_dbg_ilt failed. rc = %d\n", |
|---|
| 7917 | + rc); |
|---|
| 7918 | + } |
|---|
| 7919 | + } |
|---|
| 7920 | + |
|---|
| 8055 | 7921 | /* GRC dump - must be last because when mcp stuck it will |
|---|
| 8056 | 7922 | * clutter idle_chk, reg_fifo, ... |
|---|
| 8057 | 7923 | */ |
|---|
| 7924 | + for (i = 0; i < MAX_DBG_GRC_PARAMS; i++) |
|---|
| 7925 | + dev_data->grc.param_val[i] = grc_params[i]; |
|---|
| 7926 | + |
|---|
| 8058 | 7927 | rc = qed_dbg_grc(cdev, (u8 *)buffer + offset + |
|---|
| 8059 | 7928 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 8060 | 7929 | if (!rc) { |
|---|
| 8061 | 7930 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8062 | | - qed_calc_regdump_header(GRC_DUMP, cur_engine, |
|---|
| 7931 | + qed_calc_regdump_header(cdev, GRC_DUMP, |
|---|
| 7932 | + cur_engine, |
|---|
| 8063 | 7933 | feature_size, omit_engine); |
|---|
| 8064 | 7934 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8065 | 7935 | } else { |
|---|
| .. | .. |
|---|
| 8068 | 7938 | } |
|---|
| 8069 | 7939 | |
|---|
| 8070 | 7940 | qed_set_debug_engine(cdev, org_engine); |
|---|
| 7941 | + |
|---|
| 8071 | 7942 | /* mcp_trace */ |
|---|
| 8072 | 7943 | rc = qed_dbg_mcp_trace(cdev, (u8 *)buffer + offset + |
|---|
| 8073 | 7944 | REGDUMP_HEADER_SIZE, &feature_size); |
|---|
| 8074 | 7945 | if (!rc) { |
|---|
| 8075 | 7946 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8076 | | - qed_calc_regdump_header(MCP_TRACE, cur_engine, |
|---|
| 7947 | + qed_calc_regdump_header(cdev, MCP_TRACE, cur_engine, |
|---|
| 8077 | 7948 | feature_size, omit_engine); |
|---|
| 8078 | 7949 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8079 | 7950 | } else { |
|---|
| 8080 | 7951 | DP_ERR(cdev, "qed_dbg_mcp_trace failed. rc = %d\n", rc); |
|---|
| 8081 | 7952 | } |
|---|
| 8082 | 7953 | |
|---|
| 7954 | + /* Re-populate nvm attribute info */ |
|---|
| 7955 | + qed_mcp_nvm_info_free(p_hwfn); |
|---|
| 7956 | + qed_mcp_nvm_info_populate(p_hwfn); |
|---|
| 7957 | + |
|---|
| 8083 | 7958 | /* nvm cfg1 */ |
|---|
| 8084 | 7959 | rc = qed_dbg_nvm_image(cdev, |
|---|
| 8085 | | - (u8 *)buffer + offset + REGDUMP_HEADER_SIZE, |
|---|
| 8086 | | - &feature_size, QED_NVM_IMAGE_NVM_CFG1); |
|---|
| 7960 | + (u8 *)buffer + offset + |
|---|
| 7961 | + REGDUMP_HEADER_SIZE, &feature_size, |
|---|
| 7962 | + QED_NVM_IMAGE_NVM_CFG1); |
|---|
| 8087 | 7963 | if (!rc) { |
|---|
| 8088 | 7964 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8089 | | - qed_calc_regdump_header(NVM_CFG1, cur_engine, |
|---|
| 7965 | + qed_calc_regdump_header(cdev, NVM_CFG1, cur_engine, |
|---|
| 8090 | 7966 | feature_size, omit_engine); |
|---|
| 8091 | 7967 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8092 | 7968 | } else if (rc != -ENOENT) { |
|---|
| .. | .. |
|---|
| 8101 | 7977 | &feature_size, QED_NVM_IMAGE_DEFAULT_CFG); |
|---|
| 8102 | 7978 | if (!rc) { |
|---|
| 8103 | 7979 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8104 | | - qed_calc_regdump_header(DEFAULT_CFG, cur_engine, |
|---|
| 7980 | + qed_calc_regdump_header(cdev, DEFAULT_CFG, cur_engine, |
|---|
| 8105 | 7981 | feature_size, omit_engine); |
|---|
| 8106 | 7982 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8107 | 7983 | } else if (rc != -ENOENT) { |
|---|
| .. | .. |
|---|
| 8117 | 7993 | &feature_size, QED_NVM_IMAGE_NVM_META); |
|---|
| 8118 | 7994 | if (!rc) { |
|---|
| 8119 | 7995 | *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8120 | | - qed_calc_regdump_header(NVM_META, cur_engine, |
|---|
| 8121 | | - feature_size, omit_engine); |
|---|
| 7996 | + qed_calc_regdump_header(cdev, NVM_META, cur_engine, |
|---|
| 7997 | + feature_size, omit_engine); |
|---|
| 8122 | 7998 | offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8123 | 7999 | } else if (rc != -ENOENT) { |
|---|
| 8124 | 8000 | DP_ERR(cdev, |
|---|
| .. | .. |
|---|
| 8126 | 8002 | QED_NVM_IMAGE_NVM_META, "QED_NVM_IMAGE_NVM_META", rc); |
|---|
| 8127 | 8003 | } |
|---|
| 8128 | 8004 | |
|---|
| 8005 | + /* nvm mdump */ |
|---|
| 8006 | + rc = qed_dbg_nvm_image(cdev, (u8 *)buffer + offset + |
|---|
| 8007 | + REGDUMP_HEADER_SIZE, &feature_size, |
|---|
| 8008 | + QED_NVM_IMAGE_MDUMP); |
|---|
| 8009 | + if (!rc) { |
|---|
| 8010 | + *(u32 *)((u8 *)buffer + offset) = |
|---|
| 8011 | + qed_calc_regdump_header(cdev, MDUMP, cur_engine, |
|---|
| 8012 | + feature_size, omit_engine); |
|---|
| 8013 | + offset += (feature_size + REGDUMP_HEADER_SIZE); |
|---|
| 8014 | + } else if (rc != -ENOENT) { |
|---|
| 8015 | + DP_ERR(cdev, |
|---|
| 8016 | + "qed_dbg_nvm_image failed for image %d (%s), rc = %d\n", |
|---|
| 8017 | + QED_NVM_IMAGE_MDUMP, "QED_NVM_IMAGE_MDUMP", rc); |
|---|
| 8018 | + } |
|---|
| 8019 | + |
|---|
| 8020 | + cdev->dbg_bin_dump = false; |
|---|
| 8021 | + mutex_unlock(&qed_dbg_lock); |
|---|
| 8022 | + |
|---|
| 8129 | 8023 | return 0; |
|---|
| 8130 | 8024 | } |
|---|
| 8131 | 8025 | |
|---|
| 8132 | 8026 | int qed_dbg_all_data_size(struct qed_dev *cdev) |
|---|
| 8133 | 8027 | { |
|---|
| 8134 | 8028 | struct qed_hwfn *p_hwfn = |
|---|
| 8135 | | - &cdev->hwfns[cdev->dbg_params.engine_for_debug]; |
|---|
| 8136 | | - u32 regs_len = 0, image_len = 0; |
|---|
| 8029 | + &cdev->hwfns[cdev->engine_for_debug]; |
|---|
| 8030 | + u32 regs_len = 0, image_len = 0, ilt_len = 0, total_ilt_len = 0; |
|---|
| 8137 | 8031 | u8 cur_engine, org_engine; |
|---|
| 8138 | 8032 | |
|---|
| 8033 | + cdev->disable_ilt_dump = false; |
|---|
| 8139 | 8034 | org_engine = qed_get_debug_engine(cdev); |
|---|
| 8140 | 8035 | for (cur_engine = 0; cur_engine < cdev->num_hwfns; cur_engine++) { |
|---|
| 8141 | 8036 | /* Engine specific */ |
|---|
| .. | .. |
|---|
| 8150 | 8045 | REGDUMP_HEADER_SIZE + |
|---|
| 8151 | 8046 | qed_dbg_protection_override_size(cdev) + |
|---|
| 8152 | 8047 | REGDUMP_HEADER_SIZE + qed_dbg_fw_asserts_size(cdev); |
|---|
| 8048 | + |
|---|
| 8049 | + ilt_len = REGDUMP_HEADER_SIZE + qed_dbg_ilt_size(cdev); |
|---|
| 8050 | + if (ilt_len < ILT_DUMP_MAX_SIZE) { |
|---|
| 8051 | + total_ilt_len += ilt_len; |
|---|
| 8052 | + regs_len += ilt_len; |
|---|
| 8053 | + } |
|---|
| 8153 | 8054 | } |
|---|
| 8154 | 8055 | |
|---|
| 8155 | 8056 | qed_set_debug_engine(cdev, org_engine); |
|---|
| .. | .. |
|---|
| 8165 | 8066 | qed_dbg_nvm_image_length(p_hwfn, QED_NVM_IMAGE_NVM_META, &image_len); |
|---|
| 8166 | 8067 | if (image_len) |
|---|
| 8167 | 8068 | regs_len += REGDUMP_HEADER_SIZE + image_len; |
|---|
| 8069 | + qed_dbg_nvm_image_length(p_hwfn, QED_NVM_IMAGE_MDUMP, &image_len); |
|---|
| 8070 | + if (image_len) |
|---|
| 8071 | + regs_len += REGDUMP_HEADER_SIZE + image_len; |
|---|
| 8072 | + |
|---|
| 8073 | + if (regs_len > REGDUMP_MAX_SIZE) { |
|---|
| 8074 | + DP_VERBOSE(cdev, QED_MSG_DEBUG, |
|---|
| 8075 | + "Dump exceeds max size 0x%x, disable ILT dump\n", |
|---|
| 8076 | + REGDUMP_MAX_SIZE); |
|---|
| 8077 | + cdev->disable_ilt_dump = true; |
|---|
| 8078 | + regs_len -= total_ilt_len; |
|---|
| 8079 | + } |
|---|
| 8168 | 8080 | |
|---|
| 8169 | 8081 | return regs_len; |
|---|
| 8170 | 8082 | } |
|---|
| .. | .. |
|---|
| 8173 | 8085 | enum qed_dbg_features feature, u32 *num_dumped_bytes) |
|---|
| 8174 | 8086 | { |
|---|
| 8175 | 8087 | struct qed_hwfn *p_hwfn = |
|---|
| 8176 | | - &cdev->hwfns[cdev->dbg_params.engine_for_debug]; |
|---|
| 8088 | + &cdev->hwfns[cdev->engine_for_debug]; |
|---|
| 8177 | 8089 | struct qed_dbg_feature *qed_feature = |
|---|
| 8178 | | - &cdev->dbg_params.features[feature]; |
|---|
| 8090 | + &cdev->dbg_features[feature]; |
|---|
| 8179 | 8091 | enum dbg_status dbg_rc; |
|---|
| 8180 | 8092 | struct qed_ptt *p_ptt; |
|---|
| 8181 | 8093 | int rc = 0; |
|---|
| .. | .. |
|---|
| 8198 | 8110 | DP_VERBOSE(cdev, QED_MSG_DEBUG, |
|---|
| 8199 | 8111 | "copying debugfs feature to external buffer\n"); |
|---|
| 8200 | 8112 | memcpy(buffer, qed_feature->dump_buf, qed_feature->buf_size); |
|---|
| 8201 | | - *num_dumped_bytes = cdev->dbg_params.features[feature].dumped_dwords * |
|---|
| 8113 | + *num_dumped_bytes = cdev->dbg_features[feature].dumped_dwords * |
|---|
| 8202 | 8114 | 4; |
|---|
| 8203 | 8115 | |
|---|
| 8204 | 8116 | out: |
|---|
| .. | .. |
|---|
| 8209 | 8121 | int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature) |
|---|
| 8210 | 8122 | { |
|---|
| 8211 | 8123 | struct qed_hwfn *p_hwfn = |
|---|
| 8212 | | - &cdev->hwfns[cdev->dbg_params.engine_for_debug]; |
|---|
| 8124 | + &cdev->hwfns[cdev->engine_for_debug]; |
|---|
| 8125 | + struct qed_dbg_feature *qed_feature = &cdev->dbg_features[feature]; |
|---|
| 8213 | 8126 | struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn); |
|---|
| 8214 | | - struct qed_dbg_feature *qed_feature = |
|---|
| 8215 | | - &cdev->dbg_params.features[feature]; |
|---|
| 8216 | 8127 | u32 buf_size_dwords; |
|---|
| 8217 | 8128 | enum dbg_status rc; |
|---|
| 8218 | 8129 | |
|---|
| .. | .. |
|---|
| 8224 | 8135 | if (rc != DBG_STATUS_OK) |
|---|
| 8225 | 8136 | buf_size_dwords = 0; |
|---|
| 8226 | 8137 | |
|---|
| 8138 | + /* Feature will not be dumped if it exceeds maximum size */ |
|---|
| 8139 | + if (buf_size_dwords > MAX_DBG_FEATURE_SIZE_DWORDS) |
|---|
| 8140 | + buf_size_dwords = 0; |
|---|
| 8141 | + |
|---|
| 8227 | 8142 | qed_ptt_release(p_hwfn, p_ptt); |
|---|
| 8228 | 8143 | qed_feature->buf_size = buf_size_dwords * sizeof(u32); |
|---|
| 8229 | 8144 | return qed_feature->buf_size; |
|---|
| .. | .. |
|---|
| 8231 | 8146 | |
|---|
| 8232 | 8147 | u8 qed_get_debug_engine(struct qed_dev *cdev) |
|---|
| 8233 | 8148 | { |
|---|
| 8234 | | - return cdev->dbg_params.engine_for_debug; |
|---|
| 8149 | + return cdev->engine_for_debug; |
|---|
| 8235 | 8150 | } |
|---|
| 8236 | 8151 | |
|---|
| 8237 | 8152 | void qed_set_debug_engine(struct qed_dev *cdev, int engine_number) |
|---|
| 8238 | 8153 | { |
|---|
| 8239 | 8154 | DP_VERBOSE(cdev, QED_MSG_DEBUG, "set debug engine to %d\n", |
|---|
| 8240 | 8155 | engine_number); |
|---|
| 8241 | | - cdev->dbg_params.engine_for_debug = engine_number; |
|---|
| 8156 | + cdev->engine_for_debug = engine_number; |
|---|
| 8242 | 8157 | } |
|---|
| 8243 | 8158 | |
|---|
| 8244 | 8159 | void qed_dbg_pf_init(struct qed_dev *cdev) |
|---|
| 8245 | 8160 | { |
|---|
| 8246 | | - const u8 *dbg_values; |
|---|
| 8161 | + const u8 *dbg_values = NULL; |
|---|
| 8162 | + int i; |
|---|
| 8247 | 8163 | |
|---|
| 8248 | 8164 | /* Debug values are after init values. |
|---|
| 8249 | 8165 | * The offset is the first dword of the file. |
|---|
| 8250 | 8166 | */ |
|---|
| 8251 | 8167 | dbg_values = cdev->firmware->data + *(u32 *)cdev->firmware->data; |
|---|
| 8252 | | - qed_dbg_set_bin_ptr((u8 *)dbg_values); |
|---|
| 8253 | | - qed_dbg_user_set_bin_ptr((u8 *)dbg_values); |
|---|
| 8168 | + |
|---|
| 8169 | + for_each_hwfn(cdev, i) { |
|---|
| 8170 | + qed_dbg_set_bin_ptr(&cdev->hwfns[i], dbg_values); |
|---|
| 8171 | + qed_dbg_user_set_bin_ptr(&cdev->hwfns[i], dbg_values); |
|---|
| 8172 | + } |
|---|
| 8173 | + |
|---|
| 8174 | + /* Set the hwfn to be 0 as default */ |
|---|
| 8175 | + cdev->engine_for_debug = 0; |
|---|
| 8254 | 8176 | } |
|---|
| 8255 | 8177 | |
|---|
| 8256 | 8178 | void qed_dbg_pf_exit(struct qed_dev *cdev) |
|---|
| .. | .. |
|---|
| 8258 | 8180 | struct qed_dbg_feature *feature = NULL; |
|---|
| 8259 | 8181 | enum qed_dbg_features feature_idx; |
|---|
| 8260 | 8182 | |
|---|
| 8261 | | - /* Debug features' buffers may be allocated if debug feature was used |
|---|
| 8262 | | - * but dump wasn't called. |
|---|
| 8183 | + /* debug features' buffers may be allocated if debug feature was used |
|---|
| 8184 | + * but dump wasn't called |
|---|
| 8263 | 8185 | */ |
|---|
| 8264 | 8186 | for (feature_idx = 0; feature_idx < DBG_FEATURE_NUM; feature_idx++) { |
|---|
| 8265 | | - feature = &cdev->dbg_params.features[feature_idx]; |
|---|
| 8187 | + feature = &cdev->dbg_features[feature_idx]; |
|---|
| 8266 | 8188 | if (feature->dump_buf) { |
|---|
| 8267 | 8189 | vfree(feature->dump_buf); |
|---|
| 8268 | 8190 | feature->dump_buf = NULL; |
|---|