1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
14 int do_diag(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
18 if (argc == 1 || strcmp (argv[1], "run") != 0) {
21 puts ("Available hardware tests:\n");
23 puts ("Use 'diag [<test1> [<test2> ...]]'"
24 " to get more info.\n");
25 puts ("Use 'diag run [<test1> [<test2> ...]]'"
28 for (i = 1; i < argc; i++) {
29 if (post_info (argv[i]) != 0)
30 printf ("%s - no such test\n", argv[i]);
36 post_run (NULL, POST_RAM | POST_MANUAL);
38 for (i = 2; i < argc; i++) {
39 if (post_run (argv[i], POST_RAM | POST_MANUAL) != 0)
40 printf ("%s - unable to execute the test\n",
48 /***************************************************/
51 diag, CONFIG_SYS_MAXARGS, 0, do_diag,
52 "perform board diagnostics",
53 " - print list of available tests\n"
54 "diag [test1 [test2]]\n"
55 " - print information about specified tests\n"
56 "diag run - run all available tests\n"
57 "diag run [test1 [test2]]\n"
58 " - run specified tests"