rockchip: rk356x: Enable poweroff command
PATCH 1/1 rockchip: rk356x: Enable poweroff command
With PMIC_RK8XX, SYSRESET and CMD_POWEROFF options enabled it is possible to power down a board using the poweroff command and turn the board back on using a power button.
Enable the poweroff command on RK356x boards that have a button wired to PMIC pwron. Also update to use PMIC poweroff when PMIC_RK8XX is enabled to avoid also having to enable the SYSRESET_CMD_POWEROFF option.
--- configs/quartz64-a-rk3566_defconfig | 1 + configs/quartz64-b-rk3566_defconfig | 1 + configs/rock-3a-rk3568_defconfig | 1 + configs/soquartz-model-a-rk3566_defconfig | 1 + drivers/power/pmic/Kconfig | 1 + 5 files changed, 5 insertions(+)
configs/quartz64-a-rk3566_defconfig +1 -0
@@ -52,6 +52,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=y
configs/quartz64-b-rk3566_defconfig +1 -0
@@ -50,6 +50,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=y
configs/rock-3a-rk3568_defconfig +1 -0
@@ -49,6 +49,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=y
configs/soquartz-model-a-rk3566_defconfig +1 -0
@@ -43,6 +43,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=y
drivers/power/pmic/Kconfig +1 -0
@@ -233,6 +233,7 @@ config PMIC_QCOM config PMIC_RK8XX bool "Enable support for Rockchip PMIC RK8XX" + select SYSRESET_CMD_POWEROFF if SYSRESET && CMD_POWEROFF ---help--- The Rockchip RK808 PMIC provides four buck DC-DC convertors, 8 LDOs, an RTC and two low Rds (resistance (drain to source)) switches. It is
Signature · 1 line
2.41.0
Quoted 9 lines · Jonas Karlman
With
PMIC_RK8XX, SYSRESET andCMD_POWEROFFoptions enabled it is possible to power down a board using the poweroff command and turn the board back on using a power button.Enable the poweroff command on RK356x boards that have a button wired to PMIC pwron. Also update to use PMIC poweroff when
PMIC_RK8XXis enabled to avoid also having to enable theSYSRESET_CMD_POWEROFFoption.
Quoted 8 lines
Signed-off-by Jonas Karlman <[email protected]>--- configs/quartz64-a-rk3566_defconfig | 1 + configs/quartz64-b-rk3566_defconfig | 1 + configs/rock-3a-rk3568_defconfig | 1 + configs/soquartz-model-a-rk3566_defconfig | 1 + drivers/power/pmic/Kconfig | 1 + 5 files changed, 5 insertions(+)
Hi Jonas,
Quoted 3 lines · Jonas Karlman
With
PMIC_RK8XX, SYSRESET andCMD_POWEROFFoptions enabled it is possible to power down a board using the poweroff command and turn the board back on using a power button.
I'm confuse about the use case, when will people need to do this(other than just test)?
Usually people do the power on/off or reboot/reset both by software only or by hardware only,
but very little chance need to do these ops by both software and hardware.
What's more, we usually enable the power off cmd in kernel, not in bootloader.
Thanks,
- Kever
Quoted 74 lines
Enable the poweroff command on RK356x boards that have a button wired to PMIC pwron. Also update to use PMIC poweroff when
PMIC_RK8XXis enabled to avoid also having to enable theSYSRESET_CMD_POWEROFFoption.Signed-off-by Jonas Karlman <[email protected]>--- configs/quartz64-a-rk3566_defconfig | 1 + configs/quartz64-b-rk3566_defconfig | 1 + configs/rock-3a-rk3568_defconfig | 1 + configs/soquartz-model-a-rk3566_defconfig | 1 + drivers/power/pmic/Kconfig | 1 + 5 files changed, 5 insertions(+)configs/quartz64-a-rk3566_defconfig +1
-0@@ -52,6 +52,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=yconfigs/quartz64-b-rk3566_defconfig +1
-0@@ -50,6 +50,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=yconfigs/rock-3a-rk3568_defconfig +1
-0@@ -49,6 +49,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=yconfigs/soquartz-model-a-rk3566_defconfig +1
-0@@ -43,6 +43,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=ydrivers/power/pmic/Kconfig +1
-0@@ -233,6 +233,7 @@ config PMIC_QCOM config PMIC_RK8XX bool "Enable support for Rockchip PMIC RK8XX" + select SYSRESET_CMD_POWEROFF if SYSRESET && CMD_POWEROFF ---help--- The Rockchip RK808 PMIC provides four buck DC-DC convertors, 8 LDOs, an RTC and two low Rds (resistance (drain to source)) switches. It is
Hi Kever,
Quoted 9 lines · Kever Yang
Hi Jonas,
Quoted 3 lines · Jonas Karlman
With
PMIC_RK8XX, SYSRESET andCMD_POWEROFFoptions enabled it is possible to power down a board using the poweroff command and turn the board back on using a power button.I'm confuse about the use case, when will people need to do this(other than just test)?
Yes this is mostly for testing and possible automation/CI purposes. Similar to why we include other commands such as gpio, regulator etc.
Main reason is that I use ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON on my Pine64 PineTab2 RK3566 tablet, and it simplified testing of the "power: pmic: rk8xx: Fix power-on source check in SPL" series.
I could just poweroff from u-boot cmdline instead of pushing power button for 5-10 seconds or boot into linux to issue a power off command to validate the functionality.
Until PineTab2 has a mainline linux device tree that can be imported to U-Boot, I settled for enabling poweroff command on my other RK356x devices that has a power button wired to PMIC pwron.
Regards,
Jonas
Quoted 17 lines
Usually people do the power on/off or reboot/reset both by software only or by hardware only,
but very little chance need to do these ops by both software and hardware.
What's more, we usually enable the power off cmd in kernel, not in bootloader.
Thanks,
- KeverQuoted 6 lines
Enable the poweroff command on RK356x boards that have a button wired to PMIC pwron. Also update to use PMIC poweroff when
PMIC_RK8XXis enabled to avoid also having to enable theSYSRESET_CMD_POWEROFFoption.Signed-off-by Jonas Karlman <[email protected]>
[...]
Hi Jonas,
Please split this patch into two patch, one for update defconfig and one for update pmic Kconfig.
Thanks,
- Kever
Quoted 77 lines · Jonas Karlman
With
PMIC_RK8XX, SYSRESET andCMD_POWEROFFoptions enabled it is possible to power down a board using the poweroff command and turn the board back on using a power button.Enable the poweroff command on RK356x boards that have a button wired to PMIC pwron. Also update to use PMIC poweroff when
PMIC_RK8XXis enabled to avoid also having to enable theSYSRESET_CMD_POWEROFFoption.Signed-off-by Jonas Karlman <[email protected]>--- configs/quartz64-a-rk3566_defconfig | 1 + configs/quartz64-b-rk3566_defconfig | 1 + configs/rock-3a-rk3568_defconfig | 1 + configs/soquartz-model-a-rk3566_defconfig | 1 + drivers/power/pmic/Kconfig | 1 + 5 files changed, 5 insertions(+)configs/quartz64-a-rk3566_defconfig +1
-0@@ -52,6 +52,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=yconfigs/quartz64-b-rk3566_defconfig +1
-0@@ -50,6 +50,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=yconfigs/rock-3a-rk3568_defconfig +1
-0@@ -49,6 +49,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=yconfigs/soquartz-model-a-rk3566_defconfig +1
-0@@ -43,6 +43,7 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y +CONFIG_CMD_POWEROFF=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_PMIC=ydrivers/power/pmic/Kconfig +1
-0@@ -233,6 +233,7 @@ config PMIC_QCOM config PMIC_RK8XX bool "Enable support for Rockchip PMIC RK8XX" + select SYSRESET_CMD_POWEROFF if SYSRESET && CMD_POWEROFF ---help--- The Rockchip RK808 PMIC provides four buck DC-DC convertors, 8 LDOs, an RTC and two low Rds (resistance (drain to source)) switches. It is