diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2022-08-08 21:46:04 +0930 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-10-21 16:04:39 -0400 |
commit | 4b290d4a757caaf5efedc74ea3db9974b51f35f2 (patch) | |
tree | e068e8c4cfce2e0d8309753f2084e1491e4c291c /cmd/net.c | |
parent | 09bd3d0b0a954f250bac61fee7e3c6d037914569 (diff) | |
download | u-boot-4b290d4a757caaf5efedc74ea3db9974b51f35f2.tar.gz |
cmd: Add ncsi command
Adds an "ncsi" command to manually start NC-SI configuration.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'cmd/net.c')
-rw-r--r-- | cmd/net.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -16,6 +16,7 @@ #include <net.h> #include <net/udp.h> #include <net/sntp.h> +#include <net/ncsi.h> static int netboot_common(enum proto_t, struct cmd_tbl *, int, char * const []); @@ -566,3 +567,24 @@ U_BOOT_CMD( "list - list available devices\n" ); #endif // CONFIG_DM_ETH + +#if defined(CONFIG_CMD_NCSI) +static int do_ncsi(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) +{ + if (!phy_interface_is_ncsi() || !ncsi_active()) { + printf("Device not configured for NC-SI\n"); + return CMD_RET_FAILURE; + } + + if (net_loop(NCSI) < 0) + return CMD_RET_FAILURE; + + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD( + ncsi, 1, 1, do_ncsi, + "Configure attached NIC via NC-SI", + "" +); +#endif /* CONFIG_CMD_NCSI */ |