Lines Matching refs:se
25 struct tegra_se *se; member
214 static int tegra_sha_prep_cmd(struct tegra_se *se, u32 *cpuvaddr, in tegra_sha_prep_cmd() argument
274 host1x_uclass_incr_syncpt_indx_f(se->syncpt_id); in tegra_sha_prep_cmd()
276 dev_dbg(se->dev, "msg len %llu msg left %llu cfg %#x", in tegra_sha_prep_cmd()
282 static void tegra_sha_copy_hash_result(struct tegra_se *se, struct tegra_sha_reqctx *rctx) in tegra_sha_copy_hash_result() argument
287 rctx->result[i] = readl(se->base + se->hw->regs->result + (i * 4)); in tegra_sha_copy_hash_result()
290 static void tegra_sha_paste_hash_result(struct tegra_se *se, struct tegra_sha_reqctx *rctx) in tegra_sha_paste_hash_result() argument
296 se->base + se->hw->regs->result + (i * 4)); in tegra_sha_paste_hash_result()
304 u32 *cpuvaddr = ctx->se->cmdbuf->addr; in tegra_sha_do_update()
356 tegra_sha_paste_hash_result(ctx->se, rctx); in tegra_sha_do_update()
358 size = tegra_sha_prep_cmd(ctx->se, cpuvaddr, rctx); in tegra_sha_do_update()
360 ret = tegra_se_host1x_submit(ctx->se, size); in tegra_sha_do_update()
368 tegra_sha_copy_hash_result(ctx->se, rctx); in tegra_sha_do_update()
378 struct tegra_se *se = ctx->se; in tegra_sha_do_final() local
379 u32 *cpuvaddr = se->cmdbuf->addr; in tegra_sha_do_final()
389 size = tegra_sha_prep_cmd(se, cpuvaddr, rctx); in tegra_sha_do_final()
391 ret = tegra_se_host1x_submit(se, size); in tegra_sha_do_final()
399 dma_free_coherent(se->dev, SE_SHA_BUFLEN, in tegra_sha_do_final()
401 dma_free_coherent(se->dev, crypto_ahash_blocksize(tfm), in tegra_sha_do_final()
403 dma_free_coherent(se->dev, rctx->digest.size, rctx->digest.buf, in tegra_sha_do_final()
414 struct tegra_se *se = ctx->se; in tegra_sha_do_one_req() local
427 crypto_finalize_hash_request(se->engine, req, ret); in tegra_sha_do_one_req()
441 dev_warn(ctx->se->dev, in tegra_sha_init_fallback()
472 ctx->se = se_alg->se_dev; in tegra_sha_cra_init()
478 dev_err(ctx->se->dev, "invalid algorithm\n"); in tegra_sha_cra_init()
497 tegra_key_invalidate(ctx->se, ctx->key_id, ctx->alg); in tegra_sha_cra_exit()
505 struct tegra_se *se = ctx->se; in tegra_sha_init() local
519 rctx->digest.buf = dma_alloc_coherent(se->dev, rctx->digest.size, in tegra_sha_init()
524 rctx->residue.buf = dma_alloc_coherent(se->dev, rctx->blk_size, in tegra_sha_init()
529 rctx->datbuf.buf = dma_alloc_coherent(se->dev, SE_SHA_BUFLEN, in tegra_sha_init()
537 dma_free_coherent(se->dev, rctx->blk_size, rctx->residue.buf, in tegra_sha_init()
540 dma_free_coherent(se->dev, SE_SHA_BUFLEN, rctx->datbuf.buf, in tegra_sha_init()
550 dev_dbg(ctx->se->dev, "invalid key length (%d)\n", keylen); in tegra_hmac_fallback_setkey()
568 return tegra_key_submit(ctx->se, key, keylen, ctx->alg, &ctx->key_id); in tegra_hmac_setkey()
582 return crypto_transfer_hash_request_to_engine(ctx->se->engine, req); in tegra_sha_update()
596 return crypto_transfer_hash_request_to_engine(ctx->se->engine, req); in tegra_sha_final()
610 return crypto_transfer_hash_request_to_engine(ctx->se->engine, req); in tegra_sha_finup()
625 return crypto_transfer_hash_request_to_engine(ctx->se->engine, req); in tegra_sha_digest()
1026 int tegra_init_hash(struct tegra_se *se) in tegra_init_hash() argument
1031 se->manifest = tegra_hash_kac_manifest; in tegra_init_hash()
1034 tegra_hash_algs[i].se_dev = se; in tegra_init_hash()
1039 dev_err(se->dev, "failed to register %s\n", in tegra_init_hash()
1054 void tegra_deinit_hash(struct tegra_se *se) in tegra_deinit_hash() argument