esp-idf/components/esp_hw_support/port/esp32c3
Michael (XIAO Xufeng) 2905cbbe03 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-11 11:30:47 +08:00
..
private_include hw_support: fixed regi2c not protected by lock on ESP32S2 2022-03-13 00:24:08 +08:00
chip_info.c soc: Adds efuse hal 2022-02-24 22:20:09 +08:00
CMakeLists.txt System/Security: Memprot API unified (ESP32C3) 2021-12-21 01:50:36 +01:00
cpu_util_esp32c3.c esp_hw_support: Removed deprecated CPU util functions 2021-12-28 16:58:37 +05:30
dport_access.c esp_hw_support: update copyright notice 3 2021-08-10 13:30:57 +02:00
esp_crypto_lock.c esp_hw_support: update copyright notice 3 2021-08-10 13:30:57 +02:00
esp_ds.c global: make periph enable/disable APIs private 2021-11-08 10:37:47 +08:00
esp_hmac.c global: make periph enable/disable APIs private 2021-11-08 10:37:47 +08:00
esp_memprot.c esp_rom: extract int matrix route and cpu ticks getter 2022-02-09 13:52:20 +08:00
i2c_brownout.h esp_hw_support: update copyright notice 3 2021-08-10 13:30:57 +02:00
Kconfig.hw_support soc: moved kconfig options out of the target component. 2022-04-21 12:09:43 +08:00
Kconfig.mac system doc: Re-structure description of MAC addresses, especially on newer chip targets 2021-04-22 16:08:55 +10:00
Kconfig.rtc soc: moved kconfig options out of the target component. 2022-04-21 12:09:43 +08:00
rtc_clk_common.h esp_hw_support: update copyright notice 3 2021-08-10 13:30:57 +02:00
rtc_clk_init.c clk_tree: prework of introducing clk subsystem control 2022-04-11 12:09:06 +08:00
rtc_clk.c pm: fixed RTC8M domain power issues 2022-05-11 11:30:47 +08:00
rtc_init.c Merge branch 'bugfix/fix_esp32c3_brownout_under_deepsleep' into 'master' 2022-05-01 17:28:54 +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-11 11:30:47 +08:00
rtc_time.c reduce bootup time when using usb-serial-jtag 2021-11-29 17:21:11 +08:00