Loading boot/espressif/CMakeLists.txt +6 −1 Changes for boot/espressif/CMakeLists.txt: 6 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ if ("${MCUBOOT_TARGET}" STREQUAL "esp32" OR "${MCUBOOT_TARGET}" STREQUAL "esp32s3") set(MCUBOOT_ARCH "xtensa") elseif("${MCUBOOT_TARGET}" STREQUAL "esp32c3" OR "${MCUBOOT_TARGET}" STREQUAL "esp32c6") "${MCUBOOT_TARGET}" STREQUAL "esp32c6" OR "${MCUBOOT_TARGET}" STREQUAL "esp32h2") set(MCUBOOT_ARCH "riscv") endif() Loading @@ -36,6 +37,8 @@ elseif("${MCUBOOT_TARGET}" STREQUAL "esp32c3") set(ESP_MIN_REVISION 3) elseif("${MCUBOOT_TARGET}" STREQUAL "esp32c6") set(ESP_MIN_REVISION 0) elseif("${MCUBOOT_TARGET}" STREQUAL "esp32h2") set(ESP_MIN_REVISION 0) else() message(FATAL_ERROR "Unsupported target ${MCUBOOT_TARGET}") endif() Loading Loading @@ -115,6 +118,8 @@ if (NOT DEFINED ESP_FLASH_FREQ) "${MCUBOOT_TARGET}" STREQUAL "esp32c3" OR "${MCUBOOT_TARGET}" STREQUAL "esp32c6") set(ESP_FLASH_FREQ "40m") elseif("${MCUBOOT_TARGET}" STREQUAL "esp32h2") set(ESP_FLASH_FREQ "24m") endif() endif() Loading boot/espressif/hal/include/esp32h2/esp32h2.cmake 0 → 100644 +32 −0 Changes for boot/espressif/hal/include/esp32h2/esp32h2.cmake: 32 added lines, 0 removed lines. Original line number Diff line number Diff line # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD # # SPDX-License-Identifier: Apache-2.0 list(APPEND include_dirs ${esp_hal_dir}/components/esp_hw_support/port/${MCUBOOT_TARGET}/private_include ) list(APPEND hal_srcs ${esp_hal_dir}/components/hal/cache_hal.c ${esp_hal_dir}/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c ${esp_hal_dir}/components/esp_rom/patches/esp_rom_regi2c_${MCUBOOT_TARGET}.c ) if (DEFINED CONFIG_ESP_CONSOLE_UART_CUSTOM) list(APPEND hal_srcs ${src_dir}/${MCUBOOT_TARGET}/console_uart_custom.c ) endif() list(APPEND LINKER_SCRIPTS -T${esp_hal_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.newlib.ld ) set_source_files_properties( ${esp_hal_dir}/components/bootloader_support/src/esp_image_format.c ${esp_hal_dir}/components/bootloader_support/bootloader_flash/src/bootloader_flash.c ${esp_hal_dir}/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_${MCUBOOT_TARGET}.c ${esp_hal_dir}/components/hal/mmu_hal.c ${esp_hal_dir}/components/hal/cache_hal.c PROPERTIES COMPILE_FLAGS "-Wno-logical-op") boot/espressif/hal/include/esp32h2/sdkconfig.h 0 → 100644 +31 −0 Changes for boot/espressif/hal/include/esp32h2/sdkconfig.h: 31 added lines, 0 removed lines. Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #define BOOTLOADER_BUILD 1 #define CONFIG_IDF_FIRMWARE_CHIP_ID 0x0010 #define CONFIG_IDF_TARGET_ESP32H2 1 #define CONFIG_ESP32H2_REV_MIN_0 1 #define CONFIG_ESP32H2_REV_MIN_FULL 0 #define CONFIG_ESP_REV_MIN_FULL CONFIG_ESP32H2_REV_MIN_FULL #define CONFIG_ESP32H2_REV_MIN 0 #define CONFIG_ESP32H2_REV_MAX_FULL 99 #define CONFIG_ESP_REV_MAX_FULL CONFIG_ESP32H2_REV_MAX_FULL #define CONFIG_IDF_TARGET_ARCH_RISCV 1 #define CONFIG_MMU_PAGE_SIZE 0x10000 #define SOC_MMU_PAGE_SIZE CONFIG_MMU_PAGE_SIZE /* from soc/CMakeLists */ #define CONFIG_XTAL_FREQ_32 1 #define CONFIG_XTAL_FREQ 32 #define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 #define CONFIG_MCUBOOT 1 #define NDEBUG 1 #define CONFIG_BOOTLOADER_WDT_TIME_MS 9000 #define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200 #define CONFIG_BOOTLOADER_OFFSET_IN_FLASH 0x0000 #define CONFIG_PARTITION_TABLE_OFFSET 0x10000 #define CONFIG_EFUSE_VIRTUAL_OFFSET 0x250000 #define CONFIG_EFUSE_VIRTUAL_SIZE 0x2000 #define CONFIG_EFUSE_MAX_BLK_LEN 256 #define CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT 1 boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h +2 −0 Changes for boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ extern int ets_printf(const char *fmt, ...); #define TARGET "[esp32c3]" #elif CONFIG_IDF_TARGET_ESP32C6 #define TARGET "[esp32c6]" #elif CONFIG_IDF_TARGET_ESP32H2 #define TARGET "[esp32h2]" #else #error "Selected target not supported." #endif Loading boot/espressif/hal/src/esp32h2/console_uart_custom.c 0 → 100644 +21 −0 Changes for boot/espressif/hal/src/esp32h2/console_uart_custom.c: 21 added lines, 0 removed lines. Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include <esp_rom_uart.h> #include <hal/uart_ll.h> #include <soc/uart_periph.h> #if CONFIG_ESP_CONSOLE_UART_CUSTOM static uart_dev_t *alt_console_uart_dev = (CONFIG_ESP_CONSOLE_UART_NUM == 0) ? &UART0 : &UART1; void IRAM_ATTR esp_rom_uart_putc(char c) { while (uart_ll_get_txfifo_len(alt_console_uart_dev) == 0); uart_ll_write_txfifo(alt_console_uart_dev, (const uint8_t *) &c, 1); } #endif Loading
boot/espressif/CMakeLists.txt +6 −1 Changes for boot/espressif/CMakeLists.txt: 6 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ if ("${MCUBOOT_TARGET}" STREQUAL "esp32" OR "${MCUBOOT_TARGET}" STREQUAL "esp32s3") set(MCUBOOT_ARCH "xtensa") elseif("${MCUBOOT_TARGET}" STREQUAL "esp32c3" OR "${MCUBOOT_TARGET}" STREQUAL "esp32c6") "${MCUBOOT_TARGET}" STREQUAL "esp32c6" OR "${MCUBOOT_TARGET}" STREQUAL "esp32h2") set(MCUBOOT_ARCH "riscv") endif() Loading @@ -36,6 +37,8 @@ elseif("${MCUBOOT_TARGET}" STREQUAL "esp32c3") set(ESP_MIN_REVISION 3) elseif("${MCUBOOT_TARGET}" STREQUAL "esp32c6") set(ESP_MIN_REVISION 0) elseif("${MCUBOOT_TARGET}" STREQUAL "esp32h2") set(ESP_MIN_REVISION 0) else() message(FATAL_ERROR "Unsupported target ${MCUBOOT_TARGET}") endif() Loading Loading @@ -115,6 +118,8 @@ if (NOT DEFINED ESP_FLASH_FREQ) "${MCUBOOT_TARGET}" STREQUAL "esp32c3" OR "${MCUBOOT_TARGET}" STREQUAL "esp32c6") set(ESP_FLASH_FREQ "40m") elseif("${MCUBOOT_TARGET}" STREQUAL "esp32h2") set(ESP_FLASH_FREQ "24m") endif() endif() Loading
boot/espressif/hal/include/esp32h2/esp32h2.cmake 0 → 100644 +32 −0 Changes for boot/espressif/hal/include/esp32h2/esp32h2.cmake: 32 added lines, 0 removed lines. Original line number Diff line number Diff line # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD # # SPDX-License-Identifier: Apache-2.0 list(APPEND include_dirs ${esp_hal_dir}/components/esp_hw_support/port/${MCUBOOT_TARGET}/private_include ) list(APPEND hal_srcs ${esp_hal_dir}/components/hal/cache_hal.c ${esp_hal_dir}/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c ${esp_hal_dir}/components/esp_rom/patches/esp_rom_regi2c_${MCUBOOT_TARGET}.c ) if (DEFINED CONFIG_ESP_CONSOLE_UART_CUSTOM) list(APPEND hal_srcs ${src_dir}/${MCUBOOT_TARGET}/console_uart_custom.c ) endif() list(APPEND LINKER_SCRIPTS -T${esp_hal_dir}/components/esp_rom/${MCUBOOT_TARGET}/ld/${MCUBOOT_TARGET}.rom.newlib.ld ) set_source_files_properties( ${esp_hal_dir}/components/bootloader_support/src/esp_image_format.c ${esp_hal_dir}/components/bootloader_support/bootloader_flash/src/bootloader_flash.c ${esp_hal_dir}/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_${MCUBOOT_TARGET}.c ${esp_hal_dir}/components/hal/mmu_hal.c ${esp_hal_dir}/components/hal/cache_hal.c PROPERTIES COMPILE_FLAGS "-Wno-logical-op")
boot/espressif/hal/include/esp32h2/sdkconfig.h 0 → 100644 +31 −0 Changes for boot/espressif/hal/include/esp32h2/sdkconfig.h: 31 added lines, 0 removed lines. Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #define BOOTLOADER_BUILD 1 #define CONFIG_IDF_FIRMWARE_CHIP_ID 0x0010 #define CONFIG_IDF_TARGET_ESP32H2 1 #define CONFIG_ESP32H2_REV_MIN_0 1 #define CONFIG_ESP32H2_REV_MIN_FULL 0 #define CONFIG_ESP_REV_MIN_FULL CONFIG_ESP32H2_REV_MIN_FULL #define CONFIG_ESP32H2_REV_MIN 0 #define CONFIG_ESP32H2_REV_MAX_FULL 99 #define CONFIG_ESP_REV_MAX_FULL CONFIG_ESP32H2_REV_MAX_FULL #define CONFIG_IDF_TARGET_ARCH_RISCV 1 #define CONFIG_MMU_PAGE_SIZE 0x10000 #define SOC_MMU_PAGE_SIZE CONFIG_MMU_PAGE_SIZE /* from soc/CMakeLists */ #define CONFIG_XTAL_FREQ_32 1 #define CONFIG_XTAL_FREQ 32 #define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 #define CONFIG_MCUBOOT 1 #define NDEBUG 1 #define CONFIG_BOOTLOADER_WDT_TIME_MS 9000 #define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200 #define CONFIG_BOOTLOADER_OFFSET_IN_FLASH 0x0000 #define CONFIG_PARTITION_TABLE_OFFSET 0x10000 #define CONFIG_EFUSE_VIRTUAL_OFFSET 0x250000 #define CONFIG_EFUSE_VIRTUAL_SIZE 0x2000 #define CONFIG_EFUSE_MAX_BLK_LEN 256 #define CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT 1
boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h +2 −0 Changes for boot/espressif/hal/include/mcuboot_config/mcuboot_logging.h: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ extern int ets_printf(const char *fmt, ...); #define TARGET "[esp32c3]" #elif CONFIG_IDF_TARGET_ESP32C6 #define TARGET "[esp32c6]" #elif CONFIG_IDF_TARGET_ESP32H2 #define TARGET "[esp32h2]" #else #error "Selected target not supported." #endif Loading
boot/espressif/hal/src/esp32h2/console_uart_custom.c 0 → 100644 +21 −0 Changes for boot/espressif/hal/src/esp32h2/console_uart_custom.c: 21 added lines, 0 removed lines. Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include <esp_rom_uart.h> #include <hal/uart_ll.h> #include <soc/uart_periph.h> #if CONFIG_ESP_CONSOLE_UART_CUSTOM static uart_dev_t *alt_console_uart_dev = (CONFIG_ESP_CONSOLE_UART_NUM == 0) ? &UART0 : &UART1; void IRAM_ATTR esp_rom_uart_putc(char c) { while (uart_ll_get_txfifo_len(alt_console_uart_dev) == 0); uart_ll_write_txfifo(alt_console_uart_dev, (const uint8_t *) &c, 1); } #endif