forked from espressif/esp-idf
Power Management: support TOP domain powered down in light sleep for esp32h2
This commit is contained in:
@@ -27,8 +27,11 @@ static __attribute__((unused)) const char *TAG = "sleep_clock";
|
|||||||
|
|
||||||
esp_err_t sleep_clock_system_retention_init(void)
|
esp_err_t sleep_clock_system_retention_init(void)
|
||||||
{
|
{
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32C6
|
||||||
#define N_REGS_PCR() (((PCR_SRAM_POWER_CONF_REG - DR_REG_PCR_BASE) / 4) + 1)
|
#define N_REGS_PCR() (((PCR_SRAM_POWER_CONF_REG - DR_REG_PCR_BASE) / 4) + 1)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
|
#define N_REGS_PCR() (((PCR_PWDET_SAR_CLK_CONF_REG - DR_REG_PCR_BASE) / 4) + 1)
|
||||||
|
#endif
|
||||||
const static sleep_retention_entries_config_t pcr_regs_retention[] = {
|
const static sleep_retention_entries_config_t pcr_regs_retention[] = {
|
||||||
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_PCR_LINK(0), DR_REG_PCR_BASE, DR_REG_PCR_BASE, N_REGS_PCR(), 0, 0), .owner = ENTRY(0) | ENTRY(2) } /* pcr */
|
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_PCR_LINK(0), DR_REG_PCR_BASE, DR_REG_PCR_BASE, N_REGS_PCR(), 0, 0), .owner = ENTRY(0) | ENTRY(2) } /* pcr */
|
||||||
};
|
};
|
||||||
|
@@ -118,11 +118,17 @@ esp_err_t sleep_sys_periph_tg0_retention_init(void)
|
|||||||
|
|
||||||
esp_err_t sleep_sys_periph_iomux_retention_init(void)
|
esp_err_t sleep_sys_periph_iomux_retention_init(void)
|
||||||
{
|
{
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32C6
|
||||||
#define N_REGS_IOMUX_0() (((PERIPHS_IO_MUX_SPID_U - REG_IO_MUX_BASE) / 4) + 1)
|
#define N_REGS_IOMUX_0() (((PERIPHS_IO_MUX_SPID_U - REG_IO_MUX_BASE) / 4) + 1)
|
||||||
#define N_REGS_IOMUX_1() (((GPIO_FUNC34_OUT_SEL_CFG_REG - GPIO_FUNC0_OUT_SEL_CFG_REG) / 4) + 1)
|
#define N_REGS_IOMUX_1() (((GPIO_FUNC34_OUT_SEL_CFG_REG - GPIO_FUNC0_OUT_SEL_CFG_REG) / 4) + 1)
|
||||||
#define N_REGS_IOMUX_2() (((GPIO_FUNC124_IN_SEL_CFG_REG - GPIO_STATUS_NEXT_REG) / 4) + 1)
|
#define N_REGS_IOMUX_2() (((GPIO_FUNC124_IN_SEL_CFG_REG - GPIO_STATUS_NEXT_REG) / 4) + 1)
|
||||||
#define N_REGS_IOMUX_3() (((GPIO_PIN34_REG - DR_REG_GPIO_BASE) / 4) + 1)
|
#define N_REGS_IOMUX_3() (((GPIO_PIN34_REG - DR_REG_GPIO_BASE) / 4) + 1)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
|
#define N_REGS_IOMUX_0() (((PERIPHS_IO_MUX_SPID_U - REG_IO_MUX_BASE) / 4) + 1)
|
||||||
|
#define N_REGS_IOMUX_1() (((GPIO_FUNC31_OUT_SEL_CFG_REG - GPIO_FUNC0_OUT_SEL_CFG_REG) / 4) + 1)
|
||||||
|
#define N_REGS_IOMUX_2() (((GPIO_FUNC124_IN_SEL_CFG_REG - GPIO_STATUS_NEXT_REG) / 4) + 1)
|
||||||
|
#define N_REGS_IOMUX_3() (((GPIO_PIN31_REG - DR_REG_GPIO_BASE) / 4) + 1)
|
||||||
|
#endif
|
||||||
const static sleep_retention_entries_config_t iomux_regs_retention[] = {
|
const static sleep_retention_entries_config_t iomux_regs_retention[] = {
|
||||||
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_IOMUX_LINK(0x00), REG_IO_MUX_BASE, REG_IO_MUX_BASE, N_REGS_IOMUX_0(), 0, 0), .owner = ENTRY(0) | ENTRY(2) }, /* io_mux */
|
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_IOMUX_LINK(0x00), REG_IO_MUX_BASE, REG_IO_MUX_BASE, N_REGS_IOMUX_0(), 0, 0), .owner = ENTRY(0) | ENTRY(2) }, /* io_mux */
|
||||||
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_IOMUX_LINK(0x01), GPIO_FUNC0_OUT_SEL_CFG_REG, GPIO_FUNC0_OUT_SEL_CFG_REG, N_REGS_IOMUX_1(), 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_IOMUX_LINK(0x01), GPIO_FUNC0_OUT_SEL_CFG_REG, GPIO_FUNC0_OUT_SEL_CFG_REG, N_REGS_IOMUX_1(), 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
|
@@ -1099,6 +1099,10 @@ config SOC_PM_SUPPORT_VDDSDIO_PD
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_PM_SUPPORT_TOP_PD
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_PM_PAU_LINK_NUM
|
config SOC_PM_PAU_LINK_NUM
|
||||||
int
|
int
|
||||||
default 4
|
default 4
|
||||||
|
@@ -460,6 +460,7 @@
|
|||||||
#define SOC_PM_SUPPORT_RC32K_PD (1)
|
#define SOC_PM_SUPPORT_RC32K_PD (1)
|
||||||
#define SOC_PM_SUPPORT_RC_FAST_PD (1)
|
#define SOC_PM_SUPPORT_RC_FAST_PD (1)
|
||||||
#define SOC_PM_SUPPORT_VDDSDIO_PD (1)
|
#define SOC_PM_SUPPORT_VDDSDIO_PD (1)
|
||||||
|
#define SOC_PM_SUPPORT_TOP_PD (1)
|
||||||
#define SOC_PM_PAU_LINK_NUM (4)
|
#define SOC_PM_PAU_LINK_NUM (4)
|
||||||
#define SOC_PM_CPU_RETENTION_BY_SW (1)
|
#define SOC_PM_CPU_RETENTION_BY_SW (1)
|
||||||
#define SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY (1) /*!<Supports CRC only the stub code in RTC memory */
|
#define SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY (1) /*!<Supports CRC only the stub code in RTC memory */
|
||||||
|
Reference in New Issue
Block a user