blob: e01f2a6d575e5f46f9e14cf196d928532667015a [file] [log] [blame]
Heinrich Schuchardtb8d75762023-01-26 19:40:35 +01001.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright 2022, Heinrich Schuchardt <xypron.glpk@gmx.de>
3
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01004.. index::
5 single: mtest (command)
6
Heinrich Schuchardtb8d75762023-01-26 19:40:35 +01007mtest command
8=============
9
10Synopsis
11--------
12
13::
14
15 mtest [start [end [pattern [iterations]]]]
16
17Description
18-----------
19
20The *mtest* command tests the random access memory. It writes long values, reads
21them back and checks for differences. The test can be interrupted with CTRL+C.
22
23The default test uses *pattern* as first value to be written and varies it
24between memory addresses.
25
26An alternative test can be selected with CONFIG_SYS_ALT_MEMTEST=y. It uses
27multiple hard coded bit patterns.
28
29With CONFIGSYS_ALT_MEMTEST_BITFLIP=y a further test is executed. It writes long
30values offset by half the size of long and checks if writing to the one address
31causes bit flips at the other address.
32
33start
34 start address of the memory range tested, defaults to
35 CONFIG_SYS_MEMTEST_START
36
37end
38 end address of the memory range tested, defaults to
39 CONFIG_SYS_MEMTEST_END. If CONFIGSYS_ALT_MEMTEST_BITFLIP=y, a value will
40 be written to this address. Otherwise it is excluded from the range.
41
42pattern
43 pattern to be written to memory. This is a 64bit value on 64bit systems
44 and a 32bit value on 32bit systems. It defaults to 0. The value is
45 ignored if CONFIG_SYS_ALT_MEMTEST=y.
46
47iterations
48 number of test repetitions. If the value is not provided the test will
49 not terminate automatically. Enter CTRL+C instead.
50
51Examples
52--------
53
54::
55
56 => mtest 1000 2000 0x55aa55aa55aa55aa 10
57 Testing 00001000 ... 00002000:
58 Pattern AA55AA55AA55AA55 Writing... Reading...
59 Tested 16 iteration(s) with 0 errors.
60
61Configuration
62-------------
63
64The mtest command is enabled by CONFIG_CMD_MEMTEST=y.
65
66Return value
67------------
68
69The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.