mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 03:07:21 +02:00
change(esp_hw_support): wait pll calibration done in regdma link instead of wait fixed value
This commit is contained in:
@ -474,7 +474,7 @@ typedef struct pmu_sleep_machine_constant {
|
|||||||
.regdma_rf_on_work_time_us = 70, \
|
.regdma_rf_on_work_time_us = 70, \
|
||||||
.regdma_rf_off_work_time_us = 23, \
|
.regdma_rf_off_work_time_us = 23, \
|
||||||
.xtal_wait_stable_time_us = 250, \
|
.xtal_wait_stable_time_us = 250, \
|
||||||
.pll_wait_stable_time_us = 1 \
|
.pll_wait_stable_time_us = 50 \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ typedef struct pmu_sleep_machine_constant {
|
|||||||
.regdma_s2a_work_time_us = PMU_REGDMA_S2A_WORK_TIME_PD_TOP_US, \
|
.regdma_s2a_work_time_us = PMU_REGDMA_S2A_WORK_TIME_PD_TOP_US, \
|
||||||
.regdma_a2s_work_time_us = 0, \
|
.regdma_a2s_work_time_us = 0, \
|
||||||
.xtal_wait_stable_time_us = 250, \
|
.xtal_wait_stable_time_us = 250, \
|
||||||
.pll_wait_stable_time_us = 1 \
|
.pll_wait_stable_time_us = 50 \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -10,6 +10,11 @@
|
|||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "soc/soc_caps.h"
|
#include "soc/soc_caps.h"
|
||||||
|
#include "soc/i2c_ana_mst_reg.h"
|
||||||
|
#include "soc/regi2c_defs.h"
|
||||||
|
#include "soc/pcr_reg.h"
|
||||||
|
#include "modem/modem_syscon_reg.h"
|
||||||
|
#include "modem/modem_lpcon_reg.h"
|
||||||
|
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
@ -20,12 +25,6 @@
|
|||||||
#include "esp_private/sleep_retention.h"
|
#include "esp_private/sleep_retention.h"
|
||||||
#include "esp_private/sleep_clock.h"
|
#include "esp_private/sleep_clock.h"
|
||||||
|
|
||||||
#include "soc/pcr_reg.h"
|
|
||||||
#include "modem/modem_syscon_reg.h"
|
|
||||||
|
|
||||||
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
|
|
||||||
#include "modem/modem_lpcon_reg.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static __attribute__((unused)) const char *TAG = "sleep_clock";
|
static __attribute__((unused)) const char *TAG = "sleep_clock";
|
||||||
|
|
||||||
@ -37,11 +36,22 @@ static esp_err_t sleep_clock_system_retention_init(void *arg)
|
|||||||
#define N_REGS_PCR() (((PCR_PWDET_SAR_CLK_CONF_REG - DR_REG_PCR_BASE) / 4) + 1)
|
#define N_REGS_PCR() (((PCR_PWDET_SAR_CLK_CONF_REG - DR_REG_PCR_BASE) / 4) + 1)
|
||||||
#endif
|
#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) },
|
/* Enable i2c master clock */
|
||||||
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_PCR_LINK(1), PCR_RESET_EVENT_BYPASS_REG, PCR_RESET_EVENT_BYPASS_REG, 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
[0] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(0), MODEM_LPCON_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_EN, MODEM_LPCON_CLK_I2C_MST_EN_M, 1, 0), .owner = ENTRY(0) },
|
||||||
|
/* Start BBPLL self-calibration */
|
||||||
|
[1] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(1), I2C_MST_ANA_CONF0_REG, 0, I2C_MST_BBPLL_STOP_FORCE_HIGH, 1, 0), .owner = ENTRY(0) },
|
||||||
|
[2] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(2), I2C_MST_ANA_CONF0_REG, I2C_MST_BBPLL_STOP_FORCE_LOW, I2C_MST_BBPLL_STOP_FORCE_LOW, 1, 0), .owner = ENTRY(0) },
|
||||||
|
/* Wait calibration done */
|
||||||
|
[3] = { .config = REGDMA_LINK_WAIT_INIT (REGDMA_PCR_LINK(3), I2C_MST_ANA_CONF0_REG, I2C_MST_BBPLL_CAL_DONE, I2C_MST_BBPLL_CAL_DONE, 1, 0), .owner = ENTRY(0) },
|
||||||
|
/* Stop BBPLL self-calibration */
|
||||||
|
[4] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(4), I2C_MST_ANA_CONF0_REG, 0, I2C_MST_BBPLL_STOP_FORCE_LOW, 1, 0), .owner = ENTRY(0) },
|
||||||
|
[5] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(5), I2C_MST_ANA_CONF0_REG, I2C_MST_BBPLL_STOP_FORCE_HIGH, I2C_MST_BBPLL_STOP_FORCE_HIGH, 1, 0), .owner = ENTRY(0) },
|
||||||
|
/* Clock configuration retention */
|
||||||
|
[6] = { .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) },
|
||||||
|
[7] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_PCR_LINK(1), PCR_RESET_EVENT_BYPASS_REG, PCR_RESET_EVENT_BYPASS_REG, 1, 0, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
#if CONFIG_IDF_TARGET_ESP32H2
|
#if CONFIG_IDF_TARGET_ESP32H2
|
||||||
[2] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(2), PCR_BUS_CLK_UPDATE_REG, PCR_BUS_CLOCK_UPDATE, PCR_BUS_CLOCK_UPDATE_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
[8] = { .config = REGDMA_LINK_WRITE_INIT (REGDMA_PCR_LINK(2), PCR_BUS_CLK_UPDATE_REG, PCR_BUS_CLOCK_UPDATE, PCR_BUS_CLOCK_UPDATE_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
[3] = { .config = REGDMA_LINK_WAIT_INIT (REGDMA_PCR_LINK(3), PCR_BUS_CLK_UPDATE_REG, 0x0, PCR_BUS_CLOCK_UPDATE_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
[9] = { .config = REGDMA_LINK_WAIT_INIT (REGDMA_PCR_LINK(3), PCR_BUS_CLK_UPDATE_REG, 0x0, PCR_BUS_CLOCK_UPDATE_M, 1, 0), .owner = ENTRY(0) | ENTRY(2) },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user