From: davidwang Date: Fri, 13 Apr 2018 07:03:03 +0000 (+0800) Subject: hwrng: via - support new Centaur CPU X-Git-Tag: v5.15~8319^2~101 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49d1179573c0286474d92529544ad3a1349d15df;p=platform%2Fkernel%2Flinux-starfive.git hwrng: via - support new Centaur CPU New Centaur CPU(Family > 6) supprt Random Number Generator, but can't support MSR_VIA_RNG. Just like VIA Nano. Signed-off-by: David Wang Signed-off-by: Herbert Xu --- diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c index 6e9df55..ffe9b0c 100644 --- a/drivers/char/hw_random/via-rng.c +++ b/drivers/char/hw_random/via-rng.c @@ -135,7 +135,7 @@ static int via_rng_init(struct hwrng *rng) * is always enabled if CPUID rng_en is set. There is no * RNG configuration like it used to be the case in this * register */ - if ((c->x86 == 6) && (c->x86_model >= 0x0f)) { + if (((c->x86 == 6) && (c->x86_model >= 0x0f)) || (c->x86 > 6)){ if (!boot_cpu_has(X86_FEATURE_XSTORE_EN)) { pr_err(PFX "can't enable hardware RNG " "if XSTORE is not enabled\n");