mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
fix(hal): updated ecdsa reset api to execute correctly
This commit updated API to ensure ECDSA peripheral resets and waits until the state returns to idle.
This commit is contained in:
@@ -71,6 +71,16 @@ typedef enum {
|
||||
ECDSA_MODE_SHA_CONTINUE
|
||||
} ecdsa_ll_sha_mode_t;
|
||||
|
||||
/**
|
||||
* @brief Get the state of ECDSA peripheral
|
||||
*
|
||||
* @return State of ECDSA
|
||||
*/
|
||||
static inline uint32_t ecdsa_ll_get_state(void)
|
||||
{
|
||||
return REG_GET_FIELD(ECDSA_STATE_REG, ECDSA_BUSY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the bus clock for ECDSA peripheral module
|
||||
*
|
||||
@@ -95,6 +105,10 @@ static inline void ecdsa_ll_reset_register(void)
|
||||
|
||||
// Clear reset on parent crypto, otherwise ECDSA is held in reset
|
||||
HP_SYS_CLKRST.hp_rst_en2.reg_rst_en_crypto = 0;
|
||||
|
||||
while (ecdsa_ll_get_state() != ECDSA_STATE_IDLE) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,16 +287,6 @@ static inline void ecdsa_ll_set_stage(ecdsa_ll_stage_t stage)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the state of ECDSA peripheral
|
||||
*
|
||||
* @return State of ECDSA
|
||||
*/
|
||||
static inline uint32_t ecdsa_ll_get_state(void)
|
||||
{
|
||||
return REG_GET_FIELD(ECDSA_STATE_REG, ECDSA_BUSY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the SHA type
|
||||
*
|
||||
|
Reference in New Issue
Block a user