Эх сурвалжийг харах

Merge branch 'feature/add_target_esp32p4' into 'master'

esp32p4: introduce the target

See merge request espressif/esp-idf!24155
Armando (Dou Yiwen) 2 жил өмнө
parent
commit
17d6768e65
33 өөрчлөгдсөн 40 нэмэгдсэн , 2 устгасан
  1. 6 0
      Kconfig
  2. 0 0
      components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c
  3. 1 0
      components/bootloader_support/include/esp_app_format.h
  4. 0 0
      components/bootloader_support/src/bootloader_random_esp32p4.c
  5. 0 0
      components/bt/controller/esp32p4/Kconfig.in
  6. 0 0
      components/esp_adc/esp32p4/include/.gitkeep
  7. 1 0
      components/esp_hw_support/include/esp_chip_info.h
  8. 0 0
      components/esp_hw_support/include/soc/esp32p4/.gitkeep
  9. 0 0
      components/esp_hw_support/port/esp32p4/CMakeLists.txt
  10. 0 0
      components/esp_hw_support/port/esp32p4/cpu_region_protect.c
  11. 0 0
      components/esp_hw_support/port/esp32p4/esp_clk_tree.c
  12. 0 0
      components/esp_hw_support/port/esp32p4/io_mux.c
  13. 0 0
      components/esp_mm/port/esp32p4/ext_mem_layout.c
  14. 5 0
      components/esp_phy/CMakeLists.txt
  15. 0 0
      components/esp_rom/esp32p4/.gitkeep
  16. 0 0
      components/esp_rom/include/esp32p4/.gitkeep
  17. 0 0
      components/esp_system/ld/esp32p4/memory.ld.in
  18. 0 0
      components/esp_system/port/soc/esp32p4/CMakeLists.txt
  19. 0 0
      components/esp_system/port/soc/esp32p4/Kconfig.cpu
  20. 0 0
      components/esp_system/port/soc/esp32p4/Kconfig.system
  21. 0 0
      components/hal/esp32p4/clk_tree_hal.c
  22. 0 0
      components/hal/esp32p4/efuse_hal.c
  23. 0 0
      components/hal/esp32p4/include/.gitkeep
  24. 0 0
      components/heap/port/esp32p4/memory_layout.c
  25. 0 0
      components/idf_test/include/esp32p4/.gitkeep
  26. 0 0
      components/soc/esp32p4/gpio_periph.c
  27. 0 0
      components/soc/esp32p4/interrupts.c
  28. 0 0
      components/soc/esp32p4/uart_periph.c
  29. 2 0
      tools/cmake/dfu.cmake
  30. 20 0
      tools/cmake/toolchain-esp32p4.cmake
  31. 2 0
      tools/cmake/uf2.cmake
  32. 1 1
      tools/idf_py_actions/constants.py
  33. 2 1
      tools/tools.json

+ 6 - 0
Kconfig

@@ -90,6 +90,11 @@ mainmenu "Espressif IoT Development Framework Configuration"
         select FREERTOS_UNICORE
         select IDF_TARGET_ARCH_RISCV
 
+    config IDF_TARGET_ESP32P4
+        bool
+        default "y" if IDF_TARGET="esp32p4"
+        select IDF_TARGET_ARCH_RISCV
+
     config IDF_TARGET_ESP32H2
         bool
         default "y" if IDF_TARGET="esp32h2"
@@ -109,6 +114,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
         default 0x000C if IDF_TARGET_ESP32C2
         default 0x000D if IDF_TARGET_ESP32C6
         default 0x0010 if IDF_TARGET_ESP32H2
+        default 0x0012 if IDF_TARGET_ESP32P4
         default 0xFFFF
 
 

+ 0 - 0
components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c


+ 1 - 0
components/bootloader_support/include/esp_app_format.h

@@ -20,6 +20,7 @@ typedef enum {
     ESP_CHIP_ID_ESP32C2 = 0x000C, /*!< chip ID: ESP32-C2 */
     ESP_CHIP_ID_ESP32C6 = 0x000D, /*!< chip ID: ESP32-C6 */
     ESP_CHIP_ID_ESP32H2 = 0x0010, /*!< chip ID: ESP32-H2 */
+    ESP_CHIP_ID_ESP32P4 = 0x0012, /*!< chip ID: ESP32-P4 */
     ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */
 } __attribute__((packed)) esp_chip_id_t;
 

+ 0 - 0
components/bootloader_support/src/bootloader_random_esp32p4.c


+ 0 - 0
components/bt/controller/esp32p4/Kconfig.in


+ 0 - 0
components/esp_adc/esp32p4/include/.gitkeep


+ 1 - 0
components/esp_hw_support/include/esp_chip_info.h

@@ -27,6 +27,7 @@ typedef enum {
     CHIP_ESP32C2 = 12, //!< ESP32-C2
     CHIP_ESP32C6 = 13, //!< ESP32-C6
     CHIP_ESP32H2 = 16, //!< ESP32-H2
+    CHIP_ESP32P4 = 18, //!< ESP32-P4
     CHIP_POSIX_LINUX = 999, //!< The code is running on POSIX/Linux simulator
 } esp_chip_model_t;
 

+ 0 - 0
components/esp_hw_support/include/soc/esp32p4/.gitkeep


+ 0 - 0
components/esp_hw_support/port/esp32p4/CMakeLists.txt


+ 0 - 0
components/esp_hw_support/port/esp32p4/cpu_region_protect.c


+ 0 - 0
components/esp_hw_support/port/esp32p4/esp_clk_tree.c


+ 0 - 0
components/esp_hw_support/port/esp32p4/io_mux.c


+ 0 - 0
components/esp_mm/port/esp32p4/ext_mem_layout.c


+ 5 - 0
components/esp_phy/CMakeLists.txt

@@ -1,5 +1,10 @@
 idf_build_get_property(idf_target IDF_TARGET)
 
+if(IDF_TARGET STREQUAL "esp32p4")
+    # TODO: IDF-7460
+    return()
+endif()
+
 set(srcs "src/phy_override.c" "src/lib_printf.c")
 
 if(CONFIG_APP_NO_BLOBS)

+ 0 - 0
components/esp_rom/esp32p4/.gitkeep


+ 0 - 0
components/esp_rom/include/esp32p4/.gitkeep


+ 0 - 0
components/esp_system/ld/esp32p4/memory.ld.in


+ 0 - 0
components/esp_system/port/soc/esp32p4/CMakeLists.txt


+ 0 - 0
components/esp_system/port/soc/esp32p4/Kconfig.cpu


+ 0 - 0
components/esp_system/port/soc/esp32p4/Kconfig.system


+ 0 - 0
components/hal/esp32p4/clk_tree_hal.c


+ 0 - 0
components/hal/esp32p4/efuse_hal.c


+ 0 - 0
components/hal/esp32p4/include/.gitkeep


+ 0 - 0
components/heap/port/esp32p4/memory_layout.c


+ 0 - 0
components/idf_test/include/esp32p4/.gitkeep


+ 0 - 0
components/soc/esp32p4/gpio_periph.c


+ 0 - 0
components/soc/esp32p4/interrupts.c


+ 0 - 0
components/soc/esp32p4/uart_periph.c


+ 2 - 0
tools/cmake/dfu.cmake

@@ -17,6 +17,8 @@ function(__add_dfu_targets)
         return()
     elseif("${target}" STREQUAL "esp32h2")
         return()
+    elseif("${target}" STREQUAL "esp32p4")
+        set(dfu_pid "12")
     elseif("${target}" STREQUAL "linux")
         return()
     else()

+ 20 - 0
tools/cmake/toolchain-esp32p4.cmake

@@ -0,0 +1,20 @@
+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=rv32imafc_zicsr_zifencei -mabi=ilp32f ${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=rv32imafc_zicsr_zifencei -mabi=ilp32f ${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("-march=rv32imafc_zicsr_zifencei -mabi=ilp32f ${CMAKE_ASM_FLAGS}" UNIQ_CMAKE_ASM_FLAGS)
+set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" CACHE STRING "Asm Compiler Base Flags" FORCE)
+
+remove_duplicated_flags("-nostartfiles -march=rv32imafc_zicsr_zifencei -mabi=ilp32f --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)

+ 2 - 0
tools/cmake/uf2.cmake

@@ -16,6 +16,8 @@ function(__add_uf2_targets)
         set(uf2_family_id "0x2b88d29c")
     elseif("${target}" STREQUAL "esp32c6") # TODO: IDF-5626
         set(uf2_family_id "0x2b88d29c")
+    elseif("${target}" STREQUAL "esp32p4")
+        set(uf2_family_id "0x2b88d29c")
     elseif("${target}" STREQUAL "linux")
         return()
     else()

+ 1 - 1
tools/idf_py_actions/constants.py

@@ -33,7 +33,7 @@ if os.name != 'nt':
 URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf'
 
 SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2']
-PREVIEW_TARGETS = ['linux']
+PREVIEW_TARGETS = ['linux', 'esp32p4']
 
 OPENOCD_TAGET_CONFIG_DEFAULT = '-f interface/ftdi/esp32_devkitj_v1.cfg -f target/{target}.cfg'
 OPENOCD_TAGET_CONFIG: Dict[str, str] = {

+ 2 - 1
tools/tools.json

@@ -92,7 +92,8 @@
         "esp32c3",
         "esp32c2",
         "esp32c6",
-        "esp32h2"
+        "esp32h2",
+        "esp32p4"
       ],
       "version_cmd": [
         "riscv32-esp-elf-gdb-no-python",