Lines Matching full:ss
3 * sun4i-ss-hash.c - hardware cryptographic accelerator for Allwinner A20 SoC
11 #include "sun4i-ss.h"
28 op->ss = algt->ss; in sun4i_hash_crainit()
30 err = pm_runtime_get_sync(op->ss->dev); in sun4i_hash_crainit()
43 pm_runtime_put(op->ss->dev); in sun4i_hash_craexit()
154 * Write data by step of 32bits and put then in the SS.
160 * So the first work is to get the number of bytes to write to SS modulo 64
195 struct sun4i_ss_ctx *ss = tfmctx->ss; in sun4i_hash() local
202 dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x", in sun4i_hash()
212 dev_err(ss->dev, "Cannot process too large request\n"); in sun4i_hash()
224 spin_lock_bh(&ss->slock); in sun4i_hash()
233 writel(op->hash[i], ss->base + SS_IV0 + i * 4); in sun4i_hash()
236 writel(op->mode | SS_ENABLED | ivmode, ss->base + SS_CTL); in sun4i_hash()
246 dev_err(ss->dev, "ERROR: Bound error %u %u\n", in sun4i_hash()
267 dev_dbg(ss->dev, "We can DMA\n"); in sun4i_hash()
302 writesl(ss->base + SS_RXFIFO, op->buf, in sun4i_hash()
314 writesl(ss->base + SS_RXFIFO, mi.addr + in_i, todo); in sun4i_hash()
320 spaces = readl(ss->base + SS_FCSR); in sun4i_hash()
360 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL); in sun4i_hash()
363 v = readl(ss->base + SS_CTL); in sun4i_hash()
367 dev_err_ratelimited(ss->dev, in sun4i_hash()
384 op->hash[i] = readl(ss->base + SS_MD0 + i * 4); in sun4i_hash()
392 * Then ask the SS for finalizing the hashing operation in sun4i_hash()
397 * 3 remaining bytes to write and SS is fast enough to not care about it. in sun4i_hash()
406 writesl(ss->base + SS_RXFIFO, op->buf, nwait); in sun4i_hash()
448 writesl(ss->base + SS_RXFIFO, bf, j); in sun4i_hash()
450 /* Tell the SS to stop the hashing */ in sun4i_hash()
451 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL); in sun4i_hash()
454 * Wait for SS to finish the hash. in sun4i_hash()
460 v = readl(ss->base + SS_CTL); in sun4i_hash()
464 dev_err_ratelimited(ss->dev, in sun4i_hash()
483 v = readl(ss->base + SS_MD0 + i * 4); in sun4i_hash()
484 if (ss->variant->sha1_in_be) in sun4i_hash()
491 v = readl(ss->base + SS_MD0 + i * 4); in sun4i_hash()
497 writel(0, ss->base + SS_CTL); in sun4i_hash()
498 spin_unlock_bh(&ss->slock); in sun4i_hash()