Skip to content

Commit

Permalink
crypto: caam - increase TRNG clocks per sample
Browse files Browse the repository at this point in the history
we need to configure the TRNG to use more clocks per sample
to handle the two back-to-back 64KiB random descriptor requests
on higher frequency P5040s.

Signed-off-by: Kim Phillips <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
kimphill authored and herbertx committed Sep 27, 2012
1 parent b6f3fef commit a5bbf6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/crypto/caam/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int instantiate_rng(struct device *jrdev)

/*
* By default, the TRNG runs for 200 clocks per sample;
* 800 clocks per sample generates better entropy.
* 1600 clocks per sample generates better entropy.
*/
static void kick_trng(struct platform_device *pdev)
{
Expand All @@ -144,9 +144,9 @@ static void kick_trng(struct platform_device *pdev)

/* put RNG4 into program mode */
setbits32(&r4tst->rtmctl, RTMCTL_PRGM);
/* 800 clocks per sample */
/* 1600 clocks per sample */
val = rd_reg32(&r4tst->rtsdctl);
val = (val & ~RTSDCTL_ENT_DLY_MASK) | (800 << RTSDCTL_ENT_DLY_SHIFT);
val = (val & ~RTSDCTL_ENT_DLY_MASK) | (1600 << RTSDCTL_ENT_DLY_SHIFT);
wr_reg32(&r4tst->rtsdctl, val);
/* min. freq. count */
wr_reg32(&r4tst->rtfrqmin, 400);
Expand Down

0 comments on commit a5bbf6f

Please sign in to comment.