feat(esp_hw_support): support power down PSRAM or Flash during sleep for esp32p4 v1.0

This commit is contained in:
wuzhenghui
2024-10-22 12:07:24 +08:00
parent b57ae0a1a3
commit a1f9d5bcea
9 changed files with 67 additions and 13 deletions

View File

@@ -8,8 +8,11 @@
#include <stdint.h>
#include <stdbool.h>
#include "soc/chip_revision.h"
#include "esp_bit_defs.h"
#include "hal/misc.h"
#include "hal/efuse_hal.h"
#include "hal/pmu_types.h"
#include "soc/pmu_struct.h"
#ifdef __cplusplus
@@ -122,6 +125,10 @@ __attribute__((always_inline))
static inline void ldo_ll_enable(int ldo_unit, bool enable)
{
uint8_t index_array[LDO_LL_NUM_UNITS] = {0, 3, 1, 4};
if (ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 100) && (ldo_unit == 0)) {
// If chip_rev >= v1.0, slp_mem_dbias[3] is used to control the volt output of VO1.
PMU.hp_sys[PMU_MODE_HP_ACTIVE].regulator0.xpd_0p1a = (enable ? 8 : 0);
}
PMU.ext_ldo[index_array[ldo_unit]].pmu_ext_ldo.xpd = enable;
}