diff options
author | Corentin Labbe <clabbe.montjoie@gmail.com> | 2019-11-20 18:28:33 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-12-11 11:36:05 +0300 |
commit | 1e02e6fbdadb3a0cb56294ff37eeeb8109e1f493 (patch) | |
tree | e0f914cbe7238615c146c311554cbfbc8ebac4cb /drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c | |
parent | 6b3413f30dd6bf406a2579ab2ea4d25979a81cd3 (diff) | |
download | linux-1e02e6fbdadb3a0cb56294ff37eeeb8109e1f493.tar.xz |
crypto: sun4i-ss - add the A33 variant of SS
The A33 SS has a difference with all other SS, it give SHA1 digest
directly in BE.
So this patch adds variant support in sun4i-ss.
Fixes: 6298e948215f ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c')
-rw-r--r-- | drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c index fdc0e6cdbb85..dc35edd90034 100644 --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c @@ -479,7 +479,10 @@ hash_final: /* Get the hash from the device */ if (op->mode == SS_OP_SHA1) { for (i = 0; i < 5; i++) { - v = cpu_to_be32(readl(ss->base + SS_MD0 + i * 4)); + if (ss->variant->sha1_in_be) + v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4)); + else + v = cpu_to_be32(readl(ss->base + SS_MD0 + i * 4)); memcpy(areq->result + i * 4, &v, 4); } } else { |