diff --git a/Kconfig b/Kconfig index 143aed33d7..dcb945a028 100644 --- a/Kconfig +++ b/Kconfig @@ -151,6 +151,13 @@ mainmenu "Espressif IoT Development Framework Configuration" select IDF_ENV_BRINGUP select IDF_ENV_FPGA if ESP32H4_SELECTS_REV_MP + config IDF_TARGET_ESP32S31 + bool + default "y" if IDF_TARGET="esp32s31" + select IDF_TARGET_ARCH_RISCV + select IDF_ENV_FPGA + select IDF_ENV_BRINGUP + config IDF_TARGET_LINUX bool default "y" if IDF_TARGET="linux" @@ -169,6 +176,7 @@ mainmenu "Espressif IoT Development Framework Configuration" default 0x0014 if IDF_TARGET_ESP32C61 default 0x0019 if IDF_TARGET_ESP32H21 default 0x001C if IDF_TARGET_ESP32H4 + default 0x0020 if IDF_TARGET_ESP32S31 default 0xFFFF diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s31.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s31.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/bt/controller/esp32s31/Kconfig.in b/components/bt/controller/esp32s31/Kconfig.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_adc/esp32s31/include/.gitkeep b/components/esp_adc/esp32s31/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hal_i2c/CMakeLists.txt b/components/esp_hal_i2c/CMakeLists.txt index 1c02433b16..0a7a86fa8c 100644 --- a/components/esp_hal_i2c/CMakeLists.txt +++ b/components/esp_hal_i2c/CMakeLists.txt @@ -1,11 +1,13 @@ idf_build_get_property(target IDF_TARGET) set(includes) -list(APPEND includes "${target}/include") -list(APPEND includes "include") set(srcs) -set(include "include") +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include") + list(APPEND includes "${target}/include") +endif() +list(APPEND includes "include") + set(target_folder "${target}") # I2C related source files diff --git a/components/esp_hal_mspi/esp32s31/include/hal/.gitkeep b/components/esp_hal_mspi/esp32s31/include/hal/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hal_timg/esp32s31/include/hal/.gitkeep b/components/esp_hal_timg/esp32s31/include/hal/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hal_wdt/esp32s31/include/hal/.gitkeep b/components/esp_hal_wdt/esp32s31/include/hal/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/include/esp_chip_info.h b/components/esp_hw_support/include/esp_chip_info.h index 1cb0e780d7..b842651c20 100644 --- a/components/esp_hw_support/include/esp_chip_info.h +++ b/components/esp_hw_support/include/esp_chip_info.h @@ -32,6 +32,7 @@ typedef enum { CHIP_ESP32C5 = 23, //!< ESP32-C5 CHIP_ESP32H21 = 25, //!< ESP32-H21 CHIP_ESP32H4 = 28, //!< ESP32-H4 + CHIP_ESP32S31 = 32, //!< ESP32-S31 CHIP_POSIX_LINUX = 999, //!< The code is running on POSIX/Linux simulator } esp_chip_model_t; diff --git a/components/esp_hw_support/port/esp32s31/CMakeLists.txt b/components/esp_hw_support/port/esp32s31/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32s31/cpu_region_protect.c b/components/esp_hw_support/port/esp32s31/cpu_region_protect.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32s31/esp_clk_tree.c b/components/esp_hw_support/port/esp32s31/esp_clk_tree.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32s31/esp_cpu_intr.c b/components/esp_hw_support/port/esp32s31/esp_cpu_intr.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32s31/io_mux.c b/components/esp_hw_support/port/esp32s31/io_mux.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_mm/port/esp32s31/ext_mem_layout.c b/components/esp_mm/port/esp32s31/ext_mem_layout.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_phy/esp32s31/include/.gitkeep b/components/esp_phy/esp32s31/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_rom/esp32s31/include/esp32s31/rom/.gitkeep b/components/esp_rom/esp32s31/include/esp32s31/rom/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_security/src/esp32s31/.gitkeep b/components/esp_security/src/esp32s31/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/ld/esp32s31/memory.ld.in b/components/esp_system/ld/esp32s31/memory.ld.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/ld/esp32s31/sections.ld.in b/components/esp_system/ld/esp32s31/sections.ld.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32s31/CMakeLists.txt b/components/esp_system/port/soc/esp32s31/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32s31/Kconfig.cpu b/components/esp_system/port/soc/esp32s31/Kconfig.cpu new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/hal/esp32s31/include/hal/.gitkeep b/components/hal/esp32s31/include/hal/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/heap/port/esp32s31/memory_layout.c b/components/heap/port/esp32s31/memory_layout.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/idf_test/include/esp32s31/.gitkeep b/components/idf_test/include/esp32s31/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32s31/gpio_periph.c b/components/soc/esp32s31/gpio_periph.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32s31/interrupts.c b/components/soc/esp32s31/interrupts.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32s31/uart_periph.c b/components/soc/esp32s31/uart_periph.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/project_include.cmake b/components/soc/project_include.cmake index 624e16fbcb..d98043c7b2 100644 --- a/components/soc/project_include.cmake +++ b/components/soc/project_include.cmake @@ -16,7 +16,7 @@ if(CONFIG_IDF_TOOLCHAIN_GCC) set(_march "rv32imac_zicsr_zifencei_zaamo_zalrsc") elseif(CONFIG_IDF_TARGET_ESP32H4) set(_march "rv32imafcb_zicsr_zifencei_zaamo_zalrsc") - elseif(CONFIG_IDF_TARGET_ESP32P4) + elseif(CONFIG_IDF_TARGET_ESP32P4 OR CONFIG_IDF_TARGET_ESP32S31) set(_march "rv32imafc_zicsr_zifencei_zaamo_zalrsc") elseif(NOT(CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3)) message(FATAL_ERROR "Unknown Espressif target: ${CONFIG_IDF_TARGET}") diff --git a/components/spi_flash/test_apps/.build-test-rules.yml b/components/spi_flash/test_apps/.build-test-rules.yml index 9a6a5ee915..8c3ce61be0 100644 --- a/components/spi_flash/test_apps/.build-test-rules.yml +++ b/components/spi_flash/test_apps/.build-test-rules.yml @@ -47,7 +47,7 @@ components/spi_flash/test_apps/flash_mmap: - spi_flash - esp_hal_mspi enable: - - if: CONFIG_NAME == "release" and IDF_TARGET != "linux" + - if: CONFIG_NAME == "release" and IDF_TARGET not in ["linux", "esp32s31"] - if: CONFIG_NAME == "rom_impl" and ESP_ROM_HAS_SPI_FLASH == 1 - if: CONFIG_NAME == "psram" and SOC_MMU_PER_EXT_MEM_TARGET == 1 # MMU per target needs test. On unified MMU chips, the entry ID is unique - if: CONFIG_NAME == "xip_psram" and SOC_SPIRAM_XIP_SUPPORTED == 1 diff --git a/tools/ci/check_build_test_rules.py b/tools/ci/check_build_test_rules.py index d4d8d7aca8..1b40348495 100755 --- a/tools/ci/check_build_test_rules.py +++ b/tools/ci/check_build_test_rules.py @@ -34,6 +34,7 @@ USUAL_TO_FORMAL = { 'esp32c61': 'ESP32-C61', 'esp32h21': 'ESP32-H21', 'esp32h4': 'ESP32-H4', + 'esp32s31': 'ESP32-S31', 'linux': 'Linux', } diff --git a/tools/cmake/dfu.cmake b/tools/cmake/dfu.cmake index 455377474c..68dfa5f321 100644 --- a/tools/cmake/dfu.cmake +++ b/tools/cmake/dfu.cmake @@ -25,6 +25,8 @@ function(__add_dfu_targets) return() elseif("${target}" STREQUAL "esp32h4") return() + elseif("${target}" STREQUAL "esp32s31") + return() elseif("${target}" STREQUAL "esp32p4") set(dfu_pid "12") elseif("${target}" STREQUAL "linux") diff --git a/tools/cmake/toolchain-esp32s31.cmake b/tools/cmake/toolchain-esp32s31.cmake new file mode 100644 index 0000000000..9833188d7d --- /dev/null +++ b/tools/cmake/toolchain-esp32s31.cmake @@ -0,0 +1,2 @@ +set(_CMAKE_TOOLCHAIN_PREFIX riscv32-esp-elf-) +include($ENV{IDF_PATH}/tools/cmake/toolchain.cmake) diff --git a/tools/idf_py_actions/constants.py b/tools/idf_py_actions/constants.py index 7cbe81a597..3c97b50aff 100644 --- a/tools/idf_py_actions/constants.py +++ b/tools/idf_py_actions/constants.py @@ -50,4 +50,4 @@ SUPPORTED_TARGETS = [ 'esp32c5', 'esp32c61', ] -PREVIEW_TARGETS = ['linux', 'esp32h21', 'esp32h4'] +PREVIEW_TARGETS = ['linux', 'esp32h21', 'esp32h4', 'esp32s31'] diff --git a/tools/test_apps/security/.build-test-rules.yml b/tools/test_apps/security/.build-test-rules.yml index 8ec9a97eb6..38ad5740c7 100644 --- a/tools/test_apps/security/.build-test-rules.yml +++ b/tools/test_apps/security/.build-test-rules.yml @@ -2,7 +2,7 @@ tools/test_apps/security/secure_boot: enable: - - if: CONFIG_NAME == "qemu" + - if: CONFIG_NAME == "qemu" and IDF_TARGET not in ["esp32s31"] #IDF-14442 reason: the test can only run on an FPGA as efuses need to be reset during the test. disable: - if: CONFIG_NAME != "qemu" or IDF_TARGET == "linux" diff --git a/tools/tools.json b/tools/tools.json index 84cfdab92a..7cb0e6bee5 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -97,7 +97,8 @@ "esp32p4", "esp32c61", "esp32h21", - "esp32h4" + "esp32h4", + "esp32s31" ], "version_cmd": [ "riscv32-esp-elf-gdb-no-python", @@ -256,7 +257,8 @@ "esp32p4", "esp32c61", "esp32h21", - "esp32h4" + "esp32h4", + "esp32s31" ], "version_cmd": [ "clang", @@ -321,7 +323,8 @@ "esp32h2", "esp32p4", "esp32c61", - "esp32h21" + "esp32h21", + "esp32s31" ], "tool_info_file": "esp-clang/esp-clang-libs.info", "version_cmd": [], @@ -387,7 +390,8 @@ "esp32c61", "esp32p4", "esp32h21", - "esp32h4" + "esp32h4", + "esp32s31" ], "version_cmd": [ "riscv32-esp-elf-gcc",