blob: 56b7fca83331ec84e68c2af5a4868ebe7a539cd7 [file] [log] [blame]
wdenkc6097192002-11-03 00:24:07 +00001/*
2 * (C) Copyright 2002
3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
5 *
6 * Copyright (C) 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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
wdenk29e7f5a2004-03-12 00:14:09 +000015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wdenkc6097192002-11-03 00:24:07 +000016 * 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
wdenk29e7f5a2004-03-12 00:14:09 +000020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
wdenkc6097192002-11-03 00:24:07 +000021 *
22 */
23
24#include <common.h>
25#include <command.h>
wdenkc6097192002-11-03 00:24:07 +000026#include <image.h>
27#include <zlib.h>
28#include <asm/byteorder.h>
wdenk381669a2003-06-16 23:50:08 +000029#ifdef CONFIG_HAS_DATAFLASH
30#include <dataflash.h>
31#endif
wdenkc6097192002-11-03 00:24:07 +000032
Wolfgang Denk6405a152006-03-31 18:32:53 +020033DECLARE_GLOBAL_DATA_PTR;
34
wdenk57b2d802003-06-27 21:31:46 +000035/*cmd_boot.c*/
36extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
37
wdenkc6097192002-11-03 00:24:07 +000038#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
39 defined (CONFIG_CMDLINE_TAG) || \
40 defined (CONFIG_INITRD_TAG) || \
wdenkbc01dd52004-01-02 16:05:07 +000041 defined (CONFIG_SERIAL_TAG) || \
42 defined (CONFIG_REVISION_TAG) || \
wdenk9ca7bbc2004-10-09 23:25:58 +000043 defined (CONFIG_VFD) || \
44 defined (CONFIG_LCD)
wdenk86765902003-12-06 23:55:10 +000045static void setup_start_tag (bd_t *bd);
46
wdenk699b13a2002-11-03 18:03:52 +000047# ifdef CONFIG_SETUP_MEMORY_TAGS
wdenk86765902003-12-06 23:55:10 +000048static void setup_memory_tags (bd_t *bd);
wdenk699b13a2002-11-03 18:03:52 +000049# endif
wdenk86765902003-12-06 23:55:10 +000050static void setup_commandline_tag (bd_t *bd, char *commandline);
51
wdenkc6097192002-11-03 00:24:07 +000052#if 0
wdenk86765902003-12-06 23:55:10 +000053static void setup_ramdisk_tag (bd_t *bd);
wdenkc6097192002-11-03 00:24:07 +000054#endif
wdenk699b13a2002-11-03 18:03:52 +000055# ifdef CONFIG_INITRD_TAG
wdenk86765902003-12-06 23:55:10 +000056static void setup_initrd_tag (bd_t *bd, ulong initrd_start,
57 ulong initrd_end);
wdenk699b13a2002-11-03 18:03:52 +000058# endif
wdenk86765902003-12-06 23:55:10 +000059static void setup_end_tag (bd_t *bd);
60
wdenk9ca7bbc2004-10-09 23:25:58 +000061# if defined (CONFIG_VFD) || defined (CONFIG_LCD)
wdenk86765902003-12-06 23:55:10 +000062static void setup_videolfb_tag (gd_t *gd);
wdenk699b13a2002-11-03 18:03:52 +000063# endif
wdenkc6097192002-11-03 00:24:07 +000064
65
66static struct tag *params;
67#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
68
wdenk384ae022002-11-05 00:17:55 +000069#ifdef CONFIG_SHOW_BOOT_PROGRESS
70# include <status_led.h>
71# define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg)
72#else
73# define SHOW_BOOT_PROGRESS(arg)
74#endif
75
wdenk86765902003-12-06 23:55:10 +000076extern image_header_t header; /* from cmd_bootm.c */
wdenkc6097192002-11-03 00:24:07 +000077
78
wdenk86765902003-12-06 23:55:10 +000079void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
80 ulong addr, ulong *len_ptr, int verify)
wdenkc6097192002-11-03 00:24:07 +000081{
wdenk86765902003-12-06 23:55:10 +000082 ulong len = 0, checksum;
83 ulong initrd_start, initrd_end;
84 ulong data;
wdenk4ea537d2003-12-07 18:32:37 +000085 void (*theKernel)(int zero, int arch, uint params);
wdenk86765902003-12-06 23:55:10 +000086 image_header_t *hdr = &header;
87 bd_t *bd = gd->bd;
88
wdenkc6097192002-11-03 00:24:07 +000089#ifdef CONFIG_CMDLINE_TAG
wdenk86765902003-12-06 23:55:10 +000090 char *commandline = getenv ("bootargs");
wdenkc6097192002-11-03 00:24:07 +000091#endif
92
wdenk4ea537d2003-12-07 18:32:37 +000093 theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep);
wdenkc6097192002-11-03 00:24:07 +000094
wdenk86765902003-12-06 23:55:10 +000095 /*
96 * Check if there is an initrd image
97 */
98 if (argc >= 3) {
99 SHOW_BOOT_PROGRESS (9);
wdenk384ae022002-11-05 00:17:55 +0000100
wdenk86765902003-12-06 23:55:10 +0000101 addr = simple_strtoul (argv[2], NULL, 16);
wdenkc6097192002-11-03 00:24:07 +0000102
wdenk86765902003-12-06 23:55:10 +0000103 printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
wdenkc6097192002-11-03 00:24:07 +0000104
wdenk86765902003-12-06 23:55:10 +0000105 /* Copy header so we can blank CRC field for re-calculation */
wdenk381669a2003-06-16 23:50:08 +0000106#ifdef CONFIG_HAS_DATAFLASH
wdenk86765902003-12-06 23:55:10 +0000107 if (addr_dataflash (addr)) {
108 read_dataflash (addr, sizeof (image_header_t),
109 (char *) &header);
110 } else
wdenk57b2d802003-06-27 21:31:46 +0000111#endif
wdenk86765902003-12-06 23:55:10 +0000112 memcpy (&header, (char *) addr,
113 sizeof (image_header_t));
wdenkc6097192002-11-03 00:24:07 +0000114
wdenk86765902003-12-06 23:55:10 +0000115 if (ntohl (hdr->ih_magic) != IH_MAGIC) {
116 printf ("Bad Magic Number\n");
117 SHOW_BOOT_PROGRESS (-10);
118 do_reset (cmdtp, flag, argc, argv);
119 }
wdenkc6097192002-11-03 00:24:07 +0000120
wdenk86765902003-12-06 23:55:10 +0000121 data = (ulong) & header;
122 len = sizeof (image_header_t);
wdenkc6097192002-11-03 00:24:07 +0000123
wdenk86765902003-12-06 23:55:10 +0000124 checksum = ntohl (hdr->ih_hcrc);
125 hdr->ih_hcrc = 0;
wdenkc6097192002-11-03 00:24:07 +0000126
Wolfgang Denk7fa6e902006-03-11 22:53:33 +0100127 if (crc32 (0, (unsigned char *) data, len) != checksum) {
wdenk86765902003-12-06 23:55:10 +0000128 printf ("Bad Header Checksum\n");
129 SHOW_BOOT_PROGRESS (-11);
130 do_reset (cmdtp, flag, argc, argv);
131 }
wdenkc6097192002-11-03 00:24:07 +0000132
wdenk86765902003-12-06 23:55:10 +0000133 SHOW_BOOT_PROGRESS (10);
wdenk384ae022002-11-05 00:17:55 +0000134
wdenk86765902003-12-06 23:55:10 +0000135 print_image_hdr (hdr);
wdenkc6097192002-11-03 00:24:07 +0000136
wdenk86765902003-12-06 23:55:10 +0000137 data = addr + sizeof (image_header_t);
138 len = ntohl (hdr->ih_size);
wdenkc6097192002-11-03 00:24:07 +0000139
wdenk381669a2003-06-16 23:50:08 +0000140#ifdef CONFIG_HAS_DATAFLASH
wdenk86765902003-12-06 23:55:10 +0000141 if (addr_dataflash (addr)) {
142 read_dataflash (data, len, (char *) CFG_LOAD_ADDR);
143 data = CFG_LOAD_ADDR;
144 }
wdenk381669a2003-06-16 23:50:08 +0000145#endif
146
wdenk86765902003-12-06 23:55:10 +0000147 if (verify) {
148 ulong csum = 0;
wdenkc6097192002-11-03 00:24:07 +0000149
wdenk86765902003-12-06 23:55:10 +0000150 printf (" Verifying Checksum ... ");
Wolfgang Denk7fa6e902006-03-11 22:53:33 +0100151 csum = crc32 (0, (unsigned char *) data, len);
wdenk86765902003-12-06 23:55:10 +0000152 if (csum != ntohl (hdr->ih_dcrc)) {
153 printf ("Bad Data CRC\n");
154 SHOW_BOOT_PROGRESS (-12);
155 do_reset (cmdtp, flag, argc, argv);
156 }
157 printf ("OK\n");
158 }
wdenkc6097192002-11-03 00:24:07 +0000159
wdenk86765902003-12-06 23:55:10 +0000160 SHOW_BOOT_PROGRESS (11);
wdenk384ae022002-11-05 00:17:55 +0000161
wdenk86765902003-12-06 23:55:10 +0000162 if ((hdr->ih_os != IH_OS_LINUX) ||
163 (hdr->ih_arch != IH_CPU_ARM) ||
164 (hdr->ih_type != IH_TYPE_RAMDISK)) {
165 printf ("No Linux ARM Ramdisk Image\n");
166 SHOW_BOOT_PROGRESS (-13);
167 do_reset (cmdtp, flag, argc, argv);
168 }
wdenkc6097192002-11-03 00:24:07 +0000169
Wolfgang Denk4dc11462005-09-26 01:06:33 +0200170#if defined(CONFIG_B2) || defined(CONFIG_EVB4510) || defined(CONFIG_ARMADILLO)
wdenkb98ac282004-02-24 00:16:43 +0000171 /*
172 *we need to copy the ramdisk to SRAM to let Linux boot
173 */
174 memmove ((void *) ntohl(hdr->ih_load), (uchar *)data, len);
175 data = ntohl(hdr->ih_load);
wdenk82db02f2004-07-11 22:19:26 +0000176#endif /* CONFIG_B2 || CONFIG_EVB4510 */
wdenkb98ac282004-02-24 00:16:43 +0000177
wdenk86765902003-12-06 23:55:10 +0000178 /*
179 * Now check if we have a multifile image
180 */
181 } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
182 ulong tail = ntohl (len_ptr[0]) % 4;
183 int i;
wdenkc6097192002-11-03 00:24:07 +0000184
wdenk86765902003-12-06 23:55:10 +0000185 SHOW_BOOT_PROGRESS (13);
wdenk384ae022002-11-05 00:17:55 +0000186
wdenk86765902003-12-06 23:55:10 +0000187 /* skip kernel length and terminator */
188 data = (ulong) (&len_ptr[2]);
189 /* skip any additional image length fields */
190 for (i = 1; len_ptr[i]; ++i)
191 data += 4;
192 /* add kernel length, and align */
193 data += ntohl (len_ptr[0]);
194 if (tail) {
195 data += 4 - tail;
196 }
wdenkc6097192002-11-03 00:24:07 +0000197
wdenk86765902003-12-06 23:55:10 +0000198 len = ntohl (len_ptr[1]);
wdenkc6097192002-11-03 00:24:07 +0000199
wdenk86765902003-12-06 23:55:10 +0000200 } else {
201 /*
202 * no initrd image
203 */
204 SHOW_BOOT_PROGRESS (14);
wdenk384ae022002-11-05 00:17:55 +0000205
wdenk86765902003-12-06 23:55:10 +0000206 len = data = 0;
207 }
wdenkc6097192002-11-03 00:24:07 +0000208
209#ifdef DEBUG
wdenk86765902003-12-06 23:55:10 +0000210 if (!data) {
211 printf ("No initrd\n");
212 }
wdenkc6097192002-11-03 00:24:07 +0000213#endif
214
wdenk86765902003-12-06 23:55:10 +0000215 if (data) {
216 initrd_start = data;
217 initrd_end = initrd_start + len;
218 } else {
219 initrd_start = 0;
220 initrd_end = 0;
221 }
wdenkc6097192002-11-03 00:24:07 +0000222
wdenk86765902003-12-06 23:55:10 +0000223 SHOW_BOOT_PROGRESS (15);
wdenk384ae022002-11-05 00:17:55 +0000224
wdenk86765902003-12-06 23:55:10 +0000225 debug ("## Transferring control to Linux (at address %08lx) ...\n",
226 (ulong) theKernel);
wdenkc6097192002-11-03 00:24:07 +0000227
228#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
229 defined (CONFIG_CMDLINE_TAG) || \
230 defined (CONFIG_INITRD_TAG) || \
wdenkbc01dd52004-01-02 16:05:07 +0000231 defined (CONFIG_SERIAL_TAG) || \
232 defined (CONFIG_REVISION_TAG) || \
wdenk9ca7bbc2004-10-09 23:25:58 +0000233 defined (CONFIG_LCD) || \
wdenkc6097192002-11-03 00:24:07 +0000234 defined (CONFIG_VFD)
wdenk86765902003-12-06 23:55:10 +0000235 setup_start_tag (bd);
wdenkbc01dd52004-01-02 16:05:07 +0000236#ifdef CONFIG_SERIAL_TAG
237 setup_serial_tag (&params);
238#endif
239#ifdef CONFIG_REVISION_TAG
240 setup_revision_tag (&params);
241#endif
wdenkc6097192002-11-03 00:24:07 +0000242#ifdef CONFIG_SETUP_MEMORY_TAGS
wdenk86765902003-12-06 23:55:10 +0000243 setup_memory_tags (bd);
wdenkc6097192002-11-03 00:24:07 +0000244#endif
245#ifdef CONFIG_CMDLINE_TAG
wdenk86765902003-12-06 23:55:10 +0000246 setup_commandline_tag (bd, commandline);
wdenkc6097192002-11-03 00:24:07 +0000247#endif
248#ifdef CONFIG_INITRD_TAG
wdenk86765902003-12-06 23:55:10 +0000249 if (initrd_start && initrd_end)
250 setup_initrd_tag (bd, initrd_start, initrd_end);
wdenkc6097192002-11-03 00:24:07 +0000251#endif
wdenk9ca7bbc2004-10-09 23:25:58 +0000252#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
wdenk86765902003-12-06 23:55:10 +0000253 setup_videolfb_tag ((gd_t *) gd);
wdenkc6097192002-11-03 00:24:07 +0000254#endif
wdenk86765902003-12-06 23:55:10 +0000255 setup_end_tag (bd);
wdenkc6097192002-11-03 00:24:07 +0000256#endif
257
wdenk86765902003-12-06 23:55:10 +0000258 /* we assume that the kernel is in place */
259 printf ("\nStarting kernel ...\n\n");
wdenkc6097192002-11-03 00:24:07 +0000260
wdenk29e7f5a2004-03-12 00:14:09 +0000261#ifdef CONFIG_USB_DEVICE
262 {
263 extern void udc_disconnect (void);
264 udc_disconnect ();
265 }
266#endif
267
wdenk86765902003-12-06 23:55:10 +0000268 cleanup_before_linux ();
wdenkc6097192002-11-03 00:24:07 +0000269
wdenk4ea537d2003-12-07 18:32:37 +0000270 theKernel (0, bd->bi_arch_number, bd->bi_boot_params);
wdenkc6097192002-11-03 00:24:07 +0000271}
272
273
274#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
275 defined (CONFIG_CMDLINE_TAG) || \
276 defined (CONFIG_INITRD_TAG) || \
wdenkbc01dd52004-01-02 16:05:07 +0000277 defined (CONFIG_SERIAL_TAG) || \
278 defined (CONFIG_REVISION_TAG) || \
wdenk9ca7bbc2004-10-09 23:25:58 +0000279 defined (CONFIG_LCD) || \
wdenkc6097192002-11-03 00:24:07 +0000280 defined (CONFIG_VFD)
wdenk86765902003-12-06 23:55:10 +0000281static void setup_start_tag (bd_t *bd)
wdenkc6097192002-11-03 00:24:07 +0000282{
wdenk86765902003-12-06 23:55:10 +0000283 params = (struct tag *) bd->bi_boot_params;
wdenkc6097192002-11-03 00:24:07 +0000284
wdenk86765902003-12-06 23:55:10 +0000285 params->hdr.tag = ATAG_CORE;
286 params->hdr.size = tag_size (tag_core);
wdenkc6097192002-11-03 00:24:07 +0000287
wdenk86765902003-12-06 23:55:10 +0000288 params->u.core.flags = 0;
289 params->u.core.pagesize = 0;
290 params->u.core.rootdev = 0;
wdenkc6097192002-11-03 00:24:07 +0000291
wdenk86765902003-12-06 23:55:10 +0000292 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000293}
294
295
wdenk699b13a2002-11-03 18:03:52 +0000296#ifdef CONFIG_SETUP_MEMORY_TAGS
wdenk86765902003-12-06 23:55:10 +0000297static void setup_memory_tags (bd_t *bd)
wdenkc6097192002-11-03 00:24:07 +0000298{
wdenk86765902003-12-06 23:55:10 +0000299 int i;
wdenkc6097192002-11-03 00:24:07 +0000300
wdenk86765902003-12-06 23:55:10 +0000301 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
302 params->hdr.tag = ATAG_MEM;
303 params->hdr.size = tag_size (tag_mem32);
wdenkc6097192002-11-03 00:24:07 +0000304
wdenk86765902003-12-06 23:55:10 +0000305 params->u.mem.start = bd->bi_dram[i].start;
306 params->u.mem.size = bd->bi_dram[i].size;
wdenkc6097192002-11-03 00:24:07 +0000307
wdenk86765902003-12-06 23:55:10 +0000308 params = tag_next (params);
309 }
wdenkc6097192002-11-03 00:24:07 +0000310}
wdenk86765902003-12-06 23:55:10 +0000311#endif /* CONFIG_SETUP_MEMORY_TAGS */
wdenkc6097192002-11-03 00:24:07 +0000312
313
wdenk86765902003-12-06 23:55:10 +0000314static void setup_commandline_tag (bd_t *bd, char *commandline)
wdenkc6097192002-11-03 00:24:07 +0000315{
wdenk86765902003-12-06 23:55:10 +0000316 char *p;
wdenkc6097192002-11-03 00:24:07 +0000317
wdenkf16b5162004-03-23 21:43:07 +0000318 if (!commandline)
319 return;
320
wdenk86765902003-12-06 23:55:10 +0000321 /* eat leading white space */
322 for (p = commandline; *p == ' '; p++);
wdenkc6097192002-11-03 00:24:07 +0000323
wdenk86765902003-12-06 23:55:10 +0000324 /* skip non-existent command lines so the kernel will still
325 * use its default command line.
326 */
327 if (*p == '\0')
328 return;
wdenkc6097192002-11-03 00:24:07 +0000329
wdenk86765902003-12-06 23:55:10 +0000330 params->hdr.tag = ATAG_CMDLINE;
331 params->hdr.size =
332 (sizeof (struct tag_header) + strlen (p) + 1 + 4) >> 2;
wdenkc6097192002-11-03 00:24:07 +0000333
wdenk86765902003-12-06 23:55:10 +0000334 strcpy (params->u.cmdline.cmdline, p);
wdenkc6097192002-11-03 00:24:07 +0000335
wdenk86765902003-12-06 23:55:10 +0000336 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000337}
338
339
wdenk699b13a2002-11-03 18:03:52 +0000340#ifdef CONFIG_INITRD_TAG
wdenk86765902003-12-06 23:55:10 +0000341static void setup_initrd_tag (bd_t *bd, ulong initrd_start, ulong initrd_end)
wdenkc6097192002-11-03 00:24:07 +0000342{
wdenk86765902003-12-06 23:55:10 +0000343 /* an ATAG_INITRD node tells the kernel where the compressed
344 * ramdisk can be found. ATAG_RDIMG is a better name, actually.
345 */
wdenk19c8fb72004-04-18 22:26:17 +0000346 params->hdr.tag = ATAG_INITRD2;
wdenk86765902003-12-06 23:55:10 +0000347 params->hdr.size = tag_size (tag_initrd);
wdenkc6097192002-11-03 00:24:07 +0000348
wdenk86765902003-12-06 23:55:10 +0000349 params->u.initrd.start = initrd_start;
350 params->u.initrd.size = initrd_end - initrd_start;
wdenkc6097192002-11-03 00:24:07 +0000351
wdenk86765902003-12-06 23:55:10 +0000352 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000353}
wdenk86765902003-12-06 23:55:10 +0000354#endif /* CONFIG_INITRD_TAG */
wdenkc6097192002-11-03 00:24:07 +0000355
wdenkc6097192002-11-03 00:24:07 +0000356
wdenk9ca7bbc2004-10-09 23:25:58 +0000357#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
358extern ulong calc_fbsize (void);
wdenk86765902003-12-06 23:55:10 +0000359static void setup_videolfb_tag (gd_t *gd)
wdenkc6097192002-11-03 00:24:07 +0000360{
wdenk86765902003-12-06 23:55:10 +0000361 /* An ATAG_VIDEOLFB node tells the kernel where and how large
362 * the framebuffer for video was allocated (among other things).
363 * Note that a _physical_ address is passed !
364 *
365 * We only use it to pass the address and size, the other entries
366 * in the tag_videolfb are not of interest.
367 */
368 params->hdr.tag = ATAG_VIDEOLFB;
369 params->hdr.size = tag_size (tag_videolfb);
wdenkc6097192002-11-03 00:24:07 +0000370
wdenk86765902003-12-06 23:55:10 +0000371 params->u.videolfb.lfb_base = (u32) gd->fb_base;
wdenk9ca7bbc2004-10-09 23:25:58 +0000372 /* Fb size is calculated according to parameters for our panel
373 */
374 params->u.videolfb.lfb_size = calc_fbsize();
wdenkc6097192002-11-03 00:24:07 +0000375
wdenk86765902003-12-06 23:55:10 +0000376 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000377}
wdenk9ca7bbc2004-10-09 23:25:58 +0000378#endif /* CONFIG_VFD || CONFIG_LCD */
wdenkc6097192002-11-03 00:24:07 +0000379
wdenka21ad7b2005-05-19 22:39:42 +0000380#ifdef CONFIG_SERIAL_TAG
381void setup_serial_tag (struct tag **tmp)
382{
383 struct tag *params = *tmp;
384 struct tag_serialnr serialnr;
385 void get_board_serial(struct tag_serialnr *serialnr);
386
387 get_board_serial(&serialnr);
388 params->hdr.tag = ATAG_SERIAL;
389 params->hdr.size = tag_size (tag_serialnr);
390 params->u.serialnr.low = serialnr.low;
391 params->u.serialnr.high= serialnr.high;
392 params = tag_next (params);
393 *tmp = params;
394}
395#endif
396
wdenkcb99da52005-01-12 00:15:14 +0000397#ifdef CONFIG_REVISION_TAG
398void setup_revision_tag(struct tag **in_params)
399{
400 u32 rev = 0;
wdenkcb99da52005-01-12 00:15:14 +0000401 u32 get_board_rev(void);
402
403 rev = get_board_rev();
wdenkcb99da52005-01-12 00:15:14 +0000404 params->hdr.tag = ATAG_REVISION;
405 params->hdr.size = tag_size (tag_revision);
406 params->u.revision.rev = rev;
407 params = tag_next (params);
408}
409#endif /* CONFIG_REVISION_TAG */
410
411
wdenk86765902003-12-06 23:55:10 +0000412static void setup_end_tag (bd_t *bd)
wdenkc6097192002-11-03 00:24:07 +0000413{
wdenk86765902003-12-06 23:55:10 +0000414 params->hdr.tag = ATAG_NONE;
415 params->hdr.size = 0;
wdenkc6097192002-11-03 00:24:07 +0000416}
417
418#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */