Lines Matching defs:caps

178 	const struct stm32_cryp_caps *caps;
276 return readl_relaxed_poll_timeout(cryp->regs + cryp->caps->sr, status,
282 writel_relaxed(readl_relaxed(cryp->regs + cryp->caps->cr) | CR_CRYPEN,
283 cryp->regs + cryp->caps->cr);
290 return readl_relaxed_poll_timeout(cryp->regs + cryp->caps->cr, status,
298 return readl_relaxed_poll_timeout(cryp->regs + cryp->caps->sr, status,
304 writel_relaxed(readl_relaxed(cryp->regs + cryp->caps->cr) | CR_KEYRDEN,
305 cryp->regs + cryp->caps->cr);
310 writel_relaxed(readl_relaxed(cryp->regs + cryp->caps->cr) & ~CR_KEYRDEN,
311 cryp->regs + cryp->caps->cr);
342 stm32_cryp_write(cryp, cryp->caps->iv0l, be32_to_cpu(*iv++));
343 stm32_cryp_write(cryp, cryp->caps->iv0r, be32_to_cpu(*iv++));
346 stm32_cryp_write(cryp, cryp->caps->iv1l, be32_to_cpu(*iv++));
347 stm32_cryp_write(cryp, cryp->caps->iv1r, be32_to_cpu(*iv++));
359 if (cryp->caps->iv_protection)
362 *tmp++ = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv0l));
363 *tmp++ = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv0r));
366 *tmp++ = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv1l));
367 *tmp++ = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv1r));
370 if (cryp->caps->iv_protection)
464 stm32_cryp_write(c, c->caps->k1l, be32_to_cpu(c->ctx->key[0]));
465 stm32_cryp_write(c, c->caps->k1r, be32_to_cpu(c->ctx->key[1]));
475 if (is_aes(c) && c->caps->linear_aes_key) {
481 r_id = c->caps->k1l;
488 r_id = c->caps->k3r;
543 stm32_cryp_write(cryp, cryp->caps->cr, cfg | CR_PH_INIT | CR_CRYPEN);
555 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
558 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
575 stm32_cryp_write(cryp, cryp->caps->imsc, 0);
582 cfg = stm32_cryp_read(cryp, cryp->caps->cr);
584 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
588 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
627 writesl(cryp->regs + cryp->caps->din, block, AES_BLOCK_32);
663 stm32_cryp_write(cryp, cryp->caps->cr, cfg | CR_PH_INIT | CR_CRYPEN);
672 if (!cryp->caps->padding_wa)
674 stm32_cryp_write(cryp, cryp->caps->din, xd);
687 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
693 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
707 stm32_cryp_write(cryp, cryp->caps->imsc, 0);
735 if (cryp->caps->kp_mode)
736 stm32_cryp_write(cryp, cryp->caps->cr,
740 cryp->caps->cr, cfg | CR_AES_ECB | CR_KSE);
757 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
764 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
823 stm32_cryp_write(cryp, cryp->caps->imsc, IMSCR_IN | IMSCR_OUT);
1281 cfg = stm32_cryp_read(cryp, cryp->caps->cr);
1288 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1293 if (cryp->caps->swap_final)
1296 stm32_cryp_write(cryp, cryp->caps->din, 0);
1297 stm32_cryp_write(cryp, cryp->caps->din, size_bit);
1302 if (cryp->caps->swap_final)
1305 stm32_cryp_write(cryp, cryp->caps->din, 0);
1306 stm32_cryp_write(cryp, cryp->caps->din, size_bit);
1319 if (!cryp->caps->padding_wa)
1321 stm32_cryp_write(cryp, cryp->caps->din, xiv);
1336 readsl(cryp->regs + cryp->caps->dout, out_tag, AES_BLOCK_32);
1343 readsl(cryp->regs + cryp->caps->dout, out_tag, AES_BLOCK_32);
1351 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1367 cr = stm32_cryp_read(cryp, cryp->caps->cr);
1368 stm32_cryp_write(cryp, cryp->caps->cr, cr & ~CR_CRYPEN);
1372 stm32_cryp_write(cryp, cryp->caps->cr, cr);
1376 cryp->last_ctr[0] = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv0l));
1377 cryp->last_ctr[1] = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv0r));
1378 cryp->last_ctr[2] = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv1l));
1379 cryp->last_ctr[3] = cpu_to_be32(stm32_cryp_read(cryp, cryp->caps->iv1r));
1386 readsl(cryp->regs + cryp->caps->dout, block, cryp->hw_blocksize / sizeof(u32));
1399 writesl(cryp->regs + cryp->caps->din, block, cryp->hw_blocksize / sizeof(u32));
1412 stm32_cryp_write(cryp, cryp->caps->imsc, 0);
1413 cfg = stm32_cryp_read(cryp, cryp->caps->cr);
1415 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1418 stm32_cryp_write(cryp, cryp->caps->iv1r, cryp->gcm_ctr - 2);
1423 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1427 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1443 readsl(cryp->regs + cryp->caps->dout, block, cryp->hw_blocksize / sizeof(u32));
1453 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1458 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1461 writesl(cryp->regs + cryp->caps->din, block, AES_BLOCK_32);
1471 stm32_cryp_read(cryp, cryp->caps->dout);
1482 cfg = stm32_cryp_read(cryp, cryp->caps->cr);
1484 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1488 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1502 stm32_cryp_write(cryp, cryp->caps->imsc, 0);
1504 cfg = stm32_cryp_read(cryp, cryp->caps->cr);
1506 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1516 stm32_cryp_write(cryp, cryp->caps->iv1r, iv1tmp);
1521 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1525 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1541 readsl(cryp->regs + cryp->caps->dout, block, cryp->hw_blocksize / sizeof(u32));
1554 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1559 stm32_cryp_write(cryp, cryp->caps->cr, cfg);
1565 stm32_cryp_write(cryp, cryp->caps->din, block[i]);
1588 if (cryp->caps->padding_wa) {
1602 if (cryp->caps->padding_wa) {
1627 writesl(cryp->regs + cryp->caps->din, block, AES_BLOCK_32);
1638 u32 it_mask = stm32_cryp_read(cryp, cryp->caps->imsc);
1646 ph = stm32_cryp_read(cryp, cryp->caps->cr) & CR_PH_MASK;
1666 stm32_cryp_write(cryp, cryp->caps->imsc, it_mask);
1678 cryp->irq_status = stm32_cryp_read(cryp, cryp->caps->mis);
1978 cryp->caps = of_device_get_match_data(dev);
1979 if (!cryp->caps)
2057 if (cryp->caps->aeads_support) {
2094 if (cryp->caps->aeads_support)