From b227154fd391dd842e239148a33d1bc0369da797 Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Tue, 7 May 2024 12:12:03 +0530 Subject: [PATCH] fix(soc): Refactor variable names for MPI operations and block bases --- components/hal/esp32/include/hal/mpi_ll.h | 12 ++++++------ components/hal/esp32c3/include/hal/mpi_ll.h | 12 ++++++------ components/hal/esp32c5/include/hal/mpi_ll.h | 10 +++++----- components/hal/esp32c6/include/hal/mpi_ll.h | 12 ++++++------ components/hal/esp32h2/include/hal/mpi_ll.h | 12 ++++++------ components/hal/esp32p4/include/hal/mpi_ll.h | 12 ++++++------ components/hal/esp32s2/include/hal/mpi_ll.h | 12 ++++++------ components/hal/esp32s3/include/hal/mpi_ll.h | 12 ++++++------ components/soc/esp32/mpi_periph.c | 4 ++-- components/soc/esp32c3/mpi_periph.c | 4 ++-- components/soc/esp32c5/beta3/mpi_periph.c | 4 ++-- components/soc/esp32c6/mpi_periph.c | 4 ++-- components/soc/esp32h2/mpi_periph.c | 4 ++-- components/soc/esp32p4/mpi_periph.c | 4 ++-- components/soc/esp32s2/mpi_periph.c | 4 ++-- components/soc/esp32s3/mpi_periph.c | 4 ++-- components/soc/include/soc/mpi_periph.h | 4 ++-- 17 files changed, 65 insertions(+), 65 deletions(-) diff --git a/components/hal/esp32/include/hal/mpi_ll.h b/components/hal/esp32/include/hal/mpi_ll.h index 11fe9ea4e2..c5762d9e36 100644 --- a/components/hal/esp32/include/hal/mpi_ll.h +++ b/components/hal/esp32/include/hal/mpi_ll.h @@ -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 */ @@ -93,7 +93,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - DPORT_REG_WRITE(MPI_LL_OPERATIONS[op], 1); + DPORT_REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -115,7 +115,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t copy_words = MIN(num_words, n); /* Copy MPI data to memory block registers */ @@ -150,12 +150,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - DPORT_REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + DPORT_REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; DPORT_REG_WRITE(mem_base, value); } @@ -166,7 +166,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { HAL_ASSERT(n >= num_words); - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ esp_dport_access_read_buffer(p, mem_base, num_words); diff --git a/components/hal/esp32c3/include/hal/mpi_ll.h b/components/hal/esp32c3/include/hal/mpi_ll.h index ea009559ef..9c5f005d25 100644 --- a/components/hal/esp32c3/include/hal/mpi_ll.h +++ b/components/hal/esp32c3/include/hal/mpi_ll.h @@ -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 */ @@ -87,7 +87,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -102,7 +102,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -124,12 +124,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -139,7 +139,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ const size_t REG_WIDTH = sizeof(uint32_t); for (size_t i = 0; i < num_words; i++) { diff --git a/components/hal/esp32c5/include/hal/mpi_ll.h b/components/hal/esp32c5/include/hal/mpi_ll.h index 543a5fa60a..fa9f53e745 100644 --- a/components/hal/esp32c5/include/hal/mpi_ll.h +++ b/components/hal/esp32c5/include/hal/mpi_ll.h @@ -86,7 +86,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -101,7 +101,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -123,12 +123,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -138,7 +138,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ const size_t REG_WIDTH = sizeof(uint32_t); for (size_t i = 0; i < num_words; i++) { diff --git a/components/hal/esp32c6/include/hal/mpi_ll.h b/components/hal/esp32c6/include/hal/mpi_ll.h index 032ac17b47..f8deda1658 100644 --- a/components/hal/esp32c6/include/hal/mpi_ll.h +++ b/components/hal/esp32c6/include/hal/mpi_ll.h @@ -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 */ @@ -79,7 +79,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -94,7 +94,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -116,12 +116,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -131,7 +131,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ const size_t REG_WIDTH = sizeof(uint32_t); for (size_t i = 0; i < num_words; i++) { diff --git a/components/hal/esp32h2/include/hal/mpi_ll.h b/components/hal/esp32h2/include/hal/mpi_ll.h index 0eed1020d9..aa740dcf71 100644 --- a/components/hal/esp32h2/include/hal/mpi_ll.h +++ b/components/hal/esp32h2/include/hal/mpi_ll.h @@ -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 */ @@ -80,7 +80,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -95,7 +95,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -117,12 +117,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -132,7 +132,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ const size_t REG_WIDTH = sizeof(uint32_t); for (size_t i = 0; i < num_words; i++) { diff --git a/components/hal/esp32p4/include/hal/mpi_ll.h b/components/hal/esp32p4/include/hal/mpi_ll.h index 3a4564c4c5..769049c07a 100644 --- a/components/hal/esp32p4/include/hal/mpi_ll.h +++ b/components/hal/esp32p4/include/hal/mpi_ll.h @@ -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 */ @@ -86,7 +86,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -101,7 +101,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -123,12 +123,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -138,7 +138,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ const size_t REG_WIDTH = sizeof(uint32_t); for (size_t i = 0; i < num_words; i++) { diff --git a/components/hal/esp32s2/include/hal/mpi_ll.h b/components/hal/esp32s2/include/hal/mpi_ll.h index a85ee4561d..d6314a10a8 100644 --- a/components/hal/esp32s2/include/hal/mpi_ll.h +++ b/components/hal/esp32s2/include/hal/mpi_ll.h @@ -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 */ @@ -90,7 +90,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -105,7 +105,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -127,12 +127,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -142,7 +142,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; /* Copy data from memory block registers */ esp_dport_access_read_buffer(p, mem_base, num_words); diff --git a/components/hal/esp32s3/include/hal/mpi_ll.h b/components/hal/esp32s3/include/hal/mpi_ll.h index a79da6f7c2..021cb1bdd0 100644 --- a/components/hal/esp32s3/include/hal/mpi_ll.h +++ b/components/hal/esp32s3/include/hal/mpi_ll.h @@ -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 */ @@ -87,7 +87,7 @@ static inline bool mpi_ll_check_memory_init_complete(void) static inline void mpi_ll_start_op(mpi_op_t op) { - REG_WRITE(MPI_LL_OPERATIONS[op], 1); + REG_WRITE(MPI_OPERATIONS_REG[op], 1); } static inline bool mpi_ll_get_int_status(void) @@ -102,7 +102,7 @@ static inline bool mpi_ll_get_int_status(void) */ static inline void mpi_ll_write_to_mem_block(mpi_param_t param, size_t offset, const uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; uint32_t* pbase = (uint32_t*) mem_base; uint32_t copy_words = MIN(num_words, n); @@ -124,12 +124,12 @@ static inline void mpi_ll_write_m_prime(uint32_t Mprime) static inline void mpi_ll_write_rinv(uint32_t rinv) { - REG_WRITE(MPI_LL_BLOCK_BASES[MPI_PARAM_Z], rinv); + REG_WRITE(MPI_BLOCK_BASES[MPI_PARAM_Z], rinv); } static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_t value) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[param] + offset; + uint32_t mem_base = MPI_BLOCK_BASES[param] + offset; REG_WRITE(mem_base, value); } @@ -139,7 +139,7 @@ static inline void mpi_ll_write_at_offset(mpi_param_t param, int offset, uint32_ */ static inline void mpi_ll_read_from_mem_block(uint32_t* p, size_t n, size_t num_words) { - uint32_t mem_base = MPI_LL_BLOCK_BASES[MPI_PARAM_Z]; + uint32_t mem_base = MPI_BLOCK_BASES[MPI_PARAM_Z]; esp_dport_access_read_buffer(p, mem_base, num_words); /* Zero any remaining limbs in the bignum, if the buffer is bigger than num_words */ diff --git a/components/soc/esp32/mpi_periph.c b/components/soc/esp32/mpi_periph.c index 4bb547f0c6..e5c277c512 100644 --- a/components/soc/esp32/mpi_periph.c +++ b/components/soc/esp32/mpi_periph.c @@ -7,13 +7,13 @@ #include "soc/hwcrypto_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_MEM_X_BLOCK_BASE, RSA_MEM_Y_BLOCK_BASE, RSA_MEM_Z_BLOCK_BASE, RSA_MEM_M_BLOCK_BASE, }; -const uint32_t MPI_LL_OPERATIONS[SOC_MPI_OPERATIONS_NUM] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_MULT_START_REG, }; diff --git a/components/soc/esp32c3/mpi_periph.c b/components/soc/esp32c3/mpi_periph.c index c9f3870045..ad9e0bfdb2 100644 --- a/components/soc/esp32c3/mpi_periph.c +++ b/components/soc/esp32c3/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/hwcrypto_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_MEM_X_BLOCK_BASE, RSA_MEM_Y_BLOCK_BASE, RSA_MEM_Z_BLOCK_BASE, RSA_MEM_M_BLOCK_BASE, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_MULT_START_REG, RSA_MOD_MULT_START_REG, RSA_MODEXP_START_REG, diff --git a/components/soc/esp32c5/beta3/mpi_periph.c b/components/soc/esp32c5/beta3/mpi_periph.c index 7193e88f64..b41e252944 100644 --- a/components/soc/esp32c5/beta3/mpi_periph.c +++ b/components/soc/esp32c5/beta3/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/rsa_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_X_MEM, RSA_Y_MEM, RSA_Z_MEM, RSA_M_MEM, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_SET_START_MULT_REG, RSA_SET_START_MODMULT_REG, RSA_SET_START_MODEXP_REG, diff --git a/components/soc/esp32c6/mpi_periph.c b/components/soc/esp32c6/mpi_periph.c index 1fd50f5318..a062e7f859 100644 --- a/components/soc/esp32c6/mpi_periph.c +++ b/components/soc/esp32c6/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/rsa_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_X_MEM, RSA_Y_MEM, RSA_Z_MEM, RSA_M_MEM, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_SET_START_MULT_REG, RSA_SET_START_MODMULT_REG, RSA_SET_START_MODEXP_REG, diff --git a/components/soc/esp32h2/mpi_periph.c b/components/soc/esp32h2/mpi_periph.c index 0efc0d191b..4936ca5bd0 100644 --- a/components/soc/esp32h2/mpi_periph.c +++ b/components/soc/esp32h2/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/rsa_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_X_MEM_REG, RSA_Y_MEM_REG, RSA_Z_MEM_REG, RSA_M_MEM_REG, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_SET_START_MULT_REG, RSA_SET_START_MODMULT_REG, RSA_SET_START_MODEXP_REG, diff --git a/components/soc/esp32p4/mpi_periph.c b/components/soc/esp32p4/mpi_periph.c index 1fd50f5318..a062e7f859 100644 --- a/components/soc/esp32p4/mpi_periph.c +++ b/components/soc/esp32p4/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/rsa_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_X_MEM, RSA_Y_MEM, RSA_Z_MEM, RSA_M_MEM, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_SET_START_MULT_REG, RSA_SET_START_MODMULT_REG, RSA_SET_START_MODEXP_REG, diff --git a/components/soc/esp32s2/mpi_periph.c b/components/soc/esp32s2/mpi_periph.c index c9f3870045..ad9e0bfdb2 100644 --- a/components/soc/esp32s2/mpi_periph.c +++ b/components/soc/esp32s2/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/hwcrypto_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_MEM_X_BLOCK_BASE, RSA_MEM_Y_BLOCK_BASE, RSA_MEM_Z_BLOCK_BASE, RSA_MEM_M_BLOCK_BASE, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_MULT_START_REG, RSA_MOD_MULT_START_REG, RSA_MODEXP_START_REG, diff --git a/components/soc/esp32s3/mpi_periph.c b/components/soc/esp32s3/mpi_periph.c index c9f3870045..ad9e0bfdb2 100644 --- a/components/soc/esp32s3/mpi_periph.c +++ b/components/soc/esp32s3/mpi_periph.c @@ -7,14 +7,14 @@ #include "soc/hwcrypto_reg.h" #include "soc/mpi_periph.h" -const uint32_t MPI_LL_BLOCK_BASES[4] = { +const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM] = { RSA_MEM_X_BLOCK_BASE, RSA_MEM_Y_BLOCK_BASE, RSA_MEM_Z_BLOCK_BASE, RSA_MEM_M_BLOCK_BASE, }; -const uint32_t MPI_LL_OPERATIONS[3] = { +const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM] = { RSA_MULT_START_REG, RSA_MOD_MULT_START_REG, RSA_MODEXP_START_REG, diff --git a/components/soc/include/soc/mpi_periph.h b/components/soc/include/soc/mpi_periph.h index db1caa9121..4a0e0fdfd5 100644 --- a/components/soc/include/soc/mpi_periph.h +++ b/components/soc/include/soc/mpi_periph.h @@ -16,8 +16,8 @@ extern "C" #if SOC_MPI_SUPPORTED -extern const uint32_t MPI_LL_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM]; -extern const uint32_t MPI_LL_OPERATIONS[SOC_MPI_OPERATIONS_NUM]; +extern const uint32_t MPI_BLOCK_BASES[SOC_MPI_MEM_BLOCKS_NUM]; +extern const uint32_t MPI_OPERATIONS_REG[SOC_MPI_OPERATIONS_NUM]; #endif // SOC_MPI_SUPPORTED