Skip to content

Commit

Permalink
Merge branch 'bugfix/revert_pvt' into 'master'
Browse files Browse the repository at this point in the history
Revert "feat(volt): chip auto adjust volt for esp32c6 & esp32h2"

See merge request espressif/esp-idf!26425
  • Loading branch information
ginkgm committed Oct 16, 2023
2 parents eea2536 + 9c2d470 commit 2308292
Show file tree
Hide file tree
Showing 25 changed files with 17 additions and 2,116 deletions.
26 changes: 0 additions & 26 deletions components/esp_hw_support/include/esp_private/esp_pmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,32 +249,6 @@ bool pmu_sleep_finish(void);
*/
void pmu_init(void);

/**
* @brief Initialize PVT related parameters
*/
void pvt_auto_dbias_init(void);

/**
* @brief Enable or disable PVT functions
*/
void pvt_func_enable(bool enable);

/**
* @brief Initialize charge pump related parameters
*/
void charge_pump_init(void);

/**
* @brief Enable or disable charge pump functions
*/
void charge_pump_enable(bool enable);

/**
* @brief Get Hp_dbias from register
*/
uint32_t get_pvt_dbias(void);


/**
* @brief Enable or disable system clock in PMU HP sleep state
*
Expand Down
1 change: 0 additions & 1 deletion components/esp_hw_support/include/esp_private/esp_regdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extern "C" {
#define REGDMA_MODEMSYSCON_LINK(_pri) ((0x02 << 8) | _pri)
#define REGDMA_MODEMLPCON_LINK(_pri) ((0x03 << 8) | _pri)

#define REGDMA_PVT_LINK(_pri) ((0x0c << 8) | _pri)
#define REGDMA_INTMTX_LINK(_pri) ((0x0d << 8) | _pri)
#define REGDMA_HPSYS_LINK(_pri) ((0x0e << 8) | _pri)
#define REGDMA_TEEAPM_LINK(_pri) ((0x0f << 8) | _pri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ typedef enum sleep_retention_module_bitmap {
SLEEP_RETENTION_MODULE_IOMUX = BIT(21),
SLEEP_RETENTION_MODULE_SPIMEM = BIT(22),
SLEEP_RETENTION_MODULE_SYSTIMER = BIT(23),
SLEEP_RETENTION_MODULE_PVT = BIT(24),

SLEEP_RETENTION_MODULE_ALL = (uint32_t)-1
} sleep_retention_module_bitmap_t;
Expand Down
4 changes: 0 additions & 4 deletions components/esp_hw_support/linker.lf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ entries:
rtc_time (noflash_text)
if SOC_PMU_SUPPORTED = y:
pmu_sleep (noflash)
if SOC_PMU_PVT_SUPPORTED = y:
pmu_pvt_pump: pvt_func_enable (noflash)
pmu_pvt_pump: charge_pump_enable (noflash)
pmu_pvt_pump: get_pvt_dbias (noflash)
if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S2 = y:
rtc_wdt (noflash_text)
if PERIPH_CTRL_FUNC_IN_IRAM = y:
Expand Down
1 change: 0 additions & 1 deletion components/esp_hw_support/port/esp32c6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(srcs "rtc_clk_init.c"
"rtc_time.c"
"chip_info.c"
"ocode_init.c"
"pmu_pvt_pump.c"
)

if(NOT BOOTLOADER_BUILD)
Expand Down
11 changes: 2 additions & 9 deletions components/esp_hw_support/port/esp32c6/pmu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "soc/pmu_struct.h"
#include "hal/pmu_hal.h"
#include "pmu_param.h"
#include "esp_rom_sys.h"
#include "esp_private/esp_pmu.h"
#include "soc/regi2c_dig_reg.h"
#include "regi2c_ctrl.h"
Expand Down Expand Up @@ -196,19 +195,13 @@ void pmu_init(void)
/* Peripheral reg i2c power up */
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_ENIF_RTC_DREG, 1);
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_ENIF_DIG_DREG, 1);
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_RTC_REG, 0);
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_XPD_DIG_REG, 0);

pmu_hp_system_init_default(PMU_instance());
pmu_lp_system_init_default(PMU_instance());

