summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-09-21 14:25:37 -0400
committerTom Rini <trini@konsulko.com>2020-09-21 14:25:37 -0400
commit751b18b8a1b576aecf51faf22c2bb9e7ce70debd (patch)
tree9339296afd74657deb93955cf5b187f9194d7b5d /cmd
parent3bacb5ee76eadc97c0606e1b408604d20db9a97d (diff)
parentba2a0cbb053951ed6d36161989d38da724696b4d (diff)
Merge branch 'master' into next
Merge in v2020.10-rc5
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig12
-rw-r--r--cmd/acpi.c2
-rw-r--r--cmd/mem.c21
-rw-r--r--cmd/nvedit.c9
4 files changed, 36 insertions, 8 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 0761dbb746..0c984d735d 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -777,6 +777,18 @@ config SYS_ALT_MEMTEST
help
Use a more complete alternative memory test.
+if SYS_ALT_MEMTEST
+
+config SYS_ALT_MEMTEST_BITFLIP
+ bool "Bitflip test"
+ default y
+ help
+ The alternative memory test includes bitflip test since 2020.07.
+ The bitflip test significantly increases the overall test time.
+ Bitflip test can optionally be disabled here.
+
+endif
+
config SYS_MEMTEST_START
hex "default start address for mtest"
default 0
diff --git a/cmd/acpi.c b/cmd/acpi.c
index 085a3a650d..a3419b42b5 100644
--- a/cmd/acpi.c
+++ b/cmd/acpi.c
@@ -26,7 +26,7 @@ static void dump_hdr(struct acpi_table_header *hdr)
printf("%.*s %08lx %06x", ACPI_NAME_LEN, hdr->signature,
(ulong)map_to_sysmem(hdr), hdr->length);
if (has_hdr) {
- printf(" (v%02d %.6s %.8s %u %.4s %d)\n", hdr->revision,
+ printf(" (v%02d %.6s %.8s %x %.4s %x)\n", hdr->revision,
hdr->oem_id, hdr->oem_table_id, hdr->oem_revision,
hdr->aslc_id, hdr->aslc_revision);
} else {
diff --git a/cmd/mem.c b/cmd/mem.c
index 9df5eb068a..56e1d0755b 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -985,6 +985,18 @@ static ulong test_bitflip_comparison(volatile unsigned long *bufa,
return errs;
}
+static ulong mem_test_bitflip(vu_long *buf, ulong start, ulong end)
+{
+ /*
+ * Split the specified range into two halves.
+ * Note that mtest range is inclusive of start,end.
+ * Bitflip test instead uses a count (of 32-bit words).
+ */
+ ulong half_size = (end - start + 1) / 2 / sizeof(unsigned long);
+
+ return test_bitflip_comparison(buf, buf + half_size, half_size);
+}
+
static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
vu_long pattern, int iteration)
{
@@ -1104,11 +1116,10 @@ static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,
errs = mem_test_alt(buf, start, end, dummy);
if (errs == -1UL)
break;
- count += errs;
- errs = test_bitflip_comparison(buf,
- buf + (end - start) / 2,
- (end - start) /
- sizeof(unsigned long));
+ if (IS_ENABLED(CONFIG_SYS_ALT_MEMTEST_BITFLIP)) {
+ count += errs;
+ errs = mem_test_bitflip(buf, start, end);
+ }
} else {
errs = mem_test_quick(buf, start, end, pattern,
iteration);
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index d188c6aa6b..7fce723800 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -1171,6 +1171,11 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag,
uint32_t crc;
env_t *ep = (env_t *)ptr;
+ if (size <= offsetof(env_t, data)) {
+ printf("## Error: Invalid size 0x%zX\n", size);
+ return 1;
+ }
+
size -= offsetof(env_t, data);
memcpy(&crc, &ep->crc, sizeof(crc));
@@ -1472,7 +1477,7 @@ static char env_help_text[] =
"env select [target] - select environment target\n"
#endif
#if defined(CONFIG_CMD_NVEDIT_EFI)
- "env set -e [-nv][-bs][-rt][-at][-a][-i addr,size][-v] name [arg ...]\n"
+ "env set -e [-nv][-bs][-rt][-at][-a][-i addr:size][-v] name [arg ...]\n"
" - set UEFI variable; unset if '-i' or 'arg' not specified\n"
#endif
"env set [-f] name [arg ...]\n";
@@ -1536,7 +1541,7 @@ U_BOOT_CMD_COMPLETE(
"set environment variables",
#if defined(CONFIG_CMD_NVEDIT_EFI)
"-e [-guid guid][-nv][-bs][-rt][-at][-a][-v]\n"
- " [-i addr,size name], or [name [value ...]]\n"
+ " [-i addr:size name], or [name [value ...]]\n"
" - set UEFI variable 'name' to 'value' ...'\n"
" \"-guid\": GUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n"
" \"-nv\": set non-volatile attribute\n"