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 6617b244995..f4b310919fa 100644 --- a/components/esp_hw_support/include/esp_private/esp_pau.h +++ b/components/esp_hw_support/include/esp_private/esp_pau.h @@ -25,7 +25,7 @@ extern "C" { */ void pau_regdma_set_entry_link_addr(pau_regdma_link_addr_t *link_entries); -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #if SOC_PM_PAU_REGDMA_LINK_MODEM /** * @brief Set the address of WiFi MAC REGDMA Link in modem state @@ -90,6 +90,7 @@ void pau_regdma_trigger_extra_link_restore(void); */ bool pau_regdma_enable_aon_link_entry(bool enable); #endif +#endif #ifdef __cplusplus } 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 0345c26b32d..ca95a3a197c 100644 --- a/components/esp_hw_support/include/esp_private/sleep_modem.h +++ b/components/esp_hw_support/include/esp_private/sleep_modem.h @@ -15,11 +15,11 @@ extern "C" { #endif -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #define SLEEP_MODEM_SKIP_I2C_MST_CLK_RETENTION (BIT(0)) #define SLEEP_MODEM_SKIP_WIFI_RETENTION (BIT(1)) #define SLEEP_MODEM_RESET_RETENTION (0) -#endif // SOC_PM_SUPPORT_PMU_MODEM_STATE +#endif // SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY typedef enum { SLEEP_MODEM_WIFI = 1, SLEEP_MODEM_BT = 2, @@ -89,7 +89,7 @@ void sleep_modem_mac_bb_power_down_prepare(void); void sleep_modem_mac_bb_power_up_prepare(void); #endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY /** * @brief The retention action in the modem state of PHY module @@ -112,7 +112,7 @@ bool sleep_modem_phy_link_enabled(void); */ bool sleep_modem_phy_link_done(void); -#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE */ +#endif /* SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY */ /** * @brief Whether the current target allows Modem or the TOP power domain to be powered off during light sleep @@ -210,7 +210,7 @@ void esp_pm_register_light_sleep_default_params_config_callback(update_light_sle */ void esp_pm_unregister_light_sleep_default_params_config_callback(void); -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY /** * @brief Init phy link. * @@ -278,7 +278,7 @@ esp_err_t sleep_phy_link_deinit(void *link_head); * @param flags A bitmap to indicate the PHY link regdma description configuration flag */ void sleep_phy_link_config(void *link_context, uint32_t flags); -#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE */ +#endif /* SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY */ #ifdef __cplusplus } diff --git a/components/esp_hw_support/lowpower/CMakeLists.txt b/components/esp_hw_support/lowpower/CMakeLists.txt index a45919a3e27..2781a3d2ea3 100644 --- a/components/esp_hw_support/lowpower/CMakeLists.txt +++ b/components/esp_hw_support/lowpower/CMakeLists.txt @@ -37,7 +37,7 @@ if((CONFIG_SOC_PM_SUPPORT_MODEM_PD OR CONFIG_SOC_PM_SUPPORT_TOP_PD) AND CONFIG_S list(APPEND srcs "port/${target}/sleep_clock.c") endif() -if(CONFIG_SOC_PM_SUPPORT_PMU_MODEM_STATE) +if(CONFIG_SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY) list(APPEND srcs "port/${target}/sleep_phy.c") endif() diff --git a/components/esp_hw_support/lowpower/port/esp32c6/sleep_phy.c b/components/esp_hw_support/lowpower/port/esp32c6/sleep_phy.c index afcc0bf3d1d..c0c15bb6594 100644 --- a/components/esp_hw_support/lowpower/port/esp32c6/sleep_phy.c +++ b/components/esp_hw_support/lowpower/port/esp32c6/sleep_phy.c @@ -16,7 +16,7 @@ #include "esp_private/sleep_modem.h" #include "esp_private/sleep_retention.h" -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #define SARADC_TSENS_REG (0x6000e058) #define SARADC_TSENS_PU (BIT(22)) @@ -180,4 +180,4 @@ void sleep_phy_skip_wifi_reg(bool skip) regdma_link_set_skip_flag(s_phy_skip_links.skip_link[i], skip, skip); } } -#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE */ +#endif /* SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY */ diff --git a/components/esp_hw_support/port/pau_regdma.c b/components/esp_hw_support/port/pau_regdma.c index 2b0d66aa9dd..68948da9ebc 100644 --- a/components/esp_hw_support/port/pau_regdma.c +++ b/components/esp_hw_support/port/pau_regdma.c @@ -68,7 +68,7 @@ void pau_regdma_set_entry_link_addr(pau_regdma_link_addr_t *link_entries) pau_hal_set_regdma_entry_link_addr(PAU_instance()->hal, link_entries); } -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #if SOC_PM_PAU_REGDMA_LINK_MODEM void pau_regdma_set_modem_link_addr(void *link_addr) { diff --git a/components/esp_hw_support/sleep_modem.c b/components/esp_hw_support/sleep_modem.c index 56887d37690..0687f1075a8 100644 --- a/components/esp_hw_support/sleep_modem.c +++ b/components/esp_hw_support/sleep_modem.c @@ -129,7 +129,7 @@ void IRAM_ATTR mac_bb_power_up_cb_execute(void) #endif ///CONFIG_MAC_BB_PD -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY typedef struct sleep_modem_config { _lock_t phy_link_lock; @@ -217,7 +217,7 @@ inline __attribute__((always_inline)) bool sleep_modem_phy_link_done(void) return (s_sleep_modem.phy_link_done == 1); } -#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE */ +#endif /* SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY */ bool modem_domain_pd_allowed(void) { diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index c0e8b2557db..0ed688dbb82 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -333,19 +333,23 @@ void esp_phy_enable(esp_phy_modem_t modem) #endif s_is_phy_calibrated = true; } else { +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP if (!pm_mac_modem_rf_already_enabled()) { +#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP */ if (sleep_modem_phy_link_enabled() && sleep_modem_phy_link_done()) { sleep_modem_do_phy_retention(true); } else { phy_wakeup_init(); } +#if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP } else { phy_wakeup_from_modem_state_extra_init(); } +#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP */ #else phy_wakeup_init(); -#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP */ +#endif /* SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY */ #if SOC_PM_MODEM_RETENTION_BY_BACKUPDMA phy_digital_regs_load(); @@ -400,12 +404,14 @@ void esp_phy_disable(esp_phy_modem_t modem) #if SOC_PM_MODEM_RETENTION_BY_BACKUPDMA phy_digital_regs_store(); #endif +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP pm_mac_modem_clear_rf_power_state(); +#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP */ if (sleep_modem_phy_link_enabled()) { sleep_modem_do_phy_retention(false); } else -#endif /* SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP */ +#endif /* SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY */ { // Disable PHY and RF. phy_close_rf(); diff --git a/components/hal/include/hal/pau_hal.h b/components/hal/include/hal/pau_hal.h index 37490e3cc9a..25ab5362f52 100644 --- a/components/hal/include/hal/pau_hal.h +++ b/components/hal/include/hal/pau_hal.h @@ -37,7 +37,7 @@ typedef struct { */ void pau_hal_set_regdma_entry_link_addr(pau_hal_context_t *hal, pau_regdma_link_addr_t *link_addr); -#if SOC_PM_SUPPORT_PMU_MODEM_STATE +#if SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY #if SOC_PM_PAU_REGDMA_LINK_MODEM /** * @brief Set regdma modem link address diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index 5fbeb0d6456..1cc738fe323 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -1419,6 +1419,10 @@ config SOC_PM_SUPPORT_RTC_PERIPH_PD bool default y +config SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY + bool + default y + config SOC_PM_SUPPORT_PMU_MODEM_STATE bool default y diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index 63813baacf3..67b249e6f2b 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -552,7 +552,8 @@ #define SOC_PM_SUPPORT_MAC_BB_PD (1) #define SOC_PM_SUPPORT_RTC_PERIPH_PD (1) -#define SOC_PM_SUPPORT_PMU_MODEM_STATE (1) +#define SOC_PM_SUPPORT_REGDMA_TRIGGERED_PHY (1) +#define SOC_PM_SUPPORT_PMU_MODEM_STATE (1) /* macro redefine for pass esp_wifi headers md5sum check */ #define MAC_SUPPORT_PMU_MODEM_STATE SOC_PM_SUPPORT_PMU_MODEM_STATE