mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
soc/soc_caps: update soc caps for chips that support power-down of modem hardware
Closes WIFI-4424
This commit is contained in:
@@ -20,6 +20,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);
|
||||
|
||||
@@ -92,7 +102,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);
|
||||
|
||||
|
@@ -183,6 +183,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);
|
||||
|
@@ -31,6 +31,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);
|
||||
|
||||
|
@@ -176,11 +176,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);
|
||||
|
@@ -29,6 +29,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);
|
||||
|
@@ -202,6 +202,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);
|
||||
|
@@ -43,6 +43,16 @@ uint32_t g_rtc_dbias_pvt_non_240m = 27;
|
||||
|
||||
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);
|
||||
@@ -191,7 +201,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);
|
||||
|
||||
|
Reference in New Issue
Block a user