fix(esp_tee): Reset crypto peripherals before the panic-induced reset

This commit is contained in:
harshal.patil
2026-06-09 10:59:12 +05:30
parent c5e03fd55c
commit dec9ce8263
7 changed files with 128 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -18,6 +18,7 @@
#include "hal/cache_ll.h"
#include "hal/cache_hal.h"
#include "hal/apm_hal.h"
#include "soc/soc_caps.h"
#if SOC_INT_PLIC_SUPPORTED
#include "soc/plic_reg.h"
@@ -56,6 +57,12 @@ static void tee_panic_end(void)
esp_rom_output_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM);
}
// Reset crypto peripherals before the panic-induced reset so the next boot
// sees them in a clean state. The SoC-specific implementation mirrors
// esp_system_reset_modules_on_exit() in the non-TEE path using register-level
// accesses.
esp_tee_soc_reset_crypto_peripherals();
// Generate system reset
esp_rom_software_reset_system();
}