summaryrefslogtreecommitdiff
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-11-17 16:46:45 (GMT)
committerTom Rini <trini@konsulko.com>2016-11-17 16:46:45 (GMT)
commit9e40ea04e9f1a70a184504c9e2beb051eb2d9335 (patch)
treedddf5ab6a2ce464955233c7ae542ec102bb12050 /cmd/bootefi.c
parent688d1be5ba63be281c2894e74b27209133598e2e (diff)
parentb99ebaf9f01ebe864061818e00beb70cb1ddc635 (diff)
downloadu-boot-9e40ea04e9f1a70a184504c9e2beb051eb2d9335.tar.xz
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Patch queue for efi - 2016-11-17 Highlights this time around: - x86 efi_loader support - hello world efi test case - network device name is now representative - terminal output reports modes correctly - fix psci reset for ls1043/ls1046 - fix efi_add_runtime_mmio definition for x86 - efi_loader support for ls2080
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index c8079c4..ca41170 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -226,6 +226,17 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
return status == EFI_SUCCESS ? 0 : -EINVAL;
}
+#ifdef CONFIG_ARM64
+ /* On AArch64 we need to make sure we call our payload in < EL3 */
+ if (current_el() == 3) {
+ smp_kick_all_cpus();
+ dcache_disable(); /* flush cache before switch to EL2 */
+ armv8_switch_to_el2();
+ /* Enable caches again */
+ dcache_enable();
+ }
+#endif
+
return entry(&loaded_image_info, &systab);
}
@@ -239,16 +250,26 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc < 2)
return CMD_RET_USAGE;
- saddr = argv[1];
+#ifdef CONFIG_CMD_BOOTEFI_HELLO
+ if (!strcmp(argv[1], "hello")) {
+ ulong size = __efi_hello_world_end - __efi_hello_world_begin;
- addr = simple_strtoul(saddr, NULL, 16);
+ addr = CONFIG_SYS_LOAD_ADDR;
+ memcpy((char *)addr, __efi_hello_world_begin, size);
+ } else
+#endif
+ {
+ saddr = argv[1];
+
+ addr = simple_strtoul(saddr, NULL, 16);
- if (argc > 2) {
- sfdt = argv[2];
- fdt_addr = simple_strtoul(sfdt, NULL, 16);
+ if (argc > 2) {
+ sfdt = argv[2];
+ fdt_addr = simple_strtoul(sfdt, NULL, 16);
+ }
}
- printf("## Starting EFI application at 0x%08lx ...\n", addr);
+ printf("## Starting EFI application at %08lx ...\n", addr);
r = do_bootefi_exec((void *)addr, (void*)fdt_addr);
printf("## Application terminated, r = %d\n", r);
@@ -263,7 +284,12 @@ static char bootefi_help_text[] =
"<image address> [fdt address]\n"
" - boot EFI payload stored at address <image address>.\n"
" If specified, the device tree located at <fdt address> gets\n"
- " exposed as EFI configuration table.\n";
+ " exposed as EFI configuration table.\n"
+#ifdef CONFIG_CMD_BOOTEFI_HELLO
+ "hello\n"
+ " - boot a sample Hello World application stored within U-Boot"
+#endif
+ ;
#endif
U_BOOT_CMD(