From eba0a57f95e94fb3718ace04540e0d359d1c82c6 Mon Sep 17 00:00:00 2001 From: "igor.masar" Date: Fri, 24 Apr 2026 13:30:58 +0200 Subject: [PATCH] feat(soc): add SOC_USB_FSLS_PHY_NUM for USB-OTG targets Introduce SOC_USB_FSLS_PHY_NUM on ESP32-S2, ESP32-S3 and ESP32-P4 to expose the number of FSLS USB_WRAP PHYs available on each target. This separates FSLS USB_WRAP support from OTG/UTMI support so that downstream code can gate FSLS PHY handling independently. --- components/soc/esp32p4/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32p4/include/soc/soc_caps.h | 1 + components/soc/esp32s2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32s2/include/soc/soc_caps.h | 1 + components/soc/esp32s3/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32s3/include/soc/soc_caps.h | 1 + 6 files changed, 15 insertions(+) diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index 4c7c9af7849..468f0239696 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1135,6 +1135,10 @@ config SOC_USB_OTG_PERIPH_NUM int default 2 +config SOC_USB_FSLS_PHY_NUM + int + default 1 + config SOC_USB_UTMI_PHY_NUM int default 1 diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index 41c406ef90c..7c1ac3b929a 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -429,6 +429,7 @@ // USB OTG Caps #define SOC_USB_OTG_PERIPH_NUM (2U) +#define SOC_USB_FSLS_PHY_NUM (1U) // USB PHY Caps #define SOC_USB_UTMI_PHY_NUM (1U) diff --git a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in index 122c369f484..b641cfd1947 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -907,6 +907,10 @@ config SOC_USB_OTG_PERIPH_NUM int default 1 +config SOC_USB_FSLS_PHY_NUM + int + default 1 + config SOC_SHA_DMA_MAX_BUFFER_SIZE int default 3968 diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index 29f35cdafca..0bddf4df5c0 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -381,6 +381,7 @@ /*-------------------------- USB CAPS ----------------------------------------*/ #define SOC_USB_OTG_PERIPH_NUM (1U) +#define SOC_USB_FSLS_PHY_NUM (1U) /*--------------------------- SHA CAPS ---------------------------------------*/ /* Max amount of bytes in a single DMA operation is 4095, diff --git a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in index fc1ac552235..f35780aa9ac 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -1103,6 +1103,10 @@ config SOC_USB_OTG_PERIPH_NUM int default 1 +config SOC_USB_FSLS_PHY_NUM + int + default 1 + config SOC_SHA_DMA_MAX_BUFFER_SIZE int default 3968 diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index e0840e331c3..f5e72423f6c 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -428,6 +428,7 @@ /*-------------------------- USB CAPS ----------------------------------------*/ #define SOC_USB_OTG_PERIPH_NUM (1U) +#define SOC_USB_FSLS_PHY_NUM (1U) /*--------------------------- SHA CAPS ---------------------------------------*/ /* Max amount of bytes in a single DMA operation is 4095,