pmu_power_domain_force_default(PMU_instance());

pvt_auto_dbias_init();
charge_pump_init();

//HP dbias initialization
pvt_func_enable(1);
charge_pump_enable(1);
esp_rom_delay_us(1000);
}
6 changes: 2 additions & 4 deletions components/esp_hw_support/port/esp32c6/pmu_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ const pmu_hp_system_analog_param_t * pmu_hp_system_analog_param_default(pmu_hp_m
BIT(PMU_ICG_FUNC_ENA_IOMUX) | \
BIT(PMU_ICG_FUNC_ENA_SPI2) | \
BIT(PMU_ICG_FUNC_ENA_UART0) | \
BIT(PMU_ICG_FUNC_ENA_SYSTIMER) | \
BIT(PMU_ICG_FUNC_ENA_PVT_MONITOR) \
BIT(PMU_ICG_FUNC_ENA_SYSTIMER) \
) \
}

Expand Down Expand Up @@ -344,8 +343,7 @@ const pmu_hp_system_analog_param_t * pmu_hp_system_analog_param_default(pmu_hp_m
BIT(PMU_ICG_FUNC_ENA_IOMUX) | \
BIT(PMU_ICG_FUNC_ENA_SPI2) | \
BIT(PMU_ICG_FUNC_ENA_UART0) | \
BIT(PMU_ICG_FUNC_ENA_SYSTIMER) | \
BIT(PMU_ICG_FUNC_ENA_PVT_MONITOR) \
BIT(PMU_ICG_FUNC_ENA_SYSTIMER) \
) \
}

Expand Down
85 changes: 0 additions & 85 deletions components/esp_hw_support/port/esp32c6/pmu_pvt_pump.c

This file was deleted.

1 change: 0 additions & 1 deletion components/esp_hw_support/port/esp32c6/pmu_sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ static void pmu_sleep_analog_init(pmu_context_t *ctx, const pmu_sleep_analog_con
pmu_ll_hp_set_regulator_xpd (ctx->hal->dev, HP(SLEEP), analog->hp_sys.analog.xpd);
pmu_ll_hp_set_regulator_dbias (ctx->hal->dev, HP(SLEEP), analog->hp_sys.analog.dbias);
pmu_ll_hp_set_regulator_driver_bar (ctx->hal->dev, HP(SLEEP), analog->hp_sys.analog.drv_b);
pmu_ll_hp_set_regulator_dbias (ctx->hal->dev, HP(MODEM), get_pvt_dbias());

pmu_ll_lp_set_dbg_atten (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.dbg_atten);
pmu_ll_lp_set_current_power_off (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.pd_cur);
Expand Down
13 changes: 0 additions & 13 deletions components/esp_hw_support/port/esp32c6/rtc_clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "esp32c6/rom/rtc.h"
#include "soc/rtc.h"
#include "esp_private/rtc_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_hw_log.h"
#include "esp_rom_sys.h"
#include "hal/clk_tree_ll.h"
Expand Down Expand Up @@ -186,10 +185,6 @@ static void rtc_clk_cpu_freq_to_xtal(int cpu_freq, int div)
clk_ll_cpu_set_ls_divider(div);
clk_ll_cpu_set_src(SOC_CPU_CLK_SRC_XTAL);
esp_rom_set_cpu_ticks_per_us(cpu_freq);
#ifndef BOOTLOADER_BUILD
charge_pump_enable(0);
pvt_func_enable(0);
#endif
}

static void rtc_clk_cpu_freq_to_8m(void)
Expand All @@ -198,10 +193,6 @@ static void rtc_clk_cpu_freq_to_8m(void)
clk_ll_cpu_set_ls_divider(1);
clk_ll_cpu_set_src(SOC_CPU_CLK_SRC_RC_FAST);
esp_rom_set_cpu_ticks_per_us(20);
#ifndef BOOTLOADER_BUILD
charge_pump_enable(0);
pvt_func_enable(0);
#endif
}

