diff --git a/components/esp_hw_support/port/esp32c6/pmu_sleep.c b/components/esp_hw_support/port/esp32c6/pmu_sleep.c index 37c9dedd85..b4abcb8116 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32c6/pmu_sleep.c @@ -15,6 +15,7 @@ #include "soc/rtc.h" #include "soc/pmu_struct.h" #include "esp_private/esp_pmu.h" +#include "esp32c6/rom/rtc.h" #define HP(state) (PMU_MODE_HP_ ## state) #define LP(state) (PMU_MODE_LP_ ## state) @@ -152,11 +153,9 @@ const pmu_sleep_config_t* pmu_sleep_config_default( config->digital = digital_default; pmu_sleep_analog_config_t analog_default = PMU_SLEEP_ANALOG_LSLP_CONFIG_DEFAULT(pd_flags); - if (!(pd_flags & PMU_SLEEP_PD_MODEM)){ - analog_default.hp_sys.analog.slp_logic_dbias += 2; - } - if (!(pd_flags & PMU_SLEEP_PD_TOP)){ - analog_default.hp_sys.analog.slp_logic_dbias += 2; + if (!(pd_flags & PMU_SLEEP_PD_TOP) || !(pd_flags & PMU_SLEEP_PD_MODEM)){ + analog_default.hp_sys.analog.xpd = 1; + analog_default.hp_sys.analog.dbias = 2; } config->analog = analog_default; } @@ -200,10 +199,13 @@ static void pmu_sleep_analog_init(pmu_context_t *ctx, const pmu_sleep_analog_con 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_lp_set_regulator_slp_xpd (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.slp_xpd); pmu_ll_lp_set_regulator_sleep_dbias(ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.slp_dbias); + pmu_ll_lp_set_regulator_xpd (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.xpd); pmu_ll_lp_set_regulator_dbias (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.dbias); pmu_ll_lp_set_regulator_driver_bar (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.drv_b); + 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); pmu_ll_lp_set_bias_sleep_enable (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.bias_sleep); pmu_ll_lp_set_regulator_xpd (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.xpd); diff --git a/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h b/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h index 24b15a2958..dd3fbd7da9 100644 --- a/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h +++ b/components/esp_hw_support/port/esp32c6/private_include/pmu_param.h @@ -172,14 +172,14 @@ typedef struct { #define PMU_SLEEP_ANALOG_LSLP_CONFIG_DEFAULT(pd_flags) { \ .hp_sys = { \ .analog = { \ - .xpd_bias = 0x0, \ - .dbg_atten = 0x0, \ + .xpd_bias = 0, \ + .dbg_atten = 0, \ .pd_cur = 1, \ .bias_sleep = 1, \ .slp_mem_xpd = 1, \ .slp_logic_xpd = 1, \ - .slp_mem_dbias = 0x4, \ - .slp_logic_dbias = 0x4, \ + .slp_mem_dbias = 4, \ + .slp_logic_dbias = 4, \ .xpd = 0, \ .dbias = 0, \ .drv_b = 0 \ @@ -188,23 +188,23 @@ typedef struct { .lp_sys[PMU_MODE_LP_ACTIVE] = { \ .analog = { \ .slp_xpd = 0, \ - .slp_dbias = 0xc, \ + .slp_dbias = 0, \ .xpd = 1, \ - .dbias = 0x1a, \ - .drv_b = 0x0 \ + .dbias = 26, \ + .drv_b = 0 \ } \ }, \ .lp_sys[PMU_MODE_LP_SLEEP] = { \ .analog = { \ .xpd_bias = 0, \ - .dbg_atten = 0x0, \ + .dbg_atten = 0, \ .pd_cur = 1, \ .bias_sleep = 1, \ .xpd = 0, \ - .dbias = 0x1c, \ + .dbias = 28, \ .slp_xpd = 1, \ - .slp_dbias = 0x3, \ - .drv_b = 0x0 \ + .slp_dbias = 3, \ + .drv_b = 0 \ } \ } \ } @@ -213,37 +213,37 @@ typedef struct { .hp_sys = { \ .analog = { \ .xpd_bias = 0, \ - .dbg_atten = 0x3, \ - .pd_cur = 1, \ - .bias_sleep = 1, \ + .dbg_atten = 0, \ + .pd_cur = 0, \ + .bias_sleep = 0, \ + .slp_mem_xpd = 0, \ + .slp_logic_xpd = 0, \ + .slp_mem_dbias = 0, \ + .slp_logic_dbias = 0, \ .xpd = 0, \ - .dbias = 0x15, \ - .slp_mem_xpd = 1, \ - .slp_mem_dbias = 0xc, \ - .slp_logic_xpd = 1, \ - .slp_logic_dbias = 0x5, \ - .drv_b = 0x18c \ + .dbias = 0, \ + .drv_b = 0 \ } \ }, \ .lp_sys[PMU_MODE_LP_ACTIVE] = { \ .analog = { \ - .xpd = 1, \ - .dbias = 0x1a, \ .slp_xpd = 0, \ .slp_dbias = 0, \ - .drv_b = 0x7 \ + .xpd = 1, \ + .dbias = 26, \ + .drv_b = 0 \ } \ }, \ .lp_sys[PMU_MODE_LP_SLEEP] = { \ .analog = { \ .xpd_bias = 0, \ - .dbg_atten = 0xe, \ + .dbg_atten = 14, \ .pd_cur = 1, \ .bias_sleep = 1, \ .xpd = 0, \ .dbias = 0, \ .slp_xpd = 1, \ - .slp_dbias = 0xe, \ + .slp_dbias = 14, \ .drv_b = 0 \ } \ } \