Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 1 | de <net.h> |
| 2 | |
| 3 | #if !defined(CONFIG_UPDATE_TFTP) |
| 4 | #error "CONFIG_UPDATE_TFTP required" |
| 5 | #endif |
| 6 | |
| 7 | static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 8 | { |
| 9 | ulong addr = 0Un the root directory of the source tree for details. |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #include <common.h> |
| 13 | #include <command.h> |
Simon Glass | ea5427e | 2013-05-15 06:23:54 +0000 | [diff] [blame] | 14 | #include <net.h> |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 15 | |
| 16 | #if !defined(CONFIG_UPDATE_TFTP) |
| 17 | #error "CONFIG_UPDATE_TFTP required" |
| 18 | #endif |
| 19 | |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 20 | static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 21 | { |
| 22 | ulong addr = 0UL; |
| 23 | |
| 24 | if (argc > 2) |
Simon Glass | 4c12eeb | 2011-12-10 08:44:01 +0000 | [diff] [blame] | 25 | return CMD_RET_USAGE; |
Andreas Pretzsch | 7130a57 | 2011-07-16 05:51:00 +0000 | [diff] [blame] | 26 | |
| 27 | if (argc == 2) |
| 28 | addr = simple_strtoul(argv[1], NULL, 16); |
| 29 | |
| 30 | return update_tftp(addr); |
| 31 | } |
| 32 | |
| 33 | U_BOOT_CMD(fitupd, 2, 0, do_fitupd, |
| 34 | "update from FIT image", |
| 35 | "[addr]\n" |
| 36 | "\t- run update from FIT image at addr\n" |
| 37 | "\t or from tftp 'updatefile'" |
| 38 | ); |