diff options
author | Tom Rini <trini@konsulko.com> | 2025-04-07 16:40:02 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-04-08 11:43:23 -0600 |
commit | ff61d6bfd1c9534d3fc2397846a5899639f2e55d (patch) | |
tree | dcfe4bc52848a5637c975a3352b57885e5b8a06d /drivers/rng/msm_rng.c | |
parent | 34820924edbc4ec7803eb89d9852f4b870fa760a (diff) | |
parent | f892a7f397a66d8d09f418d1e0e06dfb48bac27d (diff) |
Merge branch 'next'
Note that this undoes the changes of commit cf6d4535cc4c ("x86:
emulation: Disable bloblist for now") as that was intended only for the
release due to time.
Diffstat (limited to 'drivers/rng/msm_rng.c')
-rw-r--r-- | drivers/rng/msm_rng.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/rng/msm_rng.c b/drivers/rng/msm_rng.c index f790d3b60f9..aab602c5ed0 100644 --- a/drivers/rng/msm_rng.c +++ b/drivers/rng/msm_rng.c @@ -44,6 +44,11 @@ static int msm_rng_read(struct udevice *dev, void *data, size_t len) u32 *retdata = data; size_t maxsize; u32 val; + int ret; + + ret = clk_enable(&priv->clk); + if (ret < 0) + return ret; /* calculate max size bytes to transfer back to caller */ maxsize = min_t(size_t, MAX_HW_FIFO_SIZE, len); @@ -66,6 +71,8 @@ static int msm_rng_read(struct udevice *dev, void *data, size_t len) break; } while (currsize < maxsize); + clk_disable(&priv->clk); + return 0; } @@ -76,7 +83,7 @@ static int msm_rng_enable(struct msm_rng_priv *priv, int enable) if (enable) { /* Enable PRNG only if it is not already enabled */ val = readl_relaxed(priv->base + PRNG_CONFIG); - if (val & PRNG_CONFIG_HW_ENABLE) { + if (!(val & PRNG_CONFIG_HW_ENABLE)) { val = readl_relaxed(priv->base + PRNG_LFSR_CFG); val &= ~PRNG_LFSR_CFG_MASK; val |= PRNG_LFSR_CFG_CLOCKS; @@ -118,7 +125,9 @@ static int msm_rng_probe(struct udevice *dev) if (ret < 0) return ret; - return msm_rng_enable(priv, 1); + ret = msm_rng_enable(priv, 1); + clk_disable(&priv->clk); + return ret; } static int msm_rng_remove(struct udevice *dev) |