diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-05 15:55:48 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-06 09:18:40 +0200 |
commit | 655e085e3a22d52eb040e7c3bbd2fa1cb6c249c1 (patch) | |
tree | 0e8d7ea1e317894e8432c6a665650c36dd39fc4b /drivers/hab | |
parent | d31741518a19bcc91084fd29a5dd3d07a2156089 (diff) | |
download | barebox-655e085e3a22d52eb040e7c3bbd2fa1cb6c249c1.tar.gz barebox-655e085e3a22d52eb040e7c3bbd2fa1cb6c249c1.tar.xz |
crypto: caam - Always do rng selftest
The caam rng selftest is known to be broken in several i.MX
incarnations. To be on the safe side just unconditionally execute
it rather than trying to guess from HAB failure events if this is
necessary.
We can only do the selftest once per boot though, doing it a second time
yields an error:
rng_self_test: Job Error:
2101000.jr0@1000.of: 20001953: CCB: desc idx 25: RNG: Instantiate
so only do the test when rng is not yet initialized as tested with the
RDSTA_IFx status bits.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/hab')
-rw-r--r-- | drivers/hab/habv4.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c index 6a60be6853..a53e40ad23 100644 --- a/drivers/hab/habv4.c +++ b/drivers/hab/habv4.c @@ -388,18 +388,6 @@ static void habv4_display_event(uint8_t *data, uint32_t len) habv4_display_event_record((struct hab_event_record *)data); } -/* Some chips with HAB >= 4.2.3 have an incorrect implementation of the RNG - * self-test in ROM code. In this case, an HAB event is generated, and a - * software self-test should be run. This variable is set to @c true by - * habv4_get_status() when this occurs. */ -static bool habv4_need_rng_software_self_test; - -bool caam_need_rng_software_selftest(void) -{ - return IS_ENABLED(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_SELF_TEST) && - habv4_need_rng_software_self_test; -} - #define RNG_FAIL_EVENT_SIZE 36 static uint8_t habv4_known_rng_fail_events[][RNG_FAIL_EVENT_SIZE] = { { 0xdb, 0x00, 0x24, 0x42, 0x69, 0x30, 0xe1, 0x1d, @@ -457,7 +445,6 @@ static int habv4_get_status(const struct habv4_rvt *rvt) if (IS_ENABLED(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_SELF_TEST) && is_known_rng_fail_event(data, len)) { pr_debug("RNG self-test failure detected, will run software self-test\n"); - habv4_need_rng_software_self_test = true; } else { pr_err("-------- HAB warning Event %d --------\n", index); pr_err("event data:\n"); |