]> git.ipfire.org Git - thirdparty/u-boot.git/commit - cmd/Kconfig
cmd: mem: fix range of bitflip test
authorRalph Siemsen <ralph.siemsen@linaro.org>
Wed, 9 Sep 2020 16:10:00 +0000 (12:10 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 18 Sep 2020 20:19:58 +0000 (16:19 -0400)
commit9989fb18bd5b6e2afe5f296b4c414f8d1c73d527
treedbd488a96e815e5604339d6c6fa1d34ca4179d72
parente03dd8a05f5f0fc3d99289e84debe0ae99e805bb
cmd: mem: fix range of bitflip test

The bitflip test uses two equal sized memory buffers. This is achieved
by splitting the range of memory into two pieces. The address of the
second buffer, as well as the length of each buffer, were not correctly
calculated. This caused bitflip test to access beyond the end of range.
This patch fixes the pointer arithmetic problem.

A second problem arises because u-boot "mtest" command expects the
ending address to be inclusive. When computing (end - start) this
results in missing 1 byte of the requested length. The bitflip test
expects a count rather than an "ending" address. Thus it fails to test
the last word of the requested range. Fixed by using (end - start + 1).

Added Kconfig option to optionally disable the bitflip test, since it
does add significantly to the time taken for "mtest".

Fixes: 8e434cb705d463bc8cff935160e4fb4c77cb99ab ("cmd: mem: Add bitflip
memory test to alternate mtest")

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Stefan Roese <sr@denx.de>
cmd/Kconfig
cmd/mem.c