Skip to content

Commit

Permalink
change(pm): change macro SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
10086loutianhao committed Dec 15, 2023
1 parent 3140fa2 commit d8b1f72
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/esp_hw_support/include/esp_private/esp_pau.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void pau_regdma_trigger_modem_link_backup(void);
void pau_regdma_trigger_modem_link_restore(void);
#endif

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
/**
* @brief Set the address of system REGDMA Link in active state
* @param link_addr linked lists address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void sleep_retention_do_extra_retention(bool backup_or_restore);
*/
uint32_t sleep_retention_get_modules(void);

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
/**
* @brief Software trigger REGDMA to do system linked list retention
*
Expand Down
2 changes: 1 addition & 1 deletion components/esp_hw_support/port/pau_regdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void pau_regdma_trigger_modem_link_restore(void)
}
#endif

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
void IRAM_ATTR pau_regdma_set_system_link_addr(void *link_addr)
{
/* ESP32H2 use software to trigger REGDMA to restore instead of PMU,
Expand Down
6 changes: 3 additions & 3 deletions components/esp_hw_support/sleep_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "soc/pcr_reg.h"
#include "modem/modem_syscon_reg.h"

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
#include "modem/modem_lpcon_reg.h"
#endif

Expand Down Expand Up @@ -54,13 +54,13 @@ void sleep_clock_system_retention_deinit(void)
esp_err_t sleep_clock_modem_retention_init(void)
{
#define N_REGS_SYSCON() (((MODEM_SYSCON_MEM_CONF_REG - MODEM_SYSCON_TEST_CONF_REG) / 4) + 1)
#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
#define N_REGS_LPCON() (((MODEM_LPCON_MEM_CONF_REG - MODEM_LPCON_TEST_CONF_REG) / 4) + 1)
#endif

const static sleep_retention_entries_config_t modem_regs_retention[] = {
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_MODEMSYSCON_LINK(0), MODEM_SYSCON_TEST_CONF_REG, MODEM_SYSCON_TEST_CONF_REG, N_REGS_SYSCON(), 0, 0), .owner = ENTRY(0) | ENTRY(1) }, /* MODEM SYSCON */
#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_MODEMLPCON_LINK(0), MODEM_LPCON_TEST_CONF_REG, MODEM_LPCON_TEST_CONF_REG, N_REGS_LPCON(), 0, 0), .owner = ENTRY(0) | ENTRY(1) } /* MODEM LPCON */
#endif
};
Expand Down
6 changes: 3 additions & 3 deletions components/esp_hw_support/sleep_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#include "esp_private/sleep_clock.h"
#endif

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
#include "esp_private/sleep_retention.h"
#endif

Expand Down Expand Up @@ -656,7 +656,7 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m
// Will switch to XTAL turn down MSPI speed
mspi_timing_change_speed_mode_cache_safe(true);

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
if (!deep_sleep && (pd_flags & PMU_SLEEP_PD_TOP)) {
sleep_retention_do_system_retention(true);
}
Expand Down Expand Up @@ -890,7 +890,7 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m

if (!deep_sleep) {
s_config.ccount_ticks_record = esp_cpu_get_cycle_count();
#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
if (pd_flags & PMU_SLEEP_PD_TOP) {
sleep_retention_do_system_retention(false);
}
Expand Down
2 changes: 1 addition & 1 deletion components/esp_hw_support/sleep_retention.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ void IRAM_ATTR sleep_retention_do_extra_retention(bool backup_or_restore)
}
#endif

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
void IRAM_ATTR sleep_retention_do_system_retention(bool backup_or_restore)
{
#define SYSTEM_LINK_NUM (0)
Expand Down
4 changes: 2 additions & 2 deletions components/hal/include/hal/pau_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void pau_hal_start_regdma_modem_link(pau_hal_context_t *hal, bool backup_or_rest
void pau_hal_stop_regdma_modem_link(pau_hal_context_t *hal);
#endif

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
/**
* @brief Set regdma system link address
*
Expand Down Expand Up @@ -102,7 +102,7 @@ void pau_hal_start_regdma_extra_link(pau_hal_context_t *hal, bool backup_or_rest
*/
void pau_hal_stop_regdma_extra_link(pau_hal_context_t *hal);

#if SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
/**
* @brief Enable or disable PAU module clock
*
Expand Down
2 changes: 1 addition & 1 deletion components/soc/esp32h2/include/soc/Kconfig.soc_caps.in
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ config SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY
bool
default y

config SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG
config SOC_PM_RETENTION_SW_TRIGGER_REGDMA
bool
default y

Expand Down
2 changes: 1 addition & 1 deletion components/soc/esp32h2/include/soc/soc_caps.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@
#define SOC_PM_CPU_RETENTION_BY_SW (1)
#define SOC_PM_MODEM_RETENTION_BY_REGDMA (1)
#define SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY (1) /*!<Supports CRC only the stub code in RTC memory */
#define SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG (1)
#define SOC_PM_RETENTION_SW_TRIGGER_REGDMA (1) /*!< In esp32H2, regdma will power off when entering sleep */

/*-------------------------- CLOCK SUBSYSTEM CAPS ----------------------------------------*/
#define SOC_CLK_RC_FAST_SUPPORT_CALIBRATION (1)
Expand Down

0 comments on commit d8b1f72

Please sign in to comment.