blob: 85c3567b0ba2774121a85904125803fd8d54763a [file] [log] [blame]
stroese56b9e4f2004-12-16 18:43:13 +00001/*
2 * (C) Copyright 2003-2004
Detlev Zundelf1b3f2b2009-05-13 10:54:10 +02003 * Gary Jennejohn, DENX Software Engineering, garyj@denx.de.
stroese56b9e4f2004-12-16 18:43:13 +00004 * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
5 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
stroese56b9e4f2004-12-16 18:43:13 +00007 */
8
9#include <common.h>
Bartlomiej Sieka582f1a32006-03-05 18:57:33 +010010
stroese56b9e4f2004-12-16 18:43:13 +000011#include <command.h>
12#include <image.h>
13#include <asm/byteorder.h>
stroese56b9e4f2004-12-16 18:43:13 +000014#include <fat.h>
Grant Likelyffc2dd72007-02-20 09:04:34 +010015#include <part.h>
stroese56b9e4f2004-12-16 18:43:13 +000016
17#include "auto_update.h"
18
19#ifdef CONFIG_AUTO_UPDATE
20
Jon Loeliger4ed9ed62007-07-09 18:24:55 -050021#if !defined(CONFIG_CMD_FAT)
Jon Loeliger13f75992007-07-10 10:39:10 -050022#error "must define CONFIG_CMD_FAT"
stroese56b9e4f2004-12-16 18:43:13 +000023#endif
24
25extern au_image_t au_image[];
26extern int N_AU_IMAGES;
27
Matthias Fuchs17dc7612008-04-21 14:42:06 +020028/* where to load files into memory */
29#define LOAD_ADDR ((unsigned char *)0x100000)
30#define MAX_LOADSZ 0x1c00000
stroese56b9e4f2004-12-16 18:43:13 +000031
32/* externals */
33extern int fat_register_device(block_dev_desc_t *, int);
34extern int file_fat_detectfs(void);
35extern long file_fat_read(const char *, void *, unsigned long);
Matthias Fuchs17dc7612008-04-21 14:42:06 +020036long do_fat_read (const char *filename, void *buffer,
37 unsigned long maxsize, int dols);
stroese56b9e4f2004-12-16 18:43:13 +000038extern int flash_sect_erase(ulong, ulong);
39extern int flash_sect_protect (int, ulong, ulong);
Stefan Roesebcb3b272005-10-20 16:39:16 +020040extern int flash_write (char *, ulong, ulong);
stroese56b9e4f2004-12-16 18:43:13 +000041
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020042extern block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
stroese56b9e4f2004-12-16 18:43:13 +000043
stroese56b9e4f2004-12-16 18:43:13 +000044int au_check_cksum_valid(int i, long nbytes)
45{
46 image_header_t *hdr;
stroese56b9e4f2004-12-16 18:43:13 +000047
48 hdr = (image_header_t *)LOAD_ADDR;
Marian Balakowiczdbdd16a2008-02-04 08:28:09 +010049#if defined(CONFIG_FIT)
Marian Balakowiczd7c88a42008-02-29 14:58:34 +010050 if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
Marian Balakowiczdbdd16a2008-02-04 08:28:09 +010051 puts ("Non legacy image format not supported\n");
52 return -1;
53 }
54#endif
stroese56b9e4f2004-12-16 18:43:13 +000055
Marian Balakowicz41d71ed2008-01-08 18:14:09 +010056 if ((au_image[i].type == AU_FIRMWARE) &&
57 (au_image[i].size != image_get_data_size (hdr))) {
stroese56b9e4f2004-12-16 18:43:13 +000058 printf ("Image %s has wrong size\n", au_image[i].name);
59 return -1;
60 }
61
Marian Balakowicz41d71ed2008-01-08 18:14:09 +010062 if (nbytes != (image_get_image_size (hdr))) {
stroese56b9e4f2004-12-16 18:43:13 +000063 printf ("Image %s bad total SIZE\n", au_image[i].name);
64 return -1;
65 }
stroese56b9e4f2004-12-16 18:43:13 +000066
Marian Balakowicz41d71ed2008-01-08 18:14:09 +010067 /* check the data CRC */
68 if (!image_check_dcrc (hdr)) {
stroese56b9e4f2004-12-16 18:43:13 +000069 printf ("Image %s bad data checksum\n", au_image[i].name);
70 return -1;
71 }
72 return 0;
73}
74
stroese56b9e4f2004-12-16 18:43:13 +000075int au_check_header_valid(int i, long nbytes)
76{
77 image_header_t *hdr;
stroese56b9e4f2004-12-16 18:43:13 +000078
79 hdr = (image_header_t *)LOAD_ADDR;
Marian Balakowiczdbdd16a2008-02-04 08:28:09 +010080#if defined(CONFIG_FIT)
Marian Balakowiczd7c88a42008-02-29 14:58:34 +010081 if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
Marian Balakowiczdbdd16a2008-02-04 08:28:09 +010082 puts ("Non legacy image format not supported\n");
83 return -1;
84 }
85#endif
86
stroese56b9e4f2004-12-16 18:43:13 +000087 /* check the easy ones first */
Matthias Fuchs17dc7612008-04-21 14:42:06 +020088 if (nbytes < image_get_header_size ()) {
stroese56b9e4f2004-12-16 18:43:13 +000089 printf ("Image %s bad header SIZE\n", au_image[i].name);
90 return -1;
91 }
Matthias Fuchs17dc7612008-04-21 14:42:06 +020092 if (!image_check_magic (hdr) || !image_check_arch (hdr, IH_ARCH_PPC)) {
stroese56b9e4f2004-12-16 18:43:13 +000093 printf ("Image %s bad MAGIC or ARCH\n", au_image[i].name);
94 return -1;
95 }
Marian Balakowicz41d71ed2008-01-08 18:14:09 +010096 if (!image_check_hcrc (hdr)) {
stroese56b9e4f2004-12-16 18:43:13 +000097 printf ("Image %s bad header checksum\n", au_image[i].name);
98 return -1;
99 }
stroese56b9e4f2004-12-16 18:43:13 +0000100
101 /* check the type - could do this all in one gigantic if() */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200102 if (((au_image[i].type & AU_TYPEMASK) == AU_FIRMWARE) &&
103 !image_check_type (hdr, IH_TYPE_FIRMWARE)) {
stroese56b9e4f2004-12-16 18:43:13 +0000104 printf ("Image %s wrong type\n", au_image[i].name);
105 return -1;
106 }
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200107 if (((au_image[i].type & AU_TYPEMASK) == AU_SCRIPT) &&
108 !image_check_type (hdr, IH_TYPE_SCRIPT)) {
stroese56b9e4f2004-12-16 18:43:13 +0000109 printf ("Image %s wrong type\n", au_image[i].name);
110 return -1;
111 }
112
stroese56b9e4f2004-12-16 18:43:13 +0000113 return 0;
114}
115
stroese56b9e4f2004-12-16 18:43:13 +0000116int au_do_update(int i, long sz)
117{
118 image_header_t *hdr;
119 char *addr;
120 long start, end;
121 int off, rc;
122 uint nbytes;
123 int k;
stroese56b9e4f2004-12-16 18:43:13 +0000124
125 hdr = (image_header_t *)LOAD_ADDR;
Marian Balakowiczdbdd16a2008-02-04 08:28:09 +0100126#if defined(CONFIG_FIT)
Marian Balakowiczd7c88a42008-02-29 14:58:34 +0100127 if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
Marian Balakowiczdbdd16a2008-02-04 08:28:09 +0100128 puts ("Non legacy image format not supported\n");
129 return -1;
130 }
131#endif
stroese56b9e4f2004-12-16 18:43:13 +0000132
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200133 switch (au_image[i].type & AU_TYPEMASK) {
stroese56b9e4f2004-12-16 18:43:13 +0000134 case AU_SCRIPT:
135 printf("Executing script %s\n", au_image[i].name);
136
137 /* execute a script */
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100138 if (image_check_type (hdr, IH_TYPE_SCRIPT)) {
139 addr = (char *)((char *)hdr + image_get_header_size ());
stroese56b9e4f2004-12-16 18:43:13 +0000140 /* stick a NULL at the end of the script, otherwise */
141 /* parse_string_outer() runs off the end. */
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100142 addr[image_get_data_size (hdr)] = 0;
stroese56b9e4f2004-12-16 18:43:13 +0000143 addr += 8;
144
145 /*
146 * Replace cr/lf with ;
147 */
148 k = 0;
149 while (addr[k] != 0) {
150 if ((addr[k] == 10) || (addr[k] == 13)) {
151 addr[k] = ';';
152 }
153 k++;
154 }
155
Simon Glassbf8c5b02012-02-14 19:59:21 +0000156 run_command(addr, 0);
stroese56b9e4f2004-12-16 18:43:13 +0000157 return 0;
158 }
159
160 break;
161
162 case AU_FIRMWARE:
163 case AU_NOR:
164 case AU_NAND:
165 start = au_image[i].start;
166 end = au_image[i].start + au_image[i].size - 1;
167
stroesee72a7b72005-03-16 20:58:31 +0000168 /*
169 * do not update firmware when image is already in flash.
170 */
171 if (au_image[i].type == AU_FIRMWARE) {
172 char *orig = (char*)start;
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200173 char *new = (char *)((char *)hdr +
174 image_get_header_size ());
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100175 nbytes = image_get_data_size (hdr);
stroesee72a7b72005-03-16 20:58:31 +0000176
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200177 while (--nbytes) {
stroesee72a7b72005-03-16 20:58:31 +0000178 if (*orig++ != *new++) {
179 break;
180 }
181 }
182 if (!nbytes) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200183 printf ("Skipping firmware update - "
184 "images are identical\n");
stroesee72a7b72005-03-16 20:58:31 +0000185 break;
186 }
187 }
188
stroese56b9e4f2004-12-16 18:43:13 +0000189 /* unprotect the address range */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200190 if (((au_image[i].type & AU_FLAGMASK) == AU_PROTECT) ||
191 (au_image[i].type == AU_FIRMWARE)) {
192 flash_sect_protect (0, start, end);
stroese56b9e4f2004-12-16 18:43:13 +0000193 }
194
195 /*
196 * erase the address range.
197 */
198 if (au_image[i].type != AU_NAND) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200199 printf ("Updating NOR FLASH with image %s\n",
200 au_image[i].name);
stroese56b9e4f2004-12-16 18:43:13 +0000201 debug ("flash_sect_erase(%lx, %lx);\n", start, end);
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200202 flash_sect_erase (start, end);
stroese56b9e4f2004-12-16 18:43:13 +0000203 }
204
205 udelay(10000);
206
207 /* strip the header - except for the kernel and ramdisk */
208 if (au_image[i].type != AU_FIRMWARE) {
209 addr = (char *)hdr;
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100210 off = image_get_header_size ();
211 nbytes = image_get_image_size (hdr);
stroese56b9e4f2004-12-16 18:43:13 +0000212 } else {
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100213 addr = (char *)((char *)hdr + image_get_header_size ());
stroese56b9e4f2004-12-16 18:43:13 +0000214 off = 0;
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100215 nbytes = image_get_data_size (hdr);
stroese56b9e4f2004-12-16 18:43:13 +0000216 }
217
218 /*
219 * copy the data from RAM to FLASH
220 */
221 if (au_image[i].type != AU_NAND) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200222 debug ("flash_write(%p, %lx, %x)\n",
223 addr, start, nbytes);
224 rc = flash_write ((char *)addr, start,
225 (nbytes + 1) & ~1);
stroese56b9e4f2004-12-16 18:43:13 +0000226 } else {
Matthias Fuchsc0d6f112007-07-09 10:10:04 +0200227 rc = -1;
stroese56b9e4f2004-12-16 18:43:13 +0000228 }
229 if (rc != 0) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200230 printf ("Flashing failed due to error %d\n", rc);
stroese56b9e4f2004-12-16 18:43:13 +0000231 return -1;
232 }
233
234 /*
235 * check the dcrc of the copy
236 */
237 if (au_image[i].type != AU_NAND) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200238 rc = crc32 (0, (uchar *)(start + off),
239 image_get_data_size (hdr));
stroese56b9e4f2004-12-16 18:43:13 +0000240 }
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100241 if (rc != image_get_dcrc (hdr)) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200242 printf ("Image %s Bad Data Checksum After COPY\n",
243 au_image[i].name);
stroese56b9e4f2004-12-16 18:43:13 +0000244 return -1;
245 }
246
247 /* protect the address range */
248 /* this assumes that ONLY the firmware is protected! */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200249 if (((au_image[i].type & AU_FLAGMASK) == AU_PROTECT) ||
250 (au_image[i].type == AU_FIRMWARE)) {
251 flash_sect_protect (1, start, end);
stroese56b9e4f2004-12-16 18:43:13 +0000252 }
253
254 break;
255
256 default:
257 printf("Wrong image type selected!\n");
258 }
259
260 return 0;
261}
262
stroese56b9e4f2004-12-16 18:43:13 +0000263static void process_macros (const char *input, char *output)
264{
265 char c, prev;
266 const char *varname_start = NULL;
267 int inputcnt = strlen (input);
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200268 int outputcnt = CONFIG_SYS_CBSIZE;
stroese56b9e4f2004-12-16 18:43:13 +0000269 int state = 0; /* 0 = waiting for '$' */
270 /* 1 = waiting for '(' or '{' */
271 /* 2 = waiting for ')' or '}' */
272 /* 3 = waiting for ''' */
273#ifdef DEBUG_PARSER
274 char *output_start = output;
275
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200276 printf ("[PROCESS_MACROS] INPUT len %d: \"%s\"\n",
277 strlen(input), input);
stroese56b9e4f2004-12-16 18:43:13 +0000278#endif
279
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200280 prev = '\0'; /* previous character */
stroese56b9e4f2004-12-16 18:43:13 +0000281
282 while (inputcnt && outputcnt) {
283 c = *input++;
284 inputcnt--;
285
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200286 if (state != 3) {
stroese56b9e4f2004-12-16 18:43:13 +0000287 /* remove one level of escape characters */
288 if ((c == '\\') && (prev != '\\')) {
289 if (inputcnt-- == 0)
290 break;
291 prev = c;
292 c = *input++;
293 }
294 }
295
296 switch (state) {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200297 case 0: /* Waiting for (unescaped) $ */
stroese56b9e4f2004-12-16 18:43:13 +0000298 if ((c == '\'') && (prev != '\\')) {
299 state = 3;
300 break;
301 }
302 if ((c == '$') && (prev != '\\')) {
303 state++;
304 } else {
305 *(output++) = c;
306 outputcnt--;
307 }
308 break;
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200309 case 1: /* Waiting for ( */
stroese56b9e4f2004-12-16 18:43:13 +0000310 if (c == '(' || c == '{') {
311 state++;
312 varname_start = input;
313 } else {
314 state = 0;
315 *(output++) = '$';
316 outputcnt--;
317
318 if (outputcnt) {
319 *(output++) = c;
320 outputcnt--;
321 }
322 }
323 break;
324 case 2: /* Waiting for ) */
325 if (c == ')' || c == '}') {
326 int i;
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200327 char envname[CONFIG_SYS_CBSIZE], *envval;
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200328 /* Varname # of chars */
329 int envcnt = input - varname_start - 1;
stroese56b9e4f2004-12-16 18:43:13 +0000330
331 /* Get the varname */
332 for (i = 0; i < envcnt; i++) {
333 envname[i] = varname_start[i];
334 }
335 envname[i] = 0;
336
337 /* Get its value */
338 envval = getenv (envname);
339
340 /* Copy into the line if it exists */
341 if (envval != NULL)
342 while ((*envval) && outputcnt) {
343 *(output++) = *(envval++);
344 outputcnt--;
345 }
346 /* Look for another '$' */
347 state = 0;
348 }
349 break;
350 case 3: /* Waiting for ' */
351 if ((c == '\'') && (prev != '\\')) {
352 state = 0;
353 } else {
354 *(output++) = c;
355 outputcnt--;
356 }
357 break;
358 }
359 prev = c;
360 }
361
362 if (outputcnt)
363 *output = 0;
364
365#ifdef DEBUG_PARSER
366 printf ("[PROCESS_MACROS] OUTPUT len %d: \"%s\"\n",
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200367 strlen (output_start), output_start);
stroese56b9e4f2004-12-16 18:43:13 +0000368#endif
369}
370
stroese56b9e4f2004-12-16 18:43:13 +0000371/*
372 * this is called from board_init() after the hardware has been set up
373 * and is usable. That seems like a good time to do this.
374 * Right now the return value is ignored.
375 */
376int do_auto_update(void)
377{
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200378 block_dev_desc_t *stor_dev = NULL;
stroese56b9e4f2004-12-16 18:43:13 +0000379 long sz;
Stefan Roesee0ab6e12011-11-15 08:03:33 +0000380 int i, res, cnt, old_ctrlc;
stroese56b9e4f2004-12-16 18:43:13 +0000381 char buffer[32];
382 char str[80];
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200383 int n;
stroese56b9e4f2004-12-16 18:43:13 +0000384
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200385 if (ide_dev_desc[0].type != DEV_TYPE_UNKNOWN) {
386 stor_dev = get_dev ("ide", 0);
387 if (stor_dev == NULL) {
388 debug ("ide: unknown device\n");
389 return -1;
390 }
stroese56b9e4f2004-12-16 18:43:13 +0000391 }
392
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200393 if (fat_register_device (stor_dev, 1) != 0) {
394 debug ("Unable to register ide disk 0:1\n");
stroese56b9e4f2004-12-16 18:43:13 +0000395 return -1;
396 }
stroese56b9e4f2004-12-16 18:43:13 +0000397
398 /*
399 * Check if magic file is present
400 */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200401 if ((n = do_fat_read (AU_MAGIC_FILE, buffer,
402 sizeof(buffer), LS_NO)) <= 0) {
403 debug ("No auto_update magic file (n=%d)\n", n);
stroese56b9e4f2004-12-16 18:43:13 +0000404 return -1;
405 }
406
407#ifdef CONFIG_AUTO_UPDATE_SHOW
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200408 board_auto_update_show (1);
stroese56b9e4f2004-12-16 18:43:13 +0000409#endif
410 puts("\nAutoUpdate Disk detected! Trying to update system...\n");
411
412 /* make sure that we see CTRL-C and save the old state */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200413 old_ctrlc = disable_ctrlc (0);
stroese56b9e4f2004-12-16 18:43:13 +0000414
415 /* just loop thru all the possible files */
416 for (i = 0; i < N_AU_IMAGES; i++) {
417 /*
418 * Try to expand the environment var in the fname
419 */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200420 process_macros (au_image[i].name, str);
421 strcpy (au_image[i].name, str);
stroese56b9e4f2004-12-16 18:43:13 +0000422
423 printf("Reading %s ...", au_image[i].name);
424 /* just read the header */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200425 sz = do_fat_read (au_image[i].name, LOAD_ADDR,
426 image_get_header_size (), LS_NO);
stroese56b9e4f2004-12-16 18:43:13 +0000427 debug ("read %s sz %ld hdr %d\n",
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100428 au_image[i].name, sz, image_get_header_size ());
429 if (sz <= 0 || sz < image_get_header_size ()) {
stroese56b9e4f2004-12-16 18:43:13 +0000430 puts(" not found\n");
431 continue;
432 }
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200433 if (au_check_header_valid (i, sz) < 0) {
stroese56b9e4f2004-12-16 18:43:13 +0000434 puts(" header not valid\n");
435 continue;
436 }
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200437 sz = do_fat_read (au_image[i].name, LOAD_ADDR,
438 MAX_LOADSZ, LS_NO);
stroese56b9e4f2004-12-16 18:43:13 +0000439 debug ("read %s sz %ld hdr %d\n",
Marian Balakowicz41d71ed2008-01-08 18:14:09 +0100440 au_image[i].name, sz, image_get_header_size ());
441 if (sz <= 0 || sz <= image_get_header_size ()) {
stroese56b9e4f2004-12-16 18:43:13 +0000442 puts(" not found\n");
443 continue;
444 }
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200445 if (au_check_cksum_valid (i, sz) < 0) {
stroese56b9e4f2004-12-16 18:43:13 +0000446 puts(" checksum not valid\n");
447 continue;
448 }
449 puts(" done\n");
450
451 do {
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200452 res = au_do_update (i, sz);
stroese56b9e4f2004-12-16 18:43:13 +0000453 /* let the user break out of the loop */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200454 if (ctrlc() || had_ctrlc ()) {
455 clear_ctrlc ();
stroese56b9e4f2004-12-16 18:43:13 +0000456 break;
457 }
458 cnt++;
459 } while (res < 0);
460 }
461
462 /* restore the old state */
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200463 disable_ctrlc (old_ctrlc);
stroese56b9e4f2004-12-16 18:43:13 +0000464
465 puts("AutoUpdate finished\n\n");
466#ifdef CONFIG_AUTO_UPDATE_SHOW
Matthias Fuchs17dc7612008-04-21 14:42:06 +0200467 board_auto_update_show (0);
stroese56b9e4f2004-12-16 18:43:13 +0000468#endif
469
470 return 0;
471}
472
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200473int auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
stroese56b9e4f2004-12-16 18:43:13 +0000474{
475 do_auto_update();
476
477 return 0;
478}
479U_BOOT_CMD(
480 autoupd, 1, 1, auto_update,
Peter Tyserdfb72b82009-01-27 18:03:12 -0600481 "Automatically update images",
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200482 ""
stroese56b9e4f2004-12-16 18:43:13 +0000483);
484#endif /* CONFIG_AUTO_UPDATE */