blob: f6270d9c15b4b6761e2dd4d93cb29fa58c3a9a01 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Wolfgang Denk61826a62014-11-06 14:03:01 +01002/*
3 * (C) Copyright 2011
4 * Andreas Pretzsch, carpe noctem engineering, apr@cn-eng.de
Andreas Pretzschfcc69ff2011-07-16 05:51:00 +00005 */
6
7#include <common.h>
8#include <command.h>
Simon Glassd1892ac2013-05-15 06:23:54 +00009#include <net.h>
Andreas Pretzschfcc69ff2011-07-16 05:51:00 +000010
11#if !defined(CONFIG_UPDATE_TFTP)
12#error "CONFIG_UPDATE_TFTP required"
13#endif
14
Simon Glassed38aef2020-05-10 11:40:03 -060015static int do_fitupd(struct cmd_tbl *cmdtp, int flag, int argc,
16 char *const argv[])
Andreas Pretzschfcc69ff2011-07-16 05:51:00 +000017{
18 ulong addr = 0UL;
19
20 if (argc > 2)
Simon Glassa06dfc72011-12-10 08:44:01 +000021 return CMD_RET_USAGE;
Andreas Pretzschfcc69ff2011-07-16 05:51:00 +000022
23 if (argc == 2)
24 addr = simple_strtoul(argv[1], NULL, 16);
25
Lukasz Majewskie32125a2015-08-24 00:21:47 +020026 return update_tftp(addr, NULL, NULL);
Andreas Pretzschfcc69ff2011-07-16 05:51:00 +000027}
28
29U_BOOT_CMD(fitupd, 2, 0, do_fitupd,
30 "update from FIT image",
31 "[addr]\n"
32 "\t- run update from FIT image at addr\n"
33 "\t or from tftp 'updatefile'"
34);