feat(ds): add Digital Signature peripheral support for esp32p4

This commit is contained in:
harshal.patil
2023-08-02 12:25:38 +05:30
parent 095c2a3324
commit b8c208cdb3
10 changed files with 214 additions and 15 deletions

View File

@@ -196,7 +196,12 @@ static inline uint32_t periph_ll_get_rst_en_mask(periph_module_t periph, bool en
case PERIPH_SARADC_MODULE:
return HP_SYS_CLKRST_REG_RST_EN_ADC;
case PERIPH_AES_MODULE:
return HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_AES;
ret = HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_AES;
if (enable == true) {
// Clear reset on digital signature, otherwise AES unit is held in reset
ret |= HP_SYS_CLKRST_REG_RST_EN_DS;
}
return ret;
case PERIPH_DS_MODULE:
return HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_DS;
case PERIPH_ECC_MODULE:
@@ -204,13 +209,19 @@ static inline uint32_t periph_ll_get_rst_en_mask(periph_module_t periph, bool en
case PERIPH_HMAC_MODULE:
return HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_HMAC;
case PERIPH_RSA_MODULE:
return HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_RSA;
ret = HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_RSA;
if (enable == true) {
// Clear reset on digital signature, otherwise RSA is held in reset
ret |= HP_SYS_CLKRST_REG_RST_EN_DS;
}
return ret;
case PERIPH_SEC_MODULE:
return HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_SEC;
case PERIPH_SHA_MODULE:
ret = HP_SYS_CLKRST_REG_RST_EN_CRYPTO | HP_SYS_CLKRST_REG_RST_EN_SHA;
if (enable == true) {
ret |= HP_SYS_CLKRST_REG_RST_EN_HMAC;
// Clear reset on digital signature, HMAC and ECDSA, otherwise SHA is held in reset
ret |= (HP_SYS_CLKRST_REG_RST_EN_HMAC | HP_SYS_CLKRST_REG_RST_EN_DS | HP_SYS_CLKRST_REG_RST_EN_ECDSA);
}
return ret;
case PERIPH_ECDSA_MODULE: