Lines Matching full:ss

3  * sun4i-ss-cipher.c - hardware cryptographic accelerator for Allwinner A20 SoC
13 #include "sun4i-ss.h"
19 struct sun4i_ss_ctx *ss = op->ss; in sun4i_ss_opti_poll() local
23 /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */ in sun4i_ss_opti_poll()
45 dev_err_ratelimited(ss->dev, "ERROR: Some SGs are NULL\n"); in sun4i_ss_opti_poll()
60 spin_lock_irqsave(&ss->slock, flags); in sun4i_ss_opti_poll()
63 writesl(ss->base + SS_KEY0 + i * 4, &op->key[i], 1); in sun4i_ss_opti_poll()
68 writesl(ss->base + SS_IV0 + i * 4, &v, 1); in sun4i_ss_opti_poll()
71 writel(mode, ss->base + SS_CTL); in sun4i_ss_opti_poll()
86 dev_err_ratelimited(ss->dev, "ERROR: sg_miter return null\n"); in sun4i_ss_opti_poll()
94 writesl(ss->base + SS_RXFIFO, mi.addr + oi, todo); in sun4i_ss_opti_poll()
104 spaces = readl(ss->base + SS_FCSR); in sun4i_ss_opti_poll()
114 dev_err_ratelimited(ss->dev, "ERROR: sg_miter return null\n"); in sun4i_ss_opti_poll()
122 readsl(ss->base + SS_TXFIFO, mo.addr + oo, todo); in sun4i_ss_opti_poll()
143 writel(0, ss->base + SS_CTL); in sun4i_ss_opti_poll()
144 spin_unlock_irqrestore(&ss->slock, flags); in sun4i_ss_opti_poll()
180 struct sun4i_ss_ctx *ss = op->ss; in sun4i_ss_cipher_poll() local
189 /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */ in sun4i_ss_cipher_poll()
213 dev_err_ratelimited(ss->dev, "ERROR: Some SGs are NULL\n"); in sun4i_ss_cipher_poll()
223 * we can use the SS optimized function in sun4i_ss_cipher_poll()
252 spin_lock_irqsave(&ss->slock, flags); in sun4i_ss_cipher_poll()
255 writesl(ss->base + SS_KEY0 + i * 4, &op->key[i], 1); in sun4i_ss_cipher_poll()
260 writesl(ss->base + SS_IV0 + i * 4, &v, 1); in sun4i_ss_cipher_poll()
263 writel(mode, ss->base + SS_CTL); in sun4i_ss_cipher_poll()
278 dev_err_ratelimited(ss->dev, "ERROR: sg_miter return null\n"); in sun4i_ss_cipher_poll()
289 writesl(ss->base + SS_RXFIFO, mi.addr + oi, in sun4i_ss_cipher_poll()
303 memcpy(ss->buf + ob, mi.addr + oi, todo); in sun4i_ss_cipher_poll()
308 writesl(ss->base + SS_RXFIFO, ss->buf, in sun4i_ss_cipher_poll()
320 spaces = readl(ss->base + SS_FCSR); in sun4i_ss_cipher_poll()
332 dev_err_ratelimited(ss->dev, "ERROR: sg_miter return null\n"); in sun4i_ss_cipher_poll()
341 readsl(ss->base + SS_TXFIFO, mo.addr + oo, todo); in sun4i_ss_cipher_poll()
353 readsl(ss->base + SS_TXFIFO, ss->bufo, tx_cnt); in sun4i_ss_cipher_poll()
365 memcpy(mo.addr + oo, ss->bufo + obo, todo); in sun4i_ss_cipher_poll()
390 writel(0, ss->base + SS_CTL); in sun4i_ss_cipher_poll()
391 spin_unlock_irqrestore(&ss->slock, flags); in sun4i_ss_cipher_poll()
545 op->ss = algt->ss; in sun4i_ss_cipher_init()
549 dev_err(op->ss->dev, "ERROR: Cannot allocate fallback for %s %ld\n", in sun4i_ss_cipher_init()
558 err = pm_runtime_resume_and_get(op->ss->dev); in sun4i_ss_cipher_init()
573 pm_runtime_put(op->ss->dev); in sun4i_ss_cipher_exit()
581 struct sun4i_ss_ctx *ss = op->ss; in sun4i_ss_aes_setkey() local
594 dev_dbg(ss->dev, "ERROR: Invalid keylen %u\n", keylen); in sun4i_ss_aes_setkey()