Skip to content

Commit bffa1fc

Browse files
yekai123123herbertx
authored andcommitted
crypto: hisilicon/sec - only HW V2 needs to change the BD err detection
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]>
1 parent d61a7b3 commit bffa1fc

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/crypto/hisilicon/sec2/sec_main.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,17 @@ static int sec_engine_init(struct hisi_qm *qm)
508508

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

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

516-
/* Enable sm4 xts mode multiple iv */
517-
writel_relaxed(SEC_BD_ERR_CHK_EN1,
518-
qm->io_base + SEC_BD_ERR_CHK_EN_REG1);
519-
writel_relaxed(SEC_BD_ERR_CHK_EN3,
520-
qm->io_base + SEC_BD_ERR_CHK_EN_REG3);
516+
/* HW V2 enable sm4 xts mode multiple iv */
517+
writel_relaxed(SEC_BD_ERR_CHK_EN1,
518+
qm->io_base + SEC_BD_ERR_CHK_EN_REG1);
519+
writel_relaxed(SEC_BD_ERR_CHK_EN3,
520+
qm->io_base + SEC_BD_ERR_CHK_EN_REG3);
521+
}
521522

522523
/* config endian */
523524
sec_set_endian(qm);

0 commit comments

Comments
 (0)