Skip to content

Commit

Permalink
scsi: hisi_sas: Add BIST support for phy loopback
Browse files Browse the repository at this point in the history
Add BIST (built in self test) support for phy loopback.

Through the new debugfs interface, the user can configure loopback
mode/linkrate/phy id/code mode before enabling it. And also user can
enable/disable BIST function.

Link: https://lore.kernel.org/r/1567774537-20003-13-git-send-email-john.garry@huawei.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Xiang Chen authored and Martin K. Petersen committed Sep 11, 2019
1 parent 7ec7082 commit 97b151e
Show file tree
Hide file tree
Showing 3 changed files with 543 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/scsi/hisi_sas/hisi_sas.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ struct hisi_sas_hw {
int delay_ms, int timeout_ms);
void (*snapshot_prepare)(struct hisi_hba *hisi_hba);
void (*snapshot_restore)(struct hisi_hba *hisi_hba);
int (*set_bist)(struct hisi_hba *hisi_hba, bool enable);
void (*read_iost_itct_cache)(struct hisi_hba *hisi_hba,
enum hisi_sas_debugfs_cache_type type,
u32 *cache);
Expand Down Expand Up @@ -391,6 +392,14 @@ struct hisi_hba {
int cq_nvecs;
unsigned int *reply_map;

/* bist */
enum sas_linkrate debugfs_bist_linkrate;
int debugfs_bist_code_mode;
int debugfs_bist_phy_no;
int debugfs_bist_mode;
u32 debugfs_bist_cnt;
int debugfs_bist_enable;

/* debugfs memories */
/* Put Global AXI and RAS Register into register array */
u32 *debugfs_regs[DEBUGFS_REGS_NUM];
Expand All @@ -404,6 +413,7 @@ struct hisi_hba {

struct dentry *debugfs_dir;
struct dentry *debugfs_dump_dentry;
struct dentry *debugfs_bist_dentry;
bool debugfs_snapshot;
};

Expand Down
Loading

0 comments on commit 97b151e

Please sign in to comment.