From a51813d9d937c2a49927fd5d896c78462705146b Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Tue, 14 Nov 2023 18:45:27 +0800 Subject: [PATCH] refactor(soc): SOC_USB_PERIPH_NUM option This commit refactors SOC_USB_PERIPH_NUM as follows: - Renamed to SOC_USB_OTG_PERIPH_NUM to avoid confusion with USB Serial JTAG - Updated to unsigned integer "1U" - Updated some build rules to depend on SOC_USB_OTG_SUPPORTED instead --- components/soc/esp32s2/include/soc/Kconfig.soc_caps.in | 6 +++--- components/soc/esp32s2/include/soc/soc_caps.h | 3 +-- components/soc/esp32s3/include/soc/Kconfig.soc_caps.in | 6 +++--- components/soc/esp32s3/include/soc/soc_caps.h | 2 +- examples/peripherals/.build-test-rules.yml | 2 +- examples/system/.build-test-rules.yml | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in index 79034304bc..a2f37fc1c9 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -823,9 +823,9 @@ config SOC_SPIRAM_XIP_SUPPORTED bool default y -config SOC_USB_PERIPH_NUM - bool - default y +config SOC_USB_OTG_PERIPH_NUM + int + default 1 config SOC_SHA_DMA_MAX_BUFFER_SIZE int diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index a6d7c41464..ad3b5cb454 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -352,8 +352,7 @@ #define SOC_SPIRAM_XIP_SUPPORTED 1 /*-------------------------- USB CAPS ----------------------------------------*/ -#define SOC_USB_PERIPH_NUM 1 - +#define SOC_USB_OTG_PERIPH_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 6dbd6e5f59..f8e319beb2 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -975,9 +975,9 @@ config SOC_UART_SUPPORT_XTAL_CLK bool default y -config SOC_USB_PERIPH_NUM - bool - default y +config SOC_USB_OTG_PERIPH_NUM + int + default 1 config SOC_SHA_DMA_MAX_BUFFER_SIZE int diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index 8216c69aa5..d70e3dd24c 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -386,7 +386,7 @@ #define SOC_UART_SUPPORT_XTAL_CLK (1) /*!< Support XTAL clock as the clock source */ /*-------------------------- USB CAPS ----------------------------------------*/ -#define SOC_USB_PERIPH_NUM 1 +#define SOC_USB_OTG_PERIPH_NUM (1U) /*--------------------------- SHA CAPS ---------------------------------------*/ /* Max amount of bytes in a single DMA operation is 4095, diff --git a/examples/peripherals/.build-test-rules.yml b/examples/peripherals/.build-test-rules.yml index b73f3068e2..cdd760633d 100644 --- a/examples/peripherals/.build-test-rules.yml +++ b/examples/peripherals/.build-test-rules.yml @@ -360,4 +360,4 @@ examples/peripherals/uart/uart_echo_rs485: examples/peripherals/usb: disable: - - if: SOC_USB_PERIPH_NUM != 1 + - if: SOC_USB_OTG_SUPPORTED != 1 diff --git a/examples/system/.build-test-rules.yml b/examples/system/.build-test-rules.yml index 812425a15b..9811ec8e62 100644 --- a/examples/system/.build-test-rules.yml +++ b/examples/system/.build-test-rules.yml @@ -24,7 +24,7 @@ examples/system/console/advanced: examples/system/console/advanced_usb_cdc: disable: - - if: SOC_USB_PERIPH_NUM == 0 + - if: SOC_USB_OTG_SUPPORTED != 1 depends_components: - console - vfs