Skip to contentSkip to conversation

cmd_boot: Add a poweroff command

PATCH RESEND Superseded Hans de Goede 2 participants 3 messages Jan 13, 2016 – Jan 14, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover cmd_boot: Add a poweroff command

Hi Tom,

This patch is a prereq of the board poweroff patches I've pending for sunxi, since it is a core patch I would prefer for you to merge it directly, rather then "sneak it in" in a sunxi pull-req.

This is a resend of v2 of the patch which contains the changes you requested.

Regards,

Hans

#1 lore raw

PATCH RESEND v2 1/1 cmd_boot: Add a poweroff command

From: Michael van Slingerland <[email protected]>

Add a 'poweroff' command to boot commands, this only gets enabled if the board Kconfig does a "select CMD_POWEROFF".

[hdegoede at redhat.com: Make the cmd conditional on a CMD_POWEROFF Kconfig]

---
Changes in v2:
-Improve poweroff help text
-Remove unnecessary #ifdef from command.h

---
 common/Kconfig    | 3 +++
 common/cmd_boot.c | 8 ++++++++
 include/command.h | 1 +
 3 files changed, 12 insertions(+)
common/Kconfig +3 -0
index ccf5475..9d446bf 100644
@@ -184,6 +184,9 @@ config CMD_XIMG
 	help
 	  Extract a part of a multi-image.
 
+config CMD_POWEROFF
+	bool
+
 endmenu
 
 menu "Environment commands"
common/cmd_boot.c +8 -0
index 8f2e070..72f2cf3 100644
@@ -61,3 +61,11 @@ U_BOOT_CMD(
 	"Perform RESET of the CPU",
 	""
 );
+
+#ifdef CONFIG_CMD_POWEROFF
+U_BOOT_CMD(
+	poweroff, 1, 0,	do_poweroff,
+	"Perform POWEROFF of the device",
+	""
+);
+#endif
include/command.h +1 -0
index 2ae9b6c..0524c0b 100644
@@ -110,6 +110,7 @@ extern int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
 			   char *const argv[]);
 
 extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+extern int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 /*
  * Error codes that commands return to cmd_process(). We use the standard 0
Signature · 1 line
2.5.0
#2 lore raw

PATCH RESEND v2 1/1 cmd_boot: Add a poweroff command

Quoted 8 lines · Hans de Goede

From: Michael van Slingerland <[email protected]>

Add a 'poweroff' command to boot commands, this only gets enabled if the board Kconfig does a "select CMD_POWEROFF".

[hdegoede at redhat.com: Make the cmd conditional on a CMD_POWEROFF Kconfig]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160114/89decc1f/attachment.sig>