change(esp_rom): wdt_hal_config_stage fixed in rom_version: esp32p4-eco7-20260109

This commit is contained in:
wuzhenghui
2026-03-27 19:58:56 +08:00
parent 7b1d576416
commit 83d88e73a4
+5 -2
View File
@@ -5,8 +5,11 @@
*/
#include <stddef.h>
#include "hal/config.h"
#include "soc/soc_caps.h"
#include "soc/chip_revision.h"
#include "esp_rom_caps.h"
#include "hal/efuse_hal.h"
#include "hal/mwdt_periph.h"
#include "hal/wdt_hal.h"
@@ -114,13 +117,13 @@ void wdt_hal_deinit(wdt_hal_context_t *hal)
hal->mwdt_dev = NULL;
}
#if SOC_IS(ESP32P4)
#if SOC_IS(ESP32P4) && (HAL_CONFIG(CHIP_SUPPORT_MIN_REV) <= 301)
extern void rom_wdt_hal_config_stage(wdt_hal_context_t *hal, wdt_stage_t stage, uint32_t timeout, wdt_stage_action_t behavior);
/* rwdt_ll_config_stage is implemented erroneously in ESP32P4 rom code, TODO: PM-654*/
void wdt_hal_config_stage(wdt_hal_context_t *hal, wdt_stage_t stage, uint32_t timeout_ticks, wdt_stage_action_t behavior)
{
if (hal->inst == WDT_RWDT && stage == WDT_STAGE0) {
if ((hal->inst == WDT_RWDT && stage == WDT_STAGE0) && !ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 302)) {
timeout_ticks = timeout_ticks >> (1 + REG_GET_FIELD(EFUSE_RD_REPEAT_DATA1_REG, EFUSE_WDT_DELAY_SEL));
}
rom_wdt_hal_config_stage(hal, stage, timeout_ticks, behavior);