src/dpdk/drivers/net/qede/qede_debug.c
static void qed_grc_unreset_blocks(struct ecore_hwfn *p_hwfn,
				   struct ecore_ptt *p_ptt, bool rbc_only)
{
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	u8 chip_id = dev_data->chip_id;
	u32 i;

	/* Take RBCs out of reset */
	for (i = 0; i < OSAL_ARRAY_SIZE(s_rbc_reset_defs); i++)
		if (s_rbc_reset_defs[i].reset_val[dev_data->chip_id])
			ecore_wr(p_hwfn,
			       p_ptt,
			       s_rbc_reset_defs[i].reset_reg_addr +
			       RESET_REG_UNRESET_OFFSET,
			       s_rbc_reset_defs[i].reset_val[chip_id]);

	if (!rbc_only) {
		u32 reg_val[NUM_DBG_RESET_REGS] = { 0 };
		u8 reset_reg_id;
		u32 block_id;

		/* Fill reset regs values */
		for (block_id = 0; block_id < NUM_PHYS_BLOCKS; block_id++) {
			bool is_removed, has_reset_reg, unreset_before_dump;
			const struct dbg_block_chip *block;

			block = qed_get_dbg_block_per_chip(p_hwfn,
							   (enum block_id)
							   block_id);
			is_removed =
			    GET_FIELD(block->flags, DBG_BLOCK_CHIP_IS_REMOVED);
			has_reset_reg =
			    GET_FIELD(block->flags,
				      DBG_BLOCK_CHIP_HAS_RESET_REG);
			unreset_before_dump =
			    GET_FIELD(block->flags,
				      DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP);

			if (!is_removed && has_reset_reg && unreset_before_dump)
				reg_val[block->reset_reg_id] |=
				    OSAL_BIT(block->reset_reg_bit_offset);
		}

		/* Write reset registers */
		for (reset_reg_id = 0; reset_reg_id < NUM_DBG_RESET_REGS;
		     reset_reg_id++) {
			const struct dbg_reset_reg *reset_reg;
			u32 reset_reg_addr;

			reset_reg = qed_get_dbg_reset_reg(p_hwfn, reset_reg_id);

			if (GET_FIELD
			    (reset_reg->data, DBG_RESET_REG_IS_REMOVED))
				continue;

			if (reg_val[reset_reg_id]) {
				reset_reg_addr =
				    GET_FIELD(reset_reg->data,
					      DBG_RESET_REG_ADDR);
				ecore_wr(p_hwfn,
				       p_ptt,
				       DWORDS_TO_BYTES(reset_reg_addr) +
				       RESET_REG_UNRESET_OFFSET,
				       reg_val[reset_reg_id]);
			}
		}
	}
}
/* Takes all blocks out of reset. If rbc_only is true, only RBC clients are
 * taken out of reset.
 */
