blob: b059336ca599fa4bc475644368a7a2065fb3fbe4 [file] [log] [blame]
wdenk47d1a6e2002-11-03 00:01:44 +00001/*
Stefan Roese15940c92006-03-13 11:16:36 +01002 * (C) Copyright 2000-2006
wdenk47d1a6e2002-11-03 00:01:44 +00003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
Marian Balakowiczb97a2a02008-01-08 18:14:09 +010024#define DEBUG
25
wdenk47d1a6e2002-11-03 00:01:44 +000026/*
27 * Boot support
28 */
29#include <common.h>
30#include <watchdog.h>
31#include <command.h>
wdenk47d1a6e2002-11-03 00:01:44 +000032#include <image.h>
33#include <malloc.h>
34#include <zlib.h>
wdenkc29fdfc2003-08-29 20:57:53 +000035#include <bzlib.h>
wdenk7f70e852003-05-20 14:25:27 +000036#include <environment.h>
wdenk47d1a6e2002-11-03 00:01:44 +000037#include <asm/byteorder.h>
wdenk8bde7f72003-06-27 21:31:46 +000038
Gerald Van Baren213bf8c2007-03-31 12:23:51 -040039#if defined(CONFIG_OF_LIBFDT)
40#include <fdt.h>
41#include <libfdt.h>
Gerald Van Barenc28abb92007-04-14 22:51:24 -040042#include <fdt_support.h>
Marian Balakowiczd45d5a12008-01-08 18:11:43 +010043#elif defined(CONFIG_OF_FLAT_TREE)
Wolfgang Denkf57f70a2005-10-13 01:45:54 +020044#include <ft_build.h>
45#endif
46
Wolfgang Denkd87080b2006-03-31 18:32:53 +020047DECLARE_GLOBAL_DATA_PTR;
48
Gerald Van Baren38eb5082007-05-12 09:45:46 -040049/*cmd_boot.c*/
50extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
wdenk8bde7f72003-06-27 21:31:46 +000051
Jon Loeligerbaa26db2007-07-08 17:51:39 -050052#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
wdenk47d1a6e2002-11-03 00:01:44 +000053#include <rtc.h>
54#endif
55
56#ifdef CFG_HUSH_PARSER
57#include <hush.h>
58#endif
59
wdenk2abbe072003-06-16 23:50:08 +000060#ifdef CONFIG_HAS_DATAFLASH
61#include <dataflash.h>
62#endif
63
wdenkeedcd072004-09-08 22:03:11 +000064int gunzip (void *, int, unsigned char *, unsigned long *);
wdenk47d1a6e2002-11-03 00:01:44 +000065
Marian Balakowicz321359f2008-01-08 18:11:43 +010066#ifdef CONFIG_BZIP2
67extern void bz_internal_error(int);
68#endif
wdenk47d1a6e2002-11-03 00:01:44 +000069
Jon Loeligerbaa26db2007-07-08 17:51:39 -050070#if defined(CONFIG_CMD_IMI)
wdenk47d1a6e2002-11-03 00:01:44 +000071static int image_info (unsigned long addr);
72#endif
wdenk27b207f2003-07-24 23:38:38 +000073
Jon Loeligerbaa26db2007-07-08 17:51:39 -050074#if defined(CONFIG_CMD_IMLS)
wdenk27b207f2003-07-24 23:38:38 +000075#include <flash.h>
Marian Balakowicze6f2e902005-10-11 19:09:42 +020076extern flash_info_t flash_info[]; /* info for FLASH chips */
wdenk27b207f2003-07-24 23:38:38 +000077static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
78#endif
79
wdenk47d1a6e2002-11-03 00:01:44 +000080static void print_type (image_header_t *hdr);
81
82/*
83 * Continue booting an OS image; caller already has:
84 * - copied image header to global variable `header'
85 * - checked header magic number, checksums (both header & image),
86 * - verified image architecture (PPC) and type (KERNEL or MULTI),
87 * - loaded (first part of) image to header load address,
88 * - disabled interrupts.
89 */
90typedef void boot_os_Fcn (cmd_tbl_t *cmdtp, int flag,
91 int argc, char *argv[],
92 ulong addr, /* of image to boot */
93 ulong *len_ptr, /* multi-file image length table */
94 int verify); /* getenv("verify")[0] != 'n' */
95
wdenk47d1a6e2002-11-03 00:01:44 +000096extern boot_os_Fcn do_bootm_linux;
Marian Balakowicz5d3cc552008-01-08 18:11:43 +010097
wdenkf72da342003-10-10 10:05:42 +000098#ifdef CONFIG_SILENT_CONSOLE
99static void fixup_silent_linux (void);
100#endif
wdenk47d1a6e2002-11-03 00:01:44 +0000101static boot_os_Fcn do_bootm_netbsd;
wdenkd791b1d2003-04-20 14:04:18 +0000102static boot_os_Fcn do_bootm_rtems;
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500103#if defined(CONFIG_CMD_ELF)
wdenk47d1a6e2002-11-03 00:01:44 +0000104static boot_os_Fcn do_bootm_vxworks;
105static boot_os_Fcn do_bootm_qnxelf;
106int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
107int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
Jon Loeliger90253172007-07-10 11:02:44 -0500108#endif
wdenk7f70e852003-05-20 14:25:27 +0000109#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
110static boot_os_Fcn do_bootm_artos;
111#endif
wdenk1f4bb372003-07-27 00:21:01 +0000112#ifdef CONFIG_LYNXKDI
113static boot_os_Fcn do_bootm_lynxkdi;
114extern void lynxkdi_boot( image_header_t * );
115#endif
wdenk47d1a6e2002-11-03 00:01:44 +0000116
Stefan Roese15940c92006-03-13 11:16:36 +0100117#ifndef CFG_BOOTM_LEN
118#define CFG_BOOTM_LEN 0x800000 /* use 8MByte as default max gunzip size */
119#endif
120
wdenk47d1a6e2002-11-03 00:01:44 +0000121image_header_t header;
122
123ulong load_addr = CFG_LOAD_ADDR; /* Default Load Address */
124
125int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
126{
127 ulong iflag;
128 ulong addr;
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100129 ulong data, len;
wdenk47d1a6e2002-11-03 00:01:44 +0000130 ulong *len_ptr;
Stefan Roese15940c92006-03-13 11:16:36 +0100131 uint unc_len = CFG_BOOTM_LEN;
wdenk47d1a6e2002-11-03 00:01:44 +0000132 int i, verify;
133 char *name, *s;
wdenkb13fb012003-10-30 21:49:38 +0000134 int (*appl)(int, char *[]);
wdenk47d1a6e2002-11-03 00:01:44 +0000135 image_header_t *hdr = &header;
136
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100137 verify = getenv_verify ();
wdenk47d1a6e2002-11-03 00:01:44 +0000138
139 if (argc < 2) {
140 addr = load_addr;
141 } else {
142 addr = simple_strtoul(argv[1], NULL, 16);
143 }
144
Heiko Schocherfad63402007-07-13 09:54:17 +0200145 show_boot_progress (1);
wdenk47d1a6e2002-11-03 00:01:44 +0000146 printf ("## Booting image at %08lx ...\n", addr);
147
148 /* Copy header so we can blank CRC field for re-calculation */
wdenk2abbe072003-06-16 23:50:08 +0000149#ifdef CONFIG_HAS_DATAFLASH
150 if (addr_dataflash(addr)){
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100151 read_dataflash (addr, image_get_header_size (), (char *)&header);
wdenk2abbe072003-06-16 23:50:08 +0000152 } else
153#endif
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100154 memmove (&header, (char *)addr, image_get_header_size ());
wdenk47d1a6e2002-11-03 00:01:44 +0000155
Marian Balakowicz261dcf42008-01-08 18:11:44 +0100156 if (!image_check_magic(hdr)) {
wdenk4b9206e2004-03-23 22:14:11 +0000157 puts ("Bad Magic Number\n");
Heiko Schocherfad63402007-07-13 09:54:17 +0200158 show_boot_progress (-1);
wdenk47d1a6e2002-11-03 00:01:44 +0000159 return 1;
160 }
Heiko Schocherfad63402007-07-13 09:54:17 +0200161 show_boot_progress (2);
wdenk47d1a6e2002-11-03 00:01:44 +0000162
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100163 if (!image_check_hcrc (hdr)) {
wdenk4b9206e2004-03-23 22:14:11 +0000164 puts ("Bad Header Checksum\n");
Heiko Schocherfad63402007-07-13 09:54:17 +0200165 show_boot_progress (-2);
wdenk47d1a6e2002-11-03 00:01:44 +0000166 return 1;
167 }
Heiko Schocherfad63402007-07-13 09:54:17 +0200168 show_boot_progress (3);
wdenk47d1a6e2002-11-03 00:01:44 +0000169
Wolfgang Denkbccae902005-10-06 01:50:50 +0200170#ifdef CONFIG_HAS_DATAFLASH
171 if (addr_dataflash(addr)){
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100172 len = image_get_image_size (hdr);
Wolfgang Denkbccae902005-10-06 01:50:50 +0200173 read_dataflash(addr, len, (char *)CFG_LOAD_ADDR);
174 addr = CFG_LOAD_ADDR;
175 }
176#endif
177
178
wdenk47d1a6e2002-11-03 00:01:44 +0000179 /* for multi-file images we need the data part, too */
wdenka57a4962003-10-26 22:52:58 +0000180 print_image_hdr ((image_header_t *)addr);
wdenk47d1a6e2002-11-03 00:01:44 +0000181
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100182 len = image_get_data_size (hdr);
183 data = addr + image_get_header_size ();
184 len_ptr = (ulong *)data;
wdenk47d1a6e2002-11-03 00:01:44 +0000185
186 if (verify) {
wdenk4b9206e2004-03-23 22:14:11 +0000187 puts (" Verifying Checksum ... ");
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100188 if (!image_check_dcrc ((image_header_t *)addr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000189 printf ("Bad Data CRC\n");
Heiko Schocherfad63402007-07-13 09:54:17 +0200190 show_boot_progress (-3);
wdenk47d1a6e2002-11-03 00:01:44 +0000191 return 1;
192 }
wdenk4b9206e2004-03-23 22:14:11 +0000193 puts ("OK\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000194 }
Heiko Schocherfad63402007-07-13 09:54:17 +0200195 show_boot_progress (4);
wdenk47d1a6e2002-11-03 00:01:44 +0000196
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100197 if (!image_check_target_arch (hdr)) {
198 printf ("Unsupported Architecture 0x%x\n", image_get_arch (hdr));
Heiko Schocherfad63402007-07-13 09:54:17 +0200199 show_boot_progress (-4);
wdenk47d1a6e2002-11-03 00:01:44 +0000200 return 1;
201 }
Heiko Schocherfad63402007-07-13 09:54:17 +0200202 show_boot_progress (5);
wdenk47d1a6e2002-11-03 00:01:44 +0000203
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100204 switch (image_get_type (hdr)) {
wdenkb13fb012003-10-30 21:49:38 +0000205 case IH_TYPE_STANDALONE:
206 name = "Standalone Application";
207 /* A second argument overwrites the load address */
208 if (argc > 2) {
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100209 image_set_load (hdr, simple_strtoul (argv[2], NULL, 16));
wdenkb13fb012003-10-30 21:49:38 +0000210 }
211 break;
212 case IH_TYPE_KERNEL:
213 name = "Kernel Image";
214 break;
wdenkd4ca31c2004-01-02 14:00:00 +0000215 case IH_TYPE_MULTI:
wdenkb13fb012003-10-30 21:49:38 +0000216 name = "Multi-File Image";
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100217 len = image_to_cpu (len_ptr[0]);
wdenkb13fb012003-10-30 21:49:38 +0000218 /* OS kernel is always the first image */
219 data += 8; /* kernel_len + terminator */
220 for (i=1; len_ptr[i]; ++i)
221 data += 4;
222 break;
wdenk47d1a6e2002-11-03 00:01:44 +0000223 default: printf ("Wrong Image Type for %s command\n", cmdtp->name);
Heiko Schocherfad63402007-07-13 09:54:17 +0200224 show_boot_progress (-5);
wdenk47d1a6e2002-11-03 00:01:44 +0000225 return 1;
226 }
Heiko Schocherfad63402007-07-13 09:54:17 +0200227 show_boot_progress (6);
wdenk47d1a6e2002-11-03 00:01:44 +0000228
229 /*
230 * We have reached the point of no return: we are going to
231 * overwrite all exception vector code, so we cannot easily
232 * recover from any failures any more...
233 */
234
235 iflag = disable_interrupts();
236
wdenkc7de8292002-11-19 11:04:11 +0000237#ifdef CONFIG_AMIGAONEG3SE
238 /*
wdenk8bde7f72003-06-27 21:31:46 +0000239 * We've possible left the caches enabled during
wdenkc7de8292002-11-19 11:04:11 +0000240 * bios emulation, so turn them off again
241 */
242 icache_disable();
243 invalidate_l1_instruction_cache();
244 flush_data_cache();
245 dcache_disable();
246#endif
247
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100248 switch (image_get_comp (hdr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000249 case IH_COMP_NONE:
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100250 if (image_get_load (hdr) == addr) {
wdenk47d1a6e2002-11-03 00:01:44 +0000251 printf (" XIP %s ... ", name);
252 } else {
wdenk47d1a6e2002-11-03 00:01:44 +0000253 printf (" Loading %s ... ", name);
254
Marian Balakowiczaf13cdb2008-01-08 18:11:45 +0100255 memmove_wd ((void *)image_get_load (hdr),
256 (void *)data, len, CHUNKSZ);
257
258 puts("OK\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000259 }
260 break;
261 case IH_COMP_GZIP:
262 printf (" Uncompressing %s ... ", name);
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100263 if (gunzip ((void *)image_get_load (hdr), unc_len,
wdenkeedcd072004-09-08 22:03:11 +0000264 (uchar *)data, &len) != 0) {
wdenk4b9206e2004-03-23 22:14:11 +0000265 puts ("GUNZIP ERROR - must RESET board to recover\n");
Heiko Schocherfad63402007-07-13 09:54:17 +0200266 show_boot_progress (-6);
wdenk47d1a6e2002-11-03 00:01:44 +0000267 do_reset (cmdtp, flag, argc, argv);
268 }
269 break;
wdenkc29fdfc2003-08-29 20:57:53 +0000270#ifdef CONFIG_BZIP2
271 case IH_COMP_BZIP2:
272 printf (" Uncompressing %s ... ", name);
wdenk5653fc32004-02-08 22:55:38 +0000273 /*
274 * If we've got less than 4 MB of malloc() space,
275 * use slower decompression algorithm which requires
276 * at most 2300 KB of memory.
277 */
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100278 i = BZ2_bzBuffToBuffDecompress ((char*)image_get_load (hdr),
wdenk5653fc32004-02-08 22:55:38 +0000279 &unc_len, (char *)data, len,
280 CFG_MALLOC_LEN < (4096 * 1024), 0);
wdenkc29fdfc2003-08-29 20:57:53 +0000281 if (i != BZ_OK) {
282 printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
Heiko Schocherfad63402007-07-13 09:54:17 +0200283 show_boot_progress (-6);
wdenkc29fdfc2003-08-29 20:57:53 +0000284 do_reset (cmdtp, flag, argc, argv);
285 }
286 break;
287#endif /* CONFIG_BZIP2 */
wdenk47d1a6e2002-11-03 00:01:44 +0000288 default:
289 if (iflag)
290 enable_interrupts();
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100291 printf ("Unimplemented compression type %d\n", image_get_comp (hdr));
Heiko Schocherfad63402007-07-13 09:54:17 +0200292 show_boot_progress (-7);
wdenk47d1a6e2002-11-03 00:01:44 +0000293 return 1;
294 }
wdenk4b9206e2004-03-23 22:14:11 +0000295 puts ("OK\n");
Heiko Schocherfad63402007-07-13 09:54:17 +0200296 show_boot_progress (7);
wdenk47d1a6e2002-11-03 00:01:44 +0000297
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100298 switch (image_get_type (hdr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000299 case IH_TYPE_STANDALONE:
wdenk47d1a6e2002-11-03 00:01:44 +0000300 if (iflag)
301 enable_interrupts();
302
wdenk4a6fd342003-04-12 23:38:12 +0000303 /* load (and uncompress), but don't start if "autostart"
304 * is set to "no"
305 */
wdenk4a551702003-10-08 23:26:14 +0000306 if (((s = getenv("autostart")) != NULL) && (strcmp(s,"no") == 0)) {
307 char buf[32];
308 sprintf(buf, "%lX", len);
309 setenv("filesize", buf);
wdenk4a6fd342003-04-12 23:38:12 +0000310 return 0;
wdenk4a551702003-10-08 23:26:14 +0000311 }
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100312 appl = (int (*)(int, char *[]))image_get_ep (hdr);
wdenkb13fb012003-10-30 21:49:38 +0000313 (*appl)(argc-1, &argv[1]);
wdenk4a6fd342003-04-12 23:38:12 +0000314 return 0;
wdenk47d1a6e2002-11-03 00:01:44 +0000315 case IH_TYPE_KERNEL:
316 case IH_TYPE_MULTI:
317 /* handled below */
318 break;
319 default:
320 if (iflag)
321 enable_interrupts();
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100322 printf ("Can't boot image type %d\n", image_get_type (hdr));
Heiko Schocherfad63402007-07-13 09:54:17 +0200323 show_boot_progress (-8);
wdenk47d1a6e2002-11-03 00:01:44 +0000324 return 1;
325 }
Heiko Schocherfad63402007-07-13 09:54:17 +0200326 show_boot_progress (8);
wdenk47d1a6e2002-11-03 00:01:44 +0000327
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100328 switch (image_get_os (hdr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000329 default: /* handled by (original) Linux case */
330 case IH_OS_LINUX:
wdenkf72da342003-10-10 10:05:42 +0000331#ifdef CONFIG_SILENT_CONSOLE
332 fixup_silent_linux();
333#endif
wdenk47d1a6e2002-11-03 00:01:44 +0000334 do_bootm_linux (cmdtp, flag, argc, argv,
335 addr, len_ptr, verify);
336 break;
337 case IH_OS_NETBSD:
338 do_bootm_netbsd (cmdtp, flag, argc, argv,
339 addr, len_ptr, verify);
340 break;
wdenk8bde7f72003-06-27 21:31:46 +0000341
wdenk1f4bb372003-07-27 00:21:01 +0000342#ifdef CONFIG_LYNXKDI
343 case IH_OS_LYNXOS:
344 do_bootm_lynxkdi (cmdtp, flag, argc, argv,
345 addr, len_ptr, verify);
346 break;
347#endif
348
wdenkd791b1d2003-04-20 14:04:18 +0000349 case IH_OS_RTEMS:
350 do_bootm_rtems (cmdtp, flag, argc, argv,
351 addr, len_ptr, verify);
352 break;
wdenk8bde7f72003-06-27 21:31:46 +0000353
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500354#if defined(CONFIG_CMD_ELF)
wdenk47d1a6e2002-11-03 00:01:44 +0000355 case IH_OS_VXWORKS:
356 do_bootm_vxworks (cmdtp, flag, argc, argv,
357 addr, len_ptr, verify);
358 break;
359 case IH_OS_QNX:
360 do_bootm_qnxelf (cmdtp, flag, argc, argv,
361 addr, len_ptr, verify);
362 break;
Jon Loeliger90253172007-07-10 11:02:44 -0500363#endif
wdenk7f70e852003-05-20 14:25:27 +0000364#ifdef CONFIG_ARTOS
365 case IH_OS_ARTOS:
366 do_bootm_artos (cmdtp, flag, argc, argv,
367 addr, len_ptr, verify);
368 break;
369#endif
wdenk47d1a6e2002-11-03 00:01:44 +0000370 }
371
Heiko Schocherfad63402007-07-13 09:54:17 +0200372 show_boot_progress (-9);
wdenk47d1a6e2002-11-03 00:01:44 +0000373#ifdef DEBUG
wdenk4b9206e2004-03-23 22:14:11 +0000374 puts ("\n## Control returned to monitor - resetting...\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000375 do_reset (cmdtp, flag, argc, argv);
376#endif
377 return 1;
378}
379
wdenk0d498392003-07-01 21:06:45 +0000380U_BOOT_CMD(
381 bootm, CFG_MAXARGS, 1, do_bootm,
wdenk8bde7f72003-06-27 21:31:46 +0000382 "bootm - boot application image from memory\n",
383 "[addr [arg ...]]\n - boot application image stored in memory\n"
wdenk9d5028c2004-11-21 00:06:33 +0000384 "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
385 "\t'arg' can be the address of an initrd image\n"
Gerald Van Baren213bf8c2007-03-31 12:23:51 -0400386#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
Matthew McClintock98a9c4d2006-06-28 10:41:37 -0500387 "\tWhen booting a Linux kernel which requires a flat device-tree\n"
Detlev Zundel5441f612007-10-19 16:47:26 +0200388 "\ta third argument is required which is the address of the\n"
Matthew McClintock98a9c4d2006-06-28 10:41:37 -0500389 "\tdevice-tree blob. To boot that kernel without an initrd image,\n"
390 "\tuse a '-' for the second argument. If you do not pass a third\n"
391 "\ta bd_info struct will be passed instead\n"
392#endif
wdenk8bde7f72003-06-27 21:31:46 +0000393);
394
wdenkf72da342003-10-10 10:05:42 +0000395#ifdef CONFIG_SILENT_CONSOLE
396static void
397fixup_silent_linux ()
398{
wdenkf72da342003-10-10 10:05:42 +0000399 char buf[256], *start, *end;
400 char *cmdline = getenv ("bootargs");
401
402 /* Only fix cmdline when requested */
403 if (!(gd->flags & GD_FLG_SILENT))
404 return;
405
406 debug ("before silent fix-up: %s\n", cmdline);
407 if (cmdline) {
408 if ((start = strstr (cmdline, "console=")) != NULL) {
409 end = strchr (start, ' ');
410 strncpy (buf, cmdline, (start - cmdline + 8));
411 if (end)
412 strcpy (buf + (start - cmdline + 8), end);
413 else
414 buf[start - cmdline + 8] = '\0';
415 } else {
416 strcpy (buf, cmdline);
417 strcat (buf, " console=");
418 }
419 } else {
420 strcpy (buf, "console=");
421 }
422
423 setenv ("bootargs", buf);
424 debug ("after silent fix-up: %s\n", buf);
425}
426#endif /* CONFIG_SILENT_CONSOLE */
427
wdenk47d1a6e2002-11-03 00:01:44 +0000428static void
429do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
430 int argc, char *argv[],
431 ulong addr,
432 ulong *len_ptr,
433 int verify)
434{
wdenk47d1a6e2002-11-03 00:01:44 +0000435 image_header_t *hdr = &header;
436
437 void (*loader)(bd_t *, image_header_t *, char *, char *);
438 image_header_t *img_addr;
439 char *consdev;
440 char *cmdline;
441
442
443 /*
444 * Booting a (NetBSD) kernel image
445 *
446 * This process is pretty similar to a standalone application:
447 * The (first part of an multi-) image must be a stage-2 loader,
448 * which in turn is responsible for loading & invoking the actual
449 * kernel. The only differences are the parameters being passed:
450 * besides the board info strucure, the loader expects a command
451 * line, the name of the console device, and (optionally) the
452 * address of the original image header.
453 */
454
455 img_addr = 0;
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100456 if ((image_check_type (hdr, IH_TYPE_MULTI)) && (len_ptr[1]))
wdenk47d1a6e2002-11-03 00:01:44 +0000457 img_addr = (image_header_t *) addr;
458
459
460 consdev = "";
461#if defined (CONFIG_8xx_CONS_SMC1)
462 consdev = "smc1";
463#elif defined (CONFIG_8xx_CONS_SMC2)
464 consdev = "smc2";
465#elif defined (CONFIG_8xx_CONS_SCC2)
466 consdev = "scc2";
467#elif defined (CONFIG_8xx_CONS_SCC3)
468 consdev = "scc3";
469#endif
470
471 if (argc > 2) {
472 ulong len;
473 int i;
474
475 for (i=2, len=0 ; i<argc ; i+=1)
476 len += strlen (argv[i]) + 1;
477 cmdline = malloc (len);
478
479 for (i=2, len=0 ; i<argc ; i+=1) {
480 if (i > 2)
481 cmdline[len++] = ' ';
482 strcpy (&cmdline[len], argv[i]);
483 len += strlen (argv[i]);
484 }
485 } else if ((cmdline = getenv("bootargs")) == NULL) {
486 cmdline = "";
487 }
488
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100489 loader = (void (*)(bd_t *, image_header_t *, char *, char *))image_get_ep (hdr);
wdenk47d1a6e2002-11-03 00:01:44 +0000490
491 printf ("## Transferring control to NetBSD stage-2 loader (at address %08lx) ...\n",
492 (ulong)loader);
493
Heiko Schocherfad63402007-07-13 09:54:17 +0200494 show_boot_progress (15);
wdenk47d1a6e2002-11-03 00:01:44 +0000495
496 /*
497 * NetBSD Stage-2 Loader Parameters:
498 * r3: ptr to board info data
499 * r4: image address
500 * r5: console device
501 * r6: boot args string
502 */
503 (*loader) (gd->bd, img_addr, consdev, cmdline);
504}
505
wdenk7f70e852003-05-20 14:25:27 +0000506#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
507
508/* Function that returns a character from the environment */
509extern uchar (*env_get_char)(int);
510
511static void
512do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
513 int argc, char *argv[],
514 ulong addr,
515 ulong *len_ptr,
516 int verify)
517{
wdenk7f70e852003-05-20 14:25:27 +0000518 ulong top;
519 char *s, *cmdline;
520 char **fwenv, **ss;
521 int i, j, nxt, len, envno, envsz;
522 bd_t *kbd;
523 void (*entry)(bd_t *bd, char *cmdline, char **fwenv, ulong top);
524 image_header_t *hdr = &header;
525
526 /*
527 * Booting an ARTOS kernel image + application
528 */
529
530 /* this used to be the top of memory, but was wrong... */
531#ifdef CONFIG_PPC
532 /* get stack pointer */
533 asm volatile ("mr %0,1" : "=r"(top) );
534#endif
535 debug ("## Current stack ends at 0x%08lX ", top);
536
537 top -= 2048; /* just to be sure */
538 if (top > CFG_BOOTMAPSZ)
539 top = CFG_BOOTMAPSZ;
540 top &= ~0xF;
541
542 debug ("=> set upper limit to 0x%08lX\n", top);
543
544 /* first check the artos specific boot args, then the linux args*/
545 if ((s = getenv("abootargs")) == NULL && (s = getenv("bootargs")) == NULL)
546 s = "";
547
548 /* get length of cmdline, and place it */
549 len = strlen(s);
550 top = (top - (len + 1)) & ~0xF;
551 cmdline = (char *)top;
552 debug ("## cmdline at 0x%08lX ", top);
553 strcpy(cmdline, s);
554
555 /* copy bdinfo */
556 top = (top - sizeof(bd_t)) & ~0xF;
557 debug ("## bd at 0x%08lX ", top);
558 kbd = (bd_t *)top;
559 memcpy(kbd, gd->bd, sizeof(bd_t));
560
561 /* first find number of env entries, and their size */
562 envno = 0;
563 envsz = 0;
564 for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
565 for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
566 ;
567 envno++;
568 envsz += (nxt - i) + 1; /* plus trailing zero */
569 }
570 envno++; /* plus the terminating zero */
571 debug ("## %u envvars total size %u ", envno, envsz);
572
573 top = (top - sizeof(char **)*envno) & ~0xF;
574 fwenv = (char **)top;
575 debug ("## fwenv at 0x%08lX ", top);
576
577 top = (top - envsz) & ~0xF;
578 s = (char *)top;
579 ss = fwenv;
580
581 /* now copy them */
582 for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
583 for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
584 ;
585 *ss++ = s;
586 for (j = i; j < nxt; ++j)
587 *s++ = env_get_char(j);
588 *s++ = '\0';
589 }
590 *ss++ = NULL; /* terminate */
591
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100592 entry = (void (*)(bd_t *, char *, char **, ulong))image_get_ep (hdr);
wdenk7f70e852003-05-20 14:25:27 +0000593 (*entry)(kbd, cmdline, fwenv, top);
594}
595#endif
596
597
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500598#if defined(CONFIG_CMD_BOOTD)
wdenk47d1a6e2002-11-03 00:01:44 +0000599int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
600{
601 int rcode = 0;
602#ifndef CFG_HUSH_PARSER
603 if (run_command (getenv ("bootcmd"), flag) < 0) rcode = 1;
604#else
605 if (parse_string_outer(getenv("bootcmd"),
606 FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0 ) rcode = 1;
607#endif
608 return rcode;
609}
wdenk8bde7f72003-06-27 21:31:46 +0000610
wdenk0d498392003-07-01 21:06:45 +0000611U_BOOT_CMD(
612 boot, 1, 1, do_bootd,
wdenk9d2b18a2003-06-28 23:11:04 +0000613 "boot - boot default, i.e., run 'bootcmd'\n",
614 NULL
615);
616
617/* keep old command name "bootd" for backward compatibility */
wdenk0d498392003-07-01 21:06:45 +0000618U_BOOT_CMD(
619 bootd, 1, 1, do_bootd,
wdenk8bde7f72003-06-27 21:31:46 +0000620 "bootd - boot default, i.e., run 'bootcmd'\n",
621 NULL
622);
623
wdenk47d1a6e2002-11-03 00:01:44 +0000624#endif
625
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500626#if defined(CONFIG_CMD_IMI)
wdenk47d1a6e2002-11-03 00:01:44 +0000627int do_iminfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
628{
629 int arg;
630 ulong addr;
631 int rcode=0;
632
633 if (argc < 2) {
634 return image_info (load_addr);
635 }
636
637 for (arg=1; arg <argc; ++arg) {
638 addr = simple_strtoul(argv[arg], NULL, 16);
639 if (image_info (addr) != 0) rcode = 1;
640 }
641 return rcode;
642}
643
644static int image_info (ulong addr)
645{
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100646 image_header_t *hdr = (image_header_t *)addr;
wdenk47d1a6e2002-11-03 00:01:44 +0000647
648 printf ("\n## Checking Image at %08lx ...\n", addr);
649
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100650 if (!image_check_magic (hdr)) {
wdenk4b9206e2004-03-23 22:14:11 +0000651 puts (" Bad Magic Number\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000652 return 1;
653 }
654
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100655 if (!image_check_hcrc (hdr)) {
wdenk4b9206e2004-03-23 22:14:11 +0000656 puts (" Bad Header Checksum\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000657 return 1;
658 }
659
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100660 print_image_hdr (hdr);
wdenk47d1a6e2002-11-03 00:01:44 +0000661
wdenk4b9206e2004-03-23 22:14:11 +0000662 puts (" Verifying Checksum ... ");
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100663 if (!image_check_dcrc (hdr)) {
wdenk4b9206e2004-03-23 22:14:11 +0000664 puts (" Bad Data CRC\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000665 return 1;
666 }
wdenk4b9206e2004-03-23 22:14:11 +0000667 puts ("OK\n");
wdenk47d1a6e2002-11-03 00:01:44 +0000668 return 0;
669}
wdenk0d498392003-07-01 21:06:45 +0000670
671U_BOOT_CMD(
672 iminfo, CFG_MAXARGS, 1, do_iminfo,
wdenk8bde7f72003-06-27 21:31:46 +0000673 "iminfo - print header information for application image\n",
674 "addr [addr ...]\n"
675 " - print header information for application image starting at\n"
676 " address 'addr' in memory; this includes verification of the\n"
677 " image contents (magic number, header and payload checksums)\n"
678);
679
Jon Loeliger90253172007-07-10 11:02:44 -0500680#endif
wdenk47d1a6e2002-11-03 00:01:44 +0000681
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500682#if defined(CONFIG_CMD_IMLS)
wdenk27b207f2003-07-24 23:38:38 +0000683/*-----------------------------------------------------------------------
684 * List all images found in flash.
685 */
686int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
687{
688 flash_info_t *info;
689 int i, j;
690 image_header_t *hdr;
wdenk27b207f2003-07-24 23:38:38 +0000691
692 for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
693 if (info->flash_id == FLASH_UNKNOWN)
694 goto next_bank;
Marian Balakowicze6f2e902005-10-11 19:09:42 +0200695 for (j=0; j<info->sector_count; ++j) {
wdenk27b207f2003-07-24 23:38:38 +0000696
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100697 hdr = (image_header_t *)info->start[j];
698
699 if (!hdr || !image_check_magic (hdr))
wdenk27b207f2003-07-24 23:38:38 +0000700 goto next_sector;
701
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100702 if (!image_check_hcrc (hdr))
wdenk27b207f2003-07-24 23:38:38 +0000703 goto next_sector;
704
705 printf ("Image at %08lX:\n", (ulong)hdr);
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100706 print_image_hdr (hdr);
wdenk5bb226e2003-11-17 21:14:37 +0000707
wdenk4b9206e2004-03-23 22:14:11 +0000708 puts (" Verifying Checksum ... ");
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100709 if (!image_check_dcrc (hdr)) {
710 puts ("Bad Data CRC\n");
711 } else {
712 puts ("OK\n");
wdenk5bb226e2003-11-17 21:14:37 +0000713 }
wdenkbdccc4f2003-08-05 17:43:17 +0000714next_sector: ;
wdenk27b207f2003-07-24 23:38:38 +0000715 }
wdenkbdccc4f2003-08-05 17:43:17 +0000716next_bank: ;
wdenk27b207f2003-07-24 23:38:38 +0000717 }
718
719 return (0);
720}
721
722U_BOOT_CMD(
723 imls, 1, 1, do_imls,
724 "imls - list all images found in flash\n",
725 "\n"
726 " - Prints information about all images found at sector\n"
727 " boundaries in flash.\n"
728);
Jon Loeliger90253172007-07-10 11:02:44 -0500729#endif
wdenk27b207f2003-07-24 23:38:38 +0000730
wdenk47d1a6e2002-11-03 00:01:44 +0000731void
732print_image_hdr (image_header_t *hdr)
733{
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500734#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100735 time_t timestamp = (time_t)image_get_time (hdr);
wdenk47d1a6e2002-11-03 00:01:44 +0000736 struct rtc_time tm;
737#endif
738
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100739 printf (" Image Name: %.*s\n", IH_NMLEN, image_get_name (hdr));
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500740#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
wdenk47d1a6e2002-11-03 00:01:44 +0000741 to_tm (timestamp, &tm);
742 printf (" Created: %4d-%02d-%02d %2d:%02d:%02d UTC\n",
743 tm.tm_year, tm.tm_mon, tm.tm_mday,
744 tm.tm_hour, tm.tm_min, tm.tm_sec);
Jon Loeliger90253172007-07-10 11:02:44 -0500745#endif
wdenk4b9206e2004-03-23 22:14:11 +0000746 puts (" Image Type: "); print_type(hdr);
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100747 printf ("\n Data Size: %d Bytes = ", image_get_data_size (hdr));
748 print_size (image_get_data_size (hdr), "\n");
wdenk4b9206e2004-03-23 22:14:11 +0000749 printf (" Load Address: %08x\n"
750 " Entry Point: %08x\n",
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100751 image_get_load (hdr), image_get_ep (hdr));
wdenk47d1a6e2002-11-03 00:01:44 +0000752
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100753 if (image_check_type (hdr, IH_TYPE_MULTI)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000754 int i;
755 ulong len;
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100756 ulong *len_ptr = (ulong *)((ulong)hdr + image_get_header_size ());
wdenk47d1a6e2002-11-03 00:01:44 +0000757
wdenk4b9206e2004-03-23 22:14:11 +0000758 puts (" Contents:\n");
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100759 for (i=0; (len = image_to_cpu (*len_ptr)); ++i, ++len_ptr) {
wdenk47d1a6e2002-11-03 00:01:44 +0000760 printf (" Image %d: %8ld Bytes = ", i, len);
761 print_size (len, "\n");
762 }
763 }
764}
765
766
767static void
768print_type (image_header_t *hdr)
769{
770 char *os, *arch, *type, *comp;
771
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100772 switch (image_get_os (hdr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000773 case IH_OS_INVALID: os = "Invalid OS"; break;
774 case IH_OS_NETBSD: os = "NetBSD"; break;
775 case IH_OS_LINUX: os = "Linux"; break;
776 case IH_OS_VXWORKS: os = "VxWorks"; break;
777 case IH_OS_QNX: os = "QNX"; break;
778 case IH_OS_U_BOOT: os = "U-Boot"; break;
wdenkd791b1d2003-04-20 14:04:18 +0000779 case IH_OS_RTEMS: os = "RTEMS"; break;
wdenk7f70e852003-05-20 14:25:27 +0000780#ifdef CONFIG_ARTOS
781 case IH_OS_ARTOS: os = "ARTOS"; break;
782#endif
wdenk1f4bb372003-07-27 00:21:01 +0000783#ifdef CONFIG_LYNXKDI
784 case IH_OS_LYNXOS: os = "LynxOS"; break;
785#endif
wdenk47d1a6e2002-11-03 00:01:44 +0000786 default: os = "Unknown OS"; break;
787 }
788
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100789 switch (image_get_arch (hdr)) {
790 case IH_ARCH_INVALID: arch = "Invalid CPU"; break;
791 case IH_ARCH_ALPHA: arch = "Alpha"; break;
792 case IH_ARCH_ARM: arch = "ARM"; break;
793 case IH_ARCH_AVR32: arch = "AVR32"; break;
794 case IH_ARCH_BLACKFIN: arch = "Blackfin"; break;
795 case IH_ARCH_I386: arch = "Intel x86"; break;
796 case IH_ARCH_IA64: arch = "IA64"; break;
797 case IH_ARCH_M68K: arch = "M68K"; break;
798 case IH_ARCH_MICROBLAZE:arch = "Microblaze"; break;
799 case IH_ARCH_MIPS64: arch = "MIPS 64 Bit"; break;
800 case IH_ARCH_MIPS: arch = "MIPS"; break;
801 case IH_ARCH_NIOS2: arch = "Nios-II"; break;
802 case IH_ARCH_NIOS: arch = "Nios"; break;
803 case IH_ARCH_PPC: arch = "PowerPC"; break;
804 case IH_ARCH_S390: arch = "IBM S390"; break;
805 case IH_ARCH_SH: arch = "SuperH"; break;
806 case IH_ARCH_SPARC64: arch = "SPARC 64 Bit"; break;
807 case IH_ARCH_SPARC: arch = "SPARC"; break;
wdenk47d1a6e2002-11-03 00:01:44 +0000808 default: arch = "Unknown Architecture"; break;
809 }
810
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100811 switch (image_get_type (hdr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000812 case IH_TYPE_INVALID: type = "Invalid Image"; break;
813 case IH_TYPE_STANDALONE:type = "Standalone Program"; break;
814 case IH_TYPE_KERNEL: type = "Kernel Image"; break;
815 case IH_TYPE_RAMDISK: type = "RAMDisk Image"; break;
816 case IH_TYPE_MULTI: type = "Multi-File Image"; break;
817 case IH_TYPE_FIRMWARE: type = "Firmware"; break;
818 case IH_TYPE_SCRIPT: type = "Script"; break;
Matthew McClintock25c751e2006-08-16 10:54:09 -0500819 case IH_TYPE_FLATDT: type = "Flat Device Tree"; break;
wdenk47d1a6e2002-11-03 00:01:44 +0000820 default: type = "Unknown Image"; break;
821 }
822
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100823 switch (image_get_comp (hdr)) {
wdenk47d1a6e2002-11-03 00:01:44 +0000824 case IH_COMP_NONE: comp = "uncompressed"; break;
825 case IH_COMP_GZIP: comp = "gzip compressed"; break;
826 case IH_COMP_BZIP2: comp = "bzip2 compressed"; break;
827 default: comp = "unknown compression"; break;
828 }
829
830 printf ("%s %s %s (%s)", arch, os, type, comp);
831}
832
wdenkd791b1d2003-04-20 14:04:18 +0000833static void
834do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
835 ulong addr, ulong *len_ptr, int verify)
836{
wdenkd791b1d2003-04-20 14:04:18 +0000837 image_header_t *hdr = &header;
838 void (*entry_point)(bd_t *);
839
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100840 entry_point = (void (*)(bd_t *))image_get_ep (hdr);
wdenkd791b1d2003-04-20 14:04:18 +0000841
842 printf ("## Transferring control to RTEMS (at address %08lx) ...\n",
843 (ulong)entry_point);
844
Heiko Schocherfad63402007-07-13 09:54:17 +0200845 show_boot_progress (15);
wdenkd791b1d2003-04-20 14:04:18 +0000846
847 /*
848 * RTEMS Parameters:
849 * r3: ptr to board info data
850 */
851
852 (*entry_point ) ( gd->bd );
853}
854
Jon Loeligerbaa26db2007-07-08 17:51:39 -0500855#if defined(CONFIG_CMD_ELF)
wdenk47d1a6e2002-11-03 00:01:44 +0000856static void
857do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
858 ulong addr, ulong *len_ptr, int verify)
859{
860 image_header_t *hdr = &header;
861 char str[80];
862
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100863 sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */
wdenk47d1a6e2002-11-03 00:01:44 +0000864 setenv("loadaddr", str);
865 do_bootvx(cmdtp, 0, 0, NULL);
866}
867
868static void
869do_bootm_qnxelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
870 ulong addr, ulong *len_ptr, int verify)
871{
872 image_header_t *hdr = &header;
873 char *local_args[2];
874 char str[16];
875
Marian Balakowiczb97a2a02008-01-08 18:14:09 +0100876 sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */
wdenk47d1a6e2002-11-03 00:01:44 +0000877 local_args[0] = argv[0];
878 local_args[1] = str; /* and provide it via the arguments */
879 do_bootelf(cmdtp, 0, 2, local_args);
880}
Jon Loeliger90253172007-07-10 11:02:44 -0500881#endif
wdenk1f4bb372003-07-27 00:21:01 +0000882
883#ifdef CONFIG_LYNXKDI
884static void
885do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
886 int argc, char *argv[],
887 ulong addr,
888 ulong *len_ptr,
889 int verify)
890{
891 lynxkdi_boot( &header );
892}
893
894#endif /* CONFIG_LYNXKDI */