SOC_EFUSE_DIS_DOWNLOAD_MSPI adds SPI_DOWNLOAD_MSPI_DIS to the release-mode criteria.
On ESP32-H2 its write-protection bit is shared with DIS_ICACHE, which first boot already
burns, so devices provisioned by earlier IDF versions can never set it and would report
DEVELOPMENT forever. Treat the field as satisfied when it is write-protected and warn
that MSPI access in download mode stays enabled; an unburned, unprotected field still fails.
Collapse the 12 non-ESP32 per-target secure_boot/flash_encryption secure-features files
into two shared SOC_EFUSE_*-gated files. ESP32 keeps its own (SBV1 + distinct eFuse family).
Adds SOC_EFUSE_DIS_DOWNLOAD_MSPI for C5/C61/H4 (they already burned the eFuse; the cap just
drives the unified cache-disable gating). eFuse-write behavior verified identical.
ESP32-H21 never disabled the UART download MMU cache during flash-encryption enable; the
SPI_DOWNLOAD_MSPI_DIS eFuse field exists but was never burned. Add the burn and the
SOC_EFUSE_DIS_DOWNLOAD_MSPI cap, matching peers (C5/C61/H4/P4/S31).
ESP32-H2 never disabled the UART download MMU cache during flash-encryption enable; the
SPI_DOWNLOAD_MSPI_DIS eFuse field exists but was never burned. Add the burn and the
SOC_EFUSE_DIS_DOWNLOAD_MSPI cap, matching peers (C5/C61/H4/P4/S31).
CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE is bootloader-scoped;
disabling it must not strip the application's PMP/PMA configuration.
The application now always applies region protection.
Trim bootloader size by moving some logs to DEBUG. Allows
compiling bootloader on P4 with CONFIG_ESPTOOLPY_FLASHMODE_QIO
without changing partition table offset
The digest length and the condition that reserves it at the end of RTC RAM were
duplicated in seven places. Hold the reservation in a hidden Kconfig value that
is zero when the feature does not apply, so every consumer subtracts it
unconditionally, and derive ESP_SECURE_BOOT_DIGEST_LEN from it.
Set SECURE_BOOT_SHA384_EN when enabling ECDSA-P384 Secure Boot V2 on
ESP32-P4, as done on C5/H4/S31, so that ROM verifies the bootloader
using the SHA-384 scheme. The eFuse exists only on the rev >= v3.0
eFuse table, so the Kconfig option is gated on rev >= v3.0.
The removed function `esp_bootloader_get_description` never worked in the app build.
It can be used only in the bootloader build.
To read the bootloader description from app, there is another function
`esp_ota_get_bootloader_description`.
Remove ~50 duplicate local definitions of ALIGN_UP/ALIGN_DOWN/ALIGN_UP_BY/
ALIGN_DOWN_BY across the codebase and replace them with canonical
ESP_ALIGN_UP/ESP_ALIGN_DOWN from esp_macros.h.
fix(mmap): fixed mmap read data wrong when flash being erased/written and cache not disabled
Closes IDFGH-14084
See merge request espressif/esp-idf!29804
Before:
The cache won't be disabled when XIP on psram. But during flash
erasing/programming, read data will be courrupt.
When XIP in psram is enabled, the image is not mapped to the cache so
usually there will be no flash access. The only way to read from flash
is via the driver or use mmap. The driver has protection during erasing,
while th mmap region not.
Now:
Mmap APIs provide a flag to make mmap->unmap region mutually exclusive
to flash erase/programming when XIP from psram. SPI Flash write APIs
will benefit from this. When the flag is used, no concurrent access to
mapped region will happen while writing; otherwise the cache will be
disable to avoid data corruption.
Most ESP-IDF APIs calls mmap with this flag. As for users calling
mmap-like APIs directly, they can choose whether to enable this by a
flag.
Closes https://github.com/espressif/esp-idf/issues/14897
Previously the bootloader unconditionally revoked unused secure boot key
digest slots while permanently enabling secure boot on the first boot,
ignoring CONFIG_SECURE_BOOT_ALLOW_UNUSED_DIGEST_SLOTS. Now the config is
honored on this path too: when set, the unused digest slots are left
un-revoked. This is safe as long as the debug and download interfaces are
disabled.
Update the Kconfig help and the Secure Boot v2 guide (en and zh_CN)
accordingly.
feat: enable Secure Boot, Flash Encryption and Key Manager support in ESP32S31
Closes IDF-14629, IDF-14628, IDF-14626, and IDF-14622
See merge request espressif/esp-idf!48136