Takes all blocks out of reset. If rbc_only is true, only RBC clients are
taken out of reset.
Takes all blocks out of reset . If rbc_only is true only RBC clients are taken out of reset .
static void qed_grc_unreset_blocks(struct ecore_hwfn *p_hwfn,
				   struct ecore_ptt *p_ptt, bool rbc_only)
{
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	u8 chip_id = dev_data->chip_id;
	u32 i;
	for (i = 0; i < OSAL_ARRAY_SIZE(s_rbc_reset_defs); i++)
		if (s_rbc_reset_defs[i].reset_val[dev_data->chip_id])
			ecore_wr(p_hwfn,
			       p_ptt,
			       s_rbc_reset_defs[i].reset_reg_addr +
			       RESET_REG_UNRESET_OFFSET,
			       s_rbc_reset_defs[i].reset_val[chip_id]);
	if (!rbc_only) {
		u32 reg_val[NUM_DBG_RESET_REGS] = { 0 };
		u8 reset_reg_id;
		u32 block_id;
		for (block_id = 0; block_id < NUM_PHYS_BLOCKS; block_id++) {
			bool is_removed, has_reset_reg, unreset_before_dump;
			const struct dbg_block_chip *block;
			block = qed_get_dbg_block_per_chip(p_hwfn,
							   (enum block_id)
							   block_id);
			is_removed =
			    GET_FIELD(block->flags, DBG_BLOCK_CHIP_IS_REMOVED);
			has_reset_reg =
			    GET_FIELD(block->flags,
				      DBG_BLOCK_CHIP_HAS_RESET_REG);
			unreset_before_dump =
			    GET_FIELD(block->flags,
				      DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP);
			if (!is_removed && has_reset_reg && unreset_before_dump)
				reg_val[block->reset_reg_id] |=
				    OSAL_BIT(block->reset_reg_bit_offset);
		}
		for (reset_reg_id = 0; reset_reg_id < NUM_DBG_RESET_REGS;
		     reset_reg_id++) {
			const struct dbg_reset_reg *reset_reg;
			u32 reset_reg_addr;
			reset_reg = qed_get_dbg_reset_reg(p_hwfn, reset_reg_id);
			if (GET_FIELD
			    (reset_reg->data, DBG_RESET_REG_IS_REMOVED))
				continue;
			if (reg_val[reset_reg_id]) {
				reset_reg_addr =
				    GET_FIELD(reset_reg->data,
					      DBG_RESET_REG_ADDR);
				ecore_wr(p_hwfn,
				       p_ptt,
				       DWORDS_TO_BYTES(reset_reg_addr) +
				       RESET_REG_UNRESET_OFFSET,
				       reg_val[reset_reg_id]);
			}
		}
	}
}
static void qed_grc_unreset_blocks ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , bool rbc_only ) { struct dbg_tools_data * dev_data = & p_hwfn -> dbg_info ; u8 chip_id = dev_data -> chip_id ; u32 i ; for ( i = 0 ; i < OSAL_ARRAY_SIZE ( s_rbc_reset_defs ) ; i ++ ) if ( s_rbc_reset_defs [ i ] . reset_val [ dev_data -> chip_id ] ) ecore_wr ( p_hwfn , p_ptt , s_rbc_reset_defs [ i ] . reset_reg_addr + RESET_REG_UNRESET_OFFSET , s_rbc_reset_defs [ i ] . reset_val [ chip_id ] ) ; if ( ! rbc_only ) { u32 reg_val [ NUM_DBG_RESET_REGS ] = { 0 } ; u8 reset_reg_id ; u32 block_id ; for ( block_id = 0 ; block_id < NUM_PHYS_BLOCKS ; block_id ++ ) { bool is_removed , has_reset_reg , unreset_before_dump ; const struct dbg_block_chip * block ; block = qed_get_dbg_block_per_chip ( p_hwfn , ( enum block_id ) block_id ) ; is_removed = GET_FIELD ( block -> flags , DBG_BLOCK_CHIP_IS_REMOVED ) ; has_reset_reg = GET_FIELD ( block -> flags , DBG_BLOCK_CHIP_HAS_RESET_REG ) ; unreset_before_dump = GET_FIELD ( block -> flags , DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP ) ; if ( ! is_removed && has_reset_reg && unreset_before_dump ) reg_val [ block -> reset_reg_id ] |= OSAL_BIT ( block -> reset_reg_bit_offset ) ; } for ( reset_reg_id = 0 ; reset_reg_id < NUM_DBG_RESET_REGS ; reset_reg_id ++ ) { const struct dbg_reset_reg * reset_reg ; u32 reset_reg_addr ; reset_reg = qed_get_dbg_reset_reg ( p_hwfn , reset_reg_id ) ; if ( GET_FIELD ( reset_reg -> data , DBG_RESET_REG_IS_REMOVED ) ) continue ; if ( reg_val [ reset_reg_id ] ) { reset_reg_addr = GET_FIELD ( reset_reg -> data , DBG_RESET_REG_ADDR ) ; ecore_wr ( p_hwfn , p_ptt , DWORDS_TO_BYTES ( reset_reg_addr ) + RESET_REG_UNRESET_OFFSET , reg_val [ reset_reg_id ] ) ; } } } }
Takes all blocks out of reset.
Takes all blocks out of reset .
/* Take RBCs out of reset */ /* Fill reset regs values */ /* Write reset registers */