From c07be48edb30c4cc44c0e437d0b7fd28f4b73742 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Thu, 30 Nov 2023 19:26:41 +0800 Subject: [PATCH] change(esp_hw_support): add adc retention module and it is dependencies on the clock modem --- components/esp_hw_support/sleep_modes.c | 6 +++++- .../soc/esp32c5/beta3/include/soc/retention_periph_defs.h | 4 ++++ components/soc/esp32c6/include/soc/retention_periph_defs.h | 4 ++++ components/soc/esp32h2/include/soc/retention_periph_defs.h | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index b4dc4592b8..685ca52c84 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -2137,7 +2137,11 @@ static uint32_t get_power_down_flags(void) #endif #if SOC_PM_SUPPORT_MODEM_PD - if ((s_config.domain[ESP_PD_DOMAIN_MODEM].pd_option != ESP_PD_OPTION_ON) && modem_domain_pd_allowed()) { + if ((s_config.domain[ESP_PD_DOMAIN_MODEM].pd_option != ESP_PD_OPTION_ON) && modem_domain_pd_allowed() +#if SOC_PM_MODEM_RETENTION_BY_REGDMA + && clock_domain_pd_allowed() +#endif + ) { pd_flags |= RTC_SLEEP_PD_MODEM; } #endif diff --git a/components/soc/esp32c5/beta3/include/soc/retention_periph_defs.h b/components/soc/esp32c5/beta3/include/soc/retention_periph_defs.h index 6ff9e497e6..2ef044eb40 100644 --- a/components/soc/esp32c5/beta3/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c5/beta3/include/soc/retention_periph_defs.h @@ -30,6 +30,8 @@ typedef enum periph_retention_module { * TEE, APM, UART, Timer Group, IOMUX, SPIMEM, SysTimer, etc.. */ SLEEP_RETENTION_MODULE_SYS_PERIPH = 16, + SLEEP_RETENTION_MODULE_ADC = 17, + SLEEP_RETENTION_MODULE_GDMA_CH0 = 24, SLEEP_RETENTION_MODULE_GDMA_CH1 = 25, SLEEP_RETENTION_MODULE_GDMA_CH2 = 26, @@ -53,6 +55,8 @@ typedef enum periph_retention_module_bitmap { * TEE, APM, UART, Timer Group, IOMUX, SPIMEM, SysTimer, etc.. */ SLEEP_RETENTION_MODULE_BM_SYS_PERIPH = BIT(SLEEP_RETENTION_MODULE_SYS_PERIPH), + SLEEP_RETENTION_MODULE_BM_ADC = BIT(SLEEP_RETENTION_MODULE_ADC), + SLEEP_RETENTION_MODULE_BM_GDMA_CH0 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH0), SLEEP_RETENTION_MODULE_BM_GDMA_CH1 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH1), SLEEP_RETENTION_MODULE_BM_GDMA_CH2 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH2), diff --git a/components/soc/esp32c6/include/soc/retention_periph_defs.h b/components/soc/esp32c6/include/soc/retention_periph_defs.h index 372578d1c1..bd798e1903 100644 --- a/components/soc/esp32c6/include/soc/retention_periph_defs.h +++ b/components/soc/esp32c6/include/soc/retention_periph_defs.h @@ -30,6 +30,8 @@ typedef enum periph_retention_module { * TEE, APM, UART, Timer Group, IOMUX, SPIMEM, SysTimer, etc.. */ SLEEP_RETENTION_MODULE_SYS_PERIPH = 16, + SLEEP_RETENTION_MODULE_ADC = 17, + SLEEP_RETENTION_MODULE_GDMA_CH0 = 24, SLEEP_RETENTION_MODULE_GDMA_CH1 = 25, SLEEP_RETENTION_MODULE_GDMA_CH2 = 26, @@ -54,6 +56,8 @@ typedef enum periph_retention_module_bitmap { * TEE, APM, UART, Timer Group, IOMUX, SPIMEM, SysTimer, etc.. */ SLEEP_RETENTION_MODULE_BM_SYS_PERIPH = BIT(SLEEP_RETENTION_MODULE_SYS_PERIPH), + SLEEP_RETENTION_MODULE_BM_ADC = BIT(SLEEP_RETENTION_MODULE_ADC), + SLEEP_RETENTION_MODULE_BM_GDMA_CH0 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH0), SLEEP_RETENTION_MODULE_BM_GDMA_CH1 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH1), SLEEP_RETENTION_MODULE_BM_GDMA_CH2 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH2), diff --git a/components/soc/esp32h2/include/soc/retention_periph_defs.h b/components/soc/esp32h2/include/soc/retention_periph_defs.h index 95418d873f..5ac1e90c2a 100644 --- a/components/soc/esp32h2/include/soc/retention_periph_defs.h +++ b/components/soc/esp32h2/include/soc/retention_periph_defs.h @@ -28,6 +28,8 @@ typedef enum periph_retention_module { * TEE, APM, UART, Timer Group, IOMUX, SPIMEM, SysTimer, etc.. */ SLEEP_RETENTION_MODULE_SYS_PERIPH = 16, + SLEEP_RETENTION_MODULE_ADC = 17, + SLEEP_RETENTION_MODULE_GDMA_CH0 = 24, SLEEP_RETENTION_MODULE_GDMA_CH1 = 25, SLEEP_RETENTION_MODULE_GDMA_CH2 = 26, @@ -51,6 +53,8 @@ typedef enum periph_retention_module_bitmap { * TEE, APM, UART, Timer Group, IOMUX, SPIMEM, SysTimer, etc.. */ SLEEP_RETENTION_MODULE_BM_SYS_PERIPH = BIT(SLEEP_RETENTION_MODULE_SYS_PERIPH), + SLEEP_RETENTION_MODULE_BM_ADC = BIT(SLEEP_RETENTION_MODULE_ADC), + SLEEP_RETENTION_MODULE_BM_GDMA_CH0 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH0), SLEEP_RETENTION_MODULE_BM_GDMA_CH1 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH1), SLEEP_RETENTION_MODULE_BM_GDMA_CH2 = BIT(SLEEP_RETENTION_MODULE_GDMA_CH2),