From c448597f24381d6c21294d1ecef10cc4533bcaa7 Mon Sep 17 00:00:00 2001 From: Armando Date: Tue, 20 Jun 2023 16:04:41 +0800 Subject: [PATCH] kconfig: introduced CONFIG_IDF_ENV_BRINGUP for new chip bringup usage --- Kconfig | 16 +++++++++++- components/bootloader/Kconfig.projbuild | 1 + components/esp_hw_support/Kconfig | 11 ++++++++ components/esp_system/CMakeLists.txt | 4 +-- .../esp_system/port/soc/esp32p4/Kconfig.cpu | 25 +++++++++++++++++++ components/esptool_py/Kconfig.projbuild | 2 +- .../soc/esp32/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32/include/soc/soc_caps.h | 1 + .../esp32c2/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32c2/include/soc/soc_caps.h | 1 + .../esp32c3/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32c3/include/soc/soc_caps.h | 1 + .../esp32c6/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32c6/include/soc/soc_caps.h | 1 + .../esp32h2/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32h2/include/soc/soc_caps.h | 1 + .../esp32s2/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32s2/include/soc/soc_caps.h | 1 + .../esp32s3/include/soc/Kconfig.soc_caps.in | 4 +++ components/soc/esp32s3/include/soc/soc_caps.h | 1 + 20 files changed, 90 insertions(+), 4 deletions(-) diff --git a/Kconfig b/Kconfig index c0924cc767..392a77552b 100644 --- a/Kconfig +++ b/Kconfig @@ -11,9 +11,23 @@ mainmenu "Espressif IoT Development Framework Configuration" default "y" config IDF_ENV_FPGA - # This option is for internal use only bool option env="IDF_ENV_FPGA" + help + - This option is for internal use only. + - Enabling this option will help enable all FPGA support so as to + run ESP-IDF on an FPGA. This can help reproduce some issues that + only happens on FPGA condition, or when you have to burn some + efuses multiple times. + + config IDF_ENV_BRINGUP + bool + default "y" if IDF_TARGET_ESP32P4 + help + - This option is ONLY used when doing new chip bringup. + - This option will only enable necessary hw / sw settings for running + a hello_world application. + config IDF_CI_BUILD bool diff --git a/components/bootloader/Kconfig.projbuild b/components/bootloader/Kconfig.projbuild index a4d2fb6457..78e8fadfba 100644 --- a/components/bootloader/Kconfig.projbuild +++ b/components/bootloader/Kconfig.projbuild @@ -429,6 +429,7 @@ menu "Bootloader config" config BOOTLOADER_FLASH_XMC_SUPPORT bool "Enable the support for flash chips of XMC (READ HELP FIRST)" default y + depends on !IDF_ENV_BRINGUP help Perform the startup flow recommended by XMC. Please consult XMC for the details of this flow. XMC chips will be forbidden to be used, when this option is disabled. diff --git a/components/esp_hw_support/Kconfig b/components/esp_hw_support/Kconfig index 255c32a5cf..328d6e708f 100644 --- a/components/esp_hw_support/Kconfig +++ b/components/esp_hw_support/Kconfig @@ -275,4 +275,15 @@ menu "Hardware Settings" default 3 if ESP_CRYPTO_DPA_PROTECTION_LEVEL_HIGH endmenu + + # Invisible bringup bypass options for esp_hw_support component + config ESP_BRINGUP_BYPASS_CPU_CLK_SETTING + bool + default y if !SOC_CLK_TREE_SUPPORTED + default n + help + This option is only used for new chip bringup, when + clock support isn't done yet. So with this option, + we use xtal on FPGA as the clock source. + endmenu diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index fb8f798ee6..7973182871 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -12,7 +12,7 @@ endif() set(srcs "esp_err.c") -if(CONFIG_IDF_ENV_FPGA) +if(CONFIG_IDF_ENV_FPGA OR CONFIG_ESP_BRINGUP_BYPASS_CPU_CLK_SETTING) list(APPEND srcs "fpga_overrides.c") endif() @@ -86,7 +86,7 @@ else() include(${CMAKE_CURRENT_LIST_DIR}/ld/ld.cmake) endif() -if(CONFIG_IDF_ENV_FPGA) +if(CONFIG_IDF_ENV_FPGA OR CONFIG_ESP_BRINGUP_BYPASS_CPU_CLK_SETTING) # Forces the linker to include fpga stubs from this component target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_common_include_fpga_overrides") endif() diff --git a/components/esp_system/port/soc/esp32p4/Kconfig.cpu b/components/esp_system/port/soc/esp32p4/Kconfig.cpu index e69de29bb2..23782a0741 100644 --- a/components/esp_system/port/soc/esp32p4/Kconfig.cpu +++ b/components/esp_system/port/soc/esp32p4/Kconfig.cpu @@ -0,0 +1,25 @@ +# TODO: IDF-7526 , Check all this file to update the frequency +choice ESP_DEFAULT_CPU_FREQ_MHZ + prompt "CPU frequency" + default ESP_DEFAULT_CPU_FREQ_MHZ_40 if IDF_ENV_FPGA || ESP_BRINGUP_BYPASS_CPU_CLK_SETTING + default ESP_DEFAULT_CPU_FREQ_MHZ_160 + help + CPU frequency to be set on application startup. + + config ESP_DEFAULT_CPU_FREQ_MHZ_40 + bool "40 MHz" + depends on IDF_ENV_FPGA || ESP_BRINGUP_BYPASS_CPU_CLK_SETTING + config ESP_DEFAULT_CPU_FREQ_MHZ_80 + bool "80 MHz" + config ESP_DEFAULT_CPU_FREQ_MHZ_120 + bool "120 MHz" + config ESP_DEFAULT_CPU_FREQ_MHZ_160 + bool "160 MHz" +endchoice + +config ESP_DEFAULT_CPU_FREQ_MHZ + int + default 40 if ESP_DEFAULT_CPU_FREQ_MHZ_40 + default 80 if ESP_DEFAULT_CPU_FREQ_MHZ_80 + default 120 if ESP_DEFAULT_CPU_FREQ_MHZ_120 + default 160 if ESP_DEFAULT_CPU_FREQ_MHZ_160 diff --git a/components/esptool_py/Kconfig.projbuild b/components/esptool_py/Kconfig.projbuild index abb0cf52df..f4be9d6046 100644 --- a/components/esptool_py/Kconfig.projbuild +++ b/components/esptool_py/Kconfig.projbuild @@ -3,7 +3,7 @@ menu "Serial flasher config" config ESPTOOLPY_NO_STUB bool "Disable download stub" - default "y" if IDF_ENV_FPGA + default "y" if IDF_ENV_FPGA || IDF_ENV_BRINGUP default "n" help diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index 8e1d2814e4..36445f9f65 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -147,6 +147,10 @@ config SOC_ULP_FSM_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL int default 5 diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 1aeed6ef04..4d6c0462a3 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -96,6 +96,7 @@ #define SOC_TOUCH_SENSOR_SUPPORTED 1 #define SOC_BOD_SUPPORTED 1 #define SOC_ULP_FSM_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 #if SOC_CAPS_ECO_VER < 200 #define SOC_DPORT_WORKAROUND 1 diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 32d7a8bd11..650107b7eb 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -87,6 +87,10 @@ config SOC_BOD_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_XTAL_SUPPORT_26M bool default y diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 1987495ac0..40e7963399 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -46,6 +46,7 @@ #define SOC_SECURE_BOOT_SUPPORTED 1 #define SOC_SYSTIMER_SUPPORTED 1 #define SOC_BOD_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 /*-------------------------- XTAL CAPS ---------------------------------------*/ #define SOC_XTAL_SUPPORT_26M 1 diff --git a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in index 0fe065f248..b48f9d0b98 100644 --- a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in @@ -139,6 +139,10 @@ config SOC_BOD_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_XTAL_SUPPORT_40M bool default y diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index a9ca64e3fe..32dc7519d9 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -62,6 +62,7 @@ #define SOC_SECURE_BOOT_SUPPORTED 1 #define SOC_MEMPROT_SUPPORTED 1 #define SOC_BOD_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 /*-------------------------- XTAL CAPS ---------------------------------------*/ #define SOC_XTAL_SUPPORT_40M 1 diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index de21166bde..bc5e9f21a7 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -191,6 +191,10 @@ config SOC_LP_I2C_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_XTAL_SUPPORT_40M bool default y diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index b98eb487b8..85f7e5ebf9 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -72,6 +72,7 @@ #define SOC_LP_AON_SUPPORTED 1 #define SOC_LP_PERIPHERALS_SUPPORTED 1 #define SOC_LP_I2C_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 /*-------------------------- XTAL CAPS ---------------------------------------*/ #define SOC_XTAL_SUPPORT_40M 1 diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index 204588e4c3..1a92530dc1 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -167,6 +167,10 @@ config SOC_PMU_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_XTAL_SUPPORT_32M bool default y diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index c5d5fc661b..c0569795a3 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -67,6 +67,7 @@ #define SOC_BOD_SUPPORTED 1 #define SOC_APM_SUPPORTED 1 #define SOC_PMU_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 /*-------------------------- XTAL CAPS ---------------------------------------*/ #define SOC_XTAL_SUPPORT_32M 1 diff --git a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in index 859e5319c7..7c49244290 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -171,6 +171,10 @@ config SOC_BOD_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_XTAL_SUPPORT_40M bool default y diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index 3b466741b4..d1b9c26118 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -81,6 +81,7 @@ #define SOC_MEMPROT_SUPPORTED 1 #define SOC_TOUCH_SENSOR_SUPPORTED 1 #define SOC_BOD_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 /*-------------------------- XTAL CAPS ---------------------------------------*/ #define SOC_XTAL_SUPPORT_40M 1 diff --git a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in index 98cd52d68a..3d368bab6b 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -207,6 +207,10 @@ config SOC_BOD_SUPPORTED bool default y +config SOC_CLK_TREE_SUPPORTED + bool + default y + config SOC_XTAL_SUPPORT_40M bool default y diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index 72448bfbf9..0ca912c970 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -71,6 +71,7 @@ #define SOC_MEMPROT_SUPPORTED 1 #define SOC_TOUCH_SENSOR_SUPPORTED 1 #define SOC_BOD_SUPPORTED 1 +#define SOC_CLK_TREE_SUPPORTED 1 /*-------------------------- XTAL CAPS ---------------------------------------*/ #define SOC_XTAL_SUPPORT_40M 1