File tree Expand file tree Collapse file tree 4 files changed +51
-8
lines changed
esp_hw_support/port/esp32p4
soc/esp32p4/register/hw_ver3/soc Expand file tree Collapse file tree 4 files changed +51
-8
lines changed Original file line number Diff line number Diff line change 1414#include "soc/pmu_struct.h"
1515#include "hal/efuse_hal.h"
1616#include "hal/pmu_hal.h"
17+ #include "hal/lp_sys_ll.h"
1718#include "pmu_param.h"
1819#include "esp_private/esp_pmu.h"
1920#include "soc/regi2c_dig_reg.h"
@@ -175,7 +176,9 @@ static void pmu_hp_system_init_default(pmu_context_t *ctx)
175176 pmu_hp_system_param_default (mode , & param );
176177 pmu_hp_system_init (ctx , mode , & param );
177178 }
178- REG_SET_FIELD (LP_SYSTEM_REG_HP_MEM_AUX_CTRL_REG , LP_SYSTEM_REG_HP_MEM_AUX_CTRL , 0x2074 );
179+ #if CONFIG_ESP32P4_REV_MIN_FULL >= 300
180+ lp_sys_ll_set_hp_mem_lowpower_mode (MEM_AUX_DEEPSLEEP );
181+ #endif
179182}
180183
181184static inline void pmu_lp_system_param_default (pmu_lp_mode_t mode , pmu_lp_system_param_t * param )
@@ -192,7 +195,9 @@ static void pmu_lp_system_init_default(pmu_context_t *ctx)
192195 pmu_lp_system_param_default (mode , & param );
193196 pmu_lp_system_init (ctx , mode , & param );
194197 }
195- REG_SET_FIELD (LP_SYSTEM_REG_LP_MEM_AUX_CTRL_REG , LP_SYSTEM_REG_LP_MEM_AUX_CTRL , 0x2074 );
198+ #if CONFIG_ESP32P4_REV_MIN_FULL >= 300
199+ lp_sys_ll_set_lp_mem_lowpower_mode (MEM_AUX_DEEPSLEEP );
200+ #endif
196201}
197202
198203void pmu_init (void )
Original file line number Diff line number Diff line change 2020extern "C" {
2121#endif
2222
23+ #define MEM_AUX_SHUTDOWN BIT(0)
24+ #define MEM_AUX_LIGHTSLEEP BIT(1)
25+ #define MEM_AUX_DEEPSLEEP BIT(2)
26+
2327/**
2428 * @brief ROM obtains the wake-up type through LP_SYS_STORE9_REG[0].
2529 * Set the flag to inform
@@ -65,6 +69,17 @@ FORCE_INLINE_ATTR void lp_sys_ll_set_pau_link_addr(uint32_t addr)
6569 LP_SYS .backup_dma_cfg2 .link_addr_aon = addr ;
6670}
6771
72+ #if HAL_CONFIG (CHIP_SUPPORT_MIN_REV ) >= 300
73+ FORCE_INLINE_ATTR void lp_sys_ll_set_hp_mem_lowpower_mode (uint32_t mode )
74+ {
75+ LP_SYS .hp_mem_aux_ctrl .hp_mem_lowpower_mode = mode ;
76+ }
77+
78+ FORCE_INLINE_ATTR void lp_sys_ll_set_lp_mem_lowpower_mode (uint32_t mode )
79+ {
80+ LP_SYS .lp_mem_aux_ctrl .lp_mem_lowpower_mode = mode ;
81+ }
82+ #endif
6883#ifdef __cplusplus
6984}
7085#endif
Original file line number Diff line number Diff line change @@ -1083,7 +1083,15 @@ extern "C" {
10831083 * need_des
10841084 */
10851085#define LP_SYSTEM_REG_HP_MEM_AUX_CTRL_REG (DR_REG_LP_SYS_BASE + 0x180)
1086- /** LP_SYSTEM_REG_HP_MEM_AUX_CTRL : R/W; bitpos: [31:0]; default: 8304;
1086+ /** LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE : R/W; bitpos: [2:0]; default: 0;
1087+ * need_des
1088+ */
1089+ #define LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE 0x7U
1090+ #define LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE_M (LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE_V << LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE_S)
1091+ #define LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE_V 0x7U
1092+ #define LP_SYSTEM_REG_HP_MEM_LOWPOWER_MODE_S 0
1093+
1094+ /** LP_SYSTEM_REG_HP_MEM_AUX_CTRL : R/W; bitpos: [31:3]; default: 1038;
10871095 * need_des
10881096 */
10891097#define LP_SYSTEM_REG_HP_MEM_AUX_CTRL 0xFFFFFFFFU
@@ -1095,7 +1103,14 @@ extern "C" {
10951103 * need_des
10961104 */
10971105#define LP_SYSTEM_REG_LP_MEM_AUX_CTRL_REG (DR_REG_LP_SYS_BASE + 0x184)
1098- /** LP_SYSTEM_REG_LP_MEM_AUX_CTRL : R/W; bitpos: [31:0]; default: 8304;
1106+ /** LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE : R/W; bitpos: [2:0]; default: 0;
1107+ * need_des
1108+ */
1109+ #define LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE 0x7U
1110+ #define LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE_M (LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE_V << LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE_S)
1111+ #define LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE_V 0x7U
1112+ #define LP_SYSTEM_REG_LP_MEM_LOWPOWER_MODE_S 0
1113+ /** LP_SYSTEM_REG_LP_MEM_AUX_CTRL : R/W; bitpos: [31:3]; default: 1038;
10991114 * need_des
11001115 */
11011116#define LP_SYSTEM_REG_LP_MEM_AUX_CTRL 0xFFFFFFFFU
Original file line number Diff line number Diff line change @@ -768,10 +768,14 @@ typedef union {
768768 */
769769typedef union {
770770 struct {
771- /** hp_mem_aux_ctrl : R/W; bitpos: [31 :0]; default: 8304 ;
771+ /** hp_mem_lowpower_mode : R/W; bitpos: [2 :0]; default: 0 ;
772772 * need_des
773773 */
774- uint32_t hp_mem_aux_ctrl :32 ;
774+ uint32_t hp_mem_lowpower_mode :3 ;
775+ /** hp_mem_aux_ctrl : R/W; bitpos: [31:3]; default: 1038;
776+ * need_des
777+ */
778+ uint32_t hp_mem_aux_ctrl :29 ;
775779 };
776780 uint32_t val ;
777781} lp_system_reg_hp_mem_aux_ctrl_reg_t ;
@@ -781,10 +785,14 @@ typedef union {
781785 */
782786typedef union {
783787 struct {
784- /** lp_mem_aux_ctrl : R/W; bitpos: [31:0]; default: 8304;
788+ /** lp_mem_lowpower_mode : R/W; bitpos: [2:0]; default: 0;
789+ * need_des
790+ */
791+ uint32_t lp_mem_lowpower_mode :3 ;
792+ /** lp_mem_aux_ctrl : R/W; bitpos: [31:3]; default: 1038;
785793 * need_des
786794 */
787- uint32_t lp_mem_aux_ctrl :32 ;
795+ uint32_t lp_mem_aux_ctrl :29 ;
788796 };
789797 uint32_t val ;
790798} lp_system_reg_lp_mem_aux_ctrl_reg_t ;
You can’t perform that action at this time.
0 commit comments