/**
Expand All @@ -211,10 +202,6 @@ static void rtc_clk_cpu_freq_to_8m(void)
*/
static void rtc_clk_cpu_freq_to_pll_mhz(int cpu_freq_mhz)
{
#ifndef BOOTLOADER_BUILD
pvt_func_enable(1);
charge_pump_enable(1);
#endif
clk_ll_cpu_set_hs_divider(CLK_LL_PLL_480M_FREQ_MHZ / cpu_freq_mhz);
clk_ll_cpu_set_src(SOC_CPU_CLK_SRC_PLL);
esp_rom_set_cpu_ticks_per_us(cpu_freq_mhz);
Expand Down
1 change: 0 additions & 1 deletion components/esp_hw_support/port/esp32h2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(srcs "rtc_clk_init.c"
"pmu_sleep.c"
"rtc_time.c"
"chip_info.c"
"pmu_pvt_pump.c"
)

if(NOT BOOTLOADER_BUILD)
Expand Down
12 changes: 3 additions & 9 deletions components/esp_hw_support/port/esp32h2/pmu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "soc/pmu_struct.h"
#include "hal/pmu_hal.h"
#include "pmu_param.h"
#include "esp_rom_sys.h"
#include "esp_private/esp_pmu.h"
#include "soc/regi2c_pmu.h"
#include "soc/regi2c_bias.h"
Expand Down Expand Up @@ -194,6 +193,9 @@ static void pmu_lp_system_init_default(pmu_context_t *ctx)
void pmu_init()
{
/* No peripheral reg i2c power up required on the target */

REGI2C_WRITE_MASK(I2C_PMU, I2C_PMU_EN_I2C_RTC_DREG, 0);
REGI2C_WRITE_MASK(I2C_PMU, I2C_PMU_EN_I2C_DIG_DREG, 0);
REGI2C_WRITE_MASK(I2C_PMU, I2C_PMU_EN_I2C_RTC_DREG_SLP, 0);
REGI2C_WRITE_MASK(I2C_PMU, I2C_PMU_EN_I2C_DIG_DREG_SLP, 0);
REGI2C_WRITE_MASK(I2C_PMU, I2C_PMU_OR_XPD_RTC_REG, 0);
Expand All @@ -213,12 +215,4 @@ void pmu_init()
pmu_lp_system_init_default(PMU_instance());

pmu_power_domain_force_default(PMU_instance());

pvt_auto_dbias_init();
charge_pump_init();

//HP dbias initialization
pvt_func_enable(1);
charge_pump_enable(1);
esp_rom_delay_us(1000);
}
6 changes: 2 additions & 4 deletions components/esp_hw_support/port/esp32h2/pmu_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ const pmu_hp_system_analog_param_t * pmu_hp_system_analog_param_default(pmu_hp_m
| BIT(PMU_ICG_FUNC_ENA_SEC) \
| BIT(PMU_ICG_FUNC_ENA_PWM) \
| BIT(PMU_ICG_FUNC_ENA_SYSTIMER) \
| BIT(PMU_ICG_FUNC_ENA_UART0)) \
| BIT(PMU_ICG_FUNC_ENA_PVT_MONITOR), \
| BIT(PMU_ICG_FUNC_ENA_UART0)), \
}

#define PMU_HP_MODEM_RETENTION_CONFIG_DEFAULT() { \
Expand Down Expand Up @@ -343,8 +342,7 @@ const pmu_hp_system_analog_param_t * pmu_hp_system_analog_param_default(pmu_hp_m
| BIT(PMU_ICG_FUNC_ENA_SEC) \
| BIT(PMU_ICG_FUNC_ENA_PWM) \
| BIT(PMU_ICG_FUNC_ENA_SYSTIMER) \
| BIT(PMU_ICG_FUNC_ENA_UART0)) \
| BIT(PMU_ICG_FUNC_ENA_PVT_MONITOR), \
| BIT(PMU_ICG_FUNC_ENA_UART0)), \
}

const pmu_hp_system_retention_param_t * pmu_hp_system_retention_param_default(pmu_hp_mode_t mode)
Expand Down
86 changes: 0 additions & 86 deletions components/esp_hw_support/port/esp32h2/pmu_pvt_pump.c

This file was deleted.

Loading

0 comments on commit 2308292

Please sign in to comment.