Skip to content

Commit

Permalink
crypto: hisilicon - Add debugfs for HPRE
Browse files Browse the repository at this point in the history
HiSilicon HPRE engine driver uses debugfs to provide debug information,
the usage can be found in /Documentation/ABI/testing/debugfs-hisi-hpre.

Signed-off-by: Zaibo Xu <xuzaibo@huawei.com>
Signed-off-by: Hui Tang <tanghui20@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Zaibo Xu authored and Herbert Xu committed Oct 10, 2019
1 parent b492f82 commit 8489741
Show file tree
Hide file tree
Showing 2 changed files with 460 additions and 2 deletions.
36 changes: 35 additions & 1 deletion drivers/crypto/hisilicon/hpre/hpre.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,45 @@
#define HPRE_SQE_SIZE sizeof(struct hpre_sqe)
#define HPRE_PF_DEF_Q_NUM 64
#define HPRE_PF_DEF_Q_BASE 0
#define HPRE_CLUSTERS_NUM 4

enum {
HPRE_CLUSTER0,
HPRE_CLUSTER1,
HPRE_CLUSTER2,
HPRE_CLUSTER3,
HPRE_CLUSTERS_NUM,
};

enum hpre_ctrl_dbgfs_file {
HPRE_CURRENT_QM,
HPRE_CLEAR_ENABLE,
HPRE_CLUSTER_CTRL,
HPRE_DEBUG_FILE_NUM,
};

#define HPRE_DEBUGFS_FILE_NUM (HPRE_DEBUG_FILE_NUM + HPRE_CLUSTERS_NUM - 1)

struct hpre_debugfs_file {
int index;
enum hpre_ctrl_dbgfs_file type;
spinlock_t lock;
struct hpre_debug *debug;
};

/*
* One HPRE controller has one PF and multiple VFs, some global configurations
* which PF has need this structure.
* Just relevant for PF.
*/
struct hpre_debug {
struct dentry *debug_root;
struct hpre_debugfs_file files[HPRE_DEBUGFS_FILE_NUM];
};

struct hpre {
struct hisi_qm qm;
struct list_head list;
struct hpre_debug debug;
u32 num_vfs;
unsigned long status;
};
Expand Down
Loading

0 comments on commit 8489741

Please sign in to comment.