Commit c965db44 authored by Tomer Tayar's avatar Tomer Tayar Committed by David S. Miller

qed: Add support for debug data collection

This patch adds the support for dumping and formatting the HW/FW debug data.
Signed-off-by: default avatarTomer Tayar <Tomer.Tayar@qlogic.com>
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 936f0600
...@@ -2,5 +2,5 @@ obj-$(CONFIG_QED) := qed.o ...@@ -2,5 +2,5 @@ obj-$(CONFIG_QED) := qed.o
qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \ qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
qed_int.o qed_main.o qed_mcp.o qed_sp_commands.o qed_spq.o qed_l2.o \ qed_int.o qed_main.o qed_mcp.o qed_sp_commands.o qed_spq.o qed_l2.o \
qed_selftest.o qed_dcbx.o qed_selftest.o qed_dcbx.o qed_debug.o
qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/zlib.h> #include <linux/zlib.h>
#include <linux/hashtable.h> #include <linux/hashtable.h>
#include <linux/qed/qed_if.h> #include <linux/qed/qed_if.h>
#include "qed_debug.h"
#include "qed_hsi.h" #include "qed_hsi.h"
extern const struct qed_common_ops qed_common_ops_pass; extern const struct qed_common_ops qed_common_ops_pass;
...@@ -395,6 +396,8 @@ struct qed_hwfn { ...@@ -395,6 +396,8 @@ struct qed_hwfn {
/* Buffer for unzipping firmware data */ /* Buffer for unzipping firmware data */
void *unzip_buf; void *unzip_buf;
struct dbg_tools_data dbg_info;
struct qed_simd_fp_handler simd_proto_handler[64]; struct qed_simd_fp_handler simd_proto_handler[64];
#ifdef CONFIG_QED_SRIOV #ifdef CONFIG_QED_SRIOV
...@@ -430,6 +433,19 @@ struct qed_int_params { ...@@ -430,6 +433,19 @@ struct qed_int_params {
u8 fp_msix_cnt; u8 fp_msix_cnt;
}; };
struct qed_dbg_feature {
struct dentry *dentry;
u8 *dump_buf;
u32 buf_size;
u32 dumped_dwords;
};
struct qed_dbg_params {
struct qed_dbg_feature features[DBG_FEATURE_NUM];
u8 engine_for_debug;
bool print_data;
};
struct qed_dev { struct qed_dev {
u32 dp_module; u32 dp_module;
u8 dp_level; u8 dp_level;
...@@ -444,6 +460,8 @@ struct qed_dev { ...@@ -444,6 +460,8 @@ struct qed_dev {
CHIP_REV_IS_A0(dev)) CHIP_REV_IS_A0(dev))
#define QED_IS_BB_B0(dev) (QED_IS_BB(dev) && \ #define QED_IS_BB_B0(dev) (QED_IS_BB(dev) && \
CHIP_REV_IS_B0(dev)) CHIP_REV_IS_B0(dev))
#define QED_IS_AH(dev) ((dev)->type == QED_DEV_TYPE_AH)
#define QED_IS_K2(dev) QED_IS_AH(dev)
#define QED_GET_TYPE(dev) (QED_IS_BB_A0(dev) ? CHIP_BB_A0 : \ #define QED_GET_TYPE(dev) (QED_IS_BB_A0(dev) ? CHIP_BB_A0 : \
QED_IS_BB_B0(dev) ? CHIP_BB_B0 : CHIP_K2) QED_IS_BB_B0(dev) ? CHIP_BB_B0 : CHIP_K2)
...@@ -544,6 +562,8 @@ struct qed_dev { ...@@ -544,6 +562,8 @@ struct qed_dev {
} protocol_ops; } protocol_ops;
void *ops_cookie; void *ops_cookie;
struct qed_dbg_params dbg_params;
const struct firmware *firmware; const struct firmware *firmware;
}; };
......
This diff is collapsed.
/* QLogic qed NIC Driver
* Copyright (c) 2015 QLogic Corporation
*
* This software is available under the terms of the GNU General Public License
* (GPL) Version 2, available from the file COPYING in the main directory of
* this source tree.
*/
#ifndef _QED_DEBUGFS_H
#define _QED_DEBUGFS_H
enum qed_dbg_features {
DBG_FEATURE_GRC,
DBG_FEATURE_IDLE_CHK,
DBG_FEATURE_MCP_TRACE,
DBG_FEATURE_REG_FIFO,
DBG_FEATURE_IGU_FIFO,
DBG_FEATURE_PROTECTION_OVERRIDE,
DBG_FEATURE_FW_ASSERTS,
DBG_FEATURE_NUM
};
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);
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_mcp_trace(struct qed_dev *cdev, void *buffer,
u32 *num_dumped_bytes);
int qed_dbg_mcp_trace_size(struct qed_dev *cdev);
int qed_dbg_all_data(struct qed_dev *cdev, void *buffer);
int qed_dbg_all_data_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);
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);
void qed_dbg_pf_init(struct qed_dev *cdev);
void qed_dbg_pf_exit(struct qed_dev *cdev);
#endif
This diff is collapsed.
...@@ -588,6 +588,8 @@ static int qed_nic_stop(struct qed_dev *cdev) ...@@ -588,6 +588,8 @@ static int qed_nic_stop(struct qed_dev *cdev)
} }
} }
qed_dbg_pf_exit(cdev);
return rc; return rc;
} }
...@@ -846,6 +848,8 @@ static int qed_slowpath_start(struct qed_dev *cdev, ...@@ -846,6 +848,8 @@ static int qed_slowpath_start(struct qed_dev *cdev,
/* First Dword used to diffrentiate between various sources */ /* First Dword used to diffrentiate between various sources */
data = cdev->firmware->data + sizeof(u32); data = cdev->firmware->data + sizeof(u32);
qed_dbg_pf_init(cdev);
} }
memset(&tunn_info, 0, sizeof(tunn_info)); memset(&tunn_info, 0, sizeof(tunn_info));
......
...@@ -143,6 +143,9 @@ ...@@ -143,6 +143,9 @@
#define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2) #define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2)
#define GTT_DWORD_SIZE BIT(GTT_DWORD_SIZE_BITS) #define GTT_DWORD_SIZE BIT(GTT_DWORD_SIZE_BITS)
/* Tools Version */
#define TOOLS_VERSION 10
/*****************/ /*****************/
/* CDU CONSTANTS */ /* CDU CONSTANTS */
/*****************/ /*****************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment