Skip to content

Commit fdb0dd2

Browse files
esp-wzhespressif-bot
authored andcommitted
feat(esp_hw_support): support LP_Peripheral & CNNT power domain auto powerdown on esp32p4eco1
1 parent 6b1a173 commit fdb0dd2

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

components/esp_hw_support/include/esp_sleep.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ typedef enum {
8383
#endif
8484
#if SOC_PM_SUPPORT_TOP_PD
8585
ESP_PD_DOMAIN_TOP, //!< SoC TOP
86+
#endif
87+
#if SOC_PM_SUPPORT_CNNT_PD
88+
ESP_PD_DOMAIN_CNNT, //!< Hight-speed connect peripherals power domain
8689
#endif
8790
ESP_PD_DOMAIN_MAX //!< Number of domains
8891
} esp_sleep_pd_domain_t;

components/esp_hw_support/sleep_modes.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#include "freertos/FreeRTOS.h"
2727
#include "freertos/task.h"
2828
#include "soc/soc_caps.h"
29+
#include "soc/chip_revision.h"
2930
#include "driver/rtc_io.h"
31+
#include "hal/efuse_hal.h"
3032
#include "hal/rtc_io_hal.h"
3133
#include "hal/clk_tree_hal.h"
3234

@@ -862,6 +864,12 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m
862864
pd_flags &= ~RTC_SLEEP_PD_RTC_PERIPH;
863865
}
864866
}
867+
#elif CONFIG_IDF_TARGET_ESP32P4
868+
/* Due to esp32p4 eco0 hardware bug, if LP peripheral power domain is powerdowned in sleep, there will be a possibility of
869+
triggering the EFUSE_CRC reset, so disable the power-down of this power domain on lightsleep for ECO0 version. */
870+
if (!ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 1)) {
871+
pd_flags &= ~RTC_SLEEP_PD_RTC_PERIPH;
872+
}
865873
#endif
866874

867875
uint32_t reject_triggers = allow_sleep_rejection ? (s_config.wakeup_triggers & RTC_SLEEP_REJECT_MASK) : 0;
@@ -2275,6 +2283,12 @@ static uint32_t get_power_down_flags(void)
22752283
}
22762284
#endif
22772285

2286+
#if SOC_PM_SUPPORT_CNNT_PD
2287+
if (s_config.domain[ESP_PD_DOMAIN_CNNT].pd_option != ESP_PD_OPTION_ON) {
2288+
pd_flags |= PMU_SLEEP_PD_CNNT;
2289+
}
2290+
#endif
2291+
22782292
#if SOC_PM_SUPPORT_VDDSDIO_PD
22792293
if (s_config.domain[ESP_PD_DOMAIN_VDDSDIO].pd_option != ESP_PD_OPTION_ON) {
22802294
pd_flags |= RTC_SLEEP_PD_VDDSDIO;

components/soc/esp32p4/include/soc/Kconfig.soc_caps.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,10 @@ config SOC_PM_SUPPORT_CNNT_PD
15671567
bool
15681568
default y
15691569

1570+
config SOC_PM_SUPPORT_RTC_PERIPH_PD
1571+
bool
1572+
default y
1573+
15701574
config SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY
15711575
bool
15721576
default y

components/soc/esp32p4/include/soc/soc_caps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@
620620
#define SOC_PM_SUPPORT_VDDSDIO_PD (1)
621621
#define SOC_PM_SUPPORT_TOP_PD (1)
622622
#define SOC_PM_SUPPORT_CNNT_PD (1)
623+
#define SOC_PM_SUPPORT_RTC_PERIPH_PD (1)
623624

624625
#define SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY (1) /*!<Supports CRC only the stub code in RTC memory */
625626

0 commit comments

Comments
 (0)