From 6078f64be43bd6a286ca9177583edc221929dee9 Mon Sep 17 00:00:00 2001 From: hebinglin Date: Fri, 11 Jul 2025 11:32:36 +0800 Subject: [PATCH] change(esp_hw_support): update pau regdma register driver for esp32h4beta5 --- components/hal/esp32h4/include/hal/lp_aon_ll.h | 15 +++++++++++++++ components/hal/esp32h4/include/hal/lp_timer_ll.h | 6 ++++++ components/hal/esp32h4/include/hal/pau_ll.h | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/components/hal/esp32h4/include/hal/lp_aon_ll.h b/components/hal/esp32h4/include/hal/lp_aon_ll.h index d034ec8a77..ffb2c67986 100644 --- a/components/hal/esp32h4/include/hal/lp_aon_ll.h +++ b/components/hal/esp32h4/include/hal/lp_aon_ll.h @@ -91,6 +91,21 @@ static inline void lp_aon_ll_inform_wakeup_type(bool dslp) REG_CLR_BIT(RTC_SLEEP_MODE_REG, BIT(0)); /* Tell rom to run light sleep wake stub */ } } + +/** + * @brief Set the maximum number of linked lists supported by REGDMA + * @param count: the maximum number of regdma link + */ +static inline void lp_aon_ll_set_regdma_link_count(int count) +{ + HAL_FORCE_MODIFY_U32_REG_FIELD(LP_AON.backup_dma_cfg0, aon_branch_link_length_aon, count); +} + +static inline void lp_aon_ll_set_regdma_link_addr(uint32_t addr) +{ + HAL_FORCE_MODIFY_U32_REG_FIELD(LP_AON.backup_dma_cfg2, aon_link_addr_aon, addr); +} + #ifdef __cplusplus } #endif diff --git a/components/hal/esp32h4/include/hal/lp_timer_ll.h b/components/hal/esp32h4/include/hal/lp_timer_ll.h index adc5dbaa05..47346122da 100644 --- a/components/hal/esp32h4/include/hal/lp_timer_ll.h +++ b/components/hal/esp32h4/include/hal/lp_timer_ll.h @@ -77,6 +77,12 @@ FORCE_INLINE_ATTR void lp_timer_ll_lp_alarm_intr_enable(lp_timer_dev_t *dev, boo dev->lp_int_ena.main_timer_lp_int_ena = enable; } +/* Record the start and finish times for one-time regdma work */ +FORCE_INLINE_ATTR void lp_timer_ll_record_regdma_work_time_enable(lp_timer_dev_t *dev, bool en) +{ + dev->update.main_timer_regdma_work = en; +} + #ifdef __cplusplus } #endif diff --git a/components/hal/esp32h4/include/hal/pau_ll.h b/components/hal/esp32h4/include/hal/pau_ll.h index c158e404e3..4f7bbf7716 100644 --- a/components/hal/esp32h4/include/hal/pau_ll.h +++ b/components/hal/esp32h4/include/hal/pau_ll.h @@ -84,6 +84,11 @@ static inline void pau_ll_set_regdma_timeout_read_mode_try_time(pau_dev_t *dev, REG_SET_FIELD(LP_AON_BACKUP_DMA_CFG1_REG, LP_AON_LINK_WAIT_TOUT_THRES_AON, thres); } +static inline void pau_ll_set_regdma_branch_max_link(pau_dev_t *dev, uint32_t max_link_len) +{ + REG_SET_FIELD(LP_AON_BACKUP_DMA_CFG1_REG, LP_AON_BRANCH_LINK_LENGTH_AON, max_link_len); +} + static inline uint32_t pau_ll_get_regdma_current_link_addr(pau_dev_t *dev) { return dev->regdma_current_link_addr.val;