Lines Matching refs:cryp
41 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_wait_busy() local
44 return readl_relaxed_poll_timeout(cryp->base + STARFIVE_HASH_SHACSR, status, in starfive_hash_wait_busy()
50 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_wait_key_done() local
53 return readl_relaxed_poll_timeout(cryp->base + STARFIVE_HASH_SHACSR, status, in starfive_hash_wait_key_done()
60 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_hmac_key() local
65 writel(ctx->keylen, cryp->base + STARFIVE_HASH_SHAWKLEN); in starfive_hash_hmac_key()
70 writel(rctx->csr.hash.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_hmac_key()
73 writel(*key, cryp->base + STARFIVE_HASH_SHAWKR); in starfive_hash_hmac_key()
78 writeb(*cl, cryp->base + STARFIVE_HASH_SHAWKR); in starfive_hash_hmac_key()
82 return dev_err_probe(cryp->dev, -ETIMEDOUT, "starfive_hash_wait_key_done error\n"); in starfive_hash_hmac_key()
91 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_start() local
96 dma_unmap_sg(cryp->dev, rctx->in_sg, rctx->in_sg_len, DMA_TO_DEVICE); in starfive_hash_start()
101 writel(alg_cr.v, cryp->base + STARFIVE_ALG_CR_OFFSET); in starfive_hash_start()
103 csr.v = readl(cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_start()
107 stat = readl(cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_hash_start()
109 writel(stat, cryp->base + STARFIVE_IE_MASK_OFFSET); in starfive_hash_start()
110 writel(csr.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_start()
116 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_xmit_dma() local
127 writel(rctx->total, cryp->base + STARFIVE_DMA_IN_LEN_OFFSET); in starfive_hash_xmit_dma()
137 writel(alg_cr.v, cryp->base + STARFIVE_ALG_CR_OFFSET); in starfive_hash_xmit_dma()
139 ret = dma_map_sg(cryp->dev, rctx->in_sg, rctx->in_sg_len, DMA_TO_DEVICE); in starfive_hash_xmit_dma()
141 return dev_err_probe(cryp->dev, -EINVAL, "dma_map_sg() error\n"); in starfive_hash_xmit_dma()
143 cryp->cfg_in.direction = DMA_MEM_TO_DEV; in starfive_hash_xmit_dma()
144 cryp->cfg_in.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in starfive_hash_xmit_dma()
145 cryp->cfg_in.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in starfive_hash_xmit_dma()
146 cryp->cfg_in.src_maxburst = cryp->dma_maxburst; in starfive_hash_xmit_dma()
147 cryp->cfg_in.dst_maxburst = cryp->dma_maxburst; in starfive_hash_xmit_dma()
148 cryp->cfg_in.dst_addr = cryp->phys_base + STARFIVE_ALG_FIFO_OFFSET; in starfive_hash_xmit_dma()
150 dmaengine_slave_config(cryp->tx, &cryp->cfg_in); in starfive_hash_xmit_dma()
152 in_desc = dmaengine_prep_slave_sg(cryp->tx, rctx->in_sg, in starfive_hash_xmit_dma()
163 dma_async_issue_pending(cryp->tx); in starfive_hash_xmit_dma()
171 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_xmit() local
176 writel(rctx->csr.hash.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_xmit()
179 return dev_err_probe(cryp->dev, -ETIMEDOUT, "Error resetting engine.\n"); in starfive_hash_xmit()
192 writel(rctx->csr.hash.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_xmit()
212 data[count] = readl(ctx->cryp->base + STARFIVE_HASH_SHARDR); in starfive_hash_copy_hash()
219 struct starfive_cryp_dev *cryp = (struct starfive_cryp_dev *)param; in starfive_hash_done_task() local
220 int err = cryp->err; in starfive_hash_done_task()
223 err = starfive_hash_copy_hash(cryp->req.hreq); in starfive_hash_done_task()
226 writel(STARFIVE_HASH_RESET, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_done_task()
228 crypto_finalize_hash_request(cryp->engine, cryp->req.hreq, err); in starfive_hash_done_task()
263 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_one_request() local
265 if (!cryp) in starfive_hash_one_request()
360 struct starfive_cryp_dev *cryp = ctx->cryp; in starfive_hash_digest() local
364 cryp->req.hreq = req; in starfive_hash_digest()
375 return crypto_transfer_hash_request_to_engine(cryp->engine, req); in starfive_hash_digest()
412 ctx->cryp = starfive_cryp_find_dev(ctx); in starfive_hash_init_tfm()
414 if (!ctx->cryp) in starfive_hash_init_tfm()
421 return dev_err_probe(ctx->cryp->dev, PTR_ERR(ctx->ahash_fbk), in starfive_hash_init_tfm()