Skip to content

Commit

Permalink
crypto: hisilicon/sec - only HW V2 needs to change the BD err detection
Browse files Browse the repository at this point in the history
The base register address of V2 and V3 are different. HW V3 not needs
to change the BD err detection.

Signed-off-by: Kai Ye <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
yekai123123 authored and herbertx committed Jun 17, 2022
1 parent d61a7b3 commit bffa1fc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/crypto/hisilicon/sec2/sec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,17 @@ static int sec_engine_init(struct hisi_qm *qm)

writel(SEC_SAA_ENABLE, qm->io_base + SEC_SAA_EN_REG);

/* HW V2 enable sm4 extra mode, as ctr/ecb */
if (qm->ver < QM_HW_V3)
if (qm->ver < QM_HW_V3) {
/* HW V2 enable sm4 extra mode, as ctr/ecb */
writel_relaxed(SEC_BD_ERR_CHK_EN0,
qm->io_base + SEC_BD_ERR_CHK_EN_REG0);

/* Enable sm4 xts mode multiple iv */
writel_relaxed(SEC_BD_ERR_CHK_EN1,
qm->io_base + SEC_BD_ERR_CHK_EN_REG1);
writel_relaxed(SEC_BD_ERR_CHK_EN3,
qm->io_base + SEC_BD_ERR_CHK_EN_REG3);
/* HW V2 enable sm4 xts mode multiple iv */
writel_relaxed(SEC_BD_ERR_CHK_EN1,
qm->io_base + SEC_BD_ERR_CHK_EN_REG1);
writel_relaxed(SEC_BD_ERR_CHK_EN3,
qm->io_base + SEC_BD_ERR_CHK_EN_REG3);
}

/* config endian */
sec_set_endian(qm);
Expand Down

0 comments on commit bffa1fc

Please sign in to comment.