Power Management: support DFS

This commit is contained in:
Li Shuai
2022-11-07 22:10:22 +08:00
committed by wuzhenghui
parent 2b5618606b
commit 0f6cda1dd3
6 changed files with 19 additions and 11 deletions

View File

@@ -2,10 +2,10 @@ menu "Power Management"
config PM_ENABLE
bool "Support for power management"
# SMP FreeRTOS currently does not support power management IDF-4997
# ESP32C6 currently does not support power management IDF-5347 IDF-6270
# Note. Disabling this option for C6 will also cause all sdkconfig.release test cases run without pm enabled
# ORed with __DOXYGEN__ to pass C6 docs build, need to remove when pm is supported on C6
depends on (!FREERTOS_SMP && !IDF_TARGET_ESP32C6 && !IDF_TARGET_ESP32H2) || __DOXYGEN__
# ESP32H2 currently does not support power management IDF-6270
# Note. Disabling this option for H2 will also cause all sdkconfig.release test cases run without pm enabled
# ORed with __DOXYGEN__ to pass H2 docs build, need to remove when pm is supported on H2
depends on (!FREERTOS_SMP && !IDF_TARGET_ESP32H2) || __DOXYGEN__
default n
help
If enabled, application is compiled with support for power management.

View File

@@ -288,6 +288,13 @@ esp_err_t esp_pm_configure(const void* vconfig)
*/
apb_max_freq = 80;
}
#elif CONFIG_IDF_TARGET_ESP32C6
/* Maximum SOC APB clock frequency is 40 MHz, maximum Modem (WiFi,
* Bluetooth, etc..) APB clock frequency is 80 MHz */
const int soc_apb_clk_freq = esp_clk_apb_freq() / MHZ;
const int modem_apb_clk_freq = MODEM_APB_CLK_FREQ / MHZ;
const int apb_clk_freq = MAX(soc_apb_clk_freq, modem_apb_clk_freq);
int apb_max_freq = MIN(max_freq_mhz, apb_clk_freq); /* CPU frequency in APB_MAX mode */
#else
int apb_max_freq = MIN(max_freq_mhz, 80); /* CPU frequency in APB_MAX mode */
#endif