summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-04-11 11:50:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-04-11 12:08:42 +0200
commitea569a0afd6a2e9a84418cd18ddeaeefaa5eae39 (patch)
tree06e41f60403bfb9e6f93968b68a8b550e47cd77d /drivers
parentc9504d30ed12c0f62c992b5325a86faf8ad81c32 (diff)
downloadbarebox-ea569a0afd6a2e9a84418cd18ddeaeefaa5eae39.tar.gz
hab/caam: Fix compilation of caam driver when hab is disabled
The caam driver needs the variable habv4_need_rng_software_self_test, but this is only declared when HABV4 is enabled. Instead of exporting a variable rather provide a function to test if a software selftest of the random number generator is needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/caam/ctrl.c3
-rw-r--r--drivers/hab/habv4.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 3991013..4fe3eea 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -573,8 +573,7 @@ static int caam_probe(struct device_d *dev)
cha_vid_ls = rd_reg32(&ctrl->perfmon.cha_id_ls);
/* habv4_need_rng_software_self_test is determined by habv4_get_status() */
- if (IS_ENABLED(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_SELF_TEST) &&
- habv4_need_rng_software_self_test) {
+ if (caam_need_rng_software_selftest()) {
u8 caam_era;
u8 rngvid;
u8 rngrev;
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index ca95c01..496fbe3 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -392,8 +392,13 @@ static void habv4_display_event(uint8_t *data, uint32_t len)
* 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. */
-bool habv4_need_rng_software_self_test = false;
-EXPORT_SYMBOL(habv4_need_rng_software_self_test);
+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] = {