1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (C) ASPEED Technology Inc.
4 */
5
6
7 #include <common.h>
8 #include <command.h>
9
10 #include "swfunc.h"
11 #include "comminf.h"
12 #include "mem_io.h"
13 #include "mac_api.h"
14
15 extern int mac_test(int argc, char * const argv[], uint32_t mode);
16
do_mactest(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])17 int do_mactest(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
18 {
19 display_lantest_log_msg = 0;
20 return mac_test(argc, argv, MODE_DEDICATED);
21 }
22
do_ncsitest(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])23 int do_ncsitest (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
24 {
25 display_lantest_log_msg = 0;
26 return mac_test(argc, argv, MODE_NCSI);
27 }
28
29 U_BOOT_CMD(mactest, NETESTCMD_MAX_ARGS, 0, do_mactest,
30 "Dedicated LAN test program", NULL);
31 U_BOOT_CMD(ncsitest, NETESTCMD_MAX_ARGS, 0, do_ncsitest,
32 "Share LAN (NC-SI) test program", NULL);
33
34 // ------------------------------------------------------------------------------
do_mactestd(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])35 int do_mactestd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
36 {
37 display_lantest_log_msg = 1;
38 return mac_test(argc, argv, MODE_DEDICATED);
39 }
40
do_ncsitestd(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])41 int do_ncsitestd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
42 {
43 display_lantest_log_msg = 1;
44 return mac_test(argc, argv, MODE_NCSI);
45 }
46
47 U_BOOT_CMD(mactestd, NETESTCMD_MAX_ARGS, 0, do_mactestd,
48 "Dedicated LAN test program and display more information", NULL);
49 U_BOOT_CMD(ncsitestd, NETESTCMD_MAX_ARGS, 0, do_ncsitestd,
50 "Share LAN (NC-SI) test program and display more information", NULL);
51