Skip to content

Commit

Permalink
Merge branch 'bugfix/update_naming_style_for_mpi_power_related_api' i…
Browse files Browse the repository at this point in the history
…nto 'master'

fix(hal): updated naming style for power up and down api for mpi peripheral

See merge request espressif/esp-idf!31693
  • Loading branch information
mahavirj committed Jul 5, 2024
2 parents fabf688 + 4699422 commit f978dd0
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions components/hal/esp32/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return (words + 0xF) & ~0xF;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(void)
{
DPORT_REG_CLR_BIT(DPORT_RSA_PD_CTRL_REG, DPORT_RSA_PD);
}

static inline void mpi_ll_set_power_control_bit(void)
static inline void mpi_ll_power_down(void)
{
DPORT_REG_SET_BIT(DPORT_RSA_PD_CTRL_REG, DPORT_RSA_PD);
}
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32c3/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return words;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(void)
{
REG_CLR_BIT(SYSTEM_RSA_PD_CTRL_REG, SYSTEM_RSA_MEM_PD);
}

static inline void mpi_ll_set_power_control_bit(void)
static inline void mpi_ll_power_down(void)
{
REG_SET_BIT(SYSTEM_RSA_PD_CTRL_REG, SYSTEM_RSA_MEM_PD);
}
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32c5/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return words;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(void)
{
/* Power up the MPI peripheral (default is power-down state) */
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)
static inline void mpi_ll_power_down(void)
{
/* Power down the MPI peripheral */
REG_CLR_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_FORCE_PU);
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32c6/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return words;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(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)
static inline void mpi_ll_power_down(void)
{
/* Power down the MPI peripheral */
REG_CLR_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_FORCE_PU);
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32h2/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return words;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(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)
static inline void mpi_ll_power_down(void)
{
/* Power down the MPI peripheral */
REG_CLR_BIT(PCR_RSA_PD_CTRL_REG, PCR_RSA_MEM_FORCE_PU);
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32p4/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
}

// No need to initialize Power Control Registers in case of ESP32-P4
static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(void)
{
}

static inline void mpi_ll_set_power_control_bit(void)
static inline void mpi_ll_power_down(void)
{
}

Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32s2/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return words;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(void)
{
REG_CLR_BIT(DPORT_RSA_PD_CTRL_REG, DPORT_RSA_MEM_PD);
}

static inline void mpi_ll_set_power_control_bit(void)
static inline void mpi_ll_power_down(void)
{
REG_SET_BIT(DPORT_RSA_PD_CTRL_REG, DPORT_RSA_PD);
}
Expand Down
4 changes: 2 additions & 2 deletions components/hal/esp32s3/include/hal/mpi_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ static inline size_t mpi_ll_calculate_hardware_words(size_t words)
return words;
}

static inline void mpi_ll_clear_power_control_bit(void)
static inline void mpi_ll_power_up(void)
{
REG_CLR_BIT(SYSTEM_RSA_PD_CTRL_REG, SYSTEM_RSA_MEM_PD);
}

static inline void mpi_ll_set_power_control_bit(void)
static inline void mpi_ll_power_down(void)
{
REG_SET_BIT(SYSTEM_RSA_PD_CTRL_REG, SYSTEM_RSA_MEM_PD);
}
Expand Down
4 changes: 2 additions & 2 deletions components/hal/mpi_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ size_t mpi_hal_calc_hardware_words(size_t words)

void mpi_hal_enable_hardware_hw_op(void)
{
mpi_ll_clear_power_control_bit();
mpi_ll_power_up();
while (mpi_ll_check_memory_init_complete()) {
}
// Note: from enabling RSA clock to here takes about 1.3us
Expand All @@ -27,7 +27,7 @@ void mpi_hal_enable_hardware_hw_op(void)

void mpi_hal_disable_hardware_hw_op(void)
{
mpi_ll_set_power_control_bit();
mpi_ll_power_down();
}

void mpi_hal_interrupt_enable(bool enable)
Expand Down

0 comments on commit f978dd0

Please sign in to comment.