From 833f20161073ae807f35d18b048f447355b2f961 Mon Sep 17 00:00:00 2001 From: jingli Date: Wed, 21 Sep 2022 17:19:27 +0800 Subject: [PATCH] soc/soc_caps: update soc caps for chips that support power-down of modem hardware --- components/esp_hw_support/port/esp32/rtc_init.c | 12 +++++++++++- components/esp_hw_support/port/esp32/rtc_pm.c | 2 +- components/esp_hw_support/port/esp32/rtc_sleep.c | 6 ++++-- components/esp_hw_support/port/esp32c3/rtc_init.c | 10 ++++++++++ .../esp_hw_support/port/esp32c3/rtc_sleep.c | 4 ++++ components/esp_hw_support/port/esp32s2/rtc_init.c | 10 ++++++++++ .../esp_hw_support/port/esp32s2/rtc_sleep.c | 2 ++ components/esp_hw_support/port/esp32s3/rtc_init.c | 12 +++++++++++- components/esp_hw_support/port/esp32s3/rtc_pm.c | 2 +- .../esp_hw_support/port/esp32s3/rtc_sleep.c | 15 +++++---------- components/esp_hw_support/sleep_modes.c | 9 +++++++++ components/esp_phy/src/phy_init.c | 15 +++++++++------ .../soc/esp32/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32/include/soc/rtc.h | 7 ++++--- components/soc/esp32/include/soc/soc_caps.h | 1 + .../soc/esp32c2/include/soc/Kconfig.soc_caps.in | 12 ------------ components/soc/esp32c2/include/soc/soc_caps.h | 6 ------ components/soc/esp32h2/include/soc/soc_caps.h | 2 -- .../soc/esp32s2/include/soc/Kconfig.soc_caps.in | 8 ++++---- components/soc/esp32s2/include/soc/soc_caps.h | 3 ++- .../soc/esp32s3/include/soc/Kconfig.soc_caps.in | 6 +++++- components/soc/esp32s3/include/soc/rtc.h | 6 ++---- components/soc/esp32s3/include/soc/rtc_cntl_reg.h | 6 ------ components/soc/esp32s3/include/soc/soc_caps.h | 10 +++------- 24 files changed, 102 insertions(+), 68 deletions(-) diff --git a/components/esp_hw_support/port/esp32/rtc_init.c b/components/esp_hw_support/port/esp32/rtc_init.c index 4b9472ff97..e32cdb03ae 100644 --- a/components/esp_hw_support/port/esp32/rtc_init.c +++ b/components/esp_hw_support/port/esp32/rtc_init.c @@ -16,6 +16,16 @@ void rtc_init(rtc_config_t cfg) { + /** + * When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup + * from deep sleep, these fields are changed and not reset. We will access two BB regs(BBPD_CTRL and + * NRXPD_CTRL) in rtc_sleep_pu. If PD modem and no iso, CPU will stuck when access these two BB regs + * and finally triggle RTC WDT. So need to clear modem Force PD. + * + * No worry about the power consumption, Because modem Force PD will be set at the end of this function. + */ + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); + CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PVTMON_PU | RTC_CNTL_TXRF_I2C_PU | RTC_CNTL_RFRX_PBUS_PU | RTC_CNTL_CKGEN_I2C_PU | RTC_CNTL_PLL_I2C_PU); @@ -88,7 +98,7 @@ void rtc_init(rtc_config_t cfg) CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_PAD_FORCE_UNHOLD); CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_PAD_FORCE_NOISO); } - /* force power down wifi and bt power domain */ + /* force power down modem(wifi and btdm) power domain */ SET_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); diff --git a/components/esp_hw_support/port/esp32/rtc_pm.c b/components/esp_hw_support/port/esp32/rtc_pm.c index 43ca6cdd92..38557db036 100644 --- a/components/esp_hw_support/port/esp32/rtc_pm.c +++ b/components/esp_hw_support/port/esp32/rtc_pm.c @@ -42,7 +42,7 @@ pm_sw_reject_t pm_set_sleep_mode(pm_sleep_mode_t sleep_mode, void(*pmac_save_par switch (sleep_mode) { case PM_LIGHT_SLEEP: - cfg.wifi_pd_en = 1; + cfg.modem_pd_en = 1; cfg.dig_dbias_wak = 4; cfg.dig_dbias_slp = 0; cfg.rtc_dbias_wak = 0; diff --git a/components/esp_hw_support/port/esp32/rtc_sleep.c b/components/esp_hw_support/port/esp32/rtc_sleep.c index 98bfa9644a..98396e91fd 100644 --- a/components/esp_hw_support/port/esp32/rtc_sleep.c +++ b/components/esp_hw_support/port/esp32/rtc_sleep.c @@ -91,7 +91,7 @@ void rtc_sleep_get_default_config(uint32_t sleep_flags, rtc_sleep_config_t *out_ .rtc_fastmem_pd_en = ((sleep_flags) & RTC_SLEEP_PD_RTC_FAST_MEM) ? 1 : 0, .rtc_slowmem_pd_en = ((sleep_flags) & RTC_SLEEP_PD_RTC_SLOW_MEM) ? 1 : 0, .rtc_peri_pd_en = ((sleep_flags) & RTC_SLEEP_PD_RTC_PERIPH) ? 1 : 0, - .wifi_pd_en = 0, + .modem_pd_en = (sleep_flags & RTC_SLEEP_PD_MODEM) ? 1 : 0, .int_8m_pd_en = ((sleep_flags) & RTC_SLEEP_PD_INT_8M) ? 1 : 0, .rom_mem_pd_en = 0, .deep_slp = ((sleep_flags) & RTC_SLEEP_PD_DIG) ? 1 : 0, @@ -182,7 +182,9 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_PD_EN); } - if (cfg.wifi_pd_en) { + if (cfg.modem_pd_en) { + REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_NOISO | RTC_CNTL_WIFI_FORCE_ISO); + REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PU); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); diff --git a/components/esp_hw_support/port/esp32c3/rtc_init.c b/components/esp_hw_support/port/esp32c3/rtc_init.c index 3f2b46e33c..05aeb43e81 100644 --- a/components/esp_hw_support/port/esp32c3/rtc_init.c +++ b/components/esp_hw_support/port/esp32c3/rtc_init.c @@ -30,6 +30,16 @@ static void set_rtc_dig_dbias(void); void rtc_init(rtc_config_t cfg) { + /** + * When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup + * from deep sleep, these fields are changed and not reset. We will access two BB regs(BBPD_CTRL and + * NRXPD_CTRL) in rtc_sleep_pu. If PD modem and no iso, CPU will stuck when access these two BB regs + * and finally triggle RTC WDT. So need to clear modem Force PD. + * + * No worry about the power consumption, Because modem Force PD will be set at the end of this function. + */ + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); + REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_DIG_REG, 0); REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_RTC_REG, 0); diff --git a/components/esp_hw_support/port/esp32c3/rtc_sleep.c b/components/esp_hw_support/port/esp32c3/rtc_sleep.c index 179f6e93dd..51d23e009e 100644 --- a/components/esp_hw_support/port/esp32c3/rtc_sleep.c +++ b/components/esp_hw_support/port/esp32c3/rtc_sleep.c @@ -116,11 +116,15 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) rtc_sleep_pu(pu_cfg); } if (cfg.wifi_pd_en) { + REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_NOISO | RTC_CNTL_WIFI_FORCE_ISO); + REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PU); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); } if (cfg.bt_pd_en) { + REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_BT_FORCE_NOISO | RTC_CNTL_BT_FORCE_ISO); + REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_FORCE_PU); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_PD_EN); } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_PD_EN); diff --git a/components/esp_hw_support/port/esp32s2/rtc_init.c b/components/esp_hw_support/port/esp32s2/rtc_init.c index 8ae329581c..7212b02b5d 100644 --- a/components/esp_hw_support/port/esp32s2/rtc_init.c +++ b/components/esp_hw_support/port/esp32s2/rtc_init.c @@ -26,6 +26,16 @@ static void calibrate_ocode(void); void rtc_init(rtc_config_t cfg) { + /** + * When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup + * from deep sleep, these fields are changed and not reset. We will access two BB regs(BBPD_CTRL and + * NRXPD_CTRL) in rtc_sleep_pu. If PD modem and no iso, CPU will stuck when access these two BB regs + * and finally triggle RTC WDT. So need to clear modem Force PD. + * + * No worry about the power consumption, Because modem Force PD will be set at the end of this function. + */ + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); + CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PVTMON_PU); REG_SET_FIELD(RTC_CNTL_TIMER1_REG, RTC_CNTL_PLL_BUF_WAIT, cfg.pll_wait); REG_SET_FIELD(RTC_CNTL_TIMER1_REG, RTC_CNTL_CK8M_WAIT, cfg.ck8m_wait); diff --git a/components/esp_hw_support/port/esp32s2/rtc_sleep.c b/components/esp_hw_support/port/esp32s2/rtc_sleep.c index c138239934..391582adde 100644 --- a/components/esp_hw_support/port/esp32s2/rtc_sleep.c +++ b/components/esp_hw_support/port/esp32s2/rtc_sleep.c @@ -131,6 +131,8 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) } if (cfg.wifi_pd_en) { + REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_NOISO | RTC_CNTL_WIFI_FORCE_ISO); + REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PU); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); diff --git a/components/esp_hw_support/port/esp32s3/rtc_init.c b/components/esp_hw_support/port/esp32s3/rtc_init.c index 266e330c15..7c4e2b2279 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_init.c +++ b/components/esp_hw_support/port/esp32s3/rtc_init.c @@ -35,6 +35,16 @@ static void calibrate_ocode(void); void rtc_init(rtc_config_t cfg) { + /** + * When run rtc_init, it maybe deep sleep reset. Since we power down modem in deep sleep, after wakeup + * from deep sleep, these fields are changed and not reset. We will access two BB regs(BBPD_CTRL and + * NRXPD_CTRL) in rtc_sleep_pu. If PD modem and no iso, CPU will stuck when access these two BB regs + * and finally triggle RTC WDT. So need to clear modem Force PD. + * + * No worry about the power consumption, Because modem Force PD will be set at the end of this function. + */ + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); + REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_RTC_REG, 0); REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_DIG_REG, 0); CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PVTMON_PU); @@ -177,7 +187,7 @@ void rtc_init(rtc_config_t cfg) CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_PAD_FORCE_UNHOLD); CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_PAD_FORCE_NOISO); } - /* force power down wifi and bt power domain */ + /* force power down modem(wifi and ble) power domain */ SET_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); diff --git a/components/esp_hw_support/port/esp32s3/rtc_pm.c b/components/esp_hw_support/port/esp32s3/rtc_pm.c index 4bf523eb20..a4a4e2e2cb 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_pm.c +++ b/components/esp_hw_support/port/esp32s3/rtc_pm.c @@ -44,7 +44,7 @@ pm_sw_reject_t pm_set_sleep_mode(pm_sleep_mode_t sleep_mode, void(*pmac_save_par switch (sleep_mode) { case PM_LIGHT_SLEEP: - cfg.wifi_pd_en = 1; + cfg.modem_pd_en = 1; cfg.dig_dbias_slp = 0; cfg.rtc_dbias_slp = 0; rtc_sleep_init(cfg); diff --git a/components/esp_hw_support/port/esp32s3/rtc_sleep.c b/components/esp_hw_support/port/esp32s3/rtc_sleep.c index 14d3cf3876..c381bcf489 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_sleep.c +++ b/components/esp_hw_support/port/esp32s3/rtc_sleep.c @@ -59,8 +59,7 @@ void rtc_sleep_get_default_config(uint32_t sleep_flags, rtc_sleep_config_t *out_ .rtc_fastmem_pd_en = (sleep_flags & RTC_SLEEP_PD_RTC_FAST_MEM) ? 1 : 0, .rtc_slowmem_pd_en = (sleep_flags & RTC_SLEEP_PD_RTC_SLOW_MEM) ? 1 : 0, .rtc_peri_pd_en = (sleep_flags & RTC_SLEEP_PD_RTC_PERIPH) ? 1 : 0, - .wifi_pd_en = (sleep_flags & RTC_SLEEP_PD_WIFI) ? 1 : 0, - .bt_pd_en = (sleep_flags & RTC_SLEEP_PD_BT) ? 1 : 0, + .modem_pd_en = (sleep_flags & RTC_SLEEP_PD_MODEM) ? 1 : 0, .cpu_pd_en = (sleep_flags & RTC_SLEEP_PD_CPU) ? 1 : 0, .int_8m_pd_en = (sleep_flags & RTC_SLEEP_PD_INT_8M) ? 1 : 0, .dig_peri_pd_en = (sleep_flags & RTC_SLEEP_PD_DIG_PERIPH) ? 1 : 0, @@ -157,20 +156,14 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) rtc_sleep_pu(pu_cfg); } - if (cfg.wifi_pd_en) { + if (cfg.modem_pd_en) { REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_NOISO | RTC_CNTL_WIFI_FORCE_ISO); REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PU); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN); } - if (cfg.bt_pd_en) { - REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_BT_FORCE_NOISO | RTC_CNTL_BT_FORCE_ISO); - REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_FORCE_PU); - SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_PD_EN); - } else { - CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_PD_EN); - } + if (cfg.cpu_pd_en) { REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_CPU_TOP_FORCE_NOISO | RTC_CNTL_CPU_TOP_FORCE_ISO); REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_CPU_TOP_FORCE_PU); @@ -178,6 +171,7 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_CPU_TOP_PD_EN); } + if (cfg.dig_peri_pd_en) { REG_CLR_BIT(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_PERI_FORCE_NOISO | RTC_CNTL_DG_PERI_FORCE_ISO); REG_CLR_BIT(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_PERI_FORCE_PU); @@ -185,6 +179,7 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) } else { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_PERI_PD_EN); } + if (cfg.rtc_peri_pd_en) { REG_CLR_BIT(RTC_CNTL_PWC_REG, RTC_CNTL_FORCE_NOISO | RTC_CNTL_FORCE_ISO | RTC_CNTL_FORCE_PU); SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_PD_EN); diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index e8357997b7..40cbad792f 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -599,6 +599,15 @@ void IRAM_ATTR esp_deep_sleep_start(void) uint32_t force_pd_flags = RTC_SLEEP_PD_DIG | RTC_SLEEP_PD_VDDSDIO | RTC_SLEEP_PD_INT_8M | RTC_SLEEP_PD_XTAL; + /** + * If all wireless modules share one power domain, we name this power domain "modem". + * If wireless modules have their own power domain, we give these power domains separate + * names. + */ +#if SOC_PM_SUPPORT_MODEM_PD + force_pd_flags |= RTC_SLEEP_PD_MODEM; +#endif + #if SOC_PM_SUPPORT_WIFI_PD force_pd_flags |= RTC_SLEEP_PD_WIFI; #endif diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 664e89b6a6..74729be332 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -46,12 +46,12 @@ static const char* TAG = "phy_init"; static _lock_t s_phy_access_lock; -#if !CONFIG_IDF_TARGET_ESP32C2 // TODO - WIFI-4424 +#if SOC_PM_SUPPORT_MODEM_PD || SOC_PM_SUPPORT_WIFI_PD static DRAM_ATTR struct { int count; /* power on count of wifi and bt power domain */ _lock_t lock; } s_wifi_bt_pd_controller = { .count = 0 }; -#endif +#endif // SOC_PM_SUPPORT_MODEM_PD || SOC_PM_SUPPORT_WIFI_PD /* Indicate PHY is calibrated or not */ static bool s_is_phy_calibrated = false; @@ -281,30 +281,33 @@ void esp_phy_disable(void) void IRAM_ATTR esp_wifi_bt_power_domain_on(void) { -#if !CONFIG_IDF_TARGET_ESP32C2 // TODO - WIFI-4424 +#if SOC_PM_SUPPORT_MODEM_PD || SOC_PM_SUPPORT_WIFI_PD _lock_acquire(&s_wifi_bt_pd_controller.lock); if (s_wifi_bt_pd_controller.count++ == 0) { CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); + #if !CONFIG_IDF_TARGET_ESP32 + // modem reset when power on SET_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU); CLEAR_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU); #endif + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO); } _lock_release(&s_wifi_bt_pd_controller.lock); -#endif +#endif // SOC_PM_SUPPORT_MODEM_PD || SOC_PM_SUPPORT_WIFI_PD } void esp_wifi_bt_power_domain_off(void) { -#if !CONFIG_IDF_TARGET_ESP32C2 // TODO - WIFI-4424 +#if SOC_PM_SUPPORT_MODEM_PD || SOC_PM_SUPPORT_WIFI_PD _lock_acquire(&s_wifi_bt_pd_controller.lock); if (--s_wifi_bt_pd_controller.count == 0) { SET_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO); SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); } _lock_release(&s_wifi_bt_pd_controller.lock); -#endif +#endif // SOC_PM_SUPPORT_MODEM_PD || SOC_PM_SUPPORT_WIFI_PD } void esp_phy_modem_init(void) diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index 2d3d9fbaeb..fa75663e4d 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -699,6 +699,10 @@ config SOC_PM_SUPPORT_RTC_SLOW_MEM_PD bool default y +config SOC_PM_SUPPORT_MODEM_PD + bool + default y + config SOC_SDMMC_USE_IOMUX bool default y diff --git a/components/soc/esp32/include/soc/rtc.h b/components/soc/esp32/include/soc/rtc.h index cfc583ad49..ed52573a3d 100644 --- a/components/soc/esp32/include/soc/rtc.h +++ b/components/soc/esp32/include/soc/rtc.h @@ -493,7 +493,7 @@ typedef struct rtc_sleep_config_s { uint32_t rtc_fastmem_pd_en : 1; //!< power down RTC fast memory uint32_t rtc_slowmem_pd_en : 1; //!< power down RTC slow memory uint32_t rtc_peri_pd_en : 1; //!< power down RTC peripherals - uint32_t wifi_pd_en : 1; //!< power down WiFi + uint32_t modem_pd_en : 1; //!< power down Modem(wifi and btdm) uint32_t int_8m_pd_en : 1; //!< Power down Internal 8M oscillator uint32_t rom_mem_pd_en : 1; //!< power down main RAM and ROM uint32_t deep_slp : 1; //!< power down digital domain @@ -516,8 +516,9 @@ typedef struct rtc_sleep_config_s { #define RTC_SLEEP_PD_RTC_FAST_MEM BIT(3) //!< Power down RTC FAST memory #define RTC_SLEEP_PD_RTC_MEM_FOLLOW_CPU BIT(4) //!< RTC FAST and SLOW memories are automatically powered up and down along with the CPU #define RTC_SLEEP_PD_VDDSDIO BIT(5) //!< Power down VDDSDIO regulator -#define RTC_SLEEP_PD_XTAL BIT(6) //!< Power down main XTAL -#define RTC_SLEEP_PD_INT_8M BIT(7) //!< Power down Internal 8M oscillator +#define RTC_SLEEP_PD_MODEM BIT(6) //!< Power down Modem(wifi and btdm) +#define RTC_SLEEP_PD_XTAL BIT(7) //!< Power down main XTAL +#define RTC_SLEEP_PD_INT_8M BIT(8) //!< Power down Internal 8M oscillator //These flags are not power domains, but will affect some sleep parameters #define RTC_SLEEP_DIG_USE_8M BIT(16) diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index b493bef0e7..50d610f00d 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -363,6 +363,7 @@ #define SOC_PM_SUPPORT_RTC_PERIPH_PD (1) #define SOC_PM_SUPPORT_RTC_FAST_MEM_PD (1) #define SOC_PM_SUPPORT_RTC_SLOW_MEM_PD (1) +#define SOC_PM_SUPPORT_MODEM_PD (1) /*!