#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/crc32.h>
#include "qed.h"
#include "qed_cxt.h"
#include "qed_hsi.h"
#include "qed_dbg_hsi.h"
#include "qed_hw.h"
#include "qed_mcp.h"
#include "qed_reg_addr.h"
enum mem_groups { … };
static const char * const s_mem_group_names[] = …;
static u32 cond5(const u32 *r, const u32 *imm)
{ … }
static u32 cond7(const u32 *r, const u32 *imm)
{ … }
static u32 cond6(const u32 *r, const u32 *imm)
{ … }
static u32 cond9(const u32 *r, const u32 *imm)
{ … }
static u32 cond10(const u32 *r, const u32 *imm)
{ … }
static u32 cond4(const u32 *r, const u32 *imm)
{ … }
static u32 cond0(const u32 *r, const u32 *imm)
{ … }
static u32 cond14(const u32 *r, const u32 *imm)
{ … }
static u32 cond1(const u32 *r, const u32 *imm)
{ … }
static u32 cond11(const u32 *r, const u32 *imm)
{ … }
static u32 cond12(const u32 *r, const u32 *imm)
{ … }
static u32 cond3(const u32 *r, const u32 *imm)
{ … }
static u32 cond13(const u32 *r, const u32 *imm)
{ … }
static u32 cond8(const u32 *r, const u32 *imm)
{ … }
static u32 cond2(const u32 *r, const u32 *imm)
{ … }
static u32(*cond_arr[]) (const u32 *r, const u32 *imm) = …;
#define NUM_PHYS_BLOCKS …
#define NUM_DBG_RESET_REGS …
enum hw_types { … };
enum cm_ctx_types { … };
enum dbg_bus_frame_modes { … };
enum dbg_bus_semi_frame_modes { … };
enum dbg_bus_filter_types { … };
enum dbg_bus_pre_trigger_types { … };
enum dbg_bus_post_trigger_types { … };
enum dbg_bus_other_engine_modes { … };
struct framing_mode_defs { … };
struct chip_defs { … };
struct hw_type_defs { … };
struct rbc_reset_defs { … };
struct storm_defs { … };
struct dbg_bus_constraint_op_defs { … };
struct storm_mode_defs { … };
struct grc_param_defs { … };
struct rss_mem_defs { … };
struct vfc_ram_defs { … };
struct big_ram_defs { … };
struct phy_defs { … };
struct split_type_defs { … };
#define BYTES_IN_DWORD …
#define CEIL_DWORDS(size) …
#define FIELD_BIT_OFFSET(type, field) …
#define FIELD_BIT_SIZE(type, field) …
#define FIELD_DWORD_OFFSET(type, field) …
#define FIELD_DWORD_SHIFT(type, field) …
#define FIELD_BIT_MASK(type, field) …
#define SET_VAR_FIELD(var, type, field, val) …
#define ARR_REG_WR(dev, ptt, addr, arr, arr_size) …
#define DWORDS_TO_BYTES(dwords) …
#define BYTES_TO_DWORDS(bytes) …
#define NUM_EXTRA_DBG_LINES(block) …
#define NUM_DBG_LINES(block) …
#define USE_DMAE …
#define PROTECT_WIDE_BUS …
#define RAM_LINES_TO_DWORDS(lines) …
#define RAM_LINES_TO_BYTES(lines) …
#define REG_DUMP_LEN_SHIFT …
#define MEM_DUMP_ENTRY_SIZE_DWORDS …
#define IDLE_CHK_RULE_SIZE_DWORDS …
#define IDLE_CHK_RESULT_HDR_DWORDS …
#define IDLE_CHK_RESULT_REG_HDR_DWORDS …
#define PAGE_MEM_DESC_SIZE_DWORDS …
#define IDLE_CHK_MAX_ENTRIES_SIZE …
#define VFC_CAM_CMD_STRUCT_SIZE …
#define VFC_CAM_CMD_ROW_OFFSET …
#define VFC_CAM_CMD_ROW_SIZE …
#define VFC_CAM_ADDR_STRUCT_SIZE …
#define VFC_CAM_ADDR_OP_OFFSET …
#define VFC_CAM_ADDR_OP_SIZE …
#define VFC_CAM_RESP_STRUCT_SIZE …
#define VFC_RAM_ADDR_STRUCT_SIZE …
#define VFC_RAM_ADDR_OP_OFFSET …
#define VFC_RAM_ADDR_OP_SIZE …
#define VFC_RAM_ADDR_ROW_OFFSET …
#define VFC_RAM_ADDR_ROW_SIZE …
#define VFC_RAM_RESP_STRUCT_SIZE …
#define VFC_CAM_CMD_DWORDS …
#define VFC_CAM_ADDR_DWORDS …
#define VFC_CAM_RESP_DWORDS …
#define VFC_RAM_CMD_DWORDS …
#define VFC_RAM_ADDR_DWORDS …
#define VFC_RAM_RESP_DWORDS …
#define NUM_VFC_RAM_TYPES …
#define VFC_CAM_NUM_ROWS …
#define VFC_OPCODE_CAM_RD …
#define VFC_OPCODE_RAM_RD …
#define NUM_RSS_MEM_TYPES …
#define NUM_BIG_RAM_TYPES …
#define BIG_RAM_NAME_LEN …
#define NUM_PHY_TBUS_ADDRESSES …
#define PHY_DUMP_SIZE_DWORDS …
#define RESET_REG_UNRESET_OFFSET …
#define STALL_DELAY_MS …
#define STATIC_DEBUG_LINE_DWORDS …
#define NUM_COMMON_GLOBAL_PARAMS …
#define MAX_RECURSION_DEPTH …
#define FW_IMG_KUKU …
#define FW_IMG_MAIN …
#define FW_IMG_L2B …
#define REG_FIFO_ELEMENT_DWORDS …
#define REG_FIFO_DEPTH_ELEMENTS …
#define REG_FIFO_DEPTH_DWORDS …
#define IGU_FIFO_ELEMENT_DWORDS …
#define IGU_FIFO_DEPTH_ELEMENTS …
#define IGU_FIFO_DEPTH_DWORDS …
#define PROTECTION_OVERRIDE_ELEMENT_DWORDS …
#define PROTECTION_OVERRIDE_DEPTH_ELEMENTS …
#define PROTECTION_OVERRIDE_DEPTH_DWORDS …
#define MCP_SPAD_TRACE_OFFSIZE_ADDR …
#define MAX_SW_PLTAFORM_STR_SIZE …
#define EMPTY_FW_VERSION_STR …
#define EMPTY_FW_IMAGE_STR …
static struct framing_mode_defs s_framing_mode_defs[4] = …;
static struct chip_defs s_chip_defs[MAX_CHIP_IDS] = …;
static struct storm_defs s_storm_defs[] = …;
static struct hw_type_defs s_hw_type_defs[] = …;
static struct grc_param_defs s_grc_param_defs[] = …;
static struct rss_mem_defs s_rss_mem_defs[] = …;
static struct vfc_ram_defs s_vfc_ram_defs[] = …;
static struct big_ram_defs s_big_ram_defs[] = …;
static struct rbc_reset_defs s_rbc_reset_defs[] = …;
static struct phy_defs s_phy_defs[] = …;
static struct split_type_defs s_split_type_defs[] = …;
static u32 s_app_ver;
static void qed_static_asserts(void)
{ … }
static u32 qed_read_unaligned_dword(u8 *buf)
{ … }
static void qed_grc_set_param(struct qed_hwfn *p_hwfn,
enum dbg_grc_params grc_param, u32 val)
{ … }
static u32 qed_grc_get_param(struct qed_hwfn *p_hwfn,
enum dbg_grc_params grc_param)
{ … }
static void qed_dbg_grc_init_params(struct qed_hwfn *p_hwfn)
{ … }
static void qed_set_dbg_bin_buf(struct qed_hwfn *p_hwfn,
enum bin_dbg_buffer_type buf_type,
const u32 *ptr, u32 size)
{ … }
static enum dbg_status qed_dbg_dev_init(struct qed_hwfn *p_hwfn)
{ … }
static const struct dbg_block *get_dbg_block(struct qed_hwfn *p_hwfn,
enum block_id block_id)
{ … }
static const struct dbg_block_chip *qed_get_dbg_block_per_chip(struct qed_hwfn
*p_hwfn,
enum block_id
block_id)
{ … }
static const struct dbg_reset_reg *qed_get_dbg_reset_reg(struct qed_hwfn
*p_hwfn,
u8 reset_reg_id)
{ … }
static void qed_read_storm_fw_info(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u8 storm_id, struct fw_info *fw_info)
{ … }
static u32 qed_dump_str(char *dump_buf, bool dump, const char *str)
{ … }
static u32 qed_dump_align(char *dump_buf, bool dump, u32 byte_offset)
{ … }
static u32 qed_dump_str_param(u32 *dump_buf,
bool dump,
const char *param_name, const char *param_val)
{ … }
static u32 qed_dump_num_param(u32 *dump_buf,
bool dump, const char *param_name, u32 param_val)
{ … }
static u32 qed_dump_fw_ver_param(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_dump_mfw_ver_param(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_dump_chip_revision_param(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_dump_section_hdr(u32 *dump_buf,
bool dump, const char *name, u32 num_params)
{ … }
static u32 qed_dump_common_global_params(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
u8 num_specific_global_params)
{ … }
static u32 qed_dump_last_section(u32 *dump_buf, u32 offset, bool dump)
{ … }
static void qed_update_blocks_reset_state(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{ … }
static bool qed_is_mode_match_rec(struct qed_hwfn *p_hwfn,
u16 *modes_buf_offset, u8 rec_depth)
{ … }
static bool qed_is_mode_match(struct qed_hwfn *p_hwfn, u16 *modes_buf_offset)
{ … }
static void qed_bus_enable_dbg_block(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, bool enable)
{ … }
static void qed_bus_reset_dbg_block(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{ … }
static void qed_bus_enable_clients(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 client_mask)
{ … }
static void qed_bus_config_dbg_line(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
enum block_id block_id,
u8 line_id,
u8 enable_mask,
u8 right_shift,
u8 force_valid_mask, u8 force_frame_mask)
{ … }
static void qed_bus_disable_blocks(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{ … }
static bool qed_grc_is_included(struct qed_hwfn *p_hwfn,
enum dbg_grc_params grc_param)
{ … }
static enum dbg_storms qed_get_id_from_letter(char storm_letter)
{ … }
static bool qed_grc_is_storm_included(struct qed_hwfn *p_hwfn,
enum dbg_storms storm)
{ … }
static bool qed_grc_is_mem_included(struct qed_hwfn *p_hwfn,
enum block_id block_id, u8 mem_group_id)
{ … }
static void qed_grc_stall_storms(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, bool stall)
{ … }
static void qed_grc_unreset_blocks(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, bool rbc_only)
{ … }
static const struct dbg_attn_block_type_data *
qed_get_block_attn_data(struct qed_hwfn *p_hwfn,
enum block_id block_id, enum dbg_attn_type attn_type)
{ … }
static const struct dbg_attn_reg *
qed_get_block_attn_regs(struct qed_hwfn *p_hwfn,
enum block_id block_id, enum dbg_attn_type attn_type,
u8 *num_attn_regs)
{ … }
static void qed_grc_clear_all_prty(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{ … }
static enum dbg_status qed_find_nvram_image(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 image_type,
u32 *nvram_offset_bytes,
u32 *nvram_size_bytes,
bool b_can_sleep)
{ … }
static enum dbg_status qed_nvram_read(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 nvram_offset_bytes,
u32 nvram_size_bytes,
u32 *ret_buf,
bool b_can_sleep)
{ … }
static u32 qed_grc_dump_regs_hdr(u32 *dump_buf,
bool dump,
u32 num_reg_entries,
enum init_split_types split_type,
u8 split_id, const char *reg_type_name)
{ … }
void qed_read_regs(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *buf, u32 addr, u32 len)
{ … }
static u32 qed_grc_dump_addr_range(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump, u32 addr, u32 len, bool wide_bus,
enum init_split_types split_type,
u8 split_id)
{ … }
static u32 qed_grc_dump_reg_entry_hdr(u32 *dump_buf,
bool dump, u32 addr, u32 len)
{ … }
static u32 qed_grc_dump_reg_entry(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump, u32 addr, u32 len, bool wide_bus,
enum init_split_types split_type, u8 split_id)
{ … }
static u32 qed_grc_dump_reg_entry_skip(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
u32 addr,
u32 total_len,
u32 read_len, u32 skip_len)
{ … }
static u32 qed_grc_dump_regs_entries(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct virt_mem_desc input_regs_arr,
u32 *dump_buf,
bool dump,
enum init_split_types split_type,
u8 split_id,
bool block_enable[MAX_BLOCK_ID],
u32 *num_dumped_reg_entries)
{ … }
static u32 qed_grc_dump_split_data(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct virt_mem_desc input_regs_arr,
u32 *dump_buf,
bool dump,
bool block_enable[MAX_BLOCK_ID],
enum init_split_types split_type,
u8 split_id, const char *reg_type_name)
{ … }
static u32 qed_grc_dump_registers(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
bool block_enable[MAX_BLOCK_ID],
const char *reg_type_name)
{ … }
static u32 qed_grc_dump_reset_regs(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_modified_regs(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_special_regs(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_mem_hdr(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
bool dump,
const char *name,
u32 addr,
u32 len,
u32 bit_width,
bool packed,
const char *mem_group, char storm_letter)
{ … }
static u32 qed_grc_dump_mem(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
const char *name,
u32 addr,
u32 len,
bool wide_bus,
u32 bit_width,
bool packed,
const char *mem_group, char storm_letter)
{ … }
static u32 qed_grc_dump_mem_entries(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct virt_mem_desc input_mems_arr,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_memories(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_ctx_data(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
const char *name,
u32 num_lids,
enum cm_ctx_types ctx_type, u8 storm_id)
{ … }
static u32 qed_grc_dump_ctx(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
#define VFC_STATUS_RESP_READY_BIT …
#define VFC_STATUS_BUSY_BIT …
#define VFC_STATUS_SENDING_CMD_BIT …
#define VFC_POLLING_DELAY_MS …
#define VFC_POLLING_COUNT …
static u32 qed_grc_dump_read_from_vfc(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct storm_defs *storm,
u32 *cmd_data,
u32 cmd_size,
u32 *addr_data,
u32 addr_size,
u32 resp_size, u32 *dump_buf)
{ … }
static u32 qed_grc_dump_vfc_cam(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump, u8 storm_id)
{ … }
static u32 qed_grc_dump_vfc_ram(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
u8 storm_id, struct vfc_ram_defs *ram_defs)
{ … }
static u32 qed_grc_dump_vfc(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_rss(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_big_ram(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump, u8 big_ram_id)
{ … }
static u32 qed_grc_dump_mcp(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_phy(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_mcp_hw_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static u32 qed_grc_dump_static_debug(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump)
{ … }
static enum dbg_status qed_grc_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump, u32 *num_dumped_dwords)
{ … }
static u32 qed_idle_chk_dump_failure(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
u16 rule_id,
const struct dbg_idle_chk_rule *rule,
u16 fail_entry_id, u32 *cond_reg_values)
{ … }
static u32
qed_idle_chk_dump_rule_entries(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
u32 *dump_buf, bool dump,
const struct dbg_idle_chk_rule *input_rules,
u32 num_input_rules, u32 *num_failing_rules)
{ … }
static u32 qed_idle_chk_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
static enum dbg_status qed_mcp_trace_get_data_info(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *trace_data_grc_addr,
u32 *trace_data_size)
{ … }
static enum dbg_status qed_mcp_trace_get_meta_info(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 trace_data_size_bytes,
u32 *running_bundle_id,
u32 *trace_meta_offset,
u32 *trace_meta_size)
{ … }
static enum dbg_status qed_mcp_trace_read_meta(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 nvram_offset_in_bytes,
u32 size_in_bytes, u32 *buf)
{ … }
static enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump, u32 *num_dumped_dwords)
{ … }
static enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump, u32 *num_dumped_dwords)
{ … }
static enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump, u32 *num_dumped_dwords)
{ … }
static enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
u32 *num_dumped_dwords)
{ … }
static u32 qed_fw_asserts_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u32 *dump_buf, bool dump)
{ … }
static u32 qed_ilt_dump_pages_range(u32 *dump_buf, u32 *given_offset,
bool *dump, u32 start_page_id,
u32 num_pages,
struct phys_mem_desc *ilt_pages,
bool dump_page_ids, u32 buf_size_in_dwords,
u32 *given_actual_dump_size_in_dwords)
{ … }
static u32 qed_ilt_dump_pages_section(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 *given_offset,
bool *dump,
u32 valid_conn_pf_pages,
u32 valid_conn_vf_pages,
struct phys_mem_desc *ilt_pages,
bool dump_page_ids,
u32 buf_size_in_dwords,
u32 *given_actual_dump_size_in_dwords)
{ … }
static u32
qed_ilt_dump_dump_common_global_params(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
bool dump,
u32 cduc_page_size,
u32 conn_ctx_size,
u32 cdut_page_size,
u32 *full_dump_size_param_offset,
u32 *actual_dump_size_param_offset)
{ … }
static u32 qed_ilt_dump_dump_num_pf_cids(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
bool dump, u32 *valid_conn_pf_cids)
{ … }
static u32 qed_ilt_dump_dump_num_vf_cids(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
bool dump, u32 *valid_conn_vf_cids)
{ … }
static u32 qed_ilt_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf, u32 buf_size_in_dwords, bool dump)
{ … }
enum dbg_status qed_dbg_set_bin_ptr(struct qed_hwfn *p_hwfn,
const u8 * const bin_ptr)
{ … }
static enum dbg_status qed_dbg_set_app_ver(u32 ver)
{ … }
bool qed_read_fw_info(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, struct fw_info *fw_info)
{ … }
enum dbg_status qed_dbg_grc_config(struct qed_hwfn *p_hwfn,
enum dbg_grc_params grc_param, u32 val)
{ … }
void qed_dbg_grc_set_params_default(struct qed_hwfn *p_hwfn)
{ … }
enum dbg_status qed_dbg_grc_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_grc_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status qed_dbg_idle_chk_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_idle_chk_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status qed_dbg_mcp_trace_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_mcp_trace_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status qed_dbg_reg_fifo_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_reg_fifo_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status qed_dbg_igu_fifo_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_igu_fifo_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status
qed_dbg_protection_override_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_protection_override_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status qed_dbg_fw_asserts_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
enum dbg_status qed_dbg_fw_asserts_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
static enum dbg_status qed_dbg_ilt_get_dump_buf_size(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *buf_size)
{ … }
static enum dbg_status qed_dbg_ilt_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 *dump_buf,
u32 buf_size_in_dwords,
u32 *num_dumped_dwords)
{ … }
enum dbg_status qed_dbg_read_attn(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
enum block_id block_id,
enum dbg_attn_type attn_type,
bool clear_status,
struct dbg_attn_block_result *results)
{ … }
struct reg_fifo_element { … };
struct reg_fifo_err { … };
struct igu_fifo_element { … };
struct igu_fifo_wr_data { … };
struct igu_fifo_cleanup_wr_data { … };
struct protection_override_element { … };
enum igu_fifo_sources { … };
enum igu_fifo_addr_types { … };
struct igu_fifo_addr_data { … };
#define MAX_MSG_LEN …
#define MCP_TRACE_MAX_MODULE_LEN …
#define MCP_TRACE_FORMAT_MAX_PARAMS …
#define MCP_TRACE_FORMAT_PARAM_WIDTH …
#define REG_FIFO_ELEMENT_ADDR_FACTOR …
#define REG_FIFO_ELEMENT_IS_PF_VF_VAL …
#define PROTECTION_OVERRIDE_ELEMENT_ADDR_FACTOR …
static const char * const s_status_str[] = …;
static const char * const s_idle_chk_severity_str[] = …;
static const char * const s_mcp_trace_level_str[] = …;
static const char * const s_access_strs[] = …;
static const char * const s_privilege_strs[] = …;
static const char * const s_protection_strs[] = …;
static const char * const s_master_strs[] = …;
static struct reg_fifo_err s_reg_fifo_errors[] = …;
static const char * const s_igu_fifo_source_strs[] = …;
static const char * const s_igu_fifo_error_strs[] = …;
static const struct igu_fifo_addr_data s_igu_fifo_addr_data[] = …;
static char s_temp_buf[MAX_MSG_LEN];
static void qed_user_static_asserts(void)
{ … }
static u32 qed_cyclic_add(u32 a, u32 b, u32 size)
{ … }
static u32 qed_cyclic_sub(u32 a, u32 b, u32 size)
{ … }
static u32 qed_read_from_cyclic_buf(void *buf,
u32 *offset,
u32 buf_size, u8 num_bytes_to_read)
{ … }
static u8 qed_read_byte_from_buf(void *buf, u32 *offset)
{ … }
static u32 qed_read_dword_from_buf(void *buf, u32 *offset)
{ … }
static void qed_read_str_from_buf(void *buf, u32 *offset, u32 size, char *dest)
{ … }
static char *qed_get_buf_ptr(void *buf, u32 offset)
{ … }
static u32 qed_read_param(u32 *dump_buf,
const char **param_name,
const char **param_str_val, u32 *param_num_val)
{ … }
static u32 qed_read_section_hdr(u32 *dump_buf,
const char **section_name,
u32 *num_section_params)
{ … }
static u32 qed_print_section_params(u32 *dump_buf,
u32 num_section_params,
char *results_buf, u32 *num_chars_printed)
{ … }
static const char *qed_dbg_get_block_name(struct qed_hwfn *p_hwfn,
enum block_id block_id)
{ … }
static struct dbg_tools_user_data *qed_dbg_get_user_data(struct qed_hwfn
*p_hwfn)
{ … }
static u32 qed_parse_idle_chk_dump_rules(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 *dump_buf_end,
u32 num_rules,
bool print_fw_idle_chk,
char *results_buf,
u32 *num_errors, u32 *num_warnings)
{ … }
static enum dbg_status qed_parse_idle_chk_dump(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf,
u32 *parsed_results_bytes,
u32 *num_errors,
u32 *num_warnings)
{ … }
static enum dbg_status
qed_mcp_trace_alloc_meta_data(struct qed_hwfn *p_hwfn,
const u32 *meta_buf)
{ … }
static enum dbg_status qed_parse_mcp_trace_buf(struct qed_hwfn *p_hwfn,
u8 *trace_buf,
u32 trace_buf_size,
u32 data_offset,
u32 data_size,
char *parsed_buf,
u32 *parsed_results_bytes)
{ … }
static enum dbg_status qed_parse_mcp_trace_dump(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
char *results_buf,
u32 *parsed_results_bytes,
bool free_meta_data)
{ … }
static enum dbg_status qed_parse_reg_fifo_dump(u32 *dump_buf,
char *results_buf,
u32 *parsed_results_bytes)
{ … }
static enum dbg_status qed_parse_igu_fifo_element(struct igu_fifo_element
*element, char
*results_buf,
u32 *results_offset)
{ … }
static enum dbg_status qed_parse_igu_fifo_dump(u32 *dump_buf,
char *results_buf,
u32 *parsed_results_bytes)
{ … }
static enum dbg_status
qed_parse_protection_override_dump(u32 *dump_buf,
char *results_buf,
u32 *parsed_results_bytes)
{ … }
static enum dbg_status qed_parse_fw_asserts_dump(u32 *dump_buf,
char *results_buf,
u32 *parsed_results_bytes)
{ … }
enum dbg_status qed_dbg_user_set_bin_ptr(struct qed_hwfn *p_hwfn,
const u8 * const bin_ptr)
{ … }
enum dbg_status qed_dbg_alloc_user_data(struct qed_hwfn *p_hwfn,
void **user_data_ptr)
{ … }
const char *qed_dbg_get_status_str(enum dbg_status status)
{ … }
enum dbg_status qed_get_idle_chk_results_buf_size(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
u32 *results_buf_size)
{ … }
enum dbg_status qed_print_idle_chk_results(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf,
u32 *num_errors,
u32 *num_warnings)
{ … }
void qed_dbg_mcp_trace_set_meta_data(struct qed_hwfn *p_hwfn,
const u32 *meta_buf)
{ … }
enum dbg_status qed_get_mcp_trace_results_buf_size(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
u32 *results_buf_size)
{ … }
enum dbg_status qed_print_mcp_trace_results(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf)
{ … }
enum dbg_status qed_print_mcp_trace_results_cont(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
char *results_buf)
{ … }
enum dbg_status qed_print_mcp_trace_line(struct qed_hwfn *p_hwfn,
u8 *dump_buf,
u32 num_dumped_bytes,
char *results_buf)
{ … }
void qed_mcp_trace_free_meta_data(struct qed_hwfn *p_hwfn)
{ … }
enum dbg_status qed_get_reg_fifo_results_buf_size(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
u32 *results_buf_size)
{ … }
enum dbg_status qed_print_reg_fifo_results(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf)
{ … }
enum dbg_status qed_get_igu_fifo_results_buf_size(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
u32 *results_buf_size)
{ … }
enum dbg_status qed_print_igu_fifo_results(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf)
{ … }
enum dbg_status
qed_get_protection_override_results_buf_size(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
u32 *results_buf_size)
{ … }
enum dbg_status qed_print_protection_override_results(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf)
{ … }
enum dbg_status qed_get_fw_asserts_results_buf_size(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
u32 *results_buf_size)
{ … }
enum dbg_status qed_print_fw_asserts_results(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf)
{ … }
enum dbg_status qed_dbg_parse_attn(struct qed_hwfn *p_hwfn,
struct dbg_attn_block_result *results)
{ … }
static enum dbg_status
qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
u32 *dump_buf,
u32 num_dumped_dwords,
char *results_buf)
{ … }
static DEFINE_MUTEX(qed_dbg_lock);
#define MAX_PHY_RESULT_BUFFER …
#define GRC_NUM_STR_FUNCS …
#define IDLE_CHK_NUM_STR_FUNCS …
#define MCP_TRACE_NUM_STR_FUNCS …
#define REG_FIFO_NUM_STR_FUNCS …
#define IGU_FIFO_NUM_STR_FUNCS …
#define PROTECTION_OVERRIDE_NUM_STR_FUNCS …
#define FW_ASSERTS_NUM_STR_FUNCS …
#define ILT_NUM_STR_FUNCS …
#define PHY_NUM_STR_FUNCS …
static struct { … } qed_features_lookup[] = …;
static void qed_dbg_print_feature(u8 *p_text_buf, u32 text_size)
{ … }
#define QED_RESULTS_BUF_MIN_SIZE …
static enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
enum qed_dbg_features feature_idx)
{ … }
#define MAX_DBG_FEATURE_SIZE_DWORDS …
static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
enum qed_dbg_features feature_idx)
{ … }
int qed_dbg_grc(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes)
{ … }
int qed_dbg_grc_size(struct qed_dev *cdev)
{ … }
int qed_dbg_idle_chk(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes)
{ … }
int qed_dbg_idle_chk_size(struct qed_dev *cdev)
{ … }
int qed_dbg_reg_fifo(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes)
{ … }
int qed_dbg_reg_fifo_size(struct qed_dev *cdev)
{ … }
int qed_dbg_igu_fifo(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes)
{ … }
int qed_dbg_igu_fifo_size(struct qed_dev *cdev)
{ … }
static int qed_dbg_nvm_image_length(struct qed_hwfn *p_hwfn,
enum qed_nvm_images image_id, u32 *length)
{ … }
static int qed_dbg_nvm_image(struct qed_dev *cdev, void *buffer,
u32 *num_dumped_bytes,
enum qed_nvm_images image_id)
{ … }
int qed_dbg_protection_override(struct qed_dev *cdev, void *buffer,
u32 *num_dumped_bytes)
{ … }
int qed_dbg_protection_override_size(struct qed_dev *cdev)
{ … }
int qed_dbg_fw_asserts(struct qed_dev *cdev, void *buffer,
u32 *num_dumped_bytes)
{ … }
int qed_dbg_fw_asserts_size(struct qed_dev *cdev)
{ … }
int qed_dbg_ilt(struct qed_dev *cdev, void *buffer, u32 *num_dumped_bytes)
{ … }
int qed_dbg_ilt_size(struct qed_dev *cdev)
{ … }
int qed_dbg_mcp_trace(struct qed_dev *cdev, void *buffer,
u32 *num_dumped_bytes)
{ … }
int qed_dbg_mcp_trace_size(struct qed_dev *cdev)
{ … }
#define REGDUMP_HEADER_SIZE …
#define REGDUMP_HEADER_SIZE_SHIFT …
#define REGDUMP_HEADER_SIZE_MASK …
#define REGDUMP_HEADER_FEATURE_SHIFT …
#define REGDUMP_HEADER_FEATURE_MASK …
#define REGDUMP_HEADER_BIN_DUMP_SHIFT …
#define REGDUMP_HEADER_BIN_DUMP_MASK …
#define REGDUMP_HEADER_OMIT_ENGINE_SHIFT …
#define REGDUMP_HEADER_OMIT_ENGINE_MASK …
#define REGDUMP_HEADER_ENGINE_SHIFT …
#define REGDUMP_HEADER_ENGINE_MASK …
#define REGDUMP_MAX_SIZE …
#define ILT_DUMP_MAX_SIZE …
enum debug_print_features { … };
static u32 qed_calc_regdump_header(struct qed_dev *cdev,
enum debug_print_features feature,
int engine, u32 feature_size,
u8 omit_engine, u8 dbg_bin_dump)
{ … }
int qed_dbg_all_data(struct qed_dev *cdev, void *buffer)
{ … }
int qed_dbg_all_data_size(struct qed_dev *cdev)
{ … }
int qed_dbg_feature(struct qed_dev *cdev, void *buffer,
enum qed_dbg_features feature, u32 *num_dumped_bytes)
{ … }
int qed_dbg_feature_size(struct qed_dev *cdev, enum qed_dbg_features feature)
{ … }
int qed_dbg_phy_size(struct qed_dev *cdev)
{ … }
u8 qed_get_debug_engine(struct qed_dev *cdev)
{ … }
void qed_set_debug_engine(struct qed_dev *cdev, int engine_number)
{ … }
void qed_dbg_pf_init(struct qed_dev *cdev)
{ … }
void qed_dbg_pf_exit(struct qed_dev *cdev)
{ … }