src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_grc_dump_mcp(struct ecore_hwfn *p_hwfn,
			    struct ecore_ptt *p_ptt, u32 *dump_buf, bool dump)
{
	bool block_enable[MAX_BLOCK_ID] = { 0 };
	u32 offset = 0, addr;
	bool halted = false;

	/* Halt MCP */
	if (dump && !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_MCP)) {
		halted = !ecore_mcp_halt(p_hwfn, p_ptt);
		if (!halted)
			DP_NOTICE(p_hwfn, false, "MCP halt failed!\n");
	}

	/* Dump MCP scratchpad */
	offset += qed_grc_dump_mem(p_hwfn,
				   p_ptt,
				   dump_buf + offset,
				   dump,
				   NULL,
				   BYTES_TO_DWORDS(MCP_REG_SCRATCH),
				   MCP_REG_SCRATCH_SIZE,
				   false, 0, false, "MCP", 0);

	/* Dump MCP cpu_reg_file */
	offset += qed_grc_dump_mem(p_hwfn,
				   p_ptt,
				   dump_buf + offset,
				   dump,
				   NULL,
				   BYTES_TO_DWORDS(MCP_REG_CPU_REG_FILE),
				   MCP_REG_CPU_REG_FILE_SIZE,
				   false, 0, false, "MCP", 0);

	/* Dump MCP registers */
	block_enable[BLOCK_MCP] = true;
	offset += qed_grc_dump_registers(p_hwfn,
					 p_ptt,
					 dump_buf + offset,
					 dump, block_enable, "MCP");

	/* Dump required non-MCP registers */
	offset += qed_grc_dump_regs_hdr(dump_buf + offset,
					dump, 1, SPLIT_TYPE_NONE, 0,
					"MCP");
	addr = BYTES_TO_DWORDS(MISC_REG_SHARED_MEM_ADDR);
	offset += qed_grc_dump_reg_entry(p_hwfn,
					 p_ptt,
					 dump_buf + offset,
					 dump,
					 addr,
					 1,
					 false, SPLIT_TYPE_NONE, 0);

	/* Release MCP */
	if (halted && ecore_mcp_resume(p_hwfn, p_ptt))
		DP_NOTICE(p_hwfn, false, "Failed to resume MCP after halt!\n");

	return offset;
}
/* Dumps MCP scratchpad. Returns the dumped size in dwords. */
Dumps MCP scratchpad. Returns the dumped size in dwords.
Dumps MCP scratchpad . Returns the dumped size in dwords .
static u32 qed_grc_dump_mcp(struct ecore_hwfn *p_hwfn,
			    struct ecore_ptt *p_ptt, u32 *dump_buf, bool dump)
{
	bool block_enable[MAX_BLOCK_ID] = { 0 };
	u32 offset = 0, addr;
	bool halted = false;
	if (dump && !qed_grc_get_param(p_hwfn, DBG_GRC_PARAM_NO_MCP)) {
		halted = !ecore_mcp_halt(p_hwfn, p_ptt);
		if (!halted)
			DP_NOTICE(p_hwfn, false, "MCP halt failed!\n");
	}
	offset += qed_grc_dump_mem(p_hwfn,
				   p_ptt,
				   dump_buf + offset,
				   dump,
				   NULL,
				   BYTES_TO_DWORDS(MCP_REG_SCRATCH),
				   MCP_REG_SCRATCH_SIZE,
				   false, 0, false, "MCP", 0);
	offset += qed_grc_dump_mem(p_hwfn,
				   p_ptt,
				   dump_buf + offset,
				   dump,
				   NULL,
				   BYTES_TO_DWORDS(MCP_REG_CPU_REG_FILE),
				   MCP_REG_CPU_REG_FILE_SIZE,
				   false, 0, false, "MCP", 0);
	block_enable[BLOCK_MCP] = true;
	offset += qed_grc_dump_registers(p_hwfn,
					 p_ptt,
					 dump_buf + offset,
					 dump, block_enable, "MCP");
	offset += qed_grc_dump_regs_hdr(dump_buf + offset,
					dump, 1, SPLIT_TYPE_NONE, 0,
					"MCP");
	addr = BYTES_TO_DWORDS(MISC_REG_SHARED_MEM_ADDR);
	offset += qed_grc_dump_reg_entry(p_hwfn,
					 p_ptt,
					 dump_buf + offset,
					 dump,
					 addr,
					 1,
					 false, SPLIT_TYPE_NONE, 0);
	if (halted && ecore_mcp_resume(p_hwfn, p_ptt))
		DP_NOTICE(p_hwfn, false, "Failed to resume MCP after halt!\n");
	return offset;
}
static u32 qed_grc_dump_mcp ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 * dump_buf , bool dump ) { bool block_enable [ MAX_BLOCK_ID ] = { 0 } ; u32 offset = 0 , addr ; bool halted = false ; if ( dump && ! qed_grc_get_param ( p_hwfn , DBG_GRC_PARAM_NO_MCP ) ) { halted = ! ecore_mcp_halt ( p_hwfn , p_ptt ) ; if ( ! halted ) DP_NOTICE ( p_hwfn , false , " \n " ) ; } offset += qed_grc_dump_mem ( p_hwfn , p_ptt , dump_buf + offset , dump , NULL , BYTES_TO_DWORDS ( MCP_REG_SCRATCH ) , MCP_REG_SCRATCH_SIZE , false , 0 , false , " " , 0 ) ; offset += qed_grc_dump_mem ( p_hwfn , p_ptt , dump_buf + offset , dump , NULL , BYTES_TO_DWORDS ( MCP_REG_CPU_REG_FILE ) , MCP_REG_CPU_REG_FILE_SIZE , false , 0 , false , " " , 0 ) ; block_enable [ BLOCK_MCP ] = true ; offset += qed_grc_dump_registers ( p_hwfn , p_ptt , dump_buf + offset , dump , block_enable , " " ) ; offset += qed_grc_dump_regs_hdr ( dump_buf + offset , dump , 1 , SPLIT_TYPE_NONE , 0 , " " ) ; addr = BYTES_TO_DWORDS ( MISC_REG_SHARED_MEM_ADDR ) ; offset += qed_grc_dump_reg_entry ( p_hwfn , p_ptt , dump_buf + offset , dump , addr , 1 , false , SPLIT_TYPE_NONE , 0 ) ; if ( halted && ecore_mcp_resume ( p_hwfn , p_ptt ) ) DP_NOTICE ( p_hwfn , false , " \n " ) ; return offset ; }
Dumps MCP scratchpad.
Dumps MCP scratchpad .
/* Halt MCP */ /* Dump MCP scratchpad */ /* Dump MCP cpu_reg_file */ /* Dump MCP registers */ /* Dump required non-MCP registers */ /* Release MCP */