From bcb9d6081227da282f7488bdf6b796f32a1ec237 Mon Sep 17 00:00:00 2001 From: "igor.masar" Date: Fri, 24 Apr 2026 00:16:30 +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, ESP32-P4 and ESP32-H4 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/esp32h4/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h4/include/soc/soc_caps.h | 1 + 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 + 8 files changed, 20 insertions(+) diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index 570e11b5fd9..5068c4633b8 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -1006,3 +1006,7 @@ config SOC_RCC_IS_INDEPENDENT config SOC_USB_OTG_PERIPH_NUM int default 1 + +config SOC_USB_FSLS_PHY_NUM + int + default 1 diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index 9739faf559d..1c1fab002c6 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -539,3 +539,4 @@ /*-------------------------- USB CAPS ----------------------------------------*/ #define SOC_USB_OTG_PERIPH_NUM (1U) +#define SOC_USB_FSLS_PHY_NUM (1U) diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index bdac2e746c8..bbacbf19521 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1163,6 +1163,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 e4543793f28..a8070619717 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -430,6 +430,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 14049a85c8c..51917176e30 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -747,6 +747,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 e454af050fe..9f6955a2afe 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -341,6 +341,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 7b500cf80e8..33fbcdda60c 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -867,6 +867,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 261987e68f1..fb6c1b015f0 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -360,6 +360,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,