summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-11-13 08:21:07 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-11-13 08:21:07 +0100
commitdf605b19fdeab6333c0bf2e49953dfa3ae28e002 (patch)
treedbfe964e515fa5efc5e98764510015c881446258 /common
parent5f5decec00df364859fd375dde8c0e2c148447d1 (diff)
parent1bf16188c5922854f384317b7585bc8cd91593b5 (diff)
downloadbarebox-df605b19fdeab6333c0bf2e49953dfa3ae28e002.tar.gz
barebox-df605b19fdeab6333c0bf2e49953dfa3ae28e002.tar.xz
Merge branch 'for-next/efi'
Diffstat (limited to 'common')
-rw-r--r--common/efi-guid.c1
-rw-r--r--common/efi/efi.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/common/efi-guid.c b/common/efi-guid.c
index 71aa21ddda..1e45ccf4d2 100644
--- a/common/efi-guid.c
+++ b/common/efi-guid.c
@@ -35,6 +35,7 @@ const char *efi_guid_string(efi_guid_t *g)
EFI_GUID_STRING(EFI_UGA_PROTOCOL_GUID, "UGA Draw Protocol", "EFI 1.1 UGA Draw Protocol");
EFI_GUID_STRING(EFI_UGA_IO_PROTOCOL_GUID, "UGA Protocol", "EFI 1.1 UGA Protocol");
EFI_GUID_STRING(EFI_PCI_IO_PROTOCOL_GUID, "PCI IO Protocol", "EFI 1.1 PCI IO Protocol");
+ EFI_GUID_STRING(EFI_USB_IO_PROTOCOL_GUID, "USB IO Protocol", "EFI 1.0 USB IO Protocol");
EFI_GUID_STRING(EFI_FILE_INFO_GUID, "File Info", "EFI File Infom");
EFI_GUID_STRING(EFI_SIMPLE_FILE_SYSTEM_GUID, "Filesystem", "EFI 1.0 Simple FileSystem");
EFI_GUID_STRING(EFI_DEVICE_TREE_GUID, "Device Tree", "EFI Device Tree GUID");
diff --git a/common/efi/efi.c b/common/efi/efi.c
index 4b42f5d676..561ce4c081 100644
--- a/common/efi/efi.c
+++ b/common/efi/efi.c
@@ -25,6 +25,7 @@
#include <magicvar.h>
#include <init.h>
#include <restart.h>
+#include <poweroff.h>
#include <driver.h>
#include <platform_data/serial-ns16550.h>
#include <io.h>
@@ -283,9 +284,18 @@ static void __noreturn efi_restart_system(struct restart_handler *rst)
hang();
}
+static void __noreturn efi_poweroff_system(struct poweroff_handler *handler)
+{
+ shutdown_barebox();
+ RT->reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
+
+ hang();
+}
+
static int restart_register_feature(void)
{
restart_handler_register_fn(efi_restart_system);
+ poweroff_handler_register_fn(efi_poweroff_system);
return 0;
}