2023-07-13 15:27:35

by Thomas Bourgoin

[permalink] [raw]
Subject: [PATCH v2 0/7] Support of HASH on STM32MP13

From: Thomas Bourgoin <[email protected]>

The STM32MP13 platform introduces a new version of the IP HASH.
This version of the IP support SHA1, SHA2, SHA3 algorithms and HMAC.
This serie also add some fixes when using the DMA to feed data to the IP.

1. Add new YAML compatible st,stm32mp13-hash.

2. Update driver to support SHA2, SHA3 algorithms for the compatible
st,stm32mp13-hash.

3. Argument bufcnt is unused in function stm32_hash_write_ctrl. Removes it
to simplify the declaration of the function.

4-7. DMA fixes

Changes in v2:
- Add SoB in dt-bindings: crypto: add new compatible for stm32-hash

- Fix regression in crypto: stm32 - add new algorithms support
The macro HASH_CSR_NB_SHA256 was equal to 22 change to 38.

- Update commit message of crypto: stm32 - fix MDMAT condition
Cc: [email protected] and
Reviewed-by: Linus Walleij <[email protected]>

Lionel Debieve (1):
dt-bindings: crypto: add new compatible for stm32-hash

Thomas Bourgoin (6):
crypto: stm32 - add new algorithms support
crypto: stm32 - remove bufcnt in stm32_hash_write_ctrl.
crypto: stm32 - fix loop iterating through scatterlist for DMA
crypto: stm32 - check request size and scatterlist size when using
DMA.
crypto: stm32 - fix MDMAT condition
crypto: stm32 - remove flag HASH_FLAGS_DMA_READY

.../bindings/crypto/st,stm32-hash.yaml | 1 +
drivers/crypto/stm32/Kconfig | 2 +
drivers/crypto/stm32/stm32-hash.c | 710 ++++++++++++++----
3 files changed, 566 insertions(+), 147 deletions(-)

--
2.25.1



2023-07-13 15:27:47

by Thomas Bourgoin

[permalink] [raw]
Subject: [PATCH v2 3/7] crypto: stm32 - remove bufcnt in stm32_hash_write_ctrl.

From: Thomas Bourgoin <[email protected]>

Commit "crypto: stm32 - Fix empty message processing" remove the use of
the argument bufcnt in stm32_hash_write_ctrl.
Hence, we can remove it from the function prototype and simplify the
function declaration.

Signed-off-by: Thomas Bourgoin <[email protected]>
---
drivers/crypto/stm32/stm32-hash.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index 30e42a402aa7..c179a6c1a457 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -286,7 +286,7 @@ static int stm32_hash_write_key(struct stm32_hash_dev *hdev)
return 0;
}

-static void stm32_hash_write_ctrl(struct stm32_hash_dev *hdev, int bufcnt)
+static void stm32_hash_write_ctrl(struct stm32_hash_dev *hdev)
{
struct stm32_hash_request_ctx *rctx = ahash_request_ctx(hdev->req);
struct crypto_ahash *tfm = crypto_ahash_reqtfm(hdev->req);
@@ -395,7 +395,7 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev,

hdev->flags |= HASH_FLAGS_CPU;

- stm32_hash_write_ctrl(hdev, length);
+ stm32_hash_write_ctrl(hdev);

if (stm32_hash_wait_busy(hdev))
return -ETIMEDOUT;
@@ -669,7 +669,7 @@ static int stm32_hash_dma_send(struct stm32_hash_dev *hdev)
if (rctx->nents < 0)
return -EINVAL;

- stm32_hash_write_ctrl(hdev, rctx->total);
+ stm32_hash_write_ctrl(hdev);

if (hdev->flags & HASH_FLAGS_HMAC) {
err = stm32_hash_hmac_dma_send(hdev);
--
2.25.1