summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2016-11-29 16:28:28 +0100
committerStefano Babic <sbabic@denx.de>2016-11-29 16:28:28 +0100
commit2d221489df021393654805536be7effcb9d39702 (patch)
tree1b636f10b4ccde42624ec665df13288408b59b7f /cmd
parent45a3ad81fafe3090f7f89b458f6bd9f547a453df (diff)
parente94793c844a40606252f2e3f6428063e057b3fd2 (diff)
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig22
-rw-r--r--cmd/bootefi.c57
-rw-r--r--cmd/fastboot/Kconfig17
-rw-r--r--cmd/regulator.c5
-rw-r--r--cmd/sata.c9
5 files changed, 94 insertions, 16 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index e339d8638a..b16c6032aa 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -181,6 +181,28 @@ config CMD_BOOTEFI
help
Boot an EFI image from memory.
+config CMD_BOOTEFI_HELLO_COMPILE
+ bool "Compile a standard EFI hello world binary for testing"
+ depends on CMD_BOOTEFI && (ARM || X86)
+ default y
+ help
+ This compiles a standard EFI hello world application with U-Boot so
+ that it can be used with the test/py testing framework. This is useful
+ for testing that EFI is working at a basic level, and for bringing
+ up EFI support on a new architecture.
+
+ No additional space will be required in the resulting U-Boot binary
+ when this option is enabled.
+
+config CMD_BOOTEFI_HELLO
+ bool "Allow booting a standard EFI hello world for testing"
+ depends on CMD_BOOTEFI_HELLO_COMPILE
+ help
+ This adds a standard EFI hello world application to U-Boot so that
+ it can be used with the 'bootefi hello' command. This is useful
+ for testing that EFI is working at a basic level, and for bringing
+ up EFI support on a new architecture.
+
config CMD_ELF
bool "bootelf, bootvx"
default y
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index c8079c4fe8..97a0fc9c7c 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -141,6 +141,18 @@ static void *copy_fdt(void *fdt)
return new_fdt;
}
+#ifdef CONFIG_ARM64
+static unsigned long efi_run_in_el2(ulong (*entry)(void *image_handle,
+ struct efi_system_table *st), void *image_handle,
+ struct efi_system_table *st)
+{
+ /* Enable caches again */
+ dcache_enable();
+
+ return entry(image_handle, st);
+}
+#endif
+
/*
* Load an EFI payload into a newly allocated piece of memory, register all
* EFI objects it would want to access and jump to it.
@@ -226,6 +238,22 @@ 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 */
+
+ /* Move into EL2 and keep running there */
+ armv8_switch_to_el2((ulong)entry, (ulong)&loaded_image_info,
+ (ulong)&systab, (ulong)efi_run_in_el2,
+ ES_TO_AARCH64);
+
+ /* Should never reach here, efi exits with longjmp */
+ while (1) { }
+ }
+#endif
+
return entry(&loaded_image_info, &systab);
}
@@ -239,16 +267,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 = CONFIG_SYS_LOAD_ADDR;
+ memcpy((char *)addr, __efi_hello_world_begin, size);
+ } else
+#endif
+ {
+ saddr = argv[1];
- addr = simple_strtoul(saddr, NULL, 16);
+ 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 +301,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(
diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
index 5d2facc298..89b9e73440 100644
--- a/cmd/fastboot/Kconfig
+++ b/cmd/fastboot/Kconfig
@@ -1,10 +1,9 @@
comment "FASTBOOT"
-config FASTBOOT
- bool ""
+menuconfig FASTBOOT
+ bool "Fastboot support"
-menu "Fastboot support"
- depends on FASTBOOT
+if FASTBOOT
config USB_FUNCTION_FASTBOOT
bool "Enable USB fastboot gadget"
@@ -41,6 +40,14 @@ config FASTBOOT_BUF_SIZE
downloads. This buffer should be as large as possible for a
platform. Define this to the size available RAM for fastboot.
+config FASTBOOT_USB_DEV
+ int "USB controller number"
+ default 0
+ help
+ Some boards have USB OTG controller other than 0. Define this
+ option so it can be used in compiled environment (e.g. in
+ CONFIG_BOOTCOMMAND).
+
config FASTBOOT_FLASH
bool "Enable FASTBOOT FLASH command"
help
@@ -81,4 +88,4 @@ config FASTBOOT_MBR_NAME
endif # USB_FUNCTION_FASTBOOT
-endmenu
+endif # FASTBOOT
diff --git a/cmd/regulator.c b/cmd/regulator.c
index bfea6e04b6..2ef5bc9a82 100644
--- a/cmd/regulator.c
+++ b/cmd/regulator.c
@@ -292,7 +292,10 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
- ret = regulator_set_value(dev, value);
+ if (!force)
+ ret = regulator_set_value(dev, value);
+ else
+ ret = regulator_set_value_force(dev, value);
if (ret) {
printf("Regulator: %s - can't set the Voltage!\n",
uc_pdata->name);
diff --git a/cmd/sata.c b/cmd/sata.c
index d18b5233e6..f56622acc2 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -32,9 +32,12 @@ static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
/* If the user has not yet run `sata init`, do it now */
- if (sata_curr_device == -1)
- if (sata_initialize())
- return 1;
+ if (sata_curr_device == -1) {
+ rc = sata_initialize();
+ if (rc == -1)
+ return rc;
+ sata_curr_device = rc;
+ }
switch (argc) {
case 0: