From 1b91e845449558cc890b3d0a3880514bf2b4d409 Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Tue, 20 Feb 2024 14:57:30 +0800 Subject: [PATCH] feat(esp32c5): add esp32c5 mp target --- Kconfig | 9 ++++++++- components/bootloader_support/include/esp_app_format.h | 9 ++++++++- components/esp_hw_support/include/esp_chip_info.h | 8 ++++++-- components/esptool_py/project_include.cmake | 4 +++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index 0391cfcc89..1c6b973c44 100644 --- a/Kconfig +++ b/Kconfig @@ -119,6 +119,7 @@ mainmenu "Espressif IoT Development Framework Configuration" select FREERTOS_UNICORE select IDF_TARGET_ARCH_RISCV + # TODO: IDF-9197 choice IDF_TARGET_ESP32C5_VERSION prompt "ESP32-C5 version" depends on IDF_TARGET_ESP32C5 @@ -132,6 +133,11 @@ mainmenu "Espressif IoT Development Framework Configuration" bool prompt "ESP32-C5 beta3" select ESPTOOLPY_NO_STUB + + config IDF_TARGET_ESP32C5_MP_VERSION + bool + prompt "ESP32-C5 MP" + select ESPTOOLPY_NO_STUB endchoice config IDF_TARGET_ESP32P4 @@ -159,7 +165,8 @@ mainmenu "Espressif IoT Development Framework Configuration" default 0x000D if IDF_TARGET_ESP32C6 default 0x0010 if IDF_TARGET_ESP32H2 default 0x0012 if IDF_TARGET_ESP32P4 - default 0x0011 if IDF_TARGET_ESP32C5 + default 0x0011 if IDF_TARGET_ESP32C5 && IDF_TARGET_ESP32C5_BETA3_VERSION # TODO: IDF-9197 + default 0x0017 if IDF_TARGET_ESP32C5 && IDF_TARGET_ESP32C5_MP_VERSION # TODO: IDF-9197 default 0xFFFF diff --git a/components/bootloader_support/include/esp_app_format.h b/components/bootloader_support/include/esp_app_format.h index 54279d1e18..481310d587 100644 --- a/components/bootloader_support/include/esp_app_format.h +++ b/components/bootloader_support/include/esp_app_format.h @@ -8,6 +8,9 @@ #include #include "esp_assert.h" +// TODO: IDF-9197 +#include "sdkconfig.h" + /** * @brief ESP chip ID * @@ -21,7 +24,11 @@ typedef enum { 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_ESP32C5 = 0x0011, /*!< chip ID: ESP32-C5 */ +#if CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION // TODO: IDF-9197 + ESP_CHIP_ID_ESP32C5 = 0x0011, /*!< chip ID: ESP32-C5 beta3 (MPW)*/ +#elif CONFIG_IDF_TARGET_ESP32C5_MP_VERSION + ESP_CHIP_ID_ESP32C5 = 0x0017, /*!< chip ID: ESP32-C5 MP */ +#endif 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; diff --git a/components/esp_hw_support/include/esp_chip_info.h b/components/esp_hw_support/include/esp_chip_info.h index d4871a08bd..afe1d811e8 100644 --- a/components/esp_hw_support/include/esp_chip_info.h +++ b/components/esp_hw_support/include/esp_chip_info.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -27,7 +27,11 @@ typedef enum { CHIP_ESP32C2 = 12, //!< ESP32-C2 CHIP_ESP32C6 = 13, //!< ESP32-C6 CHIP_ESP32H2 = 16, //!< ESP32-H2 - CHIP_ESP32C5 = 17, //!< ESP32-C5 beta3 TODO: [ESP32-C5] update when MP supported +#if CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION // TODO: IDF-9197 + CHIP_ESP32C5 = 17, //!< ESP32-C5 beta3 (MPW) +#elif CONFIG_IDF_TARGET_ESP32C5_MP_VERSION + CHIP_ESP32C5 = 23, //!< ESP32-C5 MP +#endif CHIP_ESP32P4 = 18, //!< ESP32-P4 CHIP_POSIX_LINUX = 999, //!< The code is running on POSIX/Linux simulator } esp_chip_model_t; diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index 78041897f0..63877c882b 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -8,10 +8,12 @@ idf_build_get_property(idf_path IDF_PATH) set(chip_model ${target}) -# TODO: [ESP32C5] remove this 'if' block when esp32C5 beta3 is no longer supported +# TODO: [ESP32C5] IDF-9197 remove this 'if' block when esp32C5 beta3 is no longer supported if(target STREQUAL "esp32c5") if(CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION) set(chip_model esp32c5beta3) + elseif(CONFIG_IDF_TARGET_ESP32C5_MP_VERSION) + set(chip_model esp32c5) endif() endif()