From 7b5799830c2881943f29e1c791c1552e9be6b8d8 Mon Sep 17 00:00:00 2001 From: Lou Tianhao Date: Tue, 19 Dec 2023 11:52:25 +0800 Subject: [PATCH] change(pm): change macro SOC_PM_RETENTION_HAS_REGDMA_POWER_BUG --- components/esp_hw_support/include/esp_private/esp_pau.h | 2 +- .../esp_hw_support/include/esp_private/sleep_retention.h | 2 +- components/esp_hw_support/port/pau_regdma.c | 2 +- components/esp_hw_support/sleep_clock.c | 6 +++--- components/esp_hw_support/sleep_modes.c | 6 +++--- components/esp_hw_support/sleep_retention.c | 2 +- components/hal/include/hal/pau_hal.h | 4 ++-- components/soc/esp32h2/include/soc/Kconfig.soc_caps.in | 2 +- components/soc/esp32h2/include/soc/soc_caps.h | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/esp_hw_support/include/esp_private/esp_pau.h b/components/esp_hw_support/include/esp_private/esp_pau.h index db6b059d27..7fdbaaa98d 100644 --- a/components/esp_hw_support/include/esp_private/esp_pau.h +++ b/components/esp_hw_support/include/esp_private/esp_pau.h @@ -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 diff --git a/components/esp_hw_support/include/esp_private/sleep_retention.h b/components/esp_hw_support/include/esp_private/sleep_retention.h index 007f973f42..fd9a622072 100644 --- a/components/esp_hw_support/include/esp_private/sleep_retention.h +++ b/components/esp_hw_support/include/esp_private/sleep_retention.h @@ -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 * diff --git a/components/esp_hw_support/port/pau_regdma.c b/components/esp_hw_support/port/pau_regdma.c index aab6b17860..e0eac0162a 100644 --- a/components/esp_hw_support/port/pau_regdma.c +++ b/components/esp_hw_support/port/pau_regdma.c @@ -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, diff --git a/components/esp_hw_support/sleep_clock.c b/components/esp_hw_support/sleep_clock.c index b18f0cb23f..384a2e3a00 100644 --- a/components/esp_hw_support/sleep_clock.c +++ b/components/esp_hw_support/sleep_clock.c @@ -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 @@ -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 }; diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 52f1d19735..309c7f8379 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -103,7 +103,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 @@ -660,7 +660,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); } @@ -892,7 +892,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); } diff --git a/components/esp_hw_support/sleep_retention.c b/components/esp_hw_support/sleep_retention.c index 48fddb29db..6c10e5b326 100644 --- a/components/esp_hw_support/sleep_retention.c +++ b/components/esp_hw_support/sleep_retention.c @@ -515,7 +515,7 @@ void 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) diff --git a/components/hal/include/hal/pau_hal.h b/components/hal/include/hal/pau_hal.h index 197fd63572..4853cfa304 100644 --- a/components/hal/include/hal/pau_hal.h +++ b/components/hal/include/hal/pau_hal.h @@ -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 * @@ -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 * diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index 126a5120f2..0e0f1040c8 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -1231,7 +1231,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 diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index 900ec8f78f..7b427f9762 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -501,7 +501,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) /*!