u-boot/doc/usage/cmd/mtest.rst
Tom Rini 11da3403e9 doc: usage: Add general rule for $?
For nearly all commands in U-Boot the '?' variable is handled the same
way with 0 meaning success, 1 meaning any failure.  Explain this in the
general rules section of the cmdline documentation (with a link to a
counter example) and then remove the redundant wording from most
commands. We retain a section about the return value in a number of
places where we are doing something such as always returning a specific
value or we have useful additional information to go along with the
normal return codes.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-10-26 09:03:35 -06:00

65 lines
1.7 KiB
ReStructuredText

.. SPDX-License-Identifier: GPL-2.0+
.. Copyright 2022, Heinrich Schuchardt <xypron.glpk@gmx.de>
.. index::
single: mtest (command)
mtest command
=============
Synopsis
--------
::
mtest [start [end [pattern [iterations]]]]
Description
-----------
The *mtest* command tests the random access memory. It writes long values, reads
them back and checks for differences. The test can be interrupted with CTRL+C.
The default test uses *pattern* as first value to be written and varies it
between memory addresses.
An alternative test can be selected with CONFIG_SYS_ALT_MEMTEST=y. It uses
multiple hard coded bit patterns.
With CONFIGSYS_ALT_MEMTEST_BITFLIP=y a further test is executed. It writes long
values offset by half the size of long and checks if writing to the one address
causes bit flips at the other address.
start
start address of the memory range tested, defaults to
CONFIG_SYS_MEMTEST_START
end
end address of the memory range tested, defaults to
CONFIG_SYS_MEMTEST_END. If CONFIGSYS_ALT_MEMTEST_BITFLIP=y, a value will
be written to this address. Otherwise it is excluded from the range.
pattern
pattern to be written to memory. This is a 64bit value on 64bit systems
and a 32bit value on 32bit systems. It defaults to 0. The value is
ignored if CONFIG_SYS_ALT_MEMTEST=y.
iterations
number of test repetitions. If the value is not provided the test will
not terminate automatically. Enter CTRL+C instead.
Examples
--------
::
=> mtest 1000 2000 0x55aa55aa55aa55aa 10
Testing 00001000 ... 00002000:
Pattern AA55AA55AA55AA55 Writing... Reading...
Tested 16 iteration(s) with 0 errors.
Configuration
-------------
The mtest command is enabled by CONFIG_CMD_MEMTEST=y.