2022-01-10 16:29:09

by Fabio Estevam

[permalink] [raw]
Subject: Re: HRNG in CAAM isn't working properly on IMX6 SoloX

Hi Horia,

On Mon, Aug 30, 2021 at 8:49 AM Fabio Estevam <[email protected]> wrote:

> We also observe this issue.
>
> Heiko on Cc tried increasing the RTSDCTL_ENT_DLY_MIN value
> and this seems to help:
>
> diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
> index af61f3a2c0d4..53c9fa04a24c 100644
> --- a/drivers/crypto/caam/regs.h
> +++ b/drivers/crypto/caam/regs.h
> @@ -513,7 +513,7 @@ struct rng4tst {
> };
> #define RTSDCTL_ENT_DLY_SHIFT 16
> #define RTSDCTL_ENT_DLY_MASK (0xffff << RTSDCTL_ENT_DLY_SHIFT)
> -#define RTSDCTL_ENT_DLY_MIN 3200
> +#define RTSDCTL_ENT_DLY_MIN 4800
> #define RTSDCTL_ENT_DLY_MAX 12800
> u32 rtsdctl; /* seed control register */
> union {

Even with the change above we get the following errors on a
imx6sx-based board running 5.10.y:

[ 0.918126] caam 2100000.crypto: registering rng-caam
[ 22.598192] caam_jr 2101000.jr: 2000025b: CCB: desc idx 2: RNG:
Hardware error
[ 22.598260] caam_jr 2101000.jr: 20003c5b: CCB: desc idx 60: RNG:
Hardware error
[ 22.598324] caam_jr 2101000.jr: 20003c5b: CCB: desc idx 60: RNG:
Hardware error
[ 22.598368] caam_jr 2101000.jr: 20003c5b: CCB: desc idx 60: RNG:
Hardware error

What is the proper way to fix this issue?

Thanks,

Fabio Estevam