From 2dc52022ac7ddea925e1a9ea64cb182b9c55dbcb Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Tue, 15 Jul 2025 18:03:40 +0800 Subject: [PATCH] feat(esp_hw_support): add API to supoport modify retention skip flag dynamically --- .../esp_hw_support/include/esp_private/esp_regdma.h | 10 +++++++++- components/esp_hw_support/port/regdma_link.c | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/esp_hw_support/include/esp_private/esp_regdma.h b/components/esp_hw_support/include/esp_private/esp_regdma.h index c0b1e45382..ff47aa943c 100644 --- a/components/esp_hw_support/include/esp_private/esp_regdma.h +++ b/components/esp_hw_support/include/esp_private/esp_regdma.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -328,6 +328,14 @@ void regdma_link_stats(void *link, int entry); */ void regdma_link_set_write_wait_content(void *link, uint32_t value, uint32_t mask); +/** + * @brief Set the flag for the retention chain node to skip the backup or restore + * @param link REGDMA linked list node pointer + * @param skip_backup whether to skip on active to sleep backup + * @param skip_restore whether to skip on sleep to active backup + */ +void regdma_link_set_skip_flag(void *link, bool skip_backup, bool skip_restore); + /** * @brief Dump all node information of the REGDMA linked list indicated by the entry argument * @param link The REGDMA linkded list head pointer diff --git a/components/esp_hw_support/port/regdma_link.c b/components/esp_hw_support/port/regdma_link.c index 4b40659a93..585eed43fe 100644 --- a/components/esp_hw_support/port/regdma_link.c +++ b/components/esp_hw_support/port/regdma_link.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -544,6 +544,15 @@ void regdma_link_set_write_wait_content(void *link, uint32_t value, uint32_t mas } } +void regdma_link_set_skip_flag(void *link, bool skip_backup, bool skip_restore) +{ + if (link) { + regdma_link_head_t *head = ®DMA_LINK_HEAD(link); + head->skip_b = skip_backup; + head->skip_r = skip_restore; + } +} + static void regdma_link_update_continuous_next_wrapper(void *link, void *next) { regdma_link_continuous_t *continuous = __containerof(link, regdma_link_continuous_t, head);