esp-idf/components/esp_hw_support/port/esp32c3
Michael (XIAO Xufeng) 7931c033ed pm: fixed RTC8M domain power issues
introduced in e44ead5356

1. The int8M power domain config by default is PD. While LEDC is using
RTC8M as clock source, this power domain will be kept on.

But when 8MD256 is used as RTC clock source, the power domain should
also be kept on.

On ESP32, there was protection for it, but broken by commit
e44ead5356. Currently the power domain
will be forced on when LEDC is using RTC8M as clock source &&
!int8m_pd_en (user enable ESP_PDP_DOMAIN_RTC8M in lightsleep). Otherwise
the power domain will be powered off, regardless of RTC clock source.

In other words, int8M domain will be forced off (even when 8MD256
used as RTC clock source) if LEDC not using RTC8M as clock source, user
doesn't enable ESP_PDP_DOMAIN_RTC8M, or in deep sleep.

On later chips, there's no such protection, so 8MD256 could't be used as
RTC clock source in sleep modes.

This commit adds protection of 8MD256 clock to other chips. Fixes the
incorrect protection logic overriding on ESP32. Now the power domain
will be determiend by the logic below (order by priority):

    1. When RTC clock source uses 8MD256, power up
    2. When LEDC uses RTC8M clock source, power up
    3. In deepsleep, power down
    4. Otherwise determined by user config of ESP_PDP_DOMAIN_RTC8M,
       power down by default. (This is preferred to have highest
       priority, but it's kept as is because of current code structure.)

2. Before, after the macro `RTC_SLEEP_CONFIG_DEFAULT` decides dbias, the
protection above may force the int8m PU. This may cause the inconsistent
of dbias and the int8m PU status.

This commit lifts the logic of pd int8m/xtal fpu logic to upper layer
(sleep_modes.c).

Related: https://github.com/espressif/esp-idf/issues/8007, https://github.com/espressif/esp-idf/pull/8089

temp
2022-11-05 20:02:53 +08:00
..
private_include sleep: restore analog calibration registers after waking up from light sleep 2022-03-07 21:58:42 +08:00
CMakeLists.txt esp_hw_support: merge C3 changes to master 2020-12-30 12:20:41 +08:00
cpu_util_esp32c3.c esp_hw_support: Add initial ESP32-C3 support 2020-11-30 15:23:15 +11:00
i2c_brownout.h esp_hw_support: Add initial ESP32-C3 support 2020-11-30 15:23:15 +11:00
i2c_rtc_clk.h esp_hw_support: merge C3 changes to master 2020-12-30 12:20:41 +08:00
regi2c_ctrl.h Merge branch 'bugfix/fix_adc_calibration_light_sleep_issue_v4.3' into 'release/v4.3' 2022-04-21 15:56:10 +08:00
rtc_clk_common.h esp_hw_support: merge C3 changes to master 2020-12-30 12:20:41 +08:00
rtc_clk_init.c driver: Update/cleanup esp32c3 rtc_tempsensor.c 2021-01-25 04:51:40 +00:00
rtc_clk.c pm: fixed RTC8M domain power issues 2022-11-05 20:02:53 +08:00
rtc_init.c fix C3 system not stable bug when dbias storing in efuse is bigger than 27 2022-10-08 11:48:47 +08:00
rtc_pm.c esp_hw_support: Add initial ESP32-C3 support 2020-11-30 15:23:15 +11:00
rtc_sleep.c pm: fixed RTC8M domain power issues 2022-11-05 20:02:53 +08:00
rtc_time.c rtc_clk: Fix rtc8m calibration failure after cpu/core reset 2022-10-12 12:41:50 +08:00