refactor(flash_enc): move esp_flash_encryption_enabled() to efuse component

This commit is contained in:
Chen Jichang
2026-03-06 18:14:22 +08:00
committed by Chen Ji Chang
parent fea2c08655
commit 04df934c05
53 changed files with 139 additions and 131 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ set(reqs esp_blockdev)
if(BOOTLOADER_BUILD)
set(srcs "partition_bootloader.c")
list(APPEND reqs spi_flash)
set(priv_reqs "bootloader_support")
set(priv_reqs "bootloader_support" "efuse")
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include"
@@ -18,7 +18,7 @@ if(BOOTLOADER_BUILD)
elseif(esp_tee_build)
set(srcs "partition_tee.c")
list(APPEND reqs spi_flash)
set(priv_reqs "tee_flash_mgr")
set(priv_reqs "tee_flash_mgr" "efuse")
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include"
@@ -29,7 +29,7 @@ elseif(esp_tee_build)
# regular, OS build
else()
set(srcs "partition.c")
set(priv_reqs esp_system spi_flash partition_table)
set(priv_reqs esp_system spi_flash partition_table efuse)
set(reqs esp_blockdev)
set(private_include_dirs)
+2 -2
View File
@@ -27,7 +27,7 @@
#include "esp_partition.h"
#include "esp_flash.h"
#if !CONFIG_IDF_TARGET_LINUX
#include "esp_flash_encrypt.h"
#include "esp_efuse.h"
#endif
#include "spi_flash_mmap.h"
#include "esp_log.h"
@@ -81,7 +81,7 @@ static bool is_partition_encrypted(bool encryption_config, esp_partition_type_t
return false;
#else
bool ret_encrypted = encryption_config;
if (!esp_flash_encryption_enabled()) {
if (!esp_efuse_is_flash_encryption_enabled()) {
/* If flash encryption is not turned on, no partitions should be treated as encrypted */
ret_encrypted = false;
} else if (type == ESP_PARTITION_TYPE_APP