diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index db0807413d..c5219d8ffc 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -67,7 +67,8 @@ if(link_binary_libs) $) endif() - if(CONFIG_IDF_TARGET_ESP32C3 OR CONFIG_IDF_TARGET_ESP32S3 OR CONFIG_IDF_TARGET_ESP32H2 OR CONFIG_IDF_TARGET_ESP32C2) + if(CONFIG_IDF_TARGET_ESP32C3 OR CONFIG_IDF_TARGET_ESP32S3 + OR CONFIG_IDF_TARGET_ESP32H2 OR CONFIG_IDF_TARGET_ESP32C2) target_link_libraries(${COMPONENT_LIB} PUBLIC btbb) target_link_libraries(${COMPONENT_LIB} INTERFACE $ libphy.a libbtbb.a $) diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index ee7da2f0e0..fcfb4cd68c 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -48,10 +48,12 @@ static const char* TAG = "phy_init"; static _lock_t s_phy_access_lock; +#if !CONFIG_IDF_TARGET_ESP32C2 // TODO - WIFI-4424 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 /* Indicate PHY is calibrated or not */ static bool s_is_phy_calibrated = false; @@ -284,26 +286,30 @@ void esp_phy_disable(void) void IRAM_ATTR esp_wifi_bt_power_domain_on(void) { +#if !CONFIG_IDF_TARGET_ESP32C2 // TODO - WIFI-4424 _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); + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD); #if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 SET_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, SYSTEM_BB_RST | SYSTEM_FE_RST); CLEAR_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, SYSTEM_BB_RST | SYSTEM_FE_RST); #endif - // CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO); + CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO); } _lock_release(&s_wifi_bt_pd_controller.lock); +#endif } void esp_wifi_bt_power_domain_off(void) { +#if !CONFIG_IDF_TARGET_ESP32C2 // TODO - WIFI-4424 _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); + 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 } #if CONFIG_MAC_BB_PD diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index 106dee8150..8362ee2ac4 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -4,7 +4,7 @@ menu "Wi-Fi" config ESP32_WIFI_ENABLED bool - default "y" if !IDF_TARGET_ESP32H2 + default y if SOC_WIFI_SUPPORTED config ESP32_WIFI_SW_COEXIST_ENABLE bool "Software controls WiFi/Bluetooth coexistence" @@ -281,7 +281,7 @@ menu "Wi-Fi" config ESP_WIFI_FTM_ENABLE bool "WiFi FTM" default n - depends on (IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) + depends on (IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C2) help Enable feature Fine Timing Measurement for calculating WiFi Round-Trip-Time (RTT). diff --git a/components/esp_wifi/include/esp_coexist_internal.h b/components/esp_wifi/include/esp_coexist_internal.h index 1e0e5d0a27..1011ee50fd 100644 --- a/components/esp_wifi/include/esp_coexist_internal.h +++ b/components/esp_wifi/include/esp_coexist_internal.h @@ -196,7 +196,7 @@ int coex_schm_curr_phase_idx_set(int idx); int coex_schm_curr_phase_idx_get(void); /** - * @brief TODO + * @brief TODO - WIFI-4423 * */ int coex_register_start_cb(int (* cb)(void)); diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index aea6411b4c..a0b316b22a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit aea6411b4cd90bc00524db58855bd6478a0e2475 +Subproject commit a0b316b22acb6fbc6001f8dc7da8d26cd564cc05 diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 4e06c8853f..2db8618cc7 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -25,7 +25,7 @@ config SOC_BT_SUPPORTED config SOC_WIFI_SUPPORTED bool - default n + default y config SOC_ASYNC_MEMCPY_SUPPORTED bool @@ -526,3 +526,15 @@ config SOC_PM_SUPPORT_WIFI_WAKEUP config SOC_PM_SUPPORT_BT_WAKEUP bool default y + +config SOC_PM_SUPPORT_CPU_PD + bool + default n + +config SOC_PM_SUPPORT_WIFI_PD + bool + default n + +config SOC_PM_SUPPORT_BT_PD + bool + default n diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 7f58821b0c..7fddf89b06 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -30,7 +30,7 @@ #define SOC_DEDICATED_GPIO_SUPPORTED 1 #define SOC_GDMA_SUPPORTED 1 #define SOC_BT_SUPPORTED 0 // Enable during bringup, IDF-4357 -#define SOC_WIFI_SUPPORTED 0 // Enable during bringup, IDF-3905 +#define SOC_WIFI_SUPPORTED 1 #define SOC_ASYNC_MEMCPY_SUPPORTED 1 #define SOC_SUPPORTS_SECURE_DL_MODE 1 #define SOC_EFUSE_KEY_PURPOSE_FIELD 0