diff --git a/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst b/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst index 8da3f10caa8..ad5d4dd1de0 100644 --- a/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst +++ b/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst @@ -329,7 +329,7 @@ pm ------- This config demonstrate the use of power management present on the ESP32-S3. -You can use the pmconfig command to test the power management. +You can use the ``pmconfig`` command to test the power management. Enables PM support. You can define standby mode and sleep mode delay time:: $ make menuconfig @@ -340,6 +340,7 @@ Enables PM support. You can define standby mode and sleep mode delay time:: (0) PM_SLEEP delay (nanoseconds) Before switching PM status, you need to query the current PM status:: + nsh> pmconfig Last state 0, Next state 0 @@ -369,12 +370,13 @@ System switch to the PM standby mode, you need to enter:: nsh> pmconfig relax normal System switch to the PM sleep mode, you need to enter:: + nsh> pmconfig relax standby nsh> pmconfig relax idle nsh> pmconfig relax normal nsh> pmconfig relax normal -Note: when normal mode COUNT is 0, it will switch to the next PM state where COUNT is not 0. +Note: When normal mode COUNT is 0, it will switch to the next PM state where COUNT is not 0. psram_quad ---------- diff --git a/arch/risc-v/src/esp32c3-legacy/esp32c3_idle.c b/arch/risc-v/src/esp32c3-legacy/esp32c3_idle.c index 5b4e406c30b..5a7fa1c3a57 100644 --- a/arch/risc-v/src/esp32c3-legacy/esp32c3_idle.c +++ b/arch/risc-v/src/esp32c3-legacy/esp32c3_idle.c @@ -200,7 +200,6 @@ static void up_idlepm(void) esp32c3_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 + CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000); } - break; default: break; @@ -208,13 +207,6 @@ static void up_idlepm(void) } else { - if (oldstate == PM_NORMAL) - { - /* Relax normal operation */ - - pm_relax(PM_IDLE_DOMAIN, PM_NORMAL); - } - #ifdef CONFIG_WATCHDOG /* Announce the power management state change to feed watchdog */ diff --git a/arch/xtensa/src/esp32/esp32_idle.c b/arch/xtensa/src/esp32/esp32_idle.c index 02cda6119cf..d5e85f7f430 100644 --- a/arch/xtensa/src/esp32/esp32_idle.c +++ b/arch/xtensa/src/esp32/esp32_idle.c @@ -219,7 +219,6 @@ static void esp32_idlepm(void) esp32_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 + CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000); } - break; default: break; @@ -227,13 +226,6 @@ static void esp32_idlepm(void) } else { - if (oldstate == PM_NORMAL) - { - /* Relax normal operation */ - - pm_relax(PM_IDLE_DOMAIN, PM_NORMAL); - } - #ifdef CONFIG_WATCHDOG /* Announce the power management state change to feed watchdog */ diff --git a/arch/xtensa/src/esp32s3/esp32s3_idle.c b/arch/xtensa/src/esp32s3/esp32s3_idle.c index 4835891bdb0..25fbe6b9ef9 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_idle.c +++ b/arch/xtensa/src/esp32s3/esp32s3_idle.c @@ -140,7 +140,6 @@ static void up_idlepm(void) esp32s3_pmsleep(CONFIG_PM_SLEEP_WAKEUP_SEC * 1000000 + CONFIG_PM_SLEEP_WAKEUP_NSEC / 1000); } - break; default: break; diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/pm/defconfig b/boards/xtensa/esp32/esp32-devkitc/configs/pm/defconfig index 278d927047a..7f6c0ca6aad 100644 --- a/boards/xtensa/esp32/esp32-devkitc/configs/pm/defconfig +++ b/boards/xtensa/esp32/esp32-devkitc/configs/pm/defconfig @@ -21,6 +21,7 @@ CONFIG_BOARD_LOOPSPERMSEC=16717 CONFIG_BUILTIN=y CONFIG_ESP32_UART0=y CONFIG_FS_PROCFS=y +CONFIG_FS_PROCFS_REGISTER=y CONFIG_HAVE_CXX=y CONFIG_HAVE_CXXINITIALIZE=y CONFIG_IDLETHREAD_STACKSIZE=3072 @@ -36,6 +37,7 @@ CONFIG_NSH_READLINE=y CONFIG_PM=y CONFIG_PM_GOVERNOR_EXPLICIT_RELAX=-1 CONFIG_PM_GOVERNOR_GREEDY=y +CONFIG_PM_PROCFS=y CONFIG_PREALLOC_TIMERS=4 CONFIG_RAM_SIZE=114688 CONFIG_RAM_START=0x20000000