From patchwork Sun Dec 20 15:41:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 559338 X-Patchwork-Delegate: hdegoede@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D24E614031C for ; Mon, 21 Dec 2015 02:42:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3C4224B737; Sun, 20 Dec 2015 16:41:59 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MY7r3z7o79A5; Sun, 20 Dec 2015 16:41:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 591EC4B741; Sun, 20 Dec 2015 16:41:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7DB224B6C6 for ; Sun, 20 Dec 2015 16:41:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zRfeCF4fg48x for ; Sun, 20 Dec 2015 16:41:50 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id 374814B699 for ; Sun, 20 Dec 2015 16:41:48 +0100 (CET) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 05A8342E5C4; Sun, 20 Dec 2015 15:41:46 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-4-24.ams2.redhat.com [10.36.4.24]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBKFfdKc022648; Sun, 20 Dec 2015 10:41:44 -0500 From: Hans de Goede To: Ian Campbell , Tom Rini Date: Sun, 20 Dec 2015 16:41:32 +0100 Message-Id: <1450626095-31948-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1450626095-31948-1-git-send-email-hdegoede@redhat.com> References: <1450626095-31948-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: u-boot@lists.denx.de, Michael van Slingerland Subject: [U-Boot] [PATCH 1/4] cmd_boot: Add a poweroff command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Michael van Slingerland 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 [hdegoede@redhat.com: Make the cmd conditional on a CMD_POWEROFF Kconfig] Signed-off-by: Hans de Goede --- common/Kconfig | 3 +++ common/cmd_boot.c | 8 ++++++++ include/command.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/common/Kconfig b/common/Kconfig index ccf5475..9d446bf 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -184,6 +184,9 @@ config CMD_XIMG help Extract a part of a multi-image. +config CMD_POWEROFF + bool + endmenu menu "Environment commands" diff --git a/common/cmd_boot.c b/common/cmd_boot.c index 8f2e070..5a8f912 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -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", + "" +); +#endif diff --git a/include/command.h b/include/command.h index 2ae9b6c..30bc327 100644 --- a/include/command.h +++ b/include/command.h @@ -110,6 +110,9 @@ 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[]); +#ifdef CONFIG_CMD_POWEROFF +extern int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +#endif /* * Error codes that commands return to cmd_process(). We use the standard 0