Heinrich Schuchardt | b8d7576 | 2023-01-26 19:40:35 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright 2022, Heinrich Schuchardt <xypron.glpk@gmx.de> |
| 3 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame] | 4 | .. index:: |
| 5 | single: mtest (command) |
| 6 | |
Heinrich Schuchardt | b8d7576 | 2023-01-26 19:40:35 +0100 | [diff] [blame] | 7 | mtest command |
| 8 | ============= |
| 9 | |
| 10 | Synopsis |
| 11 | -------- |
| 12 | |
| 13 | :: |
| 14 | |
| 15 | mtest [start [end [pattern [iterations]]]] |
| 16 | |
| 17 | Description |
| 18 | ----------- |
| 19 | |
| 20 | The *mtest* command tests the random access memory. It writes long values, reads |
| 21 | them back and checks for differences. The test can be interrupted with CTRL+C. |
| 22 | |
| 23 | The default test uses *pattern* as first value to be written and varies it |
| 24 | between memory addresses. |
| 25 | |
| 26 | An alternative test can be selected with CONFIG_SYS_ALT_MEMTEST=y. It uses |
| 27 | multiple hard coded bit patterns. |
| 28 | |
| 29 | With CONFIGSYS_ALT_MEMTEST_BITFLIP=y a further test is executed. It writes long |
| 30 | values offset by half the size of long and checks if writing to the one address |
| 31 | causes bit flips at the other address. |
| 32 | |
| 33 | start |
| 34 | start address of the memory range tested, defaults to |
| 35 | CONFIG_SYS_MEMTEST_START |
| 36 | |
| 37 | end |
| 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 | |
| 42 | pattern |
| 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 | |
| 47 | iterations |
| 48 | number of test repetitions. If the value is not provided the test will |
| 49 | not terminate automatically. Enter CTRL+C instead. |
| 50 | |
| 51 | Examples |
| 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 | |
| 61 | Configuration |
| 62 | ------------- |
| 63 | |
| 64 | The mtest command is enabled by CONFIG_CMD_MEMTEST=y. |
| 65 | |
| 66 | Return value |
| 67 | ------------ |
| 68 | |
| 69 | The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise. |