src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_fw_asserts_dump(struct ecore_hwfn *p_hwfn,
			       struct ecore_ptt *p_ptt, u32 *dump_buf,
			       bool dump)
{
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	struct fw_asserts_ram_section *asserts;
	char storm_letter_str[2] = "?";
	struct fw_info fw_info;
	u32 offset = 0;
	u8 storm_id;

	/* Dump global params */
	offset += qed_dump_common_global_params(p_hwfn,
						p_ptt,
						dump_buf + offset, dump, 1);
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "dump-type", "fw-asserts");

	/* Find Storm dump size */
	for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) {
		u32 fw_asserts_section_addr, next_list_idx_addr, next_list_idx;
		struct storm_defs *storm = &s_storm_defs[storm_id];
		u32 last_list_idx, addr;

		if (dev_data->block_in_reset[storm->sem_block_id])
			continue;

		/* Read FW info for the current Storm */
		qed_read_storm_fw_info(p_hwfn, p_ptt, storm_id, &fw_info);

		asserts = &fw_info.fw_asserts_section;

		/* Dump FW Asserts section header and params */
		storm_letter_str[0] = storm->letter;
		offset += qed_dump_section_hdr(dump_buf + offset,
					       dump, "fw_asserts", 2);
		offset += qed_dump_str_param(dump_buf + offset,
					     dump, "storm", storm_letter_str);
		offset += qed_dump_num_param(dump_buf + offset,
					     dump,
					     "size",
					     asserts->list_element_dword_size);

		/* Read and dump FW Asserts data */
		if (!dump) {
			offset += asserts->list_element_dword_size;
			continue;
		}

		fw_asserts_section_addr = storm->sem_fast_mem_addr +
			SEM_FAST_REG_INT_RAM +
			RAM_LINES_TO_BYTES(asserts->section_ram_line_offset);
		next_list_idx_addr = fw_asserts_section_addr +
			DWORDS_TO_BYTES(asserts->list_next_index_dword_offset);
		next_list_idx = ecore_rd(p_hwfn, p_ptt, next_list_idx_addr);
		last_list_idx = (next_list_idx > 0 ?
				 next_list_idx :
				 asserts->list_num_elements) - 1;
		addr = BYTES_TO_DWORDS(fw_asserts_section_addr) +
		       asserts->list_dword_offset +
		       last_list_idx * asserts->list_element_dword_size;
		offset +=
		    qed_grc_dump_addr_range(p_hwfn, p_ptt,
					    dump_buf + offset,
					    dump, addr,
					    asserts->list_element_dword_size,
						  false, SPLIT_TYPE_NONE, 0);
	}

	/* Dump last section */
	offset += qed_dump_last_section(dump_buf, offset, dump);

	return offset;
}
/* Performs FW Asserts Dump to the specified buffer.
 * Returns the dumped size in dwords.
 */
Performs FW Asserts Dump to the specified buffer.
Returns the dumped size in dwords.
Performs FW Asserts Dump to the specified buffer . Returns the dumped size in dwords .
static u32 qed_fw_asserts_dump(struct ecore_hwfn *p_hwfn,
			       struct ecore_ptt *p_ptt, u32 *dump_buf,
			       bool dump)
{
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	struct fw_asserts_ram_section *asserts;
	char storm_letter_str[2] = "?";
	struct fw_info fw_info;
	u32 offset = 0;
	u8 storm_id;
	offset += qed_dump_common_global_params(p_hwfn,
						p_ptt,
						dump_buf + offset, dump, 1);
	offset += qed_dump_str_param(dump_buf + offset,
				     dump, "dump-type", "fw-asserts");
	for (storm_id = 0; storm_id < MAX_DBG_STORMS; storm_id++) {
		u32 fw_asserts_section_addr, next_list_idx_addr, next_list_idx;
		struct storm_defs *storm = &s_storm_defs[storm_id];
		u32 last_list_idx, addr;
		if (dev_data->block_in_reset[storm->sem_block_id])
			continue;
		qed_read_storm_fw_info(p_hwfn, p_ptt, storm_id, &fw_info);
		asserts = &fw_info.fw_asserts_section;
		storm_letter_str[0] = storm->letter;
		offset += qed_dump_section_hdr(dump_buf + offset,
					       dump, "fw_asserts", 2);
		offset += qed_dump_str_param(dump_buf + offset,
					     dump, "storm", storm_letter_str);
		offset += qed_dump_num_param(dump_buf + offset,
					     dump,
					     "size",
					     asserts->list_element_dword_size);
		if (!dump) {
			offset += asserts->list_element_dword_size;
			continue;
		}
		fw_asserts_section_addr = storm->sem_fast_mem_addr +
			SEM_FAST_REG_INT_RAM +
			RAM_LINES_TO_BYTES(asserts->section_ram_line_offset);
		next_list_idx_addr = fw_asserts_section_addr +
			DWORDS_TO_BYTES(asserts->list_next_index_dword_offset);
		next_list_idx = ecore_rd(p_hwfn, p_ptt, next_list_idx_addr);
		last_list_idx = (next_list_idx > 0 ?
				 next_list_idx :
				 asserts->list_num_elements) - 1;
		addr = BYTES_TO_DWORDS(fw_asserts_section_addr) +
		       asserts->list_dword_offset +
		       last_list_idx * asserts->list_element_dword_size;
		offset +=
		    qed_grc_dump_addr_range(p_hwfn, p_ptt,
					    dump_buf + offset,
					    dump, addr,
					    asserts->list_element_dword_size,
						  false, SPLIT_TYPE_NONE, 0);
	}
	offset += qed_dump_last_section(dump_buf, offset, dump);
	return offset;
}
static u32 qed_fw_asserts_dump ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 * dump_buf , bool dump ) { struct dbg_tools_data * dev_data = & p_hwfn -> dbg_info ; struct fw_asserts_ram_section * asserts ; char storm_letter_str [ 2 ] = " " ; struct fw_info fw_info ; u32 offset = 0 ; u8 storm_id ; offset += qed_dump_common_global_params ( p_hwfn , p_ptt , dump_buf + offset , dump , 1 ) ; offset += qed_dump_str_param ( dump_buf + offset , dump , " " , " " ) ; for ( storm_id = 0 ; storm_id < MAX_DBG_STORMS ; storm_id ++ ) { u32 fw_asserts_section_addr , next_list_idx_addr , next_list_idx ; struct storm_defs * storm = & s_storm_defs [ storm_id ] ; u32 last_list_idx , addr ; if ( dev_data -> block_in_reset [ storm -> sem_block_id ] ) continue ; qed_read_storm_fw_info ( p_hwfn , p_ptt , storm_id , & fw_info ) ; asserts = & fw_info . fw_asserts_section ; storm_letter_str [ 0 ] = storm -> letter ; offset += qed_dump_section_hdr ( dump_buf + offset , dump , " " , 2 ) ; offset += qed_dump_str_param ( dump_buf + offset , dump , " " , storm_letter_str ) ; offset += qed_dump_num_param ( dump_buf + offset , dump , " " , asserts -> list_element_dword_size ) ; if ( ! dump ) { offset += asserts -> list_element_dword_size ; continue ; } fw_asserts_section_addr = storm -> sem_fast_mem_addr + SEM_FAST_REG_INT_RAM + RAM_LINES_TO_BYTES ( asserts -> section_ram_line_offset ) ; next_list_idx_addr = fw_asserts_section_addr + DWORDS_TO_BYTES ( asserts -> list_next_index_dword_offset ) ; next_list_idx = ecore_rd ( p_hwfn , p_ptt , next_list_idx_addr ) ; last_list_idx = ( next_list_idx > 0 ? next_list_idx : asserts -> list_num_elements ) - 1 ; addr = BYTES_TO_DWORDS ( fw_asserts_section_addr ) + asserts -> list_dword_offset + last_list_idx * asserts -> list_element_dword_size ; offset += qed_grc_dump_addr_range ( p_hwfn , p_ptt , dump_buf + offset , dump , addr , asserts -> list_element_dword_size , false , SPLIT_TYPE_NONE , 0 ) ; } offset += qed_dump_last_section ( dump_buf , offset , dump ) ; return offset ; }
Performs FW Asserts Dump to the specified buffer.
Performs FW Asserts Dump to the specified buffer .
/* Dump global params */ /* Find Storm dump size */ /* Read FW info for the current Storm */ /* Dump FW Asserts section header and params */ /* Read and dump FW Asserts data */ /* Dump last section */