Lines Matching refs:td

28 	struct rkce_hash_td		*td;  member
33 struct rkce_symm_td *td; member
244 hw_ctx->td = rkce_cma_alloc(sizeof(struct rkce_hash_td)); in rkce_sha_ctx_alloc()
245 if (!hw_ctx->td) in rkce_sha_ctx_alloc()
248 memset(hw_ctx->td, 0x00, sizeof(struct rkce_hash_td)); in rkce_sha_ctx_alloc()
258 rkce_cma_free(hw_ctx->td); in rkce_sha_ctx_alloc()
270 rkce_cma_free(hw_ctx->td); in rkce_sha_ctx_free()
295 ret = rkce_init_hash_td(hash_ctx->td, hash_ctx->td_buf); in rk_sha_init()
333 struct rkce_hash_td *td; in rk_sha_update() local
343 td = hash_ctx->td; in rk_sha_update()
345 td->ctrl = hash_ctx->ctrl; in rk_sha_update()
346 memset(&td->sg, 0x00, sizeof(*td->sg)); in rk_sha_update()
352 td->ctrl.last_pkg = 1; in rk_sha_update()
355 td->sg[0].src_addr_h = rkce_cma_virt2phys(input) >> 32; in rk_sha_update()
357 td->sg[0].src_addr_l = rkce_cma_virt2phys(input) & 0xffffffff; in rk_sha_update()
358 td->sg[0].src_size = len; in rk_sha_update()
365 crypto_flush_cacheline((ulong)hash_ctx->td, sizeof(*hash_ctx->td)); in rk_sha_update()
368 ret = rkce_push_td_sync(priv->hardware, td, RKCE_HASH_TIMEOUT_MS); in rk_sha_update()
608 hw_ctx->td = rkce_cma_alloc(sizeof(struct rkce_symm_td)); in rkce_cipher_ctx_alloc()
609 if (!hw_ctx->td) in rkce_cipher_ctx_alloc()
612 memset(hw_ctx->td, 0x00, sizeof(struct rkce_symm_td)); in rkce_cipher_ctx_alloc()
628 rkce_cma_free(hw_ctx->td); in rkce_cipher_ctx_alloc()
641 rkce_cma_free(hw_ctx->td); in rkce_cipher_ctx_free()
727 int rk_set_symm_td_sg(struct rkce_symm_td *td, in rk_set_symm_td_sg() argument
730 memset(td->sg, 0x00, sizeof(td->sg)); in rk_set_symm_td_sg()
733 td->sg[0].src_addr_h = rkce_cma_virt2phys(in) >> 32; in rk_set_symm_td_sg()
735 td->sg[0].src_addr_l = rkce_cma_virt2phys(in) & 0xffffffff; in rk_set_symm_td_sg()
736 td->sg[0].src_size = in_len; in rk_set_symm_td_sg()
740 td->sg[0].dst_addr_h = rkce_cma_virt2phys(out) >> 32; in rk_set_symm_td_sg()
742 td->sg[0].dst_addr_l = rkce_cma_virt2phys(out) & 0xffffffff; in rk_set_symm_td_sg()
743 td->sg[0].dst_size = out_len; in rk_set_symm_td_sg()
746 td->next_task = 0; in rk_set_symm_td_sg()
774 rkce_init_symm_td(hw_ctx->td, hw_ctx->td_buf); in rk_crypto_cipher()
776 hw_ctx->td->ctrl.td_type = RKCE_TD_TYPE_SYMM; in rk_crypto_cipher()
777 hw_ctx->td->ctrl.is_dec = !enc; in rk_crypto_cipher()
778 hw_ctx->td->ctrl.symm_algo = ce_algo; in rk_crypto_cipher()
779 hw_ctx->td->ctrl.symm_mode = ce_mode; in rk_crypto_cipher()
780 hw_ctx->td->ctrl.key_size = rk_get_td_keysize(ce_algo, ce_mode, ctx->key_len); in rk_crypto_cipher()
781 hw_ctx->td->ctrl.first_pkg = 1; in rk_crypto_cipher()
782 hw_ctx->td->ctrl.last_pkg = 1; in rk_crypto_cipher()
783 hw_ctx->td->ctrl.int_en = 1; in rk_crypto_cipher()
784 hw_ctx->td->ctrl.key_sel = use_otpkey ? RKCE_KEY_SEL_KT : RKCE_KEY_SEL_USER; in rk_crypto_cipher()
787 hw_ctx->td->ctrl.iv_len = ctx->iv_len; in rk_crypto_cipher()
795 ret = rk_set_symm_td_sg(hw_ctx->td, in, len, out, len); in rk_crypto_cipher()
816 hw_ctx->td->ctrl.iv_len = new_iv_len; in rk_crypto_cipher()
820 hw_ctx->td_aad->ctrl = hw_ctx->td->ctrl; in rk_crypto_cipher()
851 hw_ctx->td_aad->ctrl = hw_ctx->td->ctrl; in rk_crypto_cipher()
871 crypto_flush_cacheline((ulong)hw_ctx->td, sizeof(*hw_ctx->td)); in rk_crypto_cipher()
879 ret = rkce_push_td_sync(priv->hardware, hw_ctx->td, RKCE_SYMM_TIMEOUT_MS); in rk_crypto_cipher()