diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index 59d7fe783d..e7efd3f0b9 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -106,13 +106,20 @@ menu "PHY" When brownout reset occurs, reduce PHY TX power to keep the code running. config ESP_PHY_ENABLE_USB - bool "Enable USB when phy init" - depends on SOC_USB_OTG_SUPPORTED || ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG - default y if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 + bool "Keep the USB PHY enabled when initializing WiFi" + depends on SOC_WIFI_PHY_NEEDS_USB_WORKAROUND + default y if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3 \ + || ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG default n help - When using USB Serial/JTAG/OTG/CDC, PHY should enable USB, otherwise USB module - can not work properly. Notice: Enabling this configuration option will slightly impact wifi performance. + On some ESP targets, the USB PHY can interfere with WiFi thus lowering WiFi performance. As a result, on + those affected ESP targets, the ESP PHY library's initialization will automatically disable the USB PHY to + get best WiFi performance. This option controls whether or not the ESP PHY library will keep the USB PHY + enabled on initialization. + + Note: This option can be disabled to increase WiFi performance. However, disabling this option will also + mean that the USB PHY cannot be used while WiFi is enabled. + config ESP_PHY_ENABLE_CERT_TEST bool "Enable RF certification test functions" diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 3f9e896c1e..be680677db 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -703,6 +703,10 @@ config SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW bool default y +config SOC_WIFI_PHY_NEEDS_USB_WORKAROUND + bool + default y + config SOC_BLE_SUPPORTED bool default y diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index adcd92c8b5..4a509a2024 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -328,6 +328,7 @@ #define SOC_WIFI_HW_TSF (1) /*!< Support hardware TSF */ #define SOC_WIFI_FTM_SUPPORT (1) /*!< Support FTM */ #define SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW (1) /*!< Support delta early time for rf phy on/off */ +#define SOC_WIFI_PHY_NEEDS_USB_WORKAROUND (1) /*!< SoC has WiFi and USB PHYs interference, needs a workaround */ /*---------------------------------- Bluetooth CAPS ----------------------------------*/ #define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */ diff --git a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in index 1819e07a9f..ef24fe54bf 100644 --- a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in @@ -1035,6 +1035,10 @@ config SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW bool default y +config SOC_WIFI_PHY_NEEDS_USB_WORKAROUND + bool + default y + config SOC_BLE_SUPPORTED bool default y diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index a4d2898a95..374a6c71e7 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -446,6 +446,7 @@ #define SOC_WIFI_CSI_SUPPORT (1) /*!< Support CSI */ #define SOC_WIFI_MESH_SUPPORT (1) /*!< Support WIFI MESH */ #define SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW (1) /*!< Support delta early time for rf phy on/off */ +#define SOC_WIFI_PHY_NEEDS_USB_WORKAROUND (1) /*!< SoC has WiFi and USB PHYs interference, needs a workaround */ /*---------------------------------- Bluetooth CAPS ----------------------------------*/ #define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */ diff --git a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in index f75219ae1e..3964a7bab6 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -1335,6 +1335,10 @@ config SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW bool default y +config SOC_WIFI_PHY_NEEDS_USB_WORKAROUND + bool + default y + config SOC_BLE_SUPPORTED bool default y diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index ddc9edb9e8..53617df5cc 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -535,6 +535,7 @@ #define SOC_WIFI_CSI_SUPPORT (1) /*!< Support CSI */ #define SOC_WIFI_MESH_SUPPORT (1) /*!< Support WIFI MESH */ #define SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW (1) /*!< Support delta early time for rf phy on/off */ +#define SOC_WIFI_PHY_NEEDS_USB_WORKAROUND (1) /*!< SoC has WiFi and USB PHYs interference, needs a workaround */ /*---------------------------------- Bluetooth CAPS ----------------------------------*/ #define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */