diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 2 | ||||
-rw-r--r-- | cmd/bootefi.c | 12 | ||||
-rw-r--r-- | cmd/efi.c | 26 | ||||
-rw-r--r-- | cmd/mem.c | 4 | ||||
-rw-r--r-- | cmd/usb_mass_storage.c | 2 | ||||
-rw-r--r-- | cmd/x86/mtrr.c | 3 |
6 files changed, 35 insertions, 14 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 30c26b5d2b..0761dbb746 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -860,7 +860,7 @@ config CMD_ARMFLASH config CMD_ADC bool "adc - Access Analog to Digital Converters info and data" select ADC - select DM_REGULATOR + depends on DM_REGULATOR help Shows ADC device info and permit printing one-shot analog converted data from a named Analog to Digital Converter. diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 06563d28ca..40d5ef2b3a 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -433,7 +433,9 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) { efi_handle_t mem_handle = NULL, handle; struct efi_device_path *file_path = NULL; + struct efi_device_path *msg_path; efi_status_t ret; + u16 *load_options; if (!bootefi_device_path || !bootefi_image_path) { /* @@ -456,17 +458,21 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) file_path); if (ret != EFI_SUCCESS) goto out; + msg_path = file_path; } else { file_path = efi_dp_append(bootefi_device_path, bootefi_image_path); + msg_path = bootefi_image_path; } + log_info("Booting %pD\n", msg_path); + ret = EFI_CALL(efi_load_image(false, efi_root, file_path, source_buffer, source_size, &handle)); - if (ret != EFI_SUCCESS) + if (ret != EFI_SUCCESS) { + log_err("Loading image failed\n"); goto out; - - u16 *load_options; + } /* Transfer environment variable as load options */ ret = efi_env_set_load_options(handle, "bootargs", &load_options); @@ -71,7 +71,19 @@ static int h_cmp_entry(const void *v1, const void *v2) return diff < 0 ? -1 : diff > 0 ? 1 : 0; } -void *efi_build_mem_table(struct efi_entry_memmap *map, int size, bool skip_bs) +/** + * efi_build_mem_table() - make a sorted copy of the memory table + * + * @map: Pointer to EFI memory map table + * @size: Size of table in bytes + * @skip_bs: True to skip boot-time memory and merge it with conventional + * memory. This will significantly reduce the number of table + * entries. + * Return: pointer to the new table. It should be freed with free() by the + * caller. + */ +static void *efi_build_mem_table(struct efi_entry_memmap *map, int size, + bool skip_bs) { struct efi_mem_desc *desc, *end, *base, *dest, *prev; int count; @@ -92,7 +104,13 @@ void *efi_build_mem_table(struct efi_entry_memmap *map, int size, bool skip_bs) end = (struct efi_mem_desc *)((ulong)base + count * map->desc_size); for (desc = base; desc < end; desc = efi_get_next_mem_desc(map, desc)) { bool merge = true; - int type = desc->type; + u32 type = desc->type; + + if (type >= EFI_MAX_MEMORY_TYPE) { + printf("Memory map contains invalid entry type %u\n", + type); + continue; + } if (skip_bs && is_boot_services(desc->type)) type = EFI_CONVENTIONAL_MEMORY; @@ -119,7 +137,7 @@ void *efi_build_mem_table(struct efi_entry_memmap *map, int size, bool skip_bs) } /* Mark the end */ - dest->type = EFI_TABLE_END; + dest->type = EFI_MAX_MEMORY_TYPE; return base; } @@ -138,7 +156,7 @@ static void efi_print_mem_table(struct efi_entry_memmap *map, /* Keep track of all the different attributes we have seen */ attr_seen_count = 0; addr = 0; - for (upto = 0; desc->type != EFI_TABLE_END; + for (upto = 0; desc->type != EFI_MAX_MEMORY_TYPE; upto++, desc = efi_get_next_mem_desc(map, desc)) { const char *name; u64 size; @@ -30,10 +30,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifndef CONFIG_SYS_MEMTEST_SCRATCH -#define CONFIG_SYS_MEMTEST_SCRATCH 0 -#endif - /* Create a compile-time value */ #ifdef MEM_SUPPORT_64BIT_DATA #define SUPPORT_64BIT_DATA 1 diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c index d565635c6c..cf2f55994e 100644 --- a/cmd/usb_mass_storage.c +++ b/cmd/usb_mass_storage.c @@ -170,7 +170,7 @@ static int do_usb_mass_storage(struct cmd_tbl *cmdtp, int flag, goto cleanup_ums_init; } - rc = fsg_init(ums, ums_count); + rc = fsg_init(ums, ums_count, controller_index); if (rc) { pr_err("fsg_init failed\n"); rc = CMD_RET_FAILURE; diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c index e118bba5a2..99efecb9d8 100644 --- a/cmd/x86/mtrr.c +++ b/cmd/x86/mtrr.c @@ -121,7 +121,8 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc, if (argc < 1 || !cmd) { cmd = 'l'; reg = 0; - } else { + } + if (cmd != 'l') { if (argc < 2) return CMD_RET_USAGE; reg = simple_strtoul(argv[1], NULL, 16); |