Skip to contentSkip to conversation

rockchip: rk356x: Enable poweroff command

PATCH In review Jonas Karlman 2 participants 5 messages Aug 17, 2023

lore
Share & tools
lore
#0 lore raw

v2 cover rockchip: rk356x: Enable poweroff command

This series enable CMD_POWEROFF on a few RK356x boards that have a power button wired to PMIC pwron.

The poweroff command is useful for testing and make it possible to poweroff the device from U-Boot and have it turn back on when the power button is pressed.

First patch ensure sysreset poweroff implementation is used. Second patch enable poweroff cmd on a few RK356x boards.

Changes in v2:
- Split patch
- Collect r-b tag

Jonas Karlman (2):
power: pmic: rk8xx: Use sysreset implementation of the poweroff
command
rockchip: rk356x: Enable poweroff command

 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(+)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/2 power: pmic: rk8xx: Use sysreset implementation of the poweroff command

Select SYSRESET_CMD_POWEROFF to use the sysreset implementation of the poweroff command when PMIC_RK8XX is enabled.

---
v2:
- Split patch
- Collect r-b tag

 drivers/power/pmic/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/power/pmic/Kconfig +1 -0
index 176fb07c651a..4a6f0ce093ad 100644
@@ -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
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] power: pmic: rk8xx: Use sysreset implementation of the poweroff command

Quoted 5 lines · Jonas Karlman

Select SYSRESET_CMD_POWEROFF to use the sysreset implementation of the poweroff command when PMIC_RK8XX is enabled.

Thanks,
- Kever

Quoted 20 lines

---
v2:
- Split patch
- Collect r-b tag

  drivers/power/pmic/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/power/pmic/Kconfig +1 -0
index 176fb07c651a..4a6f0ce093ad 100644
@@ -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
#3 lore raw

PATCH v2 2/2 rockchip: rk356x: Enable poweroff command

In reply to Jonas Karlman

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.

---
v2:
- Split patch
- Collect r-b tag

 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 +
 4 files changed, 4 insertions(+)
configs/quartz64-a-rk3566_defconfig +1 -0
index d55b224feacd..6853cd6c44b4 100644
@@ -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
index b98c81f9dcef..aa29fff14643 100644
@@ -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
index 44ff054df665..409aa95acf06 100644
@@ -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
index c3958579db73..a0884a797d58 100644
@@ -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
Signature · 1 line
2.41.0
Reviewed-by on v2 2/2
#4 lore raw
Quoted 9 lines · Jonas Karlman

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.

Thanks,
- Kever

Quoted 59 lines

---
v2:
- Split patch
- Collect r-b tag

  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 +
  4 files changed, 4 insertions(+)
configs/quartz64-a-rk3566_defconfig +1 -0
index d55b224feacd..6853cd6c44b4 100644
@@ -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
index b98c81f9dcef..aa29fff14643 100644
@@ -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
index 44ff054df665..409aa95acf06 100644
@@ -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
index c3958579db73..a0884a797d58 100644
@@ -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