From 378f3463fe0623069b31ffa8f096fe8e6f03e30d Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 8 Nov 2017 21:45:10 +0800 Subject: [PATCH] soc/rtc: power down VDDSDIO in deep sleep If VDDSDIO is controlled by RTC (which is the case when using 1.8V flash and CONFIG_BOOTLOADER_VDDSDIO_BOOST is enabled), need to allow VDDSDIO to be controlled by the state machine before going into deep sleep. --- components/soc/esp32/rtc_sleep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/soc/esp32/rtc_sleep.c b/components/soc/esp32/rtc_sleep.c index d8d643bb4..aef995cbf 100644 --- a/components/soc/esp32/rtc_sleep.c +++ b/components/soc/esp32/rtc_sleep.c @@ -193,6 +193,10 @@ void rtc_sleep_init(rtc_sleep_config_t cfg) SET_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_FORCE_NOSLEEP); } + /* enable VDDSDIO control by state machine */ + REG_CLR_BIT(RTC_CNTL_SDIO_CONF_REG, RTC_CNTL_SDIO_FORCE); + REG_SET_BIT(RTC_CNTL_SDIO_CONF_REG, RTC_CNTL_SDIO_PD_EN); + REG_SET_FIELD(RTC_CNTL_REG, RTC_CNTL_DBIAS_SLP, cfg.rtc_dbias_slp); REG_SET_FIELD(RTC_CNTL_REG, RTC_CNTL_DBIAS_WAK, cfg.rtc_dbias_wak); REG_SET_FIELD(RTC_CNTL_REG, RTC_CNTL_DIG_DBIAS_WAK, cfg.dig_dbias_wak);