From 38f8b57fe5e6321a0e3f615ed7d5dece463f1a63 Mon Sep 17 00:00:00 2001 From: "harshal.patil" Date: Tue, 14 Oct 2025 10:05:47 +0530 Subject: [PATCH] feat(flash_encryption): Remove mspi reset when switching the XTS-AES key source --- .../src/esp32c5/flash_encryption_secure_features.c | 7 ------- .../src/esp32p4/flash_encryption_secure_features.c | 2 -- 2 files changed, 9 deletions(-) diff --git a/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c index 54a14dcfdb8..e07a2b40a1b 100644 --- a/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c @@ -79,12 +79,5 @@ esp_err_t esp_flash_encryption_use_efuse_key(void) // Force Key Manager to use eFuse key for XTS-AES operation key_mgr_hal_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY); - // TODO: Check if this is necessary else remove it - // In case Flash Encryption is enabled by a key deployed using the Key Manager, - // we just need to reset the SPI flash to ensure the key is used. - // Enabling Key Manager and forcing it to use its OWN key is handled in the - // Key Manager's key deployment API itself. - _mspi_timing_ll_reset_mspi(); - return ESP_OK; } diff --git a/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c index 907626ce32f..6d945a97611 100644 --- a/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c @@ -61,7 +61,5 @@ esp_err_t esp_flash_encryption_use_efuse_key(void) // Force Key Manager to use eFuse key for XTS-AES operation key_mgr_hal_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY); - _mspi_timing_ll_reset_mspi(); - return ESP_OK; }