diff --git a/Kconfig b/Kconfig index 312ea591d0..c86ebeaaef 100644 --- a/Kconfig +++ b/Kconfig @@ -13,6 +13,7 @@ mainmenu "Espressif IoT Development Framework Configuration" config IDF_ENV_FPGA # This option is for internal use only bool + default "y" if IDF_TARGET_ESP32C6 # TODO: IDF-5630 option env="IDF_ENV_FPGA" config IDF_TARGET_ARCH_RISCV @@ -90,6 +91,12 @@ mainmenu "Espressif IoT Development Framework Configuration" select FREERTOS_UNICORE select IDF_TARGET_ARCH_RISCV + config IDF_TARGET_ESP32C6 + bool + default "y" if IDF_TARGET="esp32c6" + select FREERTOS_UNICORE + select IDF_TARGET_ARCH_RISCV + config IDF_TARGET_LINUX bool default "y" if IDF_TARGET="linux" @@ -100,8 +107,9 @@ mainmenu "Espressif IoT Development Framework Configuration" default 0x0002 if IDF_TARGET_ESP32S2 default 0x0005 if IDF_TARGET_ESP32C3 default 0x0009 if IDF_TARGET_ESP32S3 - default 0x000C if IDF_TARGET_ESP32C2 default 0x000A if IDF_TARGET_ESP32H2_BETA_VERSION_1 + default 0x000C if IDF_TARGET_ESP32C2 + default 0x000D if IDF_TARGET_ESP32C6 default 0x000E if IDF_TARGET_ESP32H2_BETA_VERSION_2 # ESP32H2-TODO: IDF-3475 default 0xFFFF diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/bootloader_support/src/bootloader_random_esp32c6.c b/components/bootloader_support/src/bootloader_random_esp32c6.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/bt/controller/esp32c6/Kconfig.in b/components/bt/controller/esp32c6/Kconfig.in new file mode 100644 index 0000000000..eb432c86f0 --- /dev/null +++ b/components/bt/controller/esp32c6/Kconfig.in @@ -0,0 +1 @@ +# TODO: IDF-5727 diff --git a/components/esp_adc/esp32c6/include/.gitkeep b/components/esp_adc/esp32c6/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_gdbstub/esp32c6/gdbstub_esp32c6.c b/components/esp_gdbstub/esp32c6/gdbstub_esp32c6.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/include/soc/esp32c6/.gitkeep b/components/esp_hw_support/include/soc/esp32c6/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32c6/CMakeLists.txt b/components/esp_hw_support/port/esp32c6/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_hw_support/port/esp32c6/Kconfig.mac b/components/esp_hw_support/port/esp32c6/Kconfig.mac new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_rom/esp32c6/.gitkeep b/components/esp_rom/esp32c6/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_rom/include/esp32c6/.gitkeep b/components/esp_rom/include/esp32c6/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/ld/esp32c6/memory.ld.in b/components/esp_system/ld/esp32c6/memory.ld.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32c6/CMakeLists.txt b/components/esp_system/port/soc/esp32c6/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32c6/Kconfig.cpu b/components/esp_system/port/soc/esp32c6/Kconfig.cpu new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/esp_system/port/soc/esp32c6/Kconfig.system b/components/esp_system/port/soc/esp32c6/Kconfig.system new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/hal/esp32c6/efuse_hal.c b/components/hal/esp32c6/efuse_hal.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/hal/esp32c6/include/.gitkeep b/components/hal/esp32c6/include/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/heap/port/esp32c6/memory_layout.c b/components/heap/port/esp32c6/memory_layout.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/idf_test/include/esp32c6/.gitkeep b/components/idf_test/include/esp32c6/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/soc/esp32c6/CMakeLists.txt b/components/soc/esp32c6/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/spi_flash/esp32c6/flash_ops_esp32c6.c b/components/spi_flash/esp32c6/flash_ops_esp32c6.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/cmake/dfu.cmake b/tools/cmake/dfu.cmake index c6c5172dc7..8db0a6199e 100644 --- a/tools/cmake/dfu.cmake +++ b/tools/cmake/dfu.cmake @@ -15,6 +15,8 @@ function(__add_dfu_targets) return() elseif("${target}" STREQUAL "esp32c2") return() + elseif("${target}" STREQUAL "esp32c6") + return() elseif("${target}" STREQUAL "linux") return() else() diff --git a/tools/cmake/toolchain-esp32c6.cmake b/tools/cmake/toolchain-esp32c6.cmake new file mode 100644 index 0000000000..ff3ba0b65f --- /dev/null +++ b/tools/cmake/toolchain-esp32c6.cmake @@ -0,0 +1,18 @@ +include($ENV{IDF_PATH}/tools/cmake/utilities.cmake) + +set(CMAKE_SYSTEM_NAME Generic) + +set(CMAKE_C_COMPILER riscv32-esp-elf-gcc) +set(CMAKE_CXX_COMPILER riscv32-esp-elf-g++) +set(CMAKE_ASM_COMPILER riscv32-esp-elf-gcc) +set(_CMAKE_TOOLCHAIN_PREFIX riscv32-esp-elf-) + +remove_duplicated_flags("-march=rv32imac ${CMAKE_C_FLAGS}" UNIQ_CMAKE_C_FLAGS) +set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" CACHE STRING "C Compiler Base Flags" FORCE) +remove_duplicated_flags("-march=rv32imac ${CMAKE_CXX_FLAGS}" UNIQ_CMAKE_CXX_FLAGS) +set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "C++ Compiler Base Flags" FORCE) + +remove_duplicated_flags("-nostartfiles -march=rv32imac --specs=nosys.specs \ + ${CMAKE_EXE_LINKER_FLAGS}" + UNIQ_CMAKE_SAFE_EXE_LINKER_FLAGS) +set(CMAKE_EXE_LINKER_FLAGS "${UNIQ_CMAKE_SAFE_EXE_LINKER_FLAGS}" CACHE STRING "Linker Base Flags" FORCE) diff --git a/tools/cmake/uf2.cmake b/tools/cmake/uf2.cmake index 525a128eda..4e80d8decf 100644 --- a/tools/cmake/uf2.cmake +++ b/tools/cmake/uf2.cmake @@ -14,6 +14,8 @@ function(__add_uf2_targets) set(uf2_family_id "0x332726f6") elseif("${target}" STREQUAL "esp32c2") set(uf2_family_id "0x2b88d29c") + elseif("${target}" STREQUAL "esp32c6") # TODO: IDF-5626 + set(uf2_family_id "0x2b88d29c") elseif("${target}" STREQUAL "linux") return() else() diff --git a/tools/gdb_panic_server.py b/tools/gdb_panic_server.py index f576937ed9..eeef4321aa 100644 --- a/tools/gdb_panic_server.py +++ b/tools/gdb_panic_server.py @@ -59,7 +59,8 @@ GDB_REGS_INFO_RISCV_ILP32 = [ GDB_REGS_INFO = { 'esp32c3': GDB_REGS_INFO_RISCV_ILP32, 'esp32c2': GDB_REGS_INFO_RISCV_ILP32, - 'esp32h2': GDB_REGS_INFO_RISCV_ILP32 + 'esp32h2': GDB_REGS_INFO_RISCV_ILP32, + 'esp32c6': GDB_REGS_INFO_RISCV_ILP32 } PanicInfo = namedtuple('PanicInfo', 'core_id regs stack_base_addr stack_data') @@ -153,7 +154,8 @@ def parse_idf_riscv_panic_output(panic_text): # type: (str) -> PanicInfo PANIC_OUTPUT_PARSERS = { 'esp32c3': parse_idf_riscv_panic_output, 'esp32c2': parse_idf_riscv_panic_output, - 'esp32h2': parse_idf_riscv_panic_output + 'esp32h2': parse_idf_riscv_panic_output, + 'esp32c6': parse_idf_riscv_panic_output } diff --git a/tools/idf_py_actions/constants.py b/tools/idf_py_actions/constants.py index bd0f1f291a..18ebe3e7c2 100644 --- a/tools/idf_py_actions/constants.py +++ b/tools/idf_py_actions/constants.py @@ -37,4 +37,4 @@ if os.name != 'nt': URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf' SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2'] -PREVIEW_TARGETS = ['linux', 'esp32h2'] +PREVIEW_TARGETS = ['linux', 'esp32h2', 'esp32c6'] diff --git a/tools/idf_size_yaml/esp32c6_data_info.yaml b/tools/idf_size_yaml/esp32c6_data_info.yaml new file mode 100644 index 0000000000..a4fbecf547 --- /dev/null +++ b/tools/idf_size_yaml/esp32c6_data_info.yaml @@ -0,0 +1,20 @@ +# Data_type: +# primary_address: value +# length: value or equation +# secondary_address: value if exist +DRAM: + primary_address: 0x40800000 + length: 0x80000 + secondary_address: 0x40800000 +IRAM: + primary_address: 0x40800000 + length: 0x80000 +CACHE_I: + primary_address: 0x42000000 + length: 0x800000 +CACHE_D: + primary_address: 0x42000000 + length: 0x800000 +RTC_SLOW_D: # TODO: IDF-5667 Better to rename to LP_RAM + primary_address: 0x50000000 + length: 0x4000 diff --git a/tools/tools.json b/tools/tools.json index f2c6852003..d09e32b07b 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -438,7 +438,8 @@ "esp32s3", "esp32c3", "esp32h2", - "esp32c2" + "esp32c2", + "esp32c6" ], "version_cmd": [ "riscv32-esp-elf-gcc",