提交 25228f90 编写于 作者: P popcornmix 提交者: Zheng Zengkai

bcm2835-rng: Avoid initialising if already enabled

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

Avoids the 0x40000 cycles of warmup again if firmware has already used it
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 9fb8f561
...@@ -102,8 +102,10 @@ static int bcm2835_rng_init(struct hwrng *rng) ...@@ -102,8 +102,10 @@ static int bcm2835_rng_init(struct hwrng *rng)
} }
/* set warm-up count & enable */ /* set warm-up count & enable */
if (!(rng_readl(priv, RNG_CTRL) & RNG_RBGEN)) {
rng_writel(priv, RNG_WARMUP_COUNT, RNG_STATUS); rng_writel(priv, RNG_WARMUP_COUNT, RNG_STATUS);
rng_writel(priv, RNG_RBGEN, RNG_CTRL); rng_writel(priv, RNG_RBGEN, RNG_CTRL);
}
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册