msm-rng: Fix PRNG_LFSR_CFG setup

Changes to only configure the LFSR on devices that don't have the
prng hardware already setup mistakenly removed the LFSR
configuration. Instead, the change is ORing in 1s into the top 16
bits of the register (they're marked as reserved).

Restore the original code by masking off the lower 16 bits of the
register and filling them with values from the
PRNG_LFSR_CFG_CLOCKS define.

Change-Id: Idd0df7b49175c211eec5ea778733ae81f5bc8188
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Stephen Boyd 2012-06-25 15:48:37 -07:00
parent 4167071fed
commit 80bc028537

View file

@ -127,9 +127,9 @@ static int __devinit msm_rng_enable_hw(struct msm_rng_device *msm_rng_dev)
PRNG_HW_ENABLE;
/* PRNG H/W is not ON */
if (val != PRNG_HW_ENABLE) {
val = readl_relaxed(msm_rng_dev->base + PRNG_LFSR_CFG_OFFSET) &
PRNG_LFSR_CFG_MASK;
val |= PRNG_LFSR_CFG_MASK;
val = readl_relaxed(msm_rng_dev->base + PRNG_LFSR_CFG_OFFSET);
val &= PRNG_LFSR_CFG_MASK;
val |= PRNG_LFSR_CFG_CLOCKS;
writel_relaxed(val, msm_rng_dev->base + PRNG_LFSR_CFG_OFFSET);
/* The PRNG CONFIG register should be first written */