Skip to content
  • Steve Cornelius's avatar
    ENGR00216259 caam: improve RNG4 initialization process · 1f4aead4
    Steve Cornelius authored
    
    
    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: default avatarMinnick Michael-B21710 <b21710@freescale.com>
    Signed-off-by: default avatarSteve Cornelius <steve.cornelius@freescale.com>
    Signed-off-by: default avatarJason Liu <r64343@freescale.com>
    1f4aead4