From 739aca095a87c79865bc69e849d3938b63812f99 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Thu, 15 Dec 2022 19:11:55 -0300 Subject: [PATCH] risc-v/esp32c3: Prevent double initialization of SHA peripheral Signed-off-by: Gustavo Henrique Nihei --- .../risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_bringup.c | 3 ++- boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_bringup.c b/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_bringup.c index 2dd0e4e63e..638c2dc34a 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_bringup.c +++ b/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_bringup.c @@ -95,7 +95,8 @@ int esp32c3_bringup(void) } #endif -#ifdef CONFIG_ESP32C3_SHA_ACCELERATOR +#if defined(CONFIG_ESP32C3_SHA_ACCELERATOR) && \ + !defined(CONFIG_CRYPTO_CRYPTODEV_HARDWARE) ret = esp32c3_sha_init(); if (ret < 0) { diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c b/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c index c46cf07baf..3a6206cb24 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c +++ b/boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_bringup.c @@ -126,7 +126,8 @@ int esp32c3_bringup(void) } #endif -#ifdef CONFIG_ESP32C3_SHA_ACCELERATOR +#if defined(CONFIG_ESP32C3_SHA_ACCELERATOR) && \ + !defined(CONFIG_CRYPTO_CRYPTODEV_HARDWARE) ret = esp32c3_sha_init(); if (ret < 0) {