cmd_boot: Add a poweroff command
authorMichael van Slingerland <michael@deviousops.nl>
Wed, 13 Jan 2016 18:31:17 +0000 (19:31 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 14 Jan 2016 02:05:25 +0000 (21:05 -0500)
Add a 'poweroff' command to boot commands, this only gets enabled if the
board Kconfig does a "select CMD_POWEROFF".

Signed-off-by: Michael van Slingerland <michael@deviousops.nl>
[hdegoede@redhat.com: Make the cmd conditional on a CMD_POWEROFF Kconfig]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
common/Kconfig
common/cmd_boot.c
include/command.h

index ccf5475..9d446bf 100644 (file)
@@ -184,6 +184,9 @@ config CMD_XIMG
        help
          Extract a part of a multi-image.
 
+config CMD_POWEROFF
+       bool
+
 endmenu
 
 menu "Environment commands"
index 8f2e070..72f2cf3 100644 (file)
@@ -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
index 2ae9b6c..0524c0b 100644 (file)
@@ -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