mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-15 14:36:45 +00:00
Merge branch 'bugfix/c5_mpi_ecc_power_mode_v5.2' into 'release/v5.2'
fix(hal): correct mpi/ecc peripheral power up sequence for ESP32-C5 (v5.2) See merge request espressif/esp-idf!31863
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "hal/ecc_types.h"
|
||||
#include "soc/ecc_mult_reg.h"
|
||||
#include "soc/pcr_struct.h"
|
||||
#include "soc/pcr_reg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -47,6 +48,18 @@ static inline void ecc_ll_reset_register(void)
|
||||
PCR.ecdsa_conf.ecdsa_rst_en = 0;
|
||||
}
|
||||
|
||||
static inline void ecc_ll_power_up(void)
|
||||
{
|
||||
REG_CLR_BIT(PCR_ECC_PD_CTRL_REG, PCR_ECC_MEM_PD);
|
||||
REG_CLR_BIT(PCR_ECC_PD_CTRL_REG, PCR_ECC_MEM_FORCE_PD);
|
||||
}
|
||||
|
||||
static inline void ecc_ll_power_down(void)
|
||||
{
|
||||
REG_CLR_BIT(PCR_ECC_PD_CTRL_REG, PCR_ECC_MEM_FORCE_PU);
|
||||
REG_SET_BIT(PCR_ECC_PD_CTRL_REG, PCR_ECC_MEM_PD);
|
||||
}
|
||||
|
||||
static inline void ecc_ll_enable_interrupt(void)
|
||||
{
|
||||
REG_SET_FIELD(ECC_MULT_INT_ENA_REG, ECC_MULT_CALC_DONE_INT_ENA, 1);
|
||||
|
@@ -50,11 +50,15 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
|
||||
|
||||
static inline void mpi_ll_clear_power_control_bit(void)
|
||||
{
|
||||
/* Power up the MPI peripheral */
|
||||
REG_CLR_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_PD);
|
||||
REG_CLR_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_FORCE_PD);
|
||||
}
|
||||
|
||||
static inline void mpi_ll_set_power_control_bit(void)
|
||||
{
|
||||
/* Power down the MPI peripheral */
|
||||
REG_CLR_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_FORCE_PU);
|
||||
REG_SET_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_PD);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user