Skip to content

Commit 8f9467d

Browse files
committed
Merge branch 'feature/support_esp32p4_dcdc_always_on_v5.3' into 'release/v5.3'
feat(esp_hw_support): support esp32p4 dcdc always on during lightsleep (v5.3) See merge request espressif/esp-idf!31681
2 parents 34e5669 + dd5a5f1 commit 8f9467d

File tree

14 files changed

+106
-37
lines changed

14 files changed

+106
-37
lines changed

components/esp_hw_support/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ menu "Hardware Settings"
325325

326326
endmenu
327327

328+
orsource "./port/$IDF_TARGET/Kconfig.dcdc"
329+
328330
orsource "./port/$IDF_TARGET/Kconfig.ldo"
329331

330332
# Invisible bringup bypass options for esp_hw_support component

components/esp_hw_support/include/esp_private/esp_pmu.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void pmu_sleep_shutdown_dcdc(void);
270270
* @brief DCDC has taken over power supply, shut down LDO to save power consumption
271271
*/
272272
void pmu_sleep_shutdown_ldo(void);
273-
#endif
273+
#endif // SOC_DCDC_SUPPORTED
274274

275275
/**
276276
* @brief Enter deep or light sleep mode
@@ -302,9 +302,10 @@ uint32_t pmu_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt, uint32_t lslp
302302

303303
/**
304304
* @brief Finish sleep process settings and get sleep reject status
305+
* @param dslp True if sleep requests id deep-sleep
305306
* @return return sleep reject status
306307
*/
307-
bool pmu_sleep_finish(void);
308+
bool pmu_sleep_finish(bool dslp);
308309

309310
/**
310311
* @brief Initialize PMU related power/clock/digital parameters and functions

components/esp_hw_support/lowpower/cpu_retention/port/esp32c5/sleep_cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static IRAM_ATTR esp_err_t do_cpu_retention(sleep_cpu_entry_cb_t goto_sleep,
435435
}
436436
#endif
437437

438-
return pmu_sleep_finish();
438+
return pmu_sleep_finish(dslp);
439439
}
440440

441441
esp_err_t IRAM_ATTR esp_sleep_cpu_retention(uint32_t (*goto_sleep)(uint32_t, uint32_t, uint32_t, bool),

components/esp_hw_support/lowpower/cpu_retention/port/esp32c6/sleep_cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static IRAM_ATTR esp_err_t do_cpu_retention(sleep_cpu_entry_cb_t goto_sleep,
475475
}
476476
#endif
477477

478-
return pmu_sleep_finish();
478+
return pmu_sleep_finish(dslp);
479479
}
480480

481481
esp_err_t IRAM_ATTR esp_sleep_cpu_retention(uint32_t (*goto_sleep)(uint32_t, uint32_t, uint32_t, bool),

components/esp_hw_support/lowpower/cpu_retention/port/esp32h2/sleep_cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static IRAM_ATTR esp_err_t do_cpu_retention(sleep_cpu_entry_cb_t goto_sleep,
475475
}
476476
#endif
477477

478-
return pmu_sleep_finish();
478+
return pmu_sleep_finish(dslp);
479479
}
480480

481481
esp_err_t IRAM_ATTR esp_sleep_cpu_retention(uint32_t (*goto_sleep)(uint32_t, uint32_t, uint32_t, bool),

components/esp_hw_support/lowpower/cpu_retention/port/esp32p4/sleep_cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static TCM_IRAM_ATTR esp_err_t do_cpu_retention(sleep_cpu_entry_cb_t goto_sleep,
429429
}
430430
#endif
431431

432-
return pmu_sleep_finish();
432+
return pmu_sleep_finish(dslp);
433433
}
434434

435435
esp_err_t TCM_IRAM_ATTR esp_sleep_cpu_retention(uint32_t (*goto_sleep)(uint32_t, uint32_t, uint32_t, bool),

components/esp_hw_support/port/esp32c5/pmu_sleep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,12 @@ uint32_t pmu_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt, uint32_t lslp
274274
;
275275
}
276276

277-
return pmu_sleep_finish();
277+
return pmu_sleep_finish(dslp);
278278
}
279279

280-
bool pmu_sleep_finish(void)
280+
bool pmu_sleep_finish(bool dslp)
281281
{
282+
(void)dslp;
282283
return pmu_ll_hp_is_sleep_reject(PMU_instance()->hal->dev);
283284
}
284285

components/esp_hw_support/port/esp32c6/pmu_sleep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,12 @@ uint32_t pmu_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt, uint32_t lslp
341341
;
342342
}
343343

344-
return pmu_sleep_finish();
344+
return pmu_sleep_finish(dslp);
345345
}
346346

347-
bool pmu_sleep_finish(void)
347+
bool pmu_sleep_finish(bool dslp)
348348
{
349+
(void)dslp;
349350
return pmu_ll_hp_is_sleep_reject(PMU_instance()->hal->dev);
350351
}
351352

components/esp_hw_support/port/esp32h2/pmu_sleep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,12 @@ uint32_t pmu_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt, uint32_t lslp
258258
;
259259
}
260260

261-
return ESP_OK;
261+
return pmu_sleep_finish(dslp);
262262
}
263263

264-
bool pmu_sleep_finish(void)
264+
bool pmu_sleep_finish(bool dslp)
265265
{
266+
(void)dslp;
266267
return pmu_ll_hp_is_sleep_reject(PMU_instance()->hal->dev);
267268
}
268269

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
menu "DCDC Regulator Configurations"
2+
depends on SOC_GP_LDO_SUPPORTED
3+
4+
config ESP_SLEEP_KEEP_DCDC_ALWAYS_ON
5+
bool "Keep DC-DC power always on during light-sleep"
6+
default y
7+
help
8+
ESP32P4 will switch the power supply to LDO before sleeping, and switch to DCDC after waking up.
9+
These two processes take a long time and may bring some risks for some short duration
10+
light sleep. (DCDC -> LDO: 2.5ms (max), LDO -> DCDC: 1.2 ms)
11+
Enabling this option will make chip powered by DCDC during light sleep to reduce some power switch
12+
risks, this will also increase the power consumption during the light sleep.
13+
14+
DO NOT DISABLE UNLESS YOU KNOW WHAT YOU ARE DOING.
15+
16+
config ESP_SLEEP_DCM_VSET_VAL_IN_SLEEP
17+
int "DCDC voltage parameter during sleep"
18+
default 14
19+
range 0 31
20+
depends on ESP_SLEEP_KEEP_DCDC_ALWAYS_ON
21+
help
22+
This value determines the voltage of the DCDC chip during sleep. The same parameter value may
23+
correspond to different voltage values on different models of DCDC chips. Please update this
24+
value according to the model of external DCDC selected in your hardware solution.
25+
26+
For the DCDC chip model recommended by ESP, the recommended configuration
27+
values are listed below:
28+
29+
- TI-TLV62569/TLV62569P: 14
30+
endmenu

0 commit comments

Comments
 (0)