Lines Matching refs:ss
61 struct sun8i_ss_dev *ss; in sun8i_ss_prng_generate() local
70 ss = algt->ss; in sun8i_ss_prng_generate()
73 dev_err(ss->dev, "The PRNG is not seeded\n"); in sun8i_ss_prng_generate()
88 flow = sun8i_ss_get_engine_number(ss); in sun8i_ss_prng_generate()
101 dma_iv = dma_map_single(ss->dev, ctx->seed, ctx->slen, DMA_TO_DEVICE); in sun8i_ss_prng_generate()
102 if (dma_mapping_error(ss->dev, dma_iv)) { in sun8i_ss_prng_generate()
103 dev_err(ss->dev, "Cannot DMA MAP IV\n"); in sun8i_ss_prng_generate()
108 dma_dst = dma_map_single(ss->dev, d, todo, DMA_FROM_DEVICE); in sun8i_ss_prng_generate()
109 if (dma_mapping_error(ss->dev, dma_dst)) { in sun8i_ss_prng_generate()
110 dev_err(ss->dev, "Cannot DMA MAP DST\n"); in sun8i_ss_prng_generate()
115 err = pm_runtime_get_sync(ss->dev); in sun8i_ss_prng_generate()
117 pm_runtime_put_noidle(ss->dev); in sun8i_ss_prng_generate()
122 mutex_lock(&ss->mlock); in sun8i_ss_prng_generate()
123 writel(dma_iv, ss->base + SS_IV_ADR_REG); in sun8i_ss_prng_generate()
125 writel(dma_iv, ss->base + SS_KEY_ADR_REG); in sun8i_ss_prng_generate()
126 writel(dma_dst, ss->base + SS_DST_ADR_REG); in sun8i_ss_prng_generate()
127 writel(todo / 4, ss->base + SS_LEN_ADR_REG); in sun8i_ss_prng_generate()
129 reinit_completion(&ss->flows[flow].complete); in sun8i_ss_prng_generate()
130 ss->flows[flow].status = 0; in sun8i_ss_prng_generate()
134 writel(v, ss->base + SS_CTL_REG); in sun8i_ss_prng_generate()
136 wait_for_completion_interruptible_timeout(&ss->flows[flow].complete, in sun8i_ss_prng_generate()
138 if (ss->flows[flow].status == 0) { in sun8i_ss_prng_generate()
139 dev_err(ss->dev, "DMA timeout for PRNG (size=%u)\n", todo); in sun8i_ss_prng_generate()
154 mutex_unlock(&ss->mlock); in sun8i_ss_prng_generate()
156 pm_runtime_put(ss->dev); in sun8i_ss_prng_generate()
159 dma_unmap_single(ss->dev, dma_dst, todo, DMA_FROM_DEVICE); in sun8i_ss_prng_generate()
161 dma_unmap_single(ss->dev, dma_iv, ctx->slen, DMA_TO_DEVICE); in sun8i_ss_prng_generate()