Skip to content

Commit ff2b761

Browse files
authored
Merge branch 'espressif:release/v5.5' into release/v5.5
2 parents b3ed878 + cbe9388 commit ff2b761

File tree

488 files changed

+12843
-3578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

488 files changed

+12843
-3578
lines changed

.gitlab/ci/common.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,21 @@ variables:
191191
fi
192192

193193
# Custom OpenOCD
194-
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
195-
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
196-
wget $OOCD_DISTRO_URL
197-
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
198-
tar -x -f $ARCH_NAME
199-
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
200-
export PATH=$PWD/openocd-esp32/bin:$PATH
194+
if [[ "$CI_JOB_STAGE" == "target_test" ]]; then
195+
machine="$(uname -m)"
196+
if [[ "$machine" == "armv7l" ]] ; then
197+
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF"
198+
elif [[ "$machine" == "aarch64" ]] ; then
199+
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64"
200+
fi
201+
if [[ ! -z "$OOCD_DISTRO_URL" ]]; then
202+
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
203+
wget $OOCD_DISTRO_URL
204+
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
205+
tar -x -f $ARCH_NAME
206+
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
207+
export PATH=$PWD/openocd-esp32/bin:$PATH
208+
fi
201209
fi
202210

203211
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then

.gitlab/ci/pre_check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ pipeline_variables:
165165
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
166166
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
167167
fi
168+
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
169+
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
168170
- python tools/ci/ci_process_description.py
169171
- cat pipeline.env
170172
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
sbom-hash = 8f2beb57ddad1f94bed899790b00f46df893ccac
5858
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
5959
sbom-cve-exclude-list = CVE-2023-26819 Resolved in commit a328d65ad490b64da8c87523cbbfe16050ba5bf6
60+
sbom-cve-exclude-list = CVE-2023-53154 Resolved in v1.7.18
6061

6162
[submodule "components/mbedtls/mbedtls"]
6263
path = components/mbedtls/mbedtls

components/bootloader/Kconfig.log.settings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ menu "Settings"
2121
config BOOTLOADER_LOG_MODE_BINARY
2222
bool "Binary Log Mode"
2323
select BOOTLOADER_LOG_MODE_BINARY_EN
24+
depends on BOOTLOADER_LOG_VERSION_2
2425
help
2526
Enables binary logging with host-side format string expansion. In this mode, the
2627
format argument of ESP_LOGx, ESP_EARLY_LOG, and ESP_DRAM_LOG macros is stored in a

components/bootloader_support/bootloader_flash/src/bootloader_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
136136
#if ESP_TEE_BUILD
137137
#include "esp_fault.h"
138138
#include "esp_flash_partitions.h"
139-
#include "esp32c6/rom/spi_flash.h"
139+
#include "rom/spi_flash.h"
140140

141141
extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr);
142142
#endif

components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
5555
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
5656
// in this stage, set divider as 6
5757
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_SPLL);
58-
mspi_ll_fast_set_hs_divider(6);
58+
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
59+
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
5960
}
6061

6162
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)

components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
5252
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
5353
// in this stage, set divider as 6
5454
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_DEFAULT);
55-
mspi_ll_fast_set_hs_divider(6);
55+
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
56+
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
5657
}
5758

5859
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)

components/bootloader_support/src/bootloader_common_loader.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
3030
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
31+
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
3132

3233
static const char* TAG = "boot_comm";
3334

@@ -264,7 +265,10 @@ rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
264265
#if ESP_ROM_HAS_LP_ROM
265266
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_LOW)
266267
#else
267-
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
268+
/* Since the structure containing the retain_mem_t is aligned on 8 by the linker, make sure we align this
269+
* structure size here too */
270+
#define RETAIN_MEM_SIZE ALIGN_UP(sizeof(rtc_retain_mem_t), 8)
271+
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - RETAIN_MEM_SIZE)
268272
#endif //ESP_ROM_HAS_LP_ROM
269273
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
270274
return s_bootloader_retain_mem;

components/bootloader_support/src/esp32h2/secure_boot_secure_features.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
#include <strings.h>
8+
#include "hal/ecdsa_ll.h"
89
#include "esp_flash_encrypt.h"
910
#include "esp_secure_boot.h"
1011
#include "esp_efuse.h"
@@ -36,6 +37,12 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
3637
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
3738
#endif
3839

40+
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
41+
if (ecdsa_ll_is_configurable_curve_supported()) {
42+
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
43+
}
44+
#endif
45+
3946
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
4047
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
4148
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);

components/bootloader_support/src/secure_boot.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "esp_secure_boot.h"
1313
#include "hal/efuse_hal.h"
1414

15+
#ifdef SOC_ECDSA_SUPPORTED
16+
#include "hal/ecdsa_ll.h"
17+
#endif
18+
1519
#ifndef BOOTLOADER_BUILD
1620
static __attribute__((unused)) const char *TAG = "secure_boot";
1721

@@ -341,15 +345,17 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
341345
}
342346

343347
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
344-
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
345-
if (!secure) {
346-
uint8_t current_curve;
347-
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, &current_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
348-
if (err == ESP_OK) {
349-
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
350-
// If not P256 mode
351-
result &= secure;
352-
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
348+
if (ecdsa_ll_is_configurable_curve_supported()) {
349+
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
350+
if (!secure) {
351+
uint8_t current_curve;
352+
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, &current_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
353+
if (err == ESP_OK) {
354+
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
355+
// If not P256 mode
356+
result &= secure;
357+
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
358+
}
353359
}
354360
}
355361
}

0 commit comments

Comments
 (0)