Lines Matching refs:cr

74 static int ccp_do_cmd(struct ccp_op *op, u32 *cr, unsigned int cr_count)  in ccp_do_cmd()  argument
107 iowrite32(*(cr + i), cr_addr); in ccp_do_cmd()
150 u32 cr[6]; in ccp_perform_aes() local
153 cr[0] = (CCP_ENGINE_AES << REQ1_ENGINE_SHIFT) in ccp_perform_aes()
158 cr[1] = op->src.u.dma.length - 1; in ccp_perform_aes()
159 cr[2] = ccp_addr_lo(&op->src.u.dma); in ccp_perform_aes()
160 cr[3] = (op->sb_ctx << REQ4_KSB_SHIFT) in ccp_perform_aes()
163 cr[4] = ccp_addr_lo(&op->dst.u.dma); in ccp_perform_aes()
164 cr[5] = (CCP_MEMTYPE_SYSTEM << REQ6_MEMTYPE_SHIFT) in ccp_perform_aes()
168 cr[0] |= ((0x7f) << REQ1_AES_CFB_SIZE_SHIFT); in ccp_perform_aes()
171 cr[0] |= REQ1_EOM; in ccp_perform_aes()
174 cr[0] |= REQ1_INIT; in ccp_perform_aes()
176 return ccp_do_cmd(op, cr, ARRAY_SIZE(cr)); in ccp_perform_aes()
181 u32 cr[6]; in ccp_perform_xts_aes() local
184 cr[0] = (CCP_ENGINE_XTS_AES_128 << REQ1_ENGINE_SHIFT) in ccp_perform_xts_aes()
188 cr[1] = op->src.u.dma.length - 1; in ccp_perform_xts_aes()
189 cr[2] = ccp_addr_lo(&op->src.u.dma); in ccp_perform_xts_aes()
190 cr[3] = (op->sb_ctx << REQ4_KSB_SHIFT) in ccp_perform_xts_aes()
193 cr[4] = ccp_addr_lo(&op->dst.u.dma); in ccp_perform_xts_aes()
194 cr[5] = (CCP_MEMTYPE_SYSTEM << REQ6_MEMTYPE_SHIFT) in ccp_perform_xts_aes()
198 cr[0] |= REQ1_EOM; in ccp_perform_xts_aes()
201 cr[0] |= REQ1_INIT; in ccp_perform_xts_aes()
203 return ccp_do_cmd(op, cr, ARRAY_SIZE(cr)); in ccp_perform_xts_aes()
208 u32 cr[6]; in ccp_perform_sha() local
211 cr[0] = (CCP_ENGINE_SHA << REQ1_ENGINE_SHIFT) in ccp_perform_sha()
214 cr[1] = op->src.u.dma.length - 1; in ccp_perform_sha()
215 cr[2] = ccp_addr_lo(&op->src.u.dma); in ccp_perform_sha()
216 cr[3] = (op->sb_ctx << REQ4_KSB_SHIFT) in ccp_perform_sha()
221 cr[0] |= REQ1_EOM; in ccp_perform_sha()
222 cr[4] = lower_32_bits(op->u.sha.msg_bits); in ccp_perform_sha()
223 cr[5] = upper_32_bits(op->u.sha.msg_bits); in ccp_perform_sha()
225 cr[4] = 0; in ccp_perform_sha()
226 cr[5] = 0; in ccp_perform_sha()
229 return ccp_do_cmd(op, cr, ARRAY_SIZE(cr)); in ccp_perform_sha()
234 u32 cr[6]; in ccp_perform_rsa() local
237 cr[0] = (CCP_ENGINE_RSA << REQ1_ENGINE_SHIFT) in ccp_perform_rsa()
241 cr[1] = op->u.rsa.input_len - 1; in ccp_perform_rsa()
242 cr[2] = ccp_addr_lo(&op->src.u.dma); in ccp_perform_rsa()
243 cr[3] = (op->sb_ctx << REQ4_KSB_SHIFT) in ccp_perform_rsa()
246 cr[4] = ccp_addr_lo(&op->dst.u.dma); in ccp_perform_rsa()
247 cr[5] = (CCP_MEMTYPE_SYSTEM << REQ6_MEMTYPE_SHIFT) in ccp_perform_rsa()
250 return ccp_do_cmd(op, cr, ARRAY_SIZE(cr)); in ccp_perform_rsa()
255 u32 cr[6]; in ccp_perform_passthru() local
258 cr[0] = (CCP_ENGINE_PASSTHRU << REQ1_ENGINE_SHIFT) in ccp_perform_passthru()
263 cr[1] = op->src.u.dma.length - 1; in ccp_perform_passthru()
265 cr[1] = op->dst.u.dma.length - 1; in ccp_perform_passthru()
268 cr[2] = ccp_addr_lo(&op->src.u.dma); in ccp_perform_passthru()
269 cr[3] = (CCP_MEMTYPE_SYSTEM << REQ4_MEMTYPE_SHIFT) in ccp_perform_passthru()
273 cr[3] |= (op->sb_key << REQ4_KSB_SHIFT); in ccp_perform_passthru()
275 cr[2] = op->src.u.sb * CCP_SB_BYTES; in ccp_perform_passthru()
276 cr[3] = (CCP_MEMTYPE_SB << REQ4_MEMTYPE_SHIFT); in ccp_perform_passthru()
280 cr[4] = ccp_addr_lo(&op->dst.u.dma); in ccp_perform_passthru()
281 cr[5] = (CCP_MEMTYPE_SYSTEM << REQ6_MEMTYPE_SHIFT) in ccp_perform_passthru()
284 cr[4] = op->dst.u.sb * CCP_SB_BYTES; in ccp_perform_passthru()
285 cr[5] = (CCP_MEMTYPE_SB << REQ6_MEMTYPE_SHIFT); in ccp_perform_passthru()
289 cr[0] |= REQ1_EOM; in ccp_perform_passthru()
291 return ccp_do_cmd(op, cr, ARRAY_SIZE(cr)); in ccp_perform_passthru()
296 u32 cr[6]; in ccp_perform_ecc() local
299 cr[0] = REQ1_ECC_AFFINE_CONVERT in ccp_perform_ecc()
303 cr[1] = op->src.u.dma.length - 1; in ccp_perform_ecc()
304 cr[2] = ccp_addr_lo(&op->src.u.dma); in ccp_perform_ecc()
305 cr[3] = (CCP_MEMTYPE_SYSTEM << REQ4_MEMTYPE_SHIFT) in ccp_perform_ecc()
307 cr[4] = ccp_addr_lo(&op->dst.u.dma); in ccp_perform_ecc()
308 cr[5] = (CCP_MEMTYPE_SYSTEM << REQ6_MEMTYPE_SHIFT) in ccp_perform_ecc()
311 return ccp_do_cmd(op, cr, ARRAY_SIZE(cr)); in ccp_perform_ecc()