diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c index b4863a925ed..bc2efd29e9f 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -230,6 +230,12 @@ esp_err_t bootloader_init_spi_flash(void) { bootloader_init_mspi_clock(); bootloader_init_flash_configure(); + +#if CONFIG_BOOTLOADER_FLASH_DC_AWARE + // Reset flash, clear volatile bits DC[0:1]. Make it work under default mode to boot. + bootloader_spi_flash_reset(); +#endif + bootloader_spi_flash_resume(); if ((void*)bootloader_flash_unlock != (void*)bootloader_flash_unlock_default) { ESP_EARLY_LOGD(TAG, "Using overridden bootloader_flash_unlock"); diff --git a/components/esp_hal_mspi/esp32c5/include/hal/mspi_ll.h b/components/esp_hal_mspi/esp32c5/include/hal/mspi_ll.h index df6c7d1da41..cd2d1d0093b 100644 --- a/components/esp_hal_mspi/esp32c5/include/hal/mspi_ll.h +++ b/components/esp_hal_mspi/esp32c5/include/hal/mspi_ll.h @@ -75,9 +75,6 @@ static inline __attribute__((always_inline)) void mspi_timing_ll_set_core_clock( case 120: divider = 4; break; - case 240: - divider = 2; - break; default: HAL_ASSERT(false); } diff --git a/components/esp_hal_mspi/esp32c61/include/hal/mspi_ll.h b/components/esp_hal_mspi/esp32c61/include/hal/mspi_ll.h index b2e54ede984..a786c2423ec 100644 --- a/components/esp_hal_mspi/esp32c61/include/hal/mspi_ll.h +++ b/components/esp_hal_mspi/esp32c61/include/hal/mspi_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -242,6 +242,18 @@ static inline void mspi_timing_ll_set_flash_extra_dummy(uint8_t mspi_id, uint8_t REG_SET_BIT(SPI_MEM_TIMING_CALI_REG(MSPI_TIMING_LL_MSPI_ID_0), SPI_MEM_TIMING_CALI_UPDATE); } +/** + * Set MSPI Flash user dummy + * + * @param mspi_id SPI0 / SPI1 + * @param user_dummy user dummy + */ +__attribute__((always_inline)) +static inline void mspi_timing_ll_set_flash_user_dummy(uint8_t mspi_id, uint8_t user_dummy) +{ + REG_SET_FIELD(SPI_MEM_USER1_REG(mspi_id), SPI_MEM_USR_DUMMY_CYCLELEN, user_dummy); +} + /** * Get MSPI flash dummy info * diff --git a/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c5/mspi_timing_tuning_configs.h b/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c5/mspi_timing_tuning_configs.h index c213631d96f..6918b85997d 100644 --- a/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c5/mspi_timing_tuning_configs.h +++ b/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c5/mspi_timing_tuning_configs.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -121,11 +121,6 @@ ESP_STATIC_ASSERT(MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ % MSPI_TIMING_FLASH_MO #define MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 12 #define MSPI_TIMING_FLASH_DEFAULT_CONFIG_ID_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 4 -//FLASH: core clock 240M, module clock 80M, STR mode -#define MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} -#define MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE 14 -#define MSPI_TIMING_FLASH_DEFAULT_CONFIG_ID_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE 4 - //FLASH: core clock 80M, module clock 80M, STR mode #define MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} #define MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE 14 @@ -136,11 +131,6 @@ ESP_STATIC_ASSERT(MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ % MSPI_TIMING_FLASH_MO #define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 12 #define MSPI_TIMING_PSRAM_DEFAULT_CONFIG_ID_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 4 -//PSRAM: core clock 240M, module clock 80M, STR mode -#define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} -#define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE 14 -#define MSPI_TIMING_PSRAM_DEFAULT_CONFIG_ID_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE 4 - //PSRAM: core clock 80M, module clock 80M, STR mode #define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} #define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE 14 diff --git a/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c61/mspi_timing_tuning_configs.h b/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c61/mspi_timing_tuning_configs.h index 600754208db..5b677e546ac 100644 --- a/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c61/mspi_timing_tuning_configs.h +++ b/components/esp_hw_support/mspi/mspi_timing_tuning/port/esp32c61/mspi_timing_tuning_configs.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -13,6 +13,7 @@ #define MSPI_TIMING_CONFIG_NUM_MAX 32 //This should be larger than the max available timing config num #define MSPI_TIMING_TEST_DATA_LEN 128 #define MSPI_TIMING_PSRAM_TEST_DATA_ADDR 0x100000 +#define MSPI_TIMING_FLASH_TEST_DATA_ADDR ESP_BOOTLOADER_OFFSET //--------------------------------------FLASH Sampling Mode --------------------------------------// #define MSPI_TIMING_FLASH_STR_MODE 1 @@ -27,7 +28,7 @@ #define MSPI_TIMING_FLASH_MODULE_CLOCK 120 #endif //------------------------------------FLASH Needs Tuning or not-------------------------------------// -#define MSPI_TIMING_FLASH_NEEDS_TUNING 0 +#define MSPI_TIMING_FLASH_NEEDS_TUNING (MSPI_TIMING_FLASH_MODULE_CLOCK > 80) //--------------------------------------PSRAM Sampling Mode --------------------------------------// #define MSPI_TIMING_PSRAM_STR_MODE 1 @@ -37,6 +38,8 @@ #define MSPI_TIMING_PSRAM_MODULE_CLOCK 40 #elif CONFIG_SPIRAM_SPEED_80M #define MSPI_TIMING_PSRAM_MODULE_CLOCK 80 +#elif CONFIG_SPIRAM_SPEED_120M +#define MSPI_TIMING_PSRAM_MODULE_CLOCK 120 #endif #else //Disable PSRAM #define MSPI_TIMING_PSRAM_MODULE_CLOCK 10 //Define this to 10MHz @@ -46,17 +49,30 @@ #define MSPI_TIMING_PSRAM_NEEDS_TUNING (MSPI_TIMING_PSRAM_MODULE_CLOCK > 40) #endif -///////////////////////////////////// FLASH/PSRAM CORE CLOCK ///////////////////////////////////// -#if ((CONFIG_ESPTOOLPY_FLASHFREQ_80M && !CONFIG_SPIRAM) || (CONFIG_ESPTOOLPY_FLASHFREQ_80M && CONFIG_SPIRAM_SPEED_80M)) +///////////////////////////////////// FLASH CORE CLOCK ///////////////////////////////////// +//FLASH 80M +#if CONFIG_ESPTOOLPY_FLASHFREQ_80M #define MSPI_TIMING_FLASH_EXPECTED_CORE_CLK_MHZ 80 -#define MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ 80 #define MSPI_TIMING_FLASH_CONSECUTIVE_LEN_MAX 6 -#else -#define MSPI_TIMING_FLASH_EXPECTED_CORE_CLK_MHZ 240 -#define MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ 240 +#endif + +//FLASH 120M +#if CONFIG_ESPTOOLPY_FLASHFREQ_120M +#define MSPI_TIMING_FLASH_EXPECTED_CORE_CLK_MHZ 120 #define MSPI_TIMING_FLASH_CONSECUTIVE_LEN_MAX 4 #endif +///////////////////////////////////// PSRAM CORE CLOCK ///////////////////////////////////// +//PSRAM 80M +#if CONFIG_SPIRAM_SPEED_80M +#define MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ 80 +#endif + +//PSRAM 120M +#if CONFIG_SPIRAM_SPEED_120M +#define MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ 120 +#endif //PSRAM 120M DTR + //------------------------------------------Determine the Core Clock-----------------------------------------------// /** * @note @@ -98,22 +114,22 @@ ESP_STATIC_ASSERT(MSPI_TIMING_PSRAM_EXPECTED_CORE_CLK_MHZ % MSPI_TIMING_FLASH_MO /** * Timing Tuning Parameters */ +//FLASH: core clock 120M, module clock 120M, STR mode +#define MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE {{2, 0, 1}, {0, 0, 0}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {2, 2, 3}, {2, 1, 3}, {2, 0, 3}, {0, 0, 2}, {2, 2, 4}, {2, 1, 4}} +#define MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 12 +#define MSPI_TIMING_FLASH_DEFAULT_CONFIG_ID_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 2 + //FLASH: core clock 80M, module clock 80M, STR mode -#define MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} +#define MSPI_TIMING_FLASH_CONFIG_TABLE_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 1}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} #define MSPI_TIMING_FLASH_CONFIG_NUM_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE 14 #define MSPI_TIMING_FLASH_DEFAULT_CONFIG_ID_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE 4 -//PSRAM: core clock 240M, module clock 120M, STR mode -#define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_240M_MODULE_CLK_120M_STR_MODE {{2, 0, 1}, {0, 0, 0}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {2, 2, 3}, {2, 1, 3}, {2, 0, 3}, {0, 0, 2}, {2, 2, 4}, {2, 1, 4}} -#define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_240M_MODULE_CLK_120M_STR_MODE 12 -#define MSPI_TIMING_PSRAM_DEFAULT_CONFIG_ID_CORE_CLK_240M_MODULE_CLK_120M_STR_MODE 4 - -//PSRAM: core clock 240M, module clock 80M, STR mode -#define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} -#define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE 14 -#define MSPI_TIMING_PSRAM_DEFAULT_CONFIG_ID_CORE_CLK_240M_MODULE_CLK_80M_STR_MODE 4 +//PSRAM: core clock 120M, module clock 120M, STR mode +#define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE {{2, 0, 1}, {0, 0, 0}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {2, 2, 3}, {2, 1, 3}, {2, 0, 3}, {0, 0, 2}, {2, 2, 4}, {2, 1, 4}} +#define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 12 +#define MSPI_TIMING_PSRAM_DEFAULT_CONFIG_ID_CORE_CLK_120M_MODULE_CLK_120M_STR_MODE 4 //PSRAM: core clock 80M, module clock 80M, STR mode -#define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 2}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} +#define MSPI_TIMING_PSRAM_CONFIG_TABLE_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE {{2, 2, 1}, {2, 1, 1}, {2, 0, 1}, {0, 0, 0}, {3, 1, 2}, {2, 3, 2}, {2, 2, 2}, {2, 1, 2}, {2, 0, 1}, {0, 0, 1}, {3, 1, 3}, {2, 3, 3}, {2, 2, 3}, {2, 1, 3}} #define MSPI_TIMING_PSRAM_CONFIG_NUM_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE 14 #define MSPI_TIMING_PSRAM_DEFAULT_CONFIG_ID_CORE_CLK_80M_MODULE_CLK_80M_STR_MODE 4 diff --git a/components/esp_hw_support/test_apps/.build-test-rules.yml b/components/esp_hw_support/test_apps/.build-test-rules.yml index b556ff23602..88890f6b75b 100644 --- a/components/esp_hw_support/test_apps/.build-test-rules.yml +++ b/components/esp_hw_support/test_apps/.build-test-rules.yml @@ -28,7 +28,8 @@ components/esp_hw_support/test_apps/host_test_linux: components/esp_hw_support/test_apps/mspi: disable: - - if: IDF_TARGET not in ["esp32s3", "esp32p4"] + - if: IDF_TARGET not in ["esp32s3", "esp32p4", "esp32c61", "esp32c5"] + - if: CONFIG_NAME == "120sdr_120sdr" and IDF_TARGET in ["esp32s3", "esp32p4"] components/esp_hw_support/test_apps/mspi_psram_with_dfs: disable: diff --git a/components/esp_hw_support/test_apps/mspi/README.md b/components/esp_hw_support/test_apps/mspi/README.md index 3a9d77fcb99..fbd388ce703 100644 --- a/components/esp_hw_support/test_apps/mspi/README.md +++ b/components/esp_hw_support/test_apps/mspi/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-P4 | ESP32-S3 | -| ----------------- | -------- | -------- | +| Supported Targets | ESP32-C5 | ESP32-C61 | ESP32-P4 | ESP32-S3 | +| ----------------- | -------- | --------- | -------- | -------- | This project tests if Flash and PSRAM can work under different configurations. To add new configuration, create one more sdkconfig.ci.NAME file in this directory. diff --git a/components/esp_hw_support/test_apps/mspi/pytest_flash_psram.py b/components/esp_hw_support/test_apps/mspi/pytest_flash_psram.py index ab973a52bec..016cf7ce498 100644 --- a/components/esp_hw_support/test_apps/mspi/pytest_flash_psram.py +++ b/components/esp_hw_support/test_apps/mspi/pytest_flash_psram.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import os import pathlib @@ -53,7 +53,6 @@ def test_flash4_psram4(dut: IdfDut) -> None: 'config', [ 'esp32p4_120sdr_200ddr', - 'esp32p4_timing_tuning_log_safe', ], indirect=True, ) @@ -62,15 +61,44 @@ def test_flash_psram_esp32p4(dut: IdfDut) -> None: dut.run_all_single_board_cases() -# TODO: never was tested IDF-14918 -# @pytest.mark.generic -# @pytest.mark.parametrize( -# 'config', -# [ -# 'generic_timing_tuning_log_safe', -# ], -# indirect=True, -# ) -# @idf_parametrize('target', ['esp32c5', 'esp32c61'], indirect=['target']) -# def test_flash_psram_generic(dut: IdfDut) -> None: -# dut.run_all_single_board_cases() +@pytest.mark.generic +@pytest.mark.parametrize( + 'config', + [ + '120sdr_120sdr', + ], + indirect=True, +) +@idf_parametrize('target', ['esp32c5', 'esp32c61'], indirect=['target']) +def test_flash_psram_120sdr_120sdr(dut: IdfDut) -> None: + dut.run_all_single_board_cases() + + +@pytest.mark.parametrize( + 'config', + [ + 'generic_timing_tuning_log_safe', + ], + indirect=True, +) +@idf_parametrize( + 'target,markers', + [ + # S3 has no flash support auto suspend, this test is not applicable + ( + 'esp32p4', + (pytest.mark.generic,), + ), + ( + 'esp32c5', + (pytest.mark.generic,), + ), + ( + 'esp32c61', + (pytest.mark.generic,), + ), + ], + indirect=['target'], +) +def test_flash_psram_generic(dut: IdfDut) -> None: + dut.run_all_single_board_cases() diff --git a/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.esp32p4_timing_tuning_log_safe b/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.120sdr_120sdr similarity index 56% rename from components/esp_hw_support/test_apps/mspi/sdkconfig.ci.esp32p4_timing_tuning_log_safe rename to components/esp_hw_support/test_apps/mspi/sdkconfig.ci.120sdr_120sdr index b8e3d1c163a..6c8f0dba430 100644 --- a/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.esp32p4_timing_tuning_log_safe +++ b/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.120sdr_120sdr @@ -1,10 +1,6 @@ -CONFIG_IDF_TARGET="esp32p4" - -CONFIG_IDF_EXPERIMENTAL_FEATURES=y CONFIG_SPIRAM=y -CONFIG_SPIRAM_SPEED_200M=y +CONFIG_SPIRAM_SPEED_120M=y CONFIG_ESPTOOLPY_FLASHFREQ_120M=y CONFIG_SPI_FLASH_HPM_ENA=y CONFIG_BOOTLOADER_FLASH_DC_AWARE=y CONFIG_SPI_FLASH_AUTO_SUSPEND=y -CONFIG_LOG_IN_IRAM=n diff --git a/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.esp32s3_f4r4_timing_tuning_log_safe b/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.esp32s3_f4r4_timing_tuning_log_safe deleted file mode 100644 index ba6a6506aef..00000000000 --- a/components/esp_hw_support/test_apps/mspi/sdkconfig.ci.esp32s3_f4r4_timing_tuning_log_safe +++ /dev/null @@ -1,15 +0,0 @@ -# Legacy, F4R4, Flash 120M SDR, PSRAM 120M SDR - -CONFIG_IDF_TARGET="esp32s3" - -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_SPI_FLASH_HPM_ENA=y -CONFIG_ESPTOOLPY_FLASHFREQ_120M=y -CONFIG_BOOTLOADER_FLASH_DC_AWARE=y -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -CONFIG_SPIRAM=y -CONFIG_SPIRAM_SPEED_120M=y -CONFIG_SPI_FLASH_AUTO_SUSPEND=y -CONFIG_LOG_IN_IRAM=n diff --git a/components/esp_psram/esp32c61/Kconfig.spiram b/components/esp_psram/esp32c61/Kconfig.spiram index a5e97acfc62..03c8dbfde13 100644 --- a/components/esp_psram/esp32c61/Kconfig.spiram +++ b/components/esp_psram/esp32c61/Kconfig.spiram @@ -23,6 +23,8 @@ menu "SPI RAM config" help Select the speed for the SPI RAM chip. + config SPIRAM_SPEED_120M + bool "120MHz clock speed" config SPIRAM_SPEED_80M bool "80MHz clock speed" config SPIRAM_SPEED_40M @@ -31,6 +33,7 @@ menu "SPI RAM config" config SPIRAM_SPEED int + default 120 if SPIRAM_SPEED_120M default 80 if SPIRAM_SPEED_80M default 40 if SPIRAM_SPEED_40M diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced index cab65486e08..c679eec187d 100644 --- a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced @@ -4,8 +4,11 @@ CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +# Flash frequency has to be 120M if SPIRAM speed is set to 120MHz +CONFIG_ESPTOOLPY_FLASHFREQ_120M=y + CONFIG_SPIRAM=y -CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED_120M=y CONFIG_SPIRAM_XIP_FROM_PSRAM=y CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY=y diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced index aa1bcea9c70..7d386150c12 100644 --- a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced @@ -4,8 +4,11 @@ CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +# Flash frequency has to be 120M if SPIRAM speed is set to 120MHz +CONFIG_ESPTOOLPY_FLASHFREQ_120M=y + CONFIG_SPIRAM=y -CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED_120M=y CONFIG_SPIRAM_XIP_FROM_PSRAM=y CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY=y diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 972e96a7d2d..962ce87fe3a 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -601,11 +601,9 @@ static NOINLINE_ATTR IRAM_ATTR void flash_init_state(void) * In this stage, we re-configure the Flash (and MSPI) to required configuration */ spi_flash_init_chip_state(); -#if SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED // This function needs to be called when PLL is enabled. Needs to be called after spi_flash_init_chip_state in case // some state of flash is modified. mspi_timing_flash_tuning(); -#endif } MSPI_INIT_ATTR void mspi_init(void) diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index 1824ede1184..4c0305ab138 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -511,22 +511,6 @@ config SOC_SPI_MAXIMUM_BUFFER_SIZE int default 64 -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - config SOC_LP_TIMER_BIT_WIDTH_LO int default 32 diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 18080b32a85..207020f9265 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -259,12 +259,6 @@ #define SOC_SPI_MAXIMUM_BUFFER_SIZE 64 #define SOC_SPI_MAX_BITWIDTH(host_id) (4) // Supported line mode: DIO, DOUT, QIO, or QOUT -// Although ESP32 doesn't has memspi, but keep consistent with following chips.(This means SPI0/1) -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 - /*-------------------------- LP_TIMER CAPS ----------------------------------*/ #define SOC_LP_TIMER_BIT_WIDTH_LO 32 // Bit width of lp_timer low part #define SOC_LP_TIMER_BIT_WIDTH_HI 16 // Bit width of lp_timer high part diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 060f6b6ae22..5804fe2563f 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -479,22 +479,6 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_60M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_30M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED - bool - default y - config SOC_SYSTIMER_COUNTER_NUM int default 2 diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 6d92e922fb1..0e261b37efd 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -225,10 +225,6 @@ // Peripheral supports output given level during its "dummy phase" #define SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT 1 #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_60M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_30M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_15M_SUPPORTED 1 /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in index 6d17c7afbef..5ae7e7c414c 100644 --- a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in @@ -667,22 +667,6 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - config SOC_SYSTIMER_COUNTER_NUM int default 2 diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index c07ca0419a7..7c7f7965965 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -301,10 +301,6 @@ // Peripheral supports output given level during its "dummy phase" #define SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT 1 #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index f180aa2347e..6351265eca3 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -1035,19 +1035,7 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED +config SOC_SPI_MEM_FLASH_SUPPORT_HPM bool default y diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index fb6bfc0bc12..453da8aa3cd 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -423,10 +423,8 @@ #define SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY (1) #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 + +#define SOC_SPI_MEM_FLASH_SUPPORT_HPM (1) /*!< Support High Performance Mode */ /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index 61d3ce13873..ae5f30d34ac 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -863,18 +863,6 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - config SOC_SYSTIMER_COUNTER_NUM int default 2 diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index 63a1ff3f6d4..07855afc194 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -363,9 +363,6 @@ #define SOC_SPI_MEM_SUPPORT_WRAP (1) #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index c1524333f98..06d8bddaee3 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -787,15 +787,7 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED +config SOC_SPI_MEM_FLASH_SUPPORT_HPM bool default y diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index ca447600914..26420633f7f 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -329,9 +329,8 @@ #define SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY (1) #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 + +#define SOC_SPI_MEM_FLASH_SUPPORT_HPM (1) /*!< Support High Performance Mode */ /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index c70af11c784..73117e60ae3 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -867,18 +867,6 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_64M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_32M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_16M_SUPPORTED - bool - default y - config SOC_SYSTIMER_COUNTER_NUM int default 2 diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index a5e836d3723..109f6cbb64f 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -382,9 +382,6 @@ #define SOC_SPI_MEM_SUPPORT_WRAP (1) #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_64M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_32M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_16M_SUPPORTED 1 /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index 3553e18d209..786878ef340 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1415,19 +1415,7 @@ config SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT bool default y -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED +config SOC_SPI_MEM_FLASH_SUPPORT_HPM bool default y diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index 2575c45834e..a07ce2b2e79 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -539,10 +539,7 @@ #define SOC_MEMSPI_IS_INDEPENDENT 1 #define SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED 1 +#define SOC_SPI_MEM_FLASH_SUPPORT_HPM (1) /*!< Support High Performance Mode */ /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM 2 // Number of counter units diff --git a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in index 9ad3d682c92..9eb3713ec08 100644 --- a/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s2/include/soc/Kconfig.soc_caps.in @@ -567,22 +567,6 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - config SOC_SYSTIMER_COUNTER_NUM int default 1 diff --git a/components/soc/esp32s2/include/soc/soc_caps.h b/components/soc/esp32s2/include/soc/soc_caps.h index 377ac41d632..0d319761a57 100644 --- a/components/soc/esp32s2/include/soc/soc_caps.h +++ b/components/soc/esp32s2/include/soc/soc_caps.h @@ -258,10 +258,6 @@ // Only SPI1 supports this feature #define SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT 1 #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 /*-------------------------- SYSTIMER CAPS ----------------------------------*/ #define SOC_SYSTIMER_COUNTER_NUM (1U) // Number of counter units diff --git a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in index e1c85c9967d..93e8a2a3af2 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -683,22 +683,6 @@ config SOC_MEMSPI_IS_INDEPENDENT bool default y -config SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED - bool - default y - config SOC_SPIRAM_SUPPORTED bool default y @@ -1143,6 +1127,10 @@ config SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP bool default y +config SOC_SPI_MEM_FLASH_SUPPORT_HPM + bool + default y + config SOC_COEX_HW_PTI bool default y diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index a8d196c5a1a..dd3c80978d0 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -288,10 +288,6 @@ // Peripheral supports output given level during its "dummy phase" #define SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT 1 #define SOC_MEMSPI_IS_INDEPENDENT 1 -#define SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED 1 /*-------------------------- SPIRAM CAPS ----------------------------------------*/ #define SOC_SPIRAM_SUPPORTED 1 @@ -468,6 +464,8 @@ #define SOC_MEMSPI_CORE_CLK_SHARED_WITH_PSRAM (1) #define SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP (1) +#define SOC_SPI_MEM_FLASH_SUPPORT_HPM (1) /*!< Support High Performance Mode */ + /*-------------------------- COEXISTENCE HARDWARE PTI CAPS -------------------------------*/ #define SOC_COEX_HW_PTI (1) diff --git a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in index 80467b602d5..12da6c82fcc 100644 --- a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in @@ -279,14 +279,6 @@ config SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT bool default y -config SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED - bool - default y - -config SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED - bool - default y - config SOC_SPI_MEM_PSRAM_FREQ_AXI_CONSTRAINED bool default y diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index 3f122cd536f..1dc83d472e8 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -213,8 +213,6 @@ #define SOC_MEMSPI_IS_INDEPENDENT 1 #define SOC_MEMSPI_SUPPORT_CONTROL_DUMMY_OUT 1 -#define SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED 1 -#define SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED 1 #define SOC_SPI_MEM_PSRAM_FREQ_AXI_CONSTRAINED 1 #define SOC_MEMSPI_FLASH_PSRAM_INDEPENDENT 1 diff --git a/components/spi_flash/Kconfig b/components/spi_flash/Kconfig index c788633f1ca..1637c4e7d88 100644 --- a/components/spi_flash/Kconfig +++ b/components/spi_flash/Kconfig @@ -35,8 +35,7 @@ menu "Main Flash configuration" choice SPI_FLASH_HPM prompt "High Performance Mode (READ DOCS FIRST, > 80MHz)" - # Currently, only esp32s3 allows high performance mode. - depends on (IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4 || IDF_TARGET_ESP32C5) && !ESPTOOLPY_OCT_FLASH + depends on SOC_SPI_MEM_FLASH_SUPPORT_HPM && !ESPTOOLPY_OCT_FLASH default SPI_FLASH_HPM_AUTO help Whether the High Performance Mode of Flash is enabled. As an optional feature, user needs to manually diff --git a/components/spi_flash/esp32c61/Kconfig.flash_freq b/components/spi_flash/esp32c61/Kconfig.flash_freq index 2eac2e2f958..ac9875af5af 100644 --- a/components/spi_flash/esp32c61/Kconfig.flash_freq +++ b/components/spi_flash/esp32c61/Kconfig.flash_freq @@ -1,6 +1,8 @@ choice ESPTOOLPY_FLASHFREQ prompt "Flash SPI speed" default ESPTOOLPY_FLASHFREQ_80M + config ESPTOOLPY_FLASHFREQ_120M + bool "120 MHz" config ESPTOOLPY_FLASHFREQ_80M bool "80 MHz" config ESPTOOLPY_FLASHFREQ_40M diff --git a/docs/en/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst b/docs/en/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst index cf8e2d6dfd9..fdd4f687910 100644 --- a/docs/en/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst +++ b/docs/en/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst @@ -231,16 +231,14 @@ The flash driver in the application is used to read, write, erase, and save data - Step 7: Build your project, and you will see the new flash driver in use. -.. only:: SOC_MEMSPI_SRC_FREQ_120M +High Performance Flash Implementation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - High Performance Flash Implementation - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The high performance mode operates at frequencies higher than 80 MHz. Please check the datasheet for your flash and to determine which approach can reach to frequencies higher than 80 MHz, as listed in *DC Characteristics* section. Some behavior is already defined in the `high performance file `_ . If your flash meets the specified behavior, extend the list as introduced in the ``bootloader_flash_unlock`` section. If your flash has different behavior, please add the new behavior and override the behavior table ``spi_flash_hpm_enable_list``. - The high performance mode operates at frequencies higher than 80 MHz. Please check the datasheet for your flash and to determine which approach can reach to frequencies higher than 80 MHz, as listed in *DC Characteristics* section. Some behavior is already defined in the `high performance file `_ . If your flash meets the specified behavior, extend the list as introduced in the ``bootloader_flash_unlock`` section. If your flash has different behavior, please add the new behavior and override the behavior table ``spi_flash_hpm_enable_list``. +.. important:: - .. important:: - - Flash with a frequency set above 80 MHz should be tested carefully due to its strict timing requirements. If you want to use the high performance mode feature for mass production, please contact `Espressif's business team `_. + Flash with a frequency set above 80 MHz should be tested carefully due to its strict timing requirements. If you want to use the high performance mode feature for mass production, please contact `Espressif's business team `_. Example ------- diff --git a/docs/zh_CN/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst b/docs/zh_CN/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst index 073d039746a..52549d04bea 100644 --- a/docs/zh_CN/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst +++ b/docs/zh_CN/api-reference/peripherals/spi_flash/spi_flash_override_driver.rst @@ -231,16 +231,14 @@ - 步骤 7:构建项目,你将看到新的 flash 驱动程序。 -.. only:: SOC_MEMSPI_SRC_FREQ_120M +高性能 flash 实现 +~~~~~~~~~~~~~~~~~ - 高性能 flash 实现 - ~~~~~~~~~~~~~~~~~ +高性能模式在高于 80 MHz 的频率下运行。请查阅 *直流电气特性* 章节,判断芯片是否支持在高于 80 MHz 的频率下工作。`高性能文件 `_ 中已经预定义了部分高性能模式下的行为,如果你的 flash 芯片符合指定行为,请按照 ``bootloader_flash_unlock`` 部分介绍的方法扩展列表。如果你的 flash 芯片有不同的行为,请添加新行为并覆盖 ``spi_flash_hpm_enable_list`` 行为表。 - 高性能模式在高于 80 MHz 的频率下运行。请查阅 *直流电气特性* 章节,判断芯片是否支持在高于 80 MHz 的频率下工作。`高性能文件 `_ 中已经预定义了部分高性能模式下的行为,如果你的 flash 芯片符合指定行为,请按照 ``bootloader_flash_unlock`` 部分介绍的方法扩展列表。如果你的 flash 芯片有不同的行为,请添加新行为并覆盖 ``spi_flash_hpm_enable_list`` 行为表。 +.. important:: - .. important:: - - 频率设置为 80 MHz 以上的 flash 芯片应进行仔细的测试,因为此时系统对于时序的要求非常严格。如果想在量产过程中使用高性能模式的功能,请联系 `乐鑫商务部 `_。 + 频率设置为 80 MHz 以上的 flash 芯片应进行仔细的测试,因为此时系统对于时序的要求非常严格。如果想在量产过程中使用高性能模式的功能,请联系 `乐鑫商务部 `_。 示例 ----