Blame view
cmd/diag.c
1.37 KB
83d290c56
|
1 |
// SPDX-License-Identifier: GPL-2.0+ |
a46d821fc
|
2 3 4 |
/* * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
a46d821fc
|
5 6 7 8 9 10 11 |
*/ /* * Diagnostics support */ #include <common.h> #include <command.h> |
a46d821fc
|
12 |
#include <post.h> |
54841ab50
|
13 |
int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
a46d821fc
|
14 15 16 17 18 19 |
{ unsigned int i; if (argc == 1 || strcmp (argv[1], "run") != 0) { /* List test info */ if (argc == 1) { |
4b9206ed5
|
20 21 |
puts ("Available hardware tests: "); |
a46d821fc
|
22 |
post_info (NULL); |
4b9206ed5
|
23 |
puts ("Use 'diag [<test1> [<test2> ...]]'" |
a46d821fc
|
24 25 |
" to get more info. "); |
4b9206ed5
|
26 |
puts ("Use 'diag run [<test1> [<test2> ...]]'" |
a46d821fc
|
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
" to run tests. "); } else { for (i = 1; i < argc; i++) { if (post_info (argv[i]) != 0) printf ("%s - no such test ", argv[i]); } } } else { /* Run tests */ if (argc == 2) { post_run (NULL, POST_RAM | POST_MANUAL); } else { for (i = 2; i < argc; i++) { if (post_run (argv[i], POST_RAM | POST_MANUAL) != 0) printf ("%s - unable to execute the test ", argv[i]); } } } return 0; } |
8bde7f776
|
52 |
/***************************************************/ |
0d4983930
|
53 |
U_BOOT_CMD( |
6d0f6bcf3
|
54 |
diag, CONFIG_SYS_MAXARGS, 0, do_diag, |
2fb2604d5
|
55 |
"perform board diagnostics", |
8bde7f776
|
56 57 58 59 60 61 62 63 64 65 |
" - print list of available tests " "diag [test1 [test2]] " " - print information about specified tests " "diag run - run all available tests " "diag run [test1 [test2]] " |
a89c33db9
|
66 |
" - run specified tests" |
8bde7f776
|
67 |
); |