summaryrefslogtreecommitdiff
path: root/lib/efi_selftest
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-31 23:56:02 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-06-01 05:53:13 +0300
commit5ec48e38eefa5fbc2cab0c34b2b48df67c0fa23e (patch)
treea61bf0860c0ab52f36892c9a3ebc2bc36905e0be /lib/efi_selftest
parent38b9a79c6366a0e4c98b0a6f33f268fc0d3ba4ce (diff)
downloadu-boot-5ec48e38eefa5fbc2cab0c34b2b48df67c0fa23e.tar.xz
efi_loader: Kconfig entries for GetTime(), SetTime()
The GetTime() and the SetTime() runtime services are not obligatory. So let's make them customizable. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_selftest')
-rw-r--r--lib/efi_selftest/Makefile2
-rw-r--r--lib/efi_selftest/efi_selftest_rtc.c17
2 files changed, 7 insertions, 12 deletions
diff --git a/lib/efi_selftest/Makefile b/lib/efi_selftest/Makefile
index cfbb40c891..b032154147 100644
--- a/lib/efi_selftest/Makefile
+++ b/lib/efi_selftest/Makefile
@@ -27,7 +27,6 @@ efi_selftest_loaded_image.o \
efi_selftest_manageprotocols.o \
efi_selftest_memory.o \
efi_selftest_register_notify.o \
-efi_selftest_rtc.o \
efi_selftest_snp.o \
efi_selftest_textinput.o \
efi_selftest_textinputex.o \
@@ -43,6 +42,7 @@ efi_selftest_unicode_collation.o
obj-$(CONFIG_CPU_V7) += efi_selftest_unaligned.o
obj-$(CONFIG_EFI_LOADER_HII) += efi_selftest_hii.o
+obj-$(CONFIG_EFI_GET_TIME) += efi_selftest_rtc.o
ifeq ($(CONFIG_GENERATE_ACPI_TABLE),)
obj-y += efi_selftest_fdt.o
diff --git a/lib/efi_selftest/efi_selftest_rtc.c b/lib/efi_selftest/efi_selftest_rtc.c
index 9eb29add3b..6f7035dee6 100644
--- a/lib/efi_selftest/efi_selftest_rtc.c
+++ b/lib/efi_selftest/efi_selftest_rtc.c
@@ -40,7 +40,9 @@ static int setup(const efi_handle_t handle,
static int execute(void)
{
efi_status_t ret;
- struct efi_time tm, tm_old, tm_new = {
+ struct efi_time tm_old;
+#ifdef CONFIG_EFI_SET_TIME
+ struct efi_time tm, tm_new = {
.year = 2017,
.month = 5,
.day = 19,
@@ -48,31 +50,23 @@ static int execute(void)
.minute = 47,
.second = 53,
};
+#endif
/* Display current time */
ret = runtime->get_time(&tm_old, NULL);
if (ret != EFI_SUCCESS) {
-#ifdef CONFIG_CMD_DATE
efi_st_error(EFI_ST_NO_RTC);
return EFI_ST_FAILURE;
-#else
- efi_st_todo(EFI_ST_NO_RTC);
- return EFI_ST_SUCCESS;
-#endif
}
efi_st_printf("Time according to real time clock: "
"%.4u-%.2u-%.2u %.2u:%.2u:%.2u\n",
tm_old.year, tm_old.month, tm_old.day,
tm_old.hour, tm_old.minute, tm_old.second);
+#ifdef CONFIG_EFI_SET_TIME
ret = runtime->set_time(&tm_new);
if (ret != EFI_SUCCESS) {
-#ifdef CONFIG_CMD_DATE
efi_st_error(EFI_ST_NO_RTC_SET);
return EFI_ST_FAILURE;
-#else
- efi_st_todo(EFI_ST_NO_RTC_SET);
- return EFI_ST_SUCCESS;
-#endif
}
ret = runtime->get_time(&tm, NULL);
if (ret != EFI_SUCCESS) {
@@ -95,6 +89,7 @@ static int execute(void)
efi_st_error(EFI_ST_NO_RTC_SET);
return EFI_ST_FAILURE;
}
+#endif
return EFI_ST_SUCCESS;
}