diff --git a/components/esptool_py/Kconfig.projbuild b/components/esptool_py/Kconfig.projbuild index 4e2b5ed432..2007fc40d4 100644 --- a/components/esptool_py/Kconfig.projbuild +++ b/components/esptool_py/Kconfig.projbuild @@ -89,71 +89,7 @@ menu "Serial flasher config" # information get from efuse, so don't care this dout choice. default "dout" if ESPTOOLPY_FLASHMODE_OPI - choice ESPTOOLPY_FLASHFREQ - prompt "Flash SPI speed" - default ESPTOOLPY_FLASHFREQ_40M if IDF_TARGET_ESP32 - default ESPTOOLPY_FLASHFREQ_80M if ESPTOOLPY_FLASHFREQ_80M_DEFAULT - default ESPTOOLPY_FLASHFREQ_60M if IDF_TARGET_ESP32C2 - config ESPTOOLPY_FLASHFREQ_120M - bool "120 MHz (READ DOCS FIRST)" - depends on SOC_MEMSPI_SRC_FREQ_120M && \ - (SPI_FLASH_HPM_ON || ESPTOOLPY_OCT_FLASH) && \ - (ESPTOOLPY_FLASH_SAMPLE_MODE_STR || IDF_EXPERIMENTAL_FEATURES) - help - - Optional feature for QSPI Flash. Read docs and enable `CONFIG_SPI_FLASH_HPM_ENA` first! - - Flash 120 MHz SDR mode is stable. - - Flash 120 MHz DDR mode is an experimental feature, it works when - the temperature is stable. - - Risks: - If your chip powers on at a certain temperature, then after the temperature - increases or decreases by approximately 20 Celsius degrees (depending on the - chip), the program will crash randomly. - - config ESPTOOLPY_FLASHFREQ_80M - bool "80 MHz" - depends on SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED && !ESP32P4_REV_MIN_0 # TODO IDF-10488 - config ESPTOOLPY_FLASHFREQ_64M - bool "64 MHz" - depends on SOC_MEMSPI_SRC_FREQ_64M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_60M - bool "60 MHz" - depends on SOC_MEMSPI_SRC_FREQ_60M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_48M - bool "48 MHz" - depends on SOC_MEMSPI_SRC_FREQ_48M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_40M - bool "40 MHz" - depends on SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_32M - bool "32 MHz" - depends on SOC_MEMSPI_SRC_FREQ_32M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_30M - bool "30 MHz" - depends on SOC_MEMSPI_SRC_FREQ_30M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_26M - bool "26 MHz" - depends on SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_24M - bool "24 MHz" - depends on SOC_MEMSPI_SRC_FREQ_24M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_20M - bool "20 MHz" - depends on SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_16M - bool "16 MHz" - depends on SOC_MEMSPI_SRC_FREQ_16M_SUPPORTED - config ESPTOOLPY_FLASHFREQ_15M - bool "15 MHz" - depends on SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED - endchoice - - config ESPTOOLPY_FLASHFREQ_80M_DEFAULT - bool - default y if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 - default y if IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C61 - help - This is an invisible item, used to define the targets that defaults to use 80MHz Flash SPI speed. + orsource "../spi_flash/$IDF_TARGET/Kconfig.flash_freq" config ESPTOOLPY_FLASHFREQ string diff --git a/components/spi_flash/esp32/Kconfig.flash_freq b/components/spi_flash/esp32/Kconfig.flash_freq new file mode 100644 index 0000000000..ba381c1d89 --- /dev/null +++ b/components/spi_flash/esp32/Kconfig.flash_freq @@ -0,0 +1,12 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_40M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_26M + bool "26 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32c2/Kconfig.flash_freq b/components/spi_flash/esp32c2/Kconfig.flash_freq new file mode 100644 index 0000000000..c1b88babcc --- /dev/null +++ b/components/spi_flash/esp32c2/Kconfig.flash_freq @@ -0,0 +1,12 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_60M + config ESPTOOLPY_FLASHFREQ_60M + bool "60 MHz" + config ESPTOOLPY_FLASHFREQ_30M + bool "30 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" + config ESPTOOLPY_FLASHFREQ_15M + bool "15 MHz" +endchoice diff --git a/components/spi_flash/esp32c3/Kconfig.flash_freq b/components/spi_flash/esp32c3/Kconfig.flash_freq new file mode 100644 index 0000000000..48e38803bf --- /dev/null +++ b/components/spi_flash/esp32c3/Kconfig.flash_freq @@ -0,0 +1,12 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_26M + bool "26 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32c5/Kconfig.flash_freq b/components/spi_flash/esp32c5/Kconfig.flash_freq new file mode 100644 index 0000000000..2eac2e2f95 --- /dev/null +++ b/components/spi_flash/esp32c5/Kconfig.flash_freq @@ -0,0 +1,10 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32c5/Kconfig.soc_caps.in b/components/spi_flash/esp32c5/Kconfig.soc_caps.in new file mode 100644 index 0000000000..87accd576f --- /dev/null +++ b/components/spi_flash/esp32c5/Kconfig.soc_caps.in @@ -0,0 +1,8 @@ +##################################################### +# This file is auto-generated from SoC caps +# using gen_soc_caps_kconfig.py, do not edit manually +##################################################### + +config SPI_FLASH_VENDOR_XMC_SUPPORTED + bool + default y diff --git a/components/spi_flash/esp32c5/flash_vendor_caps.h b/components/spi_flash/esp32c5/flash_vendor_caps.h new file mode 100644 index 0000000000..6b127dfbd6 --- /dev/null +++ b/components/spi_flash/esp32c5/flash_vendor_caps.h @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +#define SPI_FLASH_VENDOR_XMC_SUPPORTED (1) diff --git a/components/spi_flash/esp32c6/Kconfig.flash_freq b/components/spi_flash/esp32c6/Kconfig.flash_freq new file mode 100644 index 0000000000..2eac2e2f95 --- /dev/null +++ b/components/spi_flash/esp32c6/Kconfig.flash_freq @@ -0,0 +1,10 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32c61/Kconfig.flash_freq b/components/spi_flash/esp32c61/Kconfig.flash_freq new file mode 100644 index 0000000000..2eac2e2f95 --- /dev/null +++ b/components/spi_flash/esp32c61/Kconfig.flash_freq @@ -0,0 +1,10 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32c61/Kconfig.soc_caps.in b/components/spi_flash/esp32c61/Kconfig.soc_caps.in new file mode 100644 index 0000000000..87accd576f --- /dev/null +++ b/components/spi_flash/esp32c61/Kconfig.soc_caps.in @@ -0,0 +1,8 @@ +##################################################### +# This file is auto-generated from SoC caps +# using gen_soc_caps_kconfig.py, do not edit manually +##################################################### + +config SPI_FLASH_VENDOR_XMC_SUPPORTED + bool + default y diff --git a/components/spi_flash/esp32c61/flash_vendor_caps.h b/components/spi_flash/esp32c61/flash_vendor_caps.h new file mode 100644 index 0000000000..6b127dfbd6 --- /dev/null +++ b/components/spi_flash/esp32c61/flash_vendor_caps.h @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +#define SPI_FLASH_VENDOR_XMC_SUPPORTED (1) diff --git a/components/spi_flash/esp32h2/Kconfig.flash_freq b/components/spi_flash/esp32h2/Kconfig.flash_freq new file mode 100644 index 0000000000..4a1c06fdbf --- /dev/null +++ b/components/spi_flash/esp32h2/Kconfig.flash_freq @@ -0,0 +1,10 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_64M + config ESPTOOLPY_FLASHFREQ_64M + bool "64 MHz" + config ESPTOOLPY_FLASHFREQ_32M + bool "32 MHz" + config ESPTOOLPY_FLASHFREQ_16M + bool "16 MHz" +endchoice diff --git a/components/spi_flash/esp32p4/Kconfig.flash_freq b/components/spi_flash/esp32p4/Kconfig.flash_freq new file mode 100644 index 0000000000..6e0296022f --- /dev/null +++ b/components/spi_flash/esp32p4/Kconfig.flash_freq @@ -0,0 +1,12 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_40M if ESP32P4_REV_MIN_0 + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + depends on !ESP32P4_REV_MIN_0 + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32s2/Kconfig.flash_freq b/components/spi_flash/esp32s2/Kconfig.flash_freq new file mode 100644 index 0000000000..48e38803bf --- /dev/null +++ b/components/spi_flash/esp32s2/Kconfig.flash_freq @@ -0,0 +1,12 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_26M + bool "26 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/components/spi_flash/esp32s3/Kconfig.flash_freq b/components/spi_flash/esp32s3/Kconfig.flash_freq new file mode 100644 index 0000000000..b4d149c7ed --- /dev/null +++ b/components/spi_flash/esp32s3/Kconfig.flash_freq @@ -0,0 +1,23 @@ +choice ESPTOOLPY_FLASHFREQ + prompt "Flash SPI speed" + default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_120M + bool "120 MHz (READ DOCS FIRST)" + depends on (SPI_FLASH_HPM_ON || ESPTOOLPY_OCT_FLASH) && \ + (ESPTOOLPY_FLASH_SAMPLE_MODE_STR || IDF_EXPERIMENTAL_FEATURES) + help + - Optional feature for QSPI Flash. Read docs and enable `CONFIG_SPI_FLASH_HPM_ENA` first! + - Flash 120 MHz SDR mode is stable. + - Flash 120 MHz DDR mode is an experimental feature, it works when + the temperature is stable. + Risks: + If your chip powers on at a certain temperature, then after the temperature + increases or decreases by approximately 20 Celsius degrees (depending on the + chip), the program will crash randomly. + config ESPTOOLPY_FLASHFREQ_80M + bool "80 MHz" + config ESPTOOLPY_FLASHFREQ_40M + bool "40 MHz" + config ESPTOOLPY_FLASHFREQ_20M + bool "20 MHz" +endchoice diff --git a/examples/storage/perf_benchmark/sdkconfig.ci.spiflash b/examples/storage/perf_benchmark/sdkconfig.ci.spiflash index f3ae318e22..516d34b9b6 100644 --- a/examples/storage/perf_benchmark/sdkconfig.ci.spiflash +++ b/examples/storage/perf_benchmark/sdkconfig.ci.spiflash @@ -9,9 +9,6 @@ CONFIG_FATFS_VFS_FSTAT_BLKSIZE=4096 # SPI flash CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHMODE="qio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y -CONFIG_ESPTOOLPY_FLASHFREQ="80m" CONFIG_EXAMPLE_TEST_SPIFLASH=y # SD card diff --git a/examples/storage/perf_benchmark/sdkconfig.defaults b/examples/storage/perf_benchmark/sdkconfig.defaults index cc7c20c831..ca6cd60dcf 100644 --- a/examples/storage/perf_benchmark/sdkconfig.defaults +++ b/examples/storage/perf_benchmark/sdkconfig.defaults @@ -13,7 +13,4 @@ CONFIG_LITTLEFS_SDMMC_SUPPORT=y # SPI flash CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHMODE="qio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y -CONFIG_ESPTOOLPY_FLASHFREQ="80m" CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y diff --git a/examples/system/startup_time/sdkconfig.defaults b/examples/system/startup_time/sdkconfig.defaults index b679342774..81b809ede4 100644 --- a/examples/system/startup_time/sdkconfig.defaults +++ b/examples/system/startup_time/sdkconfig.defaults @@ -2,7 +2,6 @@ # # (Not all hardware may support this configuration.) CONFIG_ESPTOOLPY_FLASHMODE_QIO=y -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y # These two settings mean that no logs are printed # during startup, but it's possible to use esp_log_level_set("*", ESP_LOG_INFO) diff --git a/tools/test_apps/system/startup/sdkconfig.ci.flash_80m_qio b/tools/test_apps/system/startup/sdkconfig.ci.flash_80m_qio index 447c189889..f1bf6f7eab 100644 --- a/tools/test_apps/system/startup/sdkconfig.ci.flash_80m_qio +++ b/tools/test_apps/system/startup/sdkconfig.ci.flash_80m_qio @@ -1,2 +1 @@ -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_ESPTOOLPY_FLASHMODE_QIO=y