src/dpdk/drivers/net/qede/qede_debug.c
static u32 qed_grc_dump_big_ram(struct ecore_hwfn *p_hwfn,
				struct ecore_ptt *p_ptt,
				u32 *dump_buf, bool dump, u8 big_ram_id)
{
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	u32 block_size, ram_size, offset = 0, reg_val, i;
	char mem_name[12] = "???_BIG_RAM";
	char type_name[8] = "???_RAM";
	struct big_ram_defs *big_ram;

	big_ram = &s_big_ram_defs[big_ram_id];
	ram_size = big_ram->ram_size[dev_data->chip_id];

	reg_val = ecore_rd(p_hwfn, p_ptt, big_ram->is_256b_reg_addr);
	block_size = reg_val &
		     OSAL_BIT(big_ram->is_256b_bit_offset[dev_data->chip_id]) ?
								     256 : 128;

	strncpy(type_name, big_ram->instance_name, BIG_RAM_NAME_LEN);
	strncpy(mem_name, big_ram->instance_name, BIG_RAM_NAME_LEN);

	/* Dump memory header */
	offset += qed_grc_dump_mem_hdr(p_hwfn,
				       dump_buf + offset,
				       dump,
				       mem_name,
				       0,
				       ram_size,
				       block_size * 8,
				       false, type_name, 0);

	/* Read and dump Big RAM data */
	if (!dump)
		return offset + ram_size;

	/* Dump Big RAM */
	for (i = 0; i < DIV_ROUND_UP(ram_size, BRB_REG_BIG_RAM_DATA_SIZE);
	     i++) {
		u32 addr, len;

		ecore_wr(p_hwfn, p_ptt, big_ram->addr_reg_addr, i);
		addr = BYTES_TO_DWORDS(big_ram->data_reg_addr);
		len = BRB_REG_BIG_RAM_DATA_SIZE;
		offset += qed_grc_dump_addr_range(p_hwfn,
						  p_ptt,
						  dump_buf + offset,
						  dump,
						  addr,
						  len,
						  false, SPLIT_TYPE_NONE, 0);
	}

	return offset;
}
/* Dumps GRC Big RAM. Returns the dumped size in dwords. */
Dumps GRC Big RAM. Returns the dumped size in dwords.
Dumps GRC Big RAM . Returns the dumped size in dwords .
static u32 qed_grc_dump_big_ram(struct ecore_hwfn *p_hwfn,
				struct ecore_ptt *p_ptt,
				u32 *dump_buf, bool dump, u8 big_ram_id)
{
	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
	u32 block_size, ram_size, offset = 0, reg_val, i;
	char mem_name[12] = "???_BIG_RAM";
	char type_name[8] = "???_RAM";
	struct big_ram_defs *big_ram;
	big_ram = &s_big_ram_defs[big_ram_id];
	ram_size = big_ram->ram_size[dev_data->chip_id];
	reg_val = ecore_rd(p_hwfn, p_ptt, big_ram->is_256b_reg_addr);
	block_size = reg_val &
		     OSAL_BIT(big_ram->is_256b_bit_offset[dev_data->chip_id]) ?
								     256 : 128;
	strncpy(type_name, big_ram->instance_name, BIG_RAM_NAME_LEN);
	strncpy(mem_name, big_ram->instance_name, BIG_RAM_NAME_LEN);
	offset += qed_grc_dump_mem_hdr(p_hwfn,
				       dump_buf + offset,
				       dump,
				       mem_name,
				       0,
				       ram_size,
				       block_size * 8,
				       false, type_name, 0);
	if (!dump)
		return offset + ram_size;
	for (i = 0; i < DIV_ROUND_UP(ram_size, BRB_REG_BIG_RAM_DATA_SIZE);
	     i++) {
		u32 addr, len;
		ecore_wr(p_hwfn, p_ptt, big_ram->addr_reg_addr, i);
		addr = BYTES_TO_DWORDS(big_ram->data_reg_addr);
		len = BRB_REG_BIG_RAM_DATA_SIZE;
		offset += qed_grc_dump_addr_range(p_hwfn,
						  p_ptt,
						  dump_buf + offset,
						  dump,
						  addr,
						  len,
						  false, SPLIT_TYPE_NONE, 0);
	}
	return offset;
}
static u32 qed_grc_dump_big_ram ( struct ecore_hwfn * p_hwfn , struct ecore_ptt * p_ptt , u32 * dump_buf , bool dump , u8 big_ram_id ) { struct dbg_tools_data * dev_data = & p_hwfn -> dbg_info ; u32 block_size , ram_size , offset = 0 , reg_val , i ; char mem_name [ 12 ] = " " ; char type_name [ 8 ] = " " ; struct big_ram_defs * big_ram ; big_ram = & s_big_ram_defs [ big_ram_id ] ; ram_size = big_ram -> ram_size [ dev_data -> chip_id ] ; reg_val = ecore_rd ( p_hwfn , p_ptt , big_ram -> is_256b_reg_addr ) ; block_size = reg_val & OSAL_BIT ( big_ram -> is_256b_bit_offset [ dev_data -> chip_id ] ) ? 256 : 128 ; strncpy ( type_name , big_ram -> instance_name , BIG_RAM_NAME_LEN ) ; strncpy ( mem_name , big_ram -> instance_name , BIG_RAM_NAME_LEN ) ; offset += qed_grc_dump_mem_hdr ( p_hwfn , dump_buf + offset , dump , mem_name , 0 , ram_size , block_size * 8 , false , type_name , 0 ) ; if ( ! dump ) return offset + ram_size ; for ( i = 0 ; i < DIV_ROUND_UP ( ram_size , BRB_REG_BIG_RAM_DATA_SIZE ) ; i ++ ) { u32 addr , len ; ecore_wr ( p_hwfn , p_ptt , big_ram -> addr_reg_addr , i ) ; addr = BYTES_TO_DWORDS ( big_ram -> data_reg_addr ) ; len = BRB_REG_BIG_RAM_DATA_SIZE ; offset += qed_grc_dump_addr_range ( p_hwfn , p_ptt , dump_buf + offset , dump , addr , len , false , SPLIT_TYPE_NONE , 0 ) ; } return offset ; }
Dumps GRC Big RAM.
Dumps GRC Big RAM .
/* Dump memory header */ /* Read and dump Big RAM data */ /* Dump Big RAM */