diff --git a/components/esp_hal_pmu/esp32c5/include/hal/pau_ll.h b/components/esp_hal_pmu/esp32c5/include/hal/pau_ll.h index 877bb992b46..f480d84fc9b 100644 --- a/components/esp_hal_pmu/esp32c5/include/hal/pau_ll.h +++ b/components/esp_hal_pmu/esp32c5/include/hal/pau_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -54,6 +54,31 @@ static inline void pau_ll_set_regdma_entry_link_backup_start_enable(pau_dev_t *d dev->regdma_conf.start = enable; } +static inline void pau_ll_set_regdma_select_wifimac_link(pau_dev_t *dev) +{ + dev->regdma_conf.sel_mac = 1; +} + +static inline void pau_ll_set_regdma_deselect_wifimac_link(pau_dev_t *dev) +{ + dev->regdma_conf.sel_mac = 0; +} + +static inline void pau_ll_set_regdma_wifimac_link_backup_direction(pau_dev_t *dev, bool to_mem) +{ + dev->regdma_conf.to_mem_mac = to_mem ? 1 : 0; +} + +static inline void pau_ll_set_regdma_wifimac_link_backup_start_enable(pau_dev_t *dev) +{ + dev->regdma_conf.start_mac = 1; +} + +static inline void pau_ll_set_regdma_wifimac_link_backup_start_disable(pau_dev_t *dev) +{ + dev->regdma_conf.start_mac = 0; +} + static inline uint32_t pau_ll_get_regdma_current_link_addr(pau_dev_t *dev) { return dev->regdma_current_link_addr.val; diff --git a/components/esp_hal_pmu/esp32c5/pau_hal.c b/components/esp_hal_pmu/esp32c5/pau_hal.c index d0887f780ea..f627c746c34 100644 --- a/components/esp_hal_pmu/esp32c5/pau_hal.c +++ b/components/esp_hal_pmu/esp32c5/pau_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -32,6 +32,25 @@ void IRAM_ATTR pau_hal_stop_regdma_modem_link(pau_hal_context_t *hal) pau_ll_clear_regdma_backup_done_intr_state(hal->dev); } +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND +void IRAM_ATTR pau_hal_start_regdma_wifimac_link(pau_hal_context_t *hal, bool backup_or_restore) +{ + pau_ll_clear_regdma_backup_done_intr_state(hal->dev); + pau_ll_set_regdma_select_wifimac_link(hal->dev); + pau_ll_set_regdma_wifimac_link_backup_direction(hal->dev, backup_or_restore); + pau_ll_set_regdma_wifimac_link_backup_start_enable(hal->dev); + + while (!(pau_ll_get_regdma_intr_raw_signal(hal->dev) & PAU_DONE_INT_RAW)); +} + +void IRAM_ATTR pau_hal_stop_regdma_wifimac_link(pau_hal_context_t *hal) +{ + pau_ll_set_regdma_wifimac_link_backup_start_disable(hal->dev); + pau_ll_set_regdma_deselect_wifimac_link(hal->dev); + pau_ll_clear_regdma_backup_done_intr_state(hal->dev); +} +#endif + void IRAM_ATTR pau_hal_start_regdma_extra_link(pau_hal_context_t *hal, bool backup_or_restore) { pau_ll_clear_regdma_backup_done_intr_state(hal->dev); diff --git a/components/esp_hal_pmu/esp32s31/pau_hal.c b/components/esp_hal_pmu/esp32s31/pau_hal.c index fc1e4c610d9..2cc34821e10 100644 --- a/components/esp_hal_pmu/esp32s31/pau_hal.c +++ b/components/esp_hal_pmu/esp32s31/pau_hal.c @@ -16,6 +16,24 @@ void pau_hal_set_regdma_entry_link_addr(pau_hal_context_t *hal, pau_regdma_link_ } void IRAM_ATTR pau_hal_start_regdma_modem_link(pau_hal_context_t *hal, bool backup_or_restore) +{ + pau_ll_clear_regdma_backup_done_intr_state(hal->dev); + pau_ll_select_regdma_entry_link(hal->dev, SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC); + pau_ll_set_regdma_entry_link_backup_direction(hal->dev, backup_or_restore); + pau_ll_set_regdma_entry_link_backup_start_enable(hal->dev, true); + + while (!(pau_ll_get_regdma_intr_raw_signal(hal->dev) & PAU_DONE_INT_RAW)); +} + +void IRAM_ATTR pau_hal_stop_regdma_modem_link(pau_hal_context_t *hal) +{ + pau_ll_set_regdma_entry_link_backup_start_enable(hal->dev, false); + pau_ll_select_regdma_entry_link(hal->dev, 0); /* restore link select to default */ + pau_ll_clear_regdma_backup_done_intr_state(hal->dev); +} + +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND +void IRAM_ATTR pau_hal_start_regdma_wifimac_link(pau_hal_context_t *hal, bool backup_or_restore) { pau_ll_clear_regdma_backup_done_intr_state(hal->dev); pau_ll_set_regdma_select_wifimac_link(hal->dev); @@ -25,12 +43,13 @@ void IRAM_ATTR pau_hal_start_regdma_modem_link(pau_hal_context_t *hal, bool back while (!(pau_ll_get_regdma_intr_raw_signal(hal->dev) & PAU_DONE_INT_RAW)); } -void IRAM_ATTR pau_hal_stop_regdma_modem_link(pau_hal_context_t *hal) +void IRAM_ATTR pau_hal_stop_regdma_wifimac_link(pau_hal_context_t *hal) { pau_ll_set_regdma_wifimac_link_backup_start_disable(hal->dev); pau_ll_set_regdma_deselect_wifimac_link(hal->dev); pau_ll_clear_regdma_backup_done_intr_state(hal->dev); } +#endif void IRAM_ATTR pau_hal_start_regdma_extra_link(pau_hal_context_t *hal, bool backup_or_restore) { diff --git a/components/esp_hal_pmu/include/hal/pau_hal.h b/components/esp_hal_pmu/include/hal/pau_hal.h index 522889a85b6..60b5c129599 100644 --- a/components/esp_hal_pmu/include/hal/pau_hal.h +++ b/components/esp_hal_pmu/include/hal/pau_hal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -61,6 +61,23 @@ void pau_hal_start_regdma_modem_link(pau_hal_context_t *hal, bool backup_or_rest * @param hal regdma hal context */ void pau_hal_stop_regdma_modem_link(pau_hal_context_t *hal); + +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND +/** + * @brief Start transmission on regdma WiFi MAC SEL link + * + * @param hal regdma hal context + * @param backup_or_restore false: restore, true: backup + */ +void pau_hal_start_regdma_wifimac_link(pau_hal_context_t *hal, bool backup_or_restore); + +/** + * @brief Stop transmission on regdma WiFi MAC SEL link + * + * @param hal regdma hal context + */ +void pau_hal_stop_regdma_wifimac_link(pau_hal_context_t *hal); +#endif #endif #if SOC_PM_RETENTION_SW_TRIGGER_REGDMA diff --git a/components/esp_hw_support/include/esp_private/esp_pau.h b/components/esp_hw_support/include/esp_private/esp_pau.h index f82d0f7dbbe..89b628affa9 100644 --- a/components/esp_hw_support/include/esp_private/esp_pau.h +++ b/components/esp_hw_support/include/esp_private/esp_pau.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -41,6 +41,18 @@ void pau_regdma_trigger_modem_link_backup(void); * @brief Software trigger regdma to perform modem link restore */ void pau_regdma_trigger_modem_link_restore(void); + +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND +/** + * @brief Software trigger REGDMA backup on WiFi MAC SEL link + */ +void pau_regdma_trigger_wifimac_link_backup(void); + +/** + * @brief Software trigger REGDMA restore on WiFi MAC SEL link + */ +void pau_regdma_trigger_wifimac_link_restore(void); +#endif #endif #if SOC_PM_RETENTION_SW_TRIGGER_REGDMA diff --git a/components/esp_hw_support/include/esp_private/sleep_modem.h b/components/esp_hw_support/include/esp_private/sleep_modem.h index 5e6aa72fa3f..47ad7548e6e 100644 --- a/components/esp_hw_support/include/esp_private/sleep_modem.h +++ b/components/esp_hw_support/include/esp_private/sleep_modem.h @@ -83,8 +83,9 @@ void sleep_modem_mac_bb_power_up_prepare(void); * @brief The retention action in the modem state of WiFi PHY module * * @param restore true for restore the PHY context, false for backup the PHY context + * @param wifimac_link_is_sel true to trigger REGDMA via WiFi MAC link */ -void sleep_modem_wifi_do_phy_retention(bool restore); +void sleep_modem_wifi_do_phy_retention(bool restore, bool wifimac_link_is_sel); /** * @brief Get WiFi modem state diff --git a/components/esp_hw_support/include/esp_private/sleep_retention.h b/components/esp_hw_support/include/esp_private/sleep_retention.h index 3b5671eb828..e10199af0b8 100644 --- a/components/esp_hw_support/include/esp_private/sleep_retention.h +++ b/components/esp_hw_support/include/esp_private/sleep_retention.h @@ -293,8 +293,10 @@ void sleep_retention_do_system_retention(bool backup_or_restore); * * @param backup_or_restore true for backup register context to memory * or false for restore to register from memory + * @param wifimac_link_is_sel true to use dedicated WiFi MAC link, + * false to use modem entry link */ -void sleep_retention_do_phy_retention(bool backup_or_restore); +void sleep_retention_do_phy_retention(bool backup_or_restore, bool wifimac_link_is_sel); #endif /*SOC_PM_SUPPORT_PMU_MODEM_STATE */ #endif // SOC_PAU_SUPPORTED diff --git a/components/esp_hw_support/port/pau_regdma.c b/components/esp_hw_support/port/pau_regdma.c index d6a34d043e5..8ec4cb64055 100644 --- a/components/esp_hw_support/port/pau_regdma.c +++ b/components/esp_hw_support/port/pau_regdma.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -80,6 +80,20 @@ void IRAM_ATTR pau_regdma_trigger_modem_link_restore(void) pau_hal_start_regdma_modem_link(PAU_instance()->hal, false); pau_hal_stop_regdma_modem_link(PAU_instance()->hal); } + +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND +void IRAM_ATTR pau_regdma_trigger_wifimac_link_backup(void) +{ + pau_hal_start_regdma_wifimac_link(PAU_instance()->hal, true); + pau_hal_stop_regdma_wifimac_link(PAU_instance()->hal); +} + +void IRAM_ATTR pau_regdma_trigger_wifimac_link_restore(void) +{ + pau_hal_start_regdma_wifimac_link(PAU_instance()->hal, false); + pau_hal_stop_regdma_wifimac_link(PAU_instance()->hal); +} +#endif #endif #if SOC_PM_RETENTION_SW_TRIGGER_REGDMA diff --git a/components/esp_hw_support/sleep_modem.c b/components/esp_hw_support/sleep_modem.c index 9bc27d130b3..1bffcf6129e 100644 --- a/components/esp_hw_support/sleep_modem.c +++ b/components/esp_hw_support/sleep_modem.c @@ -171,10 +171,10 @@ __attribute__((unused)) void sleep_modem_wifi_modem_state_deinit(void) } } -void IRAM_ATTR sleep_modem_wifi_do_phy_retention(bool restore) +void IRAM_ATTR sleep_modem_wifi_do_phy_retention(bool restore, bool wifimac_link_is_sel) { sleep_modem_state_phy_link_config(s_sleep_modem.wifi.phy_link, 1); - sleep_retention_do_phy_retention(!restore); + sleep_retention_do_phy_retention(!restore, wifimac_link_is_sel); sleep_modem_state_phy_link_config(s_sleep_modem.wifi.phy_link, 0); if (!restore) { s_sleep_modem.wifi.modem_state_phy_done = 1; diff --git a/components/esp_hw_support/sleep_retention.c b/components/esp_hw_support/sleep_retention.c index 73fbac4533c..eb4232a3e8b 100644 --- a/components/esp_hw_support/sleep_retention.c +++ b/components/esp_hw_support/sleep_retention.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -1007,7 +1007,7 @@ void IRAM_ATTR sleep_retention_do_system_retention(bool backup_or_restore) #endif #if SOC_PM_SUPPORT_PMU_MODEM_STATE -void IRAM_ATTR sleep_retention_do_phy_retention(bool backup_or_restore) +void IRAM_ATTR sleep_retention_do_phy_retention(bool backup_or_restore, bool wifimac_link_is_sel) { /* since the PHY link and other module links are within the sleep-retention entry (4) context, * add mutex protection to avoid data race. @@ -1016,9 +1016,23 @@ void IRAM_ATTR sleep_retention_do_phy_retention(bool backup_or_restore) _lock_acquire_recursive(&s_retention.lock); #endif if (backup_or_restore) { - pau_regdma_trigger_modem_link_backup(); +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND + if (wifimac_link_is_sel) { + pau_regdma_trigger_wifimac_link_backup(); + } else +#endif + { + pau_regdma_trigger_modem_link_backup(); + } } else { - pau_regdma_trigger_modem_link_restore(); +#if SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND + if (wifimac_link_is_sel) { + pau_regdma_trigger_wifimac_link_restore(); + } else +#endif + { + pau_regdma_trigger_modem_link_restore(); + } } #if SOC_PM_PAU_REGDMA_COMMON_PHY_LINK_ENTRY _lock_release_recursive(&s_retention.lock); diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 140ae0f9c88..1324dabacb6 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -23,6 +23,7 @@ #include "esp_private/esp_sleep_internal.h" #include "esp_check.h" #include "sdkconfig.h" +#include "soc/soc_caps.h" #include "freertos/FreeRTOS.h" #include "freertos/portmacro.h" #include "endian.h" @@ -67,6 +68,9 @@ extern wifi_mac_time_update_cb_t s_wifi_mac_time_update_cb; #if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP extern void pm_mac_modem_clear_rf_power_state(void); extern bool pm_mac_modem_rf_already_enabled(void); +#if SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC +extern bool pm_get_wifimac_regdma_link_selection(void); +#endif #endif static const char* TAG = "phy_init"; @@ -335,9 +339,23 @@ void esp_phy_enable(esp_phy_modem_t modem) s_is_phy_calibrated = true; } else { #if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP + bool wifimac_link_is_sel = false; if (!pm_mac_modem_rf_already_enabled()) { if (sleep_modem_wifi_modem_state_enabled() && sleep_modem_wifi_modem_link_done()) { - sleep_modem_wifi_do_phy_retention(true); +#if SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC && SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND +/* + * A race exists between SoC wakeup and modem state sleep. After modem initiates sleep, + * SoC may wake up before REGDMA completes RF close, leaving mac_modem_sleep_flag uncleared + * (it depends on regdma done). The stale flag can incorrectly trigger a sleep request + * on the next modem entry, causing abnormal sleep behavior. + * + * Therefore, this workaround ensures that mac_modem_sleep_flag is properly + * cleared by regdma closing RF with wifimac link. + * See WIFI-7246 for details. +*/ + wifimac_link_is_sel = pm_get_wifimac_regdma_link_selection(); +#endif + sleep_modem_wifi_do_phy_retention(true, wifimac_link_is_sel); } else { phy_wakeup_init(); } @@ -403,7 +421,11 @@ void esp_phy_disable(esp_phy_modem_t modem) #if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP pm_mac_modem_clear_rf_power_state(); if (sleep_modem_wifi_modem_state_enabled()) { - sleep_modem_wifi_do_phy_retention(false); + bool wifimac_link_is_sel = false; +#if SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC && SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND + wifimac_link_is_sel = pm_get_wifimac_regdma_link_selection(); +#endif + sleep_modem_wifi_do_phy_retention(false, wifimac_link_is_sel); } else #endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP */ { diff --git a/components/esp_rom/esp32c61/ld/esp32c61.rom.eco4.ld b/components/esp_rom/esp32c61/ld/esp32c61.rom.eco4.ld index ab4622513ae..81b9ff497b5 100644 --- a/components/esp_rom/esp32c61/ld/esp32c61.rom.eco4.ld +++ b/components/esp_rom/esp32c61/ld/esp32c61.rom.eco4.ld @@ -27,7 +27,7 @@ pm_set_beacon_filter = 0x40000cd8; //pm_is_in_wifi_slice_threshold = 0x40000cdc; //pm_keep_alive = 0x40000ce4; pm_process_tim = 0x40000d14; -pm_tbtt_process = 0x40000d28; +//pm_tbtt_process = 0x40000d28; pm_tx_data_process = 0x40000d44; pm_twt_process = 0x40000d54; pm_mac_try_enable_modem_state = 0x40000d68; diff --git a/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld b/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld index bcdb4df5130..62773b03b06 100644 --- a/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld +++ b/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld @@ -124,7 +124,7 @@ pm_on_isr_set_twt_target = 0x40000d00; pm_on_isr_twt_wake = 0x40000d04; pm_on_tsf_timer = 0x40000d08; pm_on_twt_force_tx = 0x40000d0c; -pm_parse_beacon = 0x40000d10; +//pm_parse_beacon = 0x40000d10; /*pm_process_tim = 0x40000d14;*/ pm_rx_beacon_process = 0x40000d18; pm_rx_data_process = 0x40000d1c; diff --git a/components/esp_rom/esp32s31/ld/esp32s31.rom.pp.ld b/components/esp_rom/esp32s31/ld/esp32s31.rom.pp.ld index f09b6961c77..199ae475d84 100644 --- a/components/esp_rom/esp32s31/ld/esp32s31.rom.pp.ld +++ b/components/esp_rom/esp32s31/ld/esp32s31.rom.pp.ld @@ -126,13 +126,13 @@ pm_on_isr_set_twt_target = 0x2f800eb0; pm_on_isr_twt_wake = 0x2f800eb4; pm_on_tsf_timer = 0x2f800eb8; pm_on_twt_force_tx = 0x2f800ebc; -pm_parse_beacon = 0x2f800ec0; +//pm_parse_beacon = 0x2f800ec0; //pm_process_tim = 0x2f800ec4; pm_rx_beacon_process = 0x2f800ec8; pm_rx_data_process = 0x2f800ecc; pm_sleep = 0x2f800ed0; pm_sleep_for = 0x2f800ed4; -pm_tbtt_process = 0x2f800ed8; +//pm_tbtt_process = 0x2f800ed8; //pm_tx_data_done_process = 0x2f800edc; pm_allow_tx = 0x2f800ee0; pm_extend_tbtt_adaptive_servo = 0x2f800ee4; diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index bdc71d49d9f..66b8ac6b07e 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -459,7 +459,8 @@ menu "Wi-Fi" config ESP_WIFI_SLP_BEACON_LOST_TIMEOUT int "Beacon loss timeout" range 5 100 - default 10 + default 25 if ESP_COEX_SW_COEXIST_ENABLE + default 10 if (!ESP_COEX_SW_COEXIST_ENABLE) depends on ESP_WIFI_SLP_BEACON_LOST_OPT help Timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond. diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 200f265f07e..f566e6bbf83 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 200f265f07ef0f295e13b90246ce2f850f45761a +Subproject commit f566e6bbf834a379727452bdb1d26a20aab334ca diff --git a/components/esp_wifi/remote/Kconfig.wifi.in b/components/esp_wifi/remote/Kconfig.wifi.in index eeaacd62617..ddc35664e05 100644 --- a/components/esp_wifi/remote/Kconfig.wifi.in +++ b/components/esp_wifi/remote/Kconfig.wifi.in @@ -438,7 +438,8 @@ config WIFI_RMT_SLP_BEACON_LOST_OPT config WIFI_RMT_SLP_BEACON_LOST_TIMEOUT int "Beacon loss timeout" range 5 100 - default 10 + default 25 if ESP_COEX_SW_COEXIST_ENABLE + default 10 if (!ESP_COEX_SW_COEXIST_ENABLE) depends on WIFI_RMT_SLP_BEACON_LOST_OPT help Timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond. diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index f32b8cb5924..dc8f4a97526 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -1439,6 +1439,10 @@ config SOC_PM_PAU_REGDMA_COMMON_PHY_LINK_ENTRY bool default y +config SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND + bool + default y + config SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED bool default y diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index dfb1e5755c8..c15d7a1bed0 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -583,6 +583,8 @@ #define SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE (1) #define SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC (4) // The range of values for the link index is [0, SOC_PM_PAU_LINK_NUM) #define SOC_PM_PAU_REGDMA_COMMON_PHY_LINK_ENTRY (1) +/** Workaround: software-triggered modem PHY retention uses dedicated WiFi MAC REGDMA, not entry link_sel */ +#define SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND (1) #define SOC_PM_PMU_MIN_SLP_SLOW_CLK_CYCLE_FIXED (1) diff --git a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in index 12bd0757356..ff47717ee14 100644 --- a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in @@ -1091,6 +1091,10 @@ config SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC int default 4 +config SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND + bool + default y + config SOC_PM_MODEM_RETENTION_BY_REGDMA bool default y diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index 5d2d08c9d31..72d2990c88e 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -453,6 +453,8 @@ #define SOC_PM_PAU_LINK_NUM (5) #define SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE (1) #define SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC (4) // The range of values for the link index is [0, SOC_PM_PAU_LINK_NUM) +/** Workaround: software-triggered modem PHY retention uses dedicated WiFi MAC REGDMA, not entry link_sel */ +#define SOC_PM_PAU_REGDMA_MODEM_WIFIMAC_WORKAROUND (1) #define SOC_PM_MODEM_RETENTION_BY_REGDMA (1) // #define SOC_PM_SUPPORT_PMU_MODEM_STATE (1) // TODO: [ESP32S31] IDF-14582