Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Wolfgang Denk | 1aaab00 | 2014-11-06 14:03:01 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2011 |
| 4 | * Andreas Pretzsch, carpe noctem engineering, apr@cn-eng.de |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <command.h> |
Simon Glass | ea5427e | 2013-05-15 06:23:54 +0000 | [diff] [blame] | 9 | #include <net.h> |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 10 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 11 | static int do_fitupd(struct cmd_tbl *cmdtp, int flag, int argc, |
| 12 | char *const argv[]) |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 13 | { |
| 14 | ulong addr = 0UL; |
| 15 | |
| 16 | if (argc > 2) |
Simon Glass | 4c12eeb | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 17 | return CMD_RET_USAGE; |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 18 | |
| 19 | if (argc == 2) |
| 20 | addr = simple_strtoul(argv[1], NULL, 16); |
| 21 | |
Lukasz Majewski | c7ff552 | 2015-08-24 00:21:47 +0200 | [diff] [blame] | 22 | return update_tftp(addr, NULL, NULL); |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 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 | ); |