Skip to content
Snippets Groups Projects
Commit 026a3f1b authored by Alex Porosanu's avatar Alex Porosanu Committed by York Sun
Browse files

drivers/crypto/fsl: disable RNG oscillator maximum frequency check


The rtfrqmax & rtfrqmin set the bounds of the expected frequency of the
oscillator, when SEC runs at its maximum frequency. For certain platforms
(f.i. T2080), the oscillator is very fast and thus if the SEC runs at
a lower than normal frequency, the ring oscillator is incorrectly detected
as being out of bounds.

This patch effectively disables the maximum frequency check, by setting a
high enough maximum allowable frequency for the oscillator. The reasoning
behind this is that usually a broken oscillator will run too slow
(i.e. not run at all) rather than run too fast.

Signed-off-by: default avatarAlex Porosanu <alexandru.porosanu@freescale.com>
Acked-by: default avatarRuchika <Gupta&lt;ruchika.gupta@freescale.com>
Reviewed-by: default avatarYork Sun <yorksun@freescale.com>
parent 6a17365b
Branches
Tags
No related merge requests found
...@@ -406,8 +406,8 @@ static void kick_trng(int ent_delay) ...@@ -406,8 +406,8 @@ static void kick_trng(int ent_delay)
sec_out32(&rng->rtsdctl, val); sec_out32(&rng->rtsdctl, val);
/* min. freq. count, equal to 1/4 of the entropy sample length */ /* min. freq. count, equal to 1/4 of the entropy sample length */
sec_out32(&rng->rtfreqmin, ent_delay >> 2); sec_out32(&rng->rtfreqmin, ent_delay >> 2);
/* max. freq. count, equal to 8 times the entropy sample length */ /* disable maximum frequency count */
sec_out32(&rng->rtfreqmax, ent_delay << 3); sec_out32(&rng->rtfreqmax, RTFRQMAX_DISABLE);
/* put RNG4 into run mode */ /* put RNG4 into run mode */
sec_clrbits32(&rng->rtmctl, RTMCTL_PRGM); sec_clrbits32(&rng->rtmctl, RTMCTL_PRGM);
} }
......
...@@ -49,6 +49,7 @@ struct rng4tst { ...@@ -49,6 +49,7 @@ struct rng4tst {
u32 rttotsam; /* PRGM=0: total samples register */ u32 rttotsam; /* PRGM=0: total samples register */
}; };
u32 rtfreqmin; /* frequency count min. limit register */ u32 rtfreqmin; /* frequency count min. limit register */
#define RTFRQMAX_DISABLE (1 << 20)
union { union {
u32 rtfreqmax; /* PRGM=1: freq. count max. limit register */ u32 rtfreqmax; /* PRGM=1: freq. count max. limit register */
u32 rtfreqcnt; /* PRGM=0: freq. count register */ u32 rtfreqcnt; /* PRGM=0: freq. count register */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment