Re: [PATCH 2/2] crypto: hisilicon/zip - optimize the address offset of the reg query function

From: huangchenghai
Date: Fri May 31 2024 - 06:09:18 EST



在 2024/5/31 17:33, Herbert Xu 写道:
On Mon, May 06, 2024 at 07:59:53PM +0800, Chenghai Huang wrote:
@@ -807,6 +786,18 @@ static int hisi_zip_regs_show(struct seq_file *s, void *unused)
DEFINE_SHOW_ATTRIBUTE(hisi_zip_regs);
+static void __iomem *get_zip_core_addr(struct hisi_qm *qm, int core_num)
+{
+ u32 zip_comp_core_num = qm->cap_tables.dev_cap_table[ZIP_CLUSTER_COMP_NUM_CAP_IDX].cap_val;
+
+ if (core_num < zip_comp_core_num)
+ return qm->io_base + HZIP_CORE_DFX_BASE +
+ (core_num + 1) * HZIP_CORE_ADDR_INTRVL;
+
+ qm->io_base + HZIP_CORE_DFX_DECOMP_BASE +
+ (core_num - zip_comp_core_num) * HZIP_CORE_ADDR_INTRVL;
+}
+
This doesn't even build.

I'm so sorry, I forgot to build it. I'll build and verify it carefully next time.

The second version will be corrected and send soon.

Thanks,
ChengHai