diff --git a/components/esp_hw_support/linker.lf b/components/esp_hw_support/linker.lf index 243cb05b550..73fdb4ea14b 100644 --- a/components/esp_hw_support/linker.lf +++ b/components/esp_hw_support/linker.lf @@ -54,6 +54,18 @@ entries: sar_periph_ctrl (noflash) else: sar_periph_ctrl: sar_periph_ctrl_power_enable (noflash) + if SOC_PM_MODEM_RETENTION_BY_REGDMA = y && ESP_PHY_MAC_BB_PD = y: + sleep_retention:sleep_retention_find_link_by_id (noflash) + regdma_link:regdma_find_link_by_id (noflash) + regdma_link:regdma_link_get_next (noflash) + regdma_link:regdma_link_get_next_continuous_wrapper (noflash) + regdma_link:regdma_link_get_next_addr_map_wrapper (noflash) + regdma_link:regdma_link_get_next_write_wait_wrapper (noflash) + regdma_link:regdma_link_get_next_branch_continuous_wrapper (noflash) + regdma_link:regdma_link_get_next_branch_addr_map_wrapper (noflash) + regdma_link:regdma_link_get_next_branch_write_wait_wrapper (noflash) + regdma_link:regdma_link_set_write_wait_content (noflash) + regdma_link:regdma_link_get_instance (noflash) [mapping:soc_pm] archive: libsoc.a diff --git a/components/esp_hw_support/port/regdma_link.c b/components/esp_hw_support/port/regdma_link.c index 11b59482942..f72c99e13d2 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-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -318,43 +318,43 @@ void * regdma_link_init(const regdma_link_config_t *config, bool branch, int mod return link; } -static void * regdma_link_get_next_continuous_wrapper(void *link) +__attribute__((used, noinline)) static void * regdma_link_get_next_continuous_wrapper(void *link) { regdma_link_continuous_t *continuous = __containerof(link, regdma_link_continuous_t, head); return (void *)(continuous->body.next); } -static void * regdma_link_get_next_addr_map_wrapper(void *link) +__attribute__((used, noinline)) static void * regdma_link_get_next_addr_map_wrapper(void *link) { regdma_link_addr_map_t *addr_map = __containerof(link, regdma_link_addr_map_t, head); return (void *)(addr_map->body.next); } -static void * regdma_link_get_next_write_wait_wrapper(void *link) +__attribute__((used, noinline)) static void * regdma_link_get_next_write_wait_wrapper(void *link) { regdma_link_write_wait_t *write_wait = __containerof(link, regdma_link_write_wait_t, head); return (void *)(write_wait->body.next); } -static regdma_entry_buf_t * regdma_link_get_next_branch_continuous_wrapper(void *link) +__attribute__((used, noinline)) static regdma_entry_buf_t * regdma_link_get_next_branch_continuous_wrapper(void *link) { regdma_link_branch_continuous_t *branch_continuous = __containerof(link, regdma_link_branch_continuous_t, head); return &branch_continuous->body.next; } -static regdma_entry_buf_t * regdma_link_get_next_branch_addr_map_wrapper(void *link) +__attribute__((used, noinline)) static regdma_entry_buf_t * regdma_link_get_next_branch_addr_map_wrapper(void *link) { regdma_link_branch_addr_map_t *branch_addr_map = __containerof(link, regdma_link_branch_addr_map_t, head); return &branch_addr_map->body.next; } -static regdma_entry_buf_t * regdma_link_get_next_branch_write_wait_wrapper(void *link) +__attribute__((used, noinline)) static regdma_entry_buf_t * regdma_link_get_next_branch_write_wait_wrapper(void *link) { regdma_link_branch_write_wait_t *branch_write_wait = __containerof(link, regdma_link_branch_write_wait_t, head); return &branch_write_wait->body.next; } -static void * regdma_link_get_next(void *link, int entry) +__attribute__((used, noinline)) static void * regdma_link_get_next(void *link, int entry) { if (link) { regdma_link_head_t head = REGDMA_LINK_HEAD(link); @@ -407,7 +407,7 @@ void * regdma_link_recursive(void *link, int entry, void (*hook)(void *, int, in return regdma_link_recursive_impl(link, entry, 0, hook); } -static void * regdma_link_get_instance(void *link) +__attribute__((used, noinline)) static void * regdma_link_get_instance(void *link) { void * container_memaddr[] = { (void *)__containerof(link, regdma_link_continuous_t, head), diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index 5004e6ac457..8327758ec72 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -434,7 +434,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/esp32c6/esp_adapter.c b/components/esp_wifi/esp32c6/esp_adapter.c index 07c46725f93..91b2bc47e9b 100644 --- a/components/esp_wifi/esp32c6/esp_adapter.c +++ b/components/esp_wifi/esp32c6/esp_adapter.c @@ -568,12 +568,12 @@ static void esp_phy_disable_wrapper(void) } #if SOC_PM_MODEM_RETENTION_BY_REGDMA -static void regdma_link_set_write_wait_content_wrapper(void *addr, uint32_t value, uint32_t mask) +static void IRAM_ATTR regdma_link_set_write_wait_content_wrapper(void *addr, uint32_t value, uint32_t mask) { regdma_link_set_write_wait_content(addr, value, mask); } -static void *sleep_retention_find_link_by_id_wrapper(int id) +static void *IRAM_ATTR sleep_retention_find_link_by_id_wrapper(int id) { return sleep_retention_find_link_by_id(id); } diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index e62e539a750..ddb9520c75c 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit e62e539a750f6a18ffeb290aff861616775727b9 +Subproject commit ddb9520c75c773766535c42153110ab2142483ab diff --git a/examples/wifi/power_save/pytest_wifi_power_save.py b/examples/wifi/power_save/pytest_wifi_power_save.py index bed25c52016..97d52261617 100644 --- a/examples/wifi/power_save/pytest_wifi_power_save.py +++ b/examples/wifi/power_save/pytest_wifi_power_save.py @@ -64,6 +64,19 @@ def test_wifi_power_save_pd_top(dut: Dut) -> None: _run_test(dut) +@pytest.mark.wifi_ap +@pytest.mark.parametrize( + 'config', + [ + 'pd_modem', + ], + indirect=True, +) +@idf_parametrize('target', ['esp32c6', 'esp32c5', 'esp32c61'], indirect=['target']) +def test_wifi_power_save_pd_modem(dut: Dut) -> None: + _run_test(dut) + + @pytest.mark.wifi_ap @pytest.mark.xtal_26mhz @pytest.mark.parametrize( diff --git a/examples/wifi/power_save/sdkconfig.ci.c2_xtal26m b/examples/wifi/power_save/sdkconfig.ci.c2_xtal26m index 065020b06fb..68a9d5efcdf 100644 --- a/examples/wifi/power_save/sdkconfig.ci.c2_xtal26m +++ b/examples/wifi/power_save/sdkconfig.ci.c2_xtal26m @@ -1,3 +1,4 @@ CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_GET_AP_INFO_FROM_STDIN=y +CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y diff --git a/examples/wifi/power_save/sdkconfig.ci.c2eco4_xtal26m b/examples/wifi/power_save/sdkconfig.ci.c2eco4_xtal26m index a302168187a..296928320fd 100644 --- a/examples/wifi/power_save/sdkconfig.ci.c2eco4_xtal26m +++ b/examples/wifi/power_save/sdkconfig.ci.c2eco4_xtal26m @@ -2,3 +2,4 @@ CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_GET_AP_INFO_FROM_STDIN=y CONFIG_ESP32C2_REV_MIN_200=y +CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y diff --git a/examples/wifi/power_save/sdkconfig.ci.c3eco7 b/examples/wifi/power_save/sdkconfig.ci.c3eco7 index 6b253290433..05ef4a47428 100644 --- a/examples/wifi/power_save/sdkconfig.ci.c3eco7 +++ b/examples/wifi/power_save/sdkconfig.ci.c3eco7 @@ -1,3 +1,4 @@ CONFIG_IDF_TARGET="esp32c3" CONFIG_ESP32C3_REV_MIN_101=y CONFIG_EXAMPLE_GET_AP_INFO_FROM_STDIN=y +CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y diff --git a/examples/wifi/power_save/sdkconfig.ci.pd_modem b/examples/wifi/power_save/sdkconfig.ci.pd_modem new file mode 100644 index 00000000000..604a4ddeb80 --- /dev/null +++ b/examples/wifi/power_save/sdkconfig.ci.pd_modem @@ -0,0 +1,4 @@ +CONFIG_EXAMPLE_GET_AP_INFO_FROM_STDIN=y +CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y +CONFIG_ESP_PHY_MAC_BB_PD=y +CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP=y diff --git a/examples/wifi/power_save/sdkconfig.ci.pd_top b/examples/wifi/power_save/sdkconfig.ci.pd_top index 92f20b28e0f..2bb4010036f 100644 --- a/examples/wifi/power_save/sdkconfig.ci.pd_top +++ b/examples/wifi/power_save/sdkconfig.ci.pd_top @@ -1,3 +1,4 @@ CONFIG_EXAMPLE_GET_AP_INFO_FROM_STDIN=y CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y CONFIG_ESP_PHY_MAC_BB_PD=y +CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y