lkml.org 
[lkml]   [2023]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/4] crypto: starfive - Add hash and HMAC support
On Mon, Jan 30, 2023 at 11:42:42PM +0800, Jia Jie Ho wrote:
>
> +static inline int starfive_hash_wait_hmac_done(struct starfive_cryp_ctx *ctx)
> +{
> + struct starfive_cryp_dev *cryp = ctx->cryp;
> + u32 status;
> +
> + return readl_relaxed_poll_timeout(cryp->base + STARFIVE_HASH_SHACSR, status,
> + (status & STARFIVE_HASH_HMAC_DONE), 10, 100000);
> +}
> +
> +static inline int starfive_hash_wait_busy(struct starfive_cryp_ctx *ctx)
> +{
> + struct starfive_cryp_dev *cryp = ctx->cryp;
> + u32 status;
> +
> + return readl_relaxed_poll_timeout(cryp->base + STARFIVE_HASH_SHACSR, status,
> + !(status & STARFIVE_HASH_BUSY), 10, 100000);
> +}
> +
> +static inline int starfive_hash_wait_key_done(struct starfive_cryp_ctx *ctx)
> +{
> + struct starfive_cryp_dev *cryp = ctx->cryp;
> + u32 status;
> +
> + return readl_relaxed_poll_timeout(cryp->base + STARFIVE_HASH_SHACSR, status,
> + (status & STARFIVE_HASH_KEY_DONE), 10, 100000);
> +}

Is there no IRQ mechanism for this?

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2023-03-27 00:16    [W:0.415 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site