Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / cmd / fitupd.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2011
4  * Andreas Pretzsch, carpe noctem engineering, apr@cn-eng.de
5  */
6
7 #include <common.h>
8 #include <command.h>
9 #include <net.h>
10
11 static int do_fitupd(struct cmd_tbl *cmdtp, int flag, int argc,
12                      char *const argv[])
13 {
14         ulong addr = 0UL;
15
16         if (argc > 2)
17                 return CMD_RET_USAGE;
18
19         if (argc == 2)
20                 addr = simple_strtoul(argv[1], NULL, 16);
21
22         return update_tftp(addr, NULL, NULL);
23 }
24
25 U_BOOT_CMD(fitupd, 2, 0, do_fitupd,
26         "update from FIT image",
27         "[addr]\n"
28         "\t- run update from FIT image at addr\n"
29         "\t  or from tftp 'updatefile'"
30 );