mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(esp_security): suppoer s31 security clock management
This commit is contained in:
@@ -8,11 +8,10 @@ endif()
|
|||||||
set(srcs "")
|
set(srcs "")
|
||||||
set(requires esp_hal_security)
|
set(requires esp_hal_security)
|
||||||
set(priv_requires esp_hw_support hal efuse)
|
set(priv_requires esp_hw_support hal efuse)
|
||||||
set(priv_includes "")
|
set(priv_includes "src/${IDF_TARGET}")
|
||||||
|
|
||||||
if(NOT non_os_build)
|
if(NOT non_os_build)
|
||||||
list(APPEND srcs "src/init.c")
|
list(APPEND srcs "src/init.c")
|
||||||
list(APPEND priv_includes "src/${IDF_TARGET}")
|
|
||||||
|
|
||||||
if(CONFIG_SOC_HMAC_SUPPORTED)
|
if(CONFIG_SOC_HMAC_SUPPORTED)
|
||||||
list(APPEND srcs "src/esp_hmac.c")
|
list(APPEND srcs "src/esp_hmac.c")
|
||||||
@@ -30,11 +29,12 @@ if(NOT non_os_build)
|
|||||||
list(APPEND srcs "src/esp_dpa_protection.c")
|
list(APPEND srcs "src/esp_dpa_protection.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c")
|
list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c"
|
||||||
|
"src/${target}/esp_crypto_clk.c")
|
||||||
list(APPEND priv_requires esp_system esp_timer)
|
list(APPEND priv_requires esp_system esp_timer)
|
||||||
elseif(esp_tee_build)
|
elseif(esp_tee_build)
|
||||||
list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c")
|
list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c"
|
||||||
list(APPEND includes "src/${IDF_TARGET}")
|
"src/${target}/esp_crypto_clk.c")
|
||||||
|
|
||||||
if(CONFIG_SOC_HMAC_SUPPORTED)
|
if(CONFIG_SOC_HMAC_SUPPORTED)
|
||||||
list(APPEND srcs "src/esp_hmac.c")
|
list(APPEND srcs "src/esp_hmac.c")
|
||||||
@@ -44,7 +44,8 @@ elseif(esp_tee_build)
|
|||||||
list(APPEND srcs "src/esp_ds.c")
|
list(APPEND srcs "src/esp_ds.c")
|
||||||
endif()
|
endif()
|
||||||
else() # BOOTLOADER_BUILD
|
else() # BOOTLOADER_BUILD
|
||||||
list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c")
|
list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c"
|
||||||
|
"src/${target}/esp_crypto_clk.c")
|
||||||
|
|
||||||
if(CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY)
|
if(CONFIG_SOC_KEY_MANAGER_FE_KEY_DEPLOY)
|
||||||
list(APPEND srcs "src/esp_key_mgr.c")
|
list(APPEND srcs "src/esp_key_mgr.c")
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
static inline void esp_crypto_clk_init(void) {}
|
static inline void esp_crypto_clk_init(void) {}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
static inline void esp_crypto_clk_init(void) {}
|
static inline void esp_crypto_clk_init(void) {}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
static inline void esp_crypto_clk_init(void) {}
|
static inline void esp_crypto_clk_init(void) {}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 480M SPLL clock
|
// Set crypto clock (`clk_sec`) to use 480M SPLL clock
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
static inline void esp_crypto_clk_init(void) {}
|
static inline void esp_crypto_clk_init(void) {}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 480M SPLL clock
|
// Set crypto clock (`clk_sec`) to use 480M SPLL clock
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 96M PLL clock
|
// Set crypto clock (`clk_sec`) to use 96M PLL clock
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 96M PLL clock
|
// Set crypto clock (`clk_sec`) to use 96M PLL clock
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 96M PLL clock
|
// Set crypto clock (`clk_sec`) to use 96M PLL clock
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -8,6 +8,10 @@
|
|||||||
#include "esp_private/esp_clk_tree_common.h"
|
#include "esp_private/esp_clk_tree_common.h"
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 240M PLL clock
|
// Set crypto clock (`clk_sec`) to use 240M PLL clock
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
static inline void esp_crypto_clk_init(void) {}
|
static inline void esp_crypto_clk_init(void) {}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
(void)enable;
|
||||||
|
}
|
||||||
@@ -6,5 +6,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
static inline void esp_crypto_clk_init(void) {}
|
static inline void esp_crypto_clk_init(void) {}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
#include "soc/clk_tree_defs.h"
|
||||||
|
#include "soc/hp_sys_clkrst_struct.h"
|
||||||
|
#if !NON_OS_BUILD
|
||||||
|
#include "esp_private/critical_section.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !NON_OS_BUILD
|
||||||
|
DEFINE_CRIT_SECTION_LOCK_STATIC(s_crypto_common_clk_mux);
|
||||||
|
#endif
|
||||||
|
static int s_crypto_common_clk_ref_cnt;
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable)
|
||||||
|
{
|
||||||
|
#if !NON_OS_BUILD
|
||||||
|
esp_os_enter_critical_safe(&s_crypto_common_clk_mux);
|
||||||
|
#endif
|
||||||
|
if (enable) {
|
||||||
|
if (s_crypto_common_clk_ref_cnt++ == 0) {
|
||||||
|
HP_SYS_CLKRST.crypto_ctrl0.reg_crypto_sys_clk_en = 1;
|
||||||
|
HP_SYS_CLKRST.crypto_ctrl0.reg_crypto_sec_clk_en = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (s_crypto_common_clk_ref_cnt > 0 && --s_crypto_common_clk_ref_cnt == 0) {
|
||||||
|
HP_SYS_CLKRST.crypto_ctrl0.reg_crypto_sec_clk_en = 0;
|
||||||
|
HP_SYS_CLKRST.crypto_ctrl0.reg_crypto_sys_clk_en = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#if !NON_OS_BUILD
|
||||||
|
esp_os_exit_critical_safe(&s_crypto_common_clk_mux);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -1,15 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
#include "soc/soc.h"
|
|
||||||
#include "soc/hp_sys_clkrst_reg.h"
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "soc/soc.h"
|
||||||
|
#include "soc/hp_sys_clkrst_reg.h"
|
||||||
|
#include "soc/hp_sys_clkrst_struct.h"
|
||||||
|
|
||||||
static inline void esp_crypto_clk_init(void)
|
static inline void esp_crypto_clk_init(void)
|
||||||
{
|
{
|
||||||
// Set crypto clock (`clk_sec`) to use 240M PLL clock
|
// Set crypto clock (`clk_sec`) to use 240M PLL clock
|
||||||
REG_SET_FIELD(HP_SYS_CLKRST_CRYPTO_CTRL0_REG, HP_SYS_CLKRST_REG_CRYPTO_CLK_SRC_SEL, 0x2);
|
REG_SET_FIELD(HP_SYS_CLKRST_CRYPTO_CTRL0_REG, HP_SYS_CLKRST_REG_CRYPTO_CLK_SRC_SEL, 0x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_crypto_common_clk_enable(bool enable);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "esp_private/esp_crypto_lock_internal.h"
|
#include "esp_private/esp_crypto_lock_internal.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp_crypto_periph_clk.h"
|
#include "esp_crypto_periph_clk.h"
|
||||||
|
#include "esp_crypto_clk.h"
|
||||||
|
|
||||||
#if SOC_AES_SUPPORTED
|
#if SOC_AES_SUPPORTED
|
||||||
#include "hal/aes_ll.h"
|
#include "hal/aes_ll.h"
|
||||||
@@ -48,6 +49,7 @@ int __DECLARE_RCC_ATOMIC_ENV __attribute__((unused));
|
|||||||
void esp_crypto_aes_enable_periph_clk(bool enable)
|
void esp_crypto_aes_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
AES_RCC_ATOMIC() {
|
AES_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
aes_ll_enable_bus_clock(enable);
|
aes_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
aes_ll_reset_register();
|
aes_ll_reset_register();
|
||||||
@@ -66,6 +68,7 @@ void esp_crypto_aes_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_sha_enable_periph_clk(bool enable)
|
void esp_crypto_sha_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
SHA_RCC_ATOMIC() {
|
SHA_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
sha_ll_enable_bus_clock(enable);
|
sha_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
sha_ll_reset_register();
|
sha_ll_reset_register();
|
||||||
@@ -84,6 +87,7 @@ void esp_crypto_sha_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_mpi_enable_periph_clk(bool enable)
|
void esp_crypto_mpi_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
MPI_RCC_ATOMIC() {
|
MPI_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
mpi_ll_enable_bus_clock(enable);
|
mpi_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
mpi_ll_power_up();
|
mpi_ll_power_up();
|
||||||
@@ -99,6 +103,7 @@ void esp_crypto_mpi_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_ecc_enable_periph_clk(bool enable)
|
void esp_crypto_ecc_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
ECC_RCC_ATOMIC() {
|
ECC_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
ecc_ll_enable_bus_clock(enable);
|
ecc_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
ecc_ll_power_up();
|
ecc_ll_power_up();
|
||||||
@@ -114,6 +119,7 @@ void esp_crypto_ecc_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_hmac_enable_periph_clk(bool enable)
|
void esp_crypto_hmac_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
HMAC_RCC_ATOMIC() {
|
HMAC_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
hmac_ll_enable_bus_clock(enable);
|
hmac_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
hmac_ll_reset_register();
|
hmac_ll_reset_register();
|
||||||
@@ -126,6 +132,7 @@ void esp_crypto_hmac_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_ds_enable_periph_clk(bool enable)
|
void esp_crypto_ds_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
DS_RCC_ATOMIC() {
|
DS_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
ds_ll_enable_bus_clock(enable);
|
ds_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
ds_ll_reset_register();
|
ds_ll_reset_register();
|
||||||
@@ -138,6 +145,7 @@ void esp_crypto_ds_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_ecdsa_enable_periph_clk(bool enable)
|
void esp_crypto_ecdsa_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
ECDSA_RCC_ATOMIC() {
|
ECDSA_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
ecdsa_ll_enable_bus_clock(enable);
|
ecdsa_ll_enable_bus_clock(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
ecdsa_ll_reset_register();
|
ecdsa_ll_reset_register();
|
||||||
@@ -150,6 +158,7 @@ void esp_crypto_ecdsa_enable_periph_clk(bool enable)
|
|||||||
void esp_crypto_key_mgr_enable_periph_clk(bool enable)
|
void esp_crypto_key_mgr_enable_periph_clk(bool enable)
|
||||||
{
|
{
|
||||||
KEY_MANAGER_RCC_ATOMIC() {
|
KEY_MANAGER_RCC_ATOMIC() {
|
||||||
|
esp_crypto_common_clk_enable(enable);
|
||||||
key_mgr_ll_power_up();
|
key_mgr_ll_power_up();
|
||||||
key_mgr_ll_enable_bus_clock(enable);
|
key_mgr_ll_enable_bus_clock(enable);
|
||||||
key_mgr_ll_enable_peripheral_clock(enable);
|
key_mgr_ll_enable_peripheral_clock(enable);
|
||||||
|
|||||||
Reference in New Issue
Block a user