mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/1] EFI: add poweroff support
@ 2017-10-26  9:59 Jean-Christophe PLAGNIOL-VILLARD
  2017-10-26 10:03 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2017-10-26  9:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/x86/configs/efi_defconfig | 1 +
 common/efi/efi.c               | 7 +++++++
 drivers/efi/Kconfig            | 1 +
 3 files changed, 9 insertions(+)

diff --git a/arch/x86/configs/efi_defconfig b/arch/x86/configs/efi_defconfig
index 0d9a44a4d..5f11c6c4e 100644
--- a/arch/x86/configs/efi_defconfig
+++ b/arch/x86/configs/efi_defconfig
@@ -55,6 +55,7 @@ CONFIG_CMD_CRC_CMP=y
 CONFIG_CMD_MM=y
 CONFIG_CMD_DETECT=y
 CONFIG_CMD_FLASH=y
+CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_2048=y
 CONFIG_CMD_BAREBOX_UPDATE=y
 CONFIG_CMD_OF_NODE=y
diff --git a/common/efi/efi.c b/common/efi/efi.c
index cd4f5f029..96601cfce 100644
--- a/common/efi/efi.c
+++ b/common/efi/efi.c
@@ -289,6 +289,13 @@ static int restart_register_feature(void)
 }
 coredevice_initcall(restart_register_feature);
 
+void __noreturn poweroff(void)
+{
+	RT->reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
+
+	hang();
+}
+
 extern char image_base[];
 extern initcall_t __barebox_initcalls_start[], __barebox_early_initcalls_end[],
 		  __barebox_initcalls_end[];
diff --git a/drivers/efi/Kconfig b/drivers/efi/Kconfig
index 2cd9dd504..5c988d2e1 100644
--- a/drivers/efi/Kconfig
+++ b/drivers/efi/Kconfig
@@ -1,2 +1,3 @@
 config EFI_BOOTUP
 	bool
+	select HAS_POWEROFF
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] EFI: add poweroff support
  2017-10-26  9:59 [PATCH 1/1] EFI: add poweroff support Jean-Christophe PLAGNIOL-VILLARD
@ 2017-10-26 10:03 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2017-10-26 10:03 UTC (permalink / raw)
  To: barebox

wrong patch sorry

Best Regards,
J.

> On 26 Oct 2017, at 5:59 PM, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
> arch/x86/configs/efi_defconfig | 1 +
> common/efi/efi.c               | 7 +++++++
> drivers/efi/Kconfig            | 1 +
> 3 files changed, 9 insertions(+)
> 
> diff --git a/arch/x86/configs/efi_defconfig b/arch/x86/configs/efi_defconfig
> index 0d9a44a4d..5f11c6c4e 100644
> --- a/arch/x86/configs/efi_defconfig
> +++ b/arch/x86/configs/efi_defconfig
> @@ -55,6 +55,7 @@ CONFIG_CMD_CRC_CMP=y
> CONFIG_CMD_MM=y
> CONFIG_CMD_DETECT=y
> CONFIG_CMD_FLASH=y
> +CONFIG_CMD_POWEROFF=y
> CONFIG_CMD_2048=y
> CONFIG_CMD_BAREBOX_UPDATE=y
> CONFIG_CMD_OF_NODE=y
> diff --git a/common/efi/efi.c b/common/efi/efi.c
> index cd4f5f029..96601cfce 100644
> --- a/common/efi/efi.c
> +++ b/common/efi/efi.c
> @@ -289,6 +289,13 @@ static int restart_register_feature(void)
> }
> coredevice_initcall(restart_register_feature);
> 
> +void __noreturn poweroff(void)
> +{
> +	RT->reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
> +
> +	hang();
> +}
> +
> extern char image_base[];
> extern initcall_t __barebox_initcalls_start[], __barebox_early_initcalls_end[],
> 		  __barebox_initcalls_end[];
> diff --git a/drivers/efi/Kconfig b/drivers/efi/Kconfig
> index 2cd9dd504..5c988d2e1 100644
> --- a/drivers/efi/Kconfig
> +++ b/drivers/efi/Kconfig
> @@ -1,2 +1,3 @@
> config EFI_BOOTUP
> 	bool
> +	select HAS_POWEROFF
> -- 
> 2.11.0
> 


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-26 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  9:59 [PATCH 1/1] EFI: add poweroff support Jean-Christophe PLAGNIOL-VILLARD
2017-10-26 10:03 ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox