wifi/bt: fix part of modem module not reset when power up

This commit is contained in:
jingli
2022-08-29 22:02:40 +08:00
parent a2086ca355
commit 91b147c9da
11 changed files with 128 additions and 77 deletions

View File

@@ -19,6 +19,7 @@
#include <sys/lock.h>
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "esp_err.h"
#include "esp_phy_init.h"
#include "esp_system.h"
@@ -43,11 +44,9 @@
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/syscon_reg.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/syscon_reg.h"
#endif
#if CONFIG_IDF_TARGET_ESP32
@@ -293,9 +292,9 @@ void IRAM_ATTR esp_wifi_bt_power_domain_on(void)
_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_ESP32C3
SET_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, SYSTEM_WIFIBB_RST | SYSTEM_FE_RST);
CLEAR_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, SYSTEM_WIFIBB_RST | SYSTEM_FE_RST);
#if !CONFIG_IDF_TARGET_ESP32
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);
}