esp-idf/components/esp_hw_support/port/esp32s2
Michael (XIAO Xufeng) 17b9cc6b4a 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-05-12 15:57:09 +08:00
..
private_include sleep: restore analog calibration registers after waking up from light sleep 2022-03-07 11:28:48 +08:00
async_memcpy_impl_cp_dma.c esp_hw_support: update copyright notice 4 2021-08-10 13:31:53 +02:00
chip_info.c esp_hw_support: update copyright notice 4 2021-08-10 13:31:53 +02:00
CMakeLists.txt esp32: move spiram, himem 2021-07-16 20:14:26 +08:00
dport_access.c esp32s2, esp32s3: update copyright notice 2021-08-05 15:01:26 +02:00
esp_crypto_lock.c esp32s2, esp32s3: update copyright notice 2021-08-05 15:01:26 +02:00
esp_ds.c esp32s2, esp32s3: update copyright notice 2021-08-05 15:01:26 +02:00
esp_hmac.c esp32s2/hmac: Release HMAC lock in downstream mode incase of failure 2021-09-06 11:21:39 +05:30
Kconfig.mac esp32: move mac target specific configs 2021-03-31 19:17:33 +08:00
memprot.c System/Memprot: fixed voltage glitching detection logic 2021-10-04 09:21:07 +02:00
regi2c_ctrl.c rename APB_CTRL ro SYS_CON 2021-09-16 20:57:57 +08:00
regi2c_ctrl.h esp_phy: use spinlock to avoid regi2c access conflicts 2022-04-06 12:18:23 +08:00
rtc_clk_common.h esp_hw_support: update copyright notice 4 2021-08-10 13:31:53 +02:00
rtc_clk_init.c rename APB_CTRL ro SYS_CON 2021-09-16 20:57:57 +08:00
rtc_clk.c pm: fixed RTC8M domain power issues 2022-05-12 15:57:09 +08:00
rtc_init.c esp_hw_support: force power down wifi and bt power domain when rtc module init 2021-10-14 10:51:10 +08:00
rtc_pm.c rename APB_CTRL ro SYS_CON 2021-09-16 20:57:57 +08:00
rtc_sleep.c pm: fixed RTC8M domain power issues 2022-05-12 15:57:09 +08:00
rtc_time.c reduce bootup time when using usb-serial-jtag 2021-12-03 20:50:22 +08:00
rtc_wdt.c esp_hw_support: update copyright notice 4 2021-08-10 13:31:53 +02:00
spiram_psram.c rename APB_CTRL ro SYS_CON 2021-09-16 20:57:57 +08:00
spiram_psram.h add flash and PSRAM CS IO acquire function 2021-09-15 20:34:17 +08:00
spiram.c add flash and PSRAM CS IO acquire function 2021-09-15 20:34:17 +08:00