]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00216259 caam: improve RNG4 initialization process
authorSteve Cornelius <steve.cornelius@freescale.com>
Thu, 9 Aug 2012 22:26:33 +0000 (15:26 -0700)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:40 +0000 (14:12 +0200)
commit0aff7236de6f713b0b6ea36936113c4d1a522267
treed89a0ef9d22cd21f8d95d4ddb061ea97af97cb83
parenta945cc562dfd0c702d4b77af20e750f96df28ad6
ENGR00216259 caam: improve RNG4 initialization process

Early versions of this driver used a set of entropy generation parameters
inherited from QorIQ devices. Those parameters were a hardcoded set
based upon internally-suggested values, and worked well on QorIQ. However,
for certain mx6 devices, oscillator values were found to be exceeding
the upper limit, and so RNG instantiation was failing in those cases.

This code improves initialization by (a) making sure the oscillator
divider is set to a known value, and (b) converting the parameter selection
to a symbolic compiler-generated form, instead of using embedded
magic number constants.

The calculation is now based on the definition of RNG4_ENT_CLOCKS_SAMPLE,
which defaults to 1600 unless overridden by something. The lower limit
is then set as /4, and the upper limit set to *8.

Tested-by: Minnick Michael-B21710 <b21710@freescale.com>
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/intern.h
drivers/crypto/caam/regs.h