
Dear Dirk Eibach,
In message 1227791865-8843-1-git-send-email-eibach@gdsys.de you wrote:
We want to use mtest for production memory test. I implemented an iteration limit, so expect can parse the results.
mtest is definitely NOT a good enough memory test for any production tests. You should rather use the much stronger POST memory tests (see post/drivers/memory.c).
The iteration limit is passed to mtest as a fourth parameter: [start [end [pattern [iterations]]]] If no fourth parameter is supplied, there is no iteration limit and the test will loop forever.
If you want to add this feature, then please do so for both configuratione (with and without CONFIG_SYS_ALT_MEMTEST selected).
#if defined(CONFIG_SYS_ALT_MEMTEST)
- if (argc > 4) {
iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
- } else {
iteration_limit = 0;
- }
This can then be moved up intot he generic part.
U_BOOT_CMD( +#ifdef CONFIG_SYS_ALT_MEMTEST
- mtest, 5, 1, do_mem_mtest,
- "mtest - simple RAM test\n",
- "[start [end [pattern [iterations]]]]\n"
+#else mtest, 4, 1, do_mem_mtest, "mtest - simple RAM test\n", "[start [end [pattern]]]\n" +#endif /* CONFIG_SYS_ALT_MEMTEST */
And this #ifdef can be avoided alltogether.
Best regards,
Wolfgang Denk