blob: c1e1d125456ef7679df36dce5177627efa1115d7 [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
wdenk86765902003-12-06 23:55:10 +000069extern image_header_t header; /* from cmd_bootm.c */
wdenkc6097192002-11-03 00:24:07 +000070
71
wdenk86765902003-12-06 23:55:10 +000072void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
73 ulong addr, ulong *len_ptr, int verify)
wdenkc6097192002-11-03 00:24:07 +000074{
wdenk86765902003-12-06 23:55:10 +000075 ulong len = 0, checksum;
76 ulong initrd_start, initrd_end;
77 ulong data;
wdenk4ea537d2003-12-07 18:32:37 +000078 void (*theKernel)(int zero, int arch, uint params);
wdenk86765902003-12-06 23:55:10 +000079 image_header_t *hdr = &header;
80 bd_t *bd = gd->bd;
81
wdenkc6097192002-11-03 00:24:07 +000082#ifdef CONFIG_CMDLINE_TAG
wdenk86765902003-12-06 23:55:10 +000083 char *commandline = getenv ("bootargs");
wdenkc6097192002-11-03 00:24:07 +000084#endif
85
wdenk4ea537d2003-12-07 18:32:37 +000086 theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep);
wdenkc6097192002-11-03 00:24:07 +000087
wdenk86765902003-12-06 23:55:10 +000088 /*
89 * Check if there is an initrd image
90 */
91 if (argc >= 3) {
Heiko Schocher8a8ec532007-07-13 09:54:17 +020092 show_boot_progress (9);
wdenk384ae022002-11-05 00:17:55 +000093
wdenk86765902003-12-06 23:55:10 +000094 addr = simple_strtoul (argv[2], NULL, 16);
wdenkc6097192002-11-03 00:24:07 +000095
wdenk86765902003-12-06 23:55:10 +000096 printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
wdenkc6097192002-11-03 00:24:07 +000097
wdenk86765902003-12-06 23:55:10 +000098 /* Copy header so we can blank CRC field for re-calculation */
wdenk381669a2003-06-16 23:50:08 +000099#ifdef CONFIG_HAS_DATAFLASH
wdenk86765902003-12-06 23:55:10 +0000100 if (addr_dataflash (addr)) {
101 read_dataflash (addr, sizeof (image_header_t),
102 (char *) &header);
103 } else
wdenk57b2d802003-06-27 21:31:46 +0000104#endif
wdenk86765902003-12-06 23:55:10 +0000105 memcpy (&header, (char *) addr,
106 sizeof (image_header_t));
wdenkc6097192002-11-03 00:24:07 +0000107
wdenk86765902003-12-06 23:55:10 +0000108 if (ntohl (hdr->ih_magic) != IH_MAGIC) {
109 printf ("Bad Magic Number\n");
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200110 show_boot_progress (-10);
wdenk86765902003-12-06 23:55:10 +0000111 do_reset (cmdtp, flag, argc, argv);
112 }
wdenkc6097192002-11-03 00:24:07 +0000113
wdenk86765902003-12-06 23:55:10 +0000114 data = (ulong) & header;
115 len = sizeof (image_header_t);
wdenkc6097192002-11-03 00:24:07 +0000116
wdenk86765902003-12-06 23:55:10 +0000117 checksum = ntohl (hdr->ih_hcrc);
118 hdr->ih_hcrc = 0;
wdenkc6097192002-11-03 00:24:07 +0000119
Wolfgang Denk7fa6e902006-03-11 22:53:33 +0100120 if (crc32 (0, (unsigned char *) data, len) != checksum) {
wdenk86765902003-12-06 23:55:10 +0000121 printf ("Bad Header Checksum\n");
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200122 show_boot_progress (-11);
wdenk86765902003-12-06 23:55:10 +0000123 do_reset (cmdtp, flag, argc, argv);
124 }
wdenkc6097192002-11-03 00:24:07 +0000125
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200126 show_boot_progress (10);
wdenk384ae022002-11-05 00:17:55 +0000127
wdenk86765902003-12-06 23:55:10 +0000128 print_image_hdr (hdr);
wdenkc6097192002-11-03 00:24:07 +0000129
wdenk86765902003-12-06 23:55:10 +0000130 data = addr + sizeof (image_header_t);
131 len = ntohl (hdr->ih_size);
wdenkc6097192002-11-03 00:24:07 +0000132
wdenk381669a2003-06-16 23:50:08 +0000133#ifdef CONFIG_HAS_DATAFLASH
wdenk86765902003-12-06 23:55:10 +0000134 if (addr_dataflash (addr)) {
135 read_dataflash (data, len, (char *) CFG_LOAD_ADDR);
136 data = CFG_LOAD_ADDR;
137 }
wdenk381669a2003-06-16 23:50:08 +0000138#endif
139
wdenk86765902003-12-06 23:55:10 +0000140 if (verify) {
141 ulong csum = 0;
wdenkc6097192002-11-03 00:24:07 +0000142
wdenk86765902003-12-06 23:55:10 +0000143 printf (" Verifying Checksum ... ");
Wolfgang Denk7fa6e902006-03-11 22:53:33 +0100144 csum = crc32 (0, (unsigned char *) data, len);
wdenk86765902003-12-06 23:55:10 +0000145 if (csum != ntohl (hdr->ih_dcrc)) {
146 printf ("Bad Data CRC\n");
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200147 show_boot_progress (-12);
wdenk86765902003-12-06 23:55:10 +0000148 do_reset (cmdtp, flag, argc, argv);
149 }
150 printf ("OK\n");
151 }
wdenkc6097192002-11-03 00:24:07 +0000152
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200153 show_boot_progress (11);
wdenk384ae022002-11-05 00:17:55 +0000154
wdenk86765902003-12-06 23:55:10 +0000155 if ((hdr->ih_os != IH_OS_LINUX) ||
156 (hdr->ih_arch != IH_CPU_ARM) ||
157 (hdr->ih_type != IH_TYPE_RAMDISK)) {
158 printf ("No Linux ARM Ramdisk Image\n");
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200159 show_boot_progress (-13);
wdenk86765902003-12-06 23:55:10 +0000160 do_reset (cmdtp, flag, argc, argv);
161 }
wdenkc6097192002-11-03 00:24:07 +0000162
Timo Tuunainen7174cc02008-02-01 10:09:03 +0000163#if defined(CONFIG_B2) || defined(CONFIG_EVB4510) || \
164 defined(CONFIG_ARMADILLO) || defined(CONFIG_M501SK)
wdenkb98ac282004-02-24 00:16:43 +0000165 /*
166 *we need to copy the ramdisk to SRAM to let Linux boot
167 */
168 memmove ((void *) ntohl(hdr->ih_load), (uchar *)data, len);
169 data = ntohl(hdr->ih_load);
wdenk82db02f2004-07-11 22:19:26 +0000170#endif /* CONFIG_B2 || CONFIG_EVB4510 */
wdenkb98ac282004-02-24 00:16:43 +0000171
wdenk86765902003-12-06 23:55:10 +0000172 /*
173 * Now check if we have a multifile image
174 */
175 } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
176 ulong tail = ntohl (len_ptr[0]) % 4;
177 int i;
wdenkc6097192002-11-03 00:24:07 +0000178
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200179 show_boot_progress (13);
wdenk384ae022002-11-05 00:17:55 +0000180
wdenk86765902003-12-06 23:55:10 +0000181 /* skip kernel length and terminator */
182 data = (ulong) (&len_ptr[2]);
183 /* skip any additional image length fields */
184 for (i = 1; len_ptr[i]; ++i)
185 data += 4;
186 /* add kernel length, and align */
187 data += ntohl (len_ptr[0]);
188 if (tail) {
189 data += 4 - tail;
190 }
wdenkc6097192002-11-03 00:24:07 +0000191
wdenk86765902003-12-06 23:55:10 +0000192 len = ntohl (len_ptr[1]);
wdenkc6097192002-11-03 00:24:07 +0000193
wdenk86765902003-12-06 23:55:10 +0000194 } else {
195 /*
196 * no initrd image
197 */
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200198 show_boot_progress (14);
wdenk384ae022002-11-05 00:17:55 +0000199
wdenk86765902003-12-06 23:55:10 +0000200 len = data = 0;
201 }
wdenkc6097192002-11-03 00:24:07 +0000202
203#ifdef DEBUG
wdenk86765902003-12-06 23:55:10 +0000204 if (!data) {
205 printf ("No initrd\n");
206 }
wdenkc6097192002-11-03 00:24:07 +0000207#endif
208
wdenk86765902003-12-06 23:55:10 +0000209 if (data) {
210 initrd_start = data;
211 initrd_end = initrd_start + len;
212 } else {
213 initrd_start = 0;
214 initrd_end = 0;
215 }
wdenkc6097192002-11-03 00:24:07 +0000216
Heiko Schocher8a8ec532007-07-13 09:54:17 +0200217 show_boot_progress (15);
wdenk384ae022002-11-05 00:17:55 +0000218
wdenk86765902003-12-06 23:55:10 +0000219 debug ("## Transferring control to Linux (at address %08lx) ...\n",
220 (ulong) theKernel);
wdenkc6097192002-11-03 00:24:07 +0000221
222#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
223 defined (CONFIG_CMDLINE_TAG) || \
224 defined (CONFIG_INITRD_TAG) || \
wdenkbc01dd52004-01-02 16:05:07 +0000225 defined (CONFIG_SERIAL_TAG) || \
226 defined (CONFIG_REVISION_TAG) || \
wdenk9ca7bbc2004-10-09 23:25:58 +0000227 defined (CONFIG_LCD) || \
wdenkc6097192002-11-03 00:24:07 +0000228 defined (CONFIG_VFD)
wdenk86765902003-12-06 23:55:10 +0000229 setup_start_tag (bd);
wdenkbc01dd52004-01-02 16:05:07 +0000230#ifdef CONFIG_SERIAL_TAG
231 setup_serial_tag (&params);
232#endif
233#ifdef CONFIG_REVISION_TAG
234 setup_revision_tag (&params);
235#endif
wdenkc6097192002-11-03 00:24:07 +0000236#ifdef CONFIG_SETUP_MEMORY_TAGS
wdenk86765902003-12-06 23:55:10 +0000237 setup_memory_tags (bd);
wdenkc6097192002-11-03 00:24:07 +0000238#endif
239#ifdef CONFIG_CMDLINE_TAG
wdenk86765902003-12-06 23:55:10 +0000240 setup_commandline_tag (bd, commandline);
wdenkc6097192002-11-03 00:24:07 +0000241#endif
242#ifdef CONFIG_INITRD_TAG
wdenk86765902003-12-06 23:55:10 +0000243 if (initrd_start && initrd_end)
244 setup_initrd_tag (bd, initrd_start, initrd_end);
wdenkc6097192002-11-03 00:24:07 +0000245#endif
wdenk9ca7bbc2004-10-09 23:25:58 +0000246#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
wdenk86765902003-12-06 23:55:10 +0000247 setup_videolfb_tag ((gd_t *) gd);
wdenkc6097192002-11-03 00:24:07 +0000248#endif
wdenk86765902003-12-06 23:55:10 +0000249 setup_end_tag (bd);
wdenkc6097192002-11-03 00:24:07 +0000250#endif
251
wdenk86765902003-12-06 23:55:10 +0000252 /* we assume that the kernel is in place */
253 printf ("\nStarting kernel ...\n\n");
wdenkc6097192002-11-03 00:24:07 +0000254
wdenk29e7f5a2004-03-12 00:14:09 +0000255#ifdef CONFIG_USB_DEVICE
256 {
257 extern void udc_disconnect (void);
258 udc_disconnect ();
259 }
260#endif
261
wdenk86765902003-12-06 23:55:10 +0000262 cleanup_before_linux ();
wdenkc6097192002-11-03 00:24:07 +0000263
wdenk4ea537d2003-12-07 18:32:37 +0000264 theKernel (0, bd->bi_arch_number, bd->bi_boot_params);
wdenkc6097192002-11-03 00:24:07 +0000265}
266
267
268#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
269 defined (CONFIG_CMDLINE_TAG) || \
270 defined (CONFIG_INITRD_TAG) || \
wdenkbc01dd52004-01-02 16:05:07 +0000271 defined (CONFIG_SERIAL_TAG) || \
272 defined (CONFIG_REVISION_TAG) || \
wdenk9ca7bbc2004-10-09 23:25:58 +0000273 defined (CONFIG_LCD) || \
wdenkc6097192002-11-03 00:24:07 +0000274 defined (CONFIG_VFD)
wdenk86765902003-12-06 23:55:10 +0000275static void setup_start_tag (bd_t *bd)
wdenkc6097192002-11-03 00:24:07 +0000276{
wdenk86765902003-12-06 23:55:10 +0000277 params = (struct tag *) bd->bi_boot_params;
wdenkc6097192002-11-03 00:24:07 +0000278
wdenk86765902003-12-06 23:55:10 +0000279 params->hdr.tag = ATAG_CORE;
280 params->hdr.size = tag_size (tag_core);
wdenkc6097192002-11-03 00:24:07 +0000281
wdenk86765902003-12-06 23:55:10 +0000282 params->u.core.flags = 0;
283 params->u.core.pagesize = 0;
284 params->u.core.rootdev = 0;
wdenkc6097192002-11-03 00:24:07 +0000285
wdenk86765902003-12-06 23:55:10 +0000286 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000287}
288
289
wdenk699b13a2002-11-03 18:03:52 +0000290#ifdef CONFIG_SETUP_MEMORY_TAGS
wdenk86765902003-12-06 23:55:10 +0000291static void setup_memory_tags (bd_t *bd)
wdenkc6097192002-11-03 00:24:07 +0000292{
wdenk86765902003-12-06 23:55:10 +0000293 int i;
wdenkc6097192002-11-03 00:24:07 +0000294
wdenk86765902003-12-06 23:55:10 +0000295 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
296 params->hdr.tag = ATAG_MEM;
297 params->hdr.size = tag_size (tag_mem32);
wdenkc6097192002-11-03 00:24:07 +0000298
wdenk86765902003-12-06 23:55:10 +0000299 params->u.mem.start = bd->bi_dram[i].start;
300 params->u.mem.size = bd->bi_dram[i].size;
wdenkc6097192002-11-03 00:24:07 +0000301
wdenk86765902003-12-06 23:55:10 +0000302 params = tag_next (params);
303 }
wdenkc6097192002-11-03 00:24:07 +0000304}
wdenk86765902003-12-06 23:55:10 +0000305#endif /* CONFIG_SETUP_MEMORY_TAGS */
wdenkc6097192002-11-03 00:24:07 +0000306
307
wdenk86765902003-12-06 23:55:10 +0000308static void setup_commandline_tag (bd_t *bd, char *commandline)
wdenkc6097192002-11-03 00:24:07 +0000309{
wdenk86765902003-12-06 23:55:10 +0000310 char *p;
wdenkc6097192002-11-03 00:24:07 +0000311
wdenkf16b5162004-03-23 21:43:07 +0000312 if (!commandline)
313 return;
314
wdenk86765902003-12-06 23:55:10 +0000315 /* eat leading white space */
316 for (p = commandline; *p == ' '; p++);
wdenkc6097192002-11-03 00:24:07 +0000317
wdenk86765902003-12-06 23:55:10 +0000318 /* skip non-existent command lines so the kernel will still
319 * use its default command line.
320 */
321 if (*p == '\0')
322 return;
wdenkc6097192002-11-03 00:24:07 +0000323
wdenk86765902003-12-06 23:55:10 +0000324 params->hdr.tag = ATAG_CMDLINE;
325 params->hdr.size =
326 (sizeof (struct tag_header) + strlen (p) + 1 + 4) >> 2;
wdenkc6097192002-11-03 00:24:07 +0000327
wdenk86765902003-12-06 23:55:10 +0000328 strcpy (params->u.cmdline.cmdline, p);
wdenkc6097192002-11-03 00:24:07 +0000329
wdenk86765902003-12-06 23:55:10 +0000330 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000331}
332
333
wdenk699b13a2002-11-03 18:03:52 +0000334#ifdef CONFIG_INITRD_TAG
wdenk86765902003-12-06 23:55:10 +0000335static void setup_initrd_tag (bd_t *bd, ulong initrd_start, ulong initrd_end)
wdenkc6097192002-11-03 00:24:07 +0000336{
wdenk86765902003-12-06 23:55:10 +0000337 /* an ATAG_INITRD node tells the kernel where the compressed
338 * ramdisk can be found. ATAG_RDIMG is a better name, actually.
339 */
wdenk19c8fb72004-04-18 22:26:17 +0000340 params->hdr.tag = ATAG_INITRD2;
wdenk86765902003-12-06 23:55:10 +0000341 params->hdr.size = tag_size (tag_initrd);
wdenkc6097192002-11-03 00:24:07 +0000342
wdenk86765902003-12-06 23:55:10 +0000343 params->u.initrd.start = initrd_start;
344 params->u.initrd.size = initrd_end - initrd_start;
wdenkc6097192002-11-03 00:24:07 +0000345
wdenk86765902003-12-06 23:55:10 +0000346 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000347}
wdenk86765902003-12-06 23:55:10 +0000348#endif /* CONFIG_INITRD_TAG */
wdenkc6097192002-11-03 00:24:07 +0000349
wdenkc6097192002-11-03 00:24:07 +0000350
wdenk9ca7bbc2004-10-09 23:25:58 +0000351#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
352extern ulong calc_fbsize (void);
wdenk86765902003-12-06 23:55:10 +0000353static void setup_videolfb_tag (gd_t *gd)
wdenkc6097192002-11-03 00:24:07 +0000354{
wdenk86765902003-12-06 23:55:10 +0000355 /* An ATAG_VIDEOLFB node tells the kernel where and how large
356 * the framebuffer for video was allocated (among other things).
357 * Note that a _physical_ address is passed !
358 *
359 * We only use it to pass the address and size, the other entries
360 * in the tag_videolfb are not of interest.
361 */
362 params->hdr.tag = ATAG_VIDEOLFB;
363 params->hdr.size = tag_size (tag_videolfb);
wdenkc6097192002-11-03 00:24:07 +0000364
wdenk86765902003-12-06 23:55:10 +0000365 params->u.videolfb.lfb_base = (u32) gd->fb_base;
wdenk9ca7bbc2004-10-09 23:25:58 +0000366 /* Fb size is calculated according to parameters for our panel
367 */
368 params->u.videolfb.lfb_size = calc_fbsize();
wdenkc6097192002-11-03 00:24:07 +0000369
wdenk86765902003-12-06 23:55:10 +0000370 params = tag_next (params);
wdenkc6097192002-11-03 00:24:07 +0000371}
wdenk9ca7bbc2004-10-09 23:25:58 +0000372#endif /* CONFIG_VFD || CONFIG_LCD */
wdenkc6097192002-11-03 00:24:07 +0000373
wdenka21ad7b2005-05-19 22:39:42 +0000374#ifdef CONFIG_SERIAL_TAG
375void setup_serial_tag (struct tag **tmp)
376{
377 struct tag *params = *tmp;
378 struct tag_serialnr serialnr;
379 void get_board_serial(struct tag_serialnr *serialnr);
380
381 get_board_serial(&serialnr);
382 params->hdr.tag = ATAG_SERIAL;
383 params->hdr.size = tag_size (tag_serialnr);
384 params->u.serialnr.low = serialnr.low;
385 params->u.serialnr.high= serialnr.high;
386 params = tag_next (params);
387 *tmp = params;
388}
389#endif
390
wdenkcb99da52005-01-12 00:15:14 +0000391#ifdef CONFIG_REVISION_TAG
392void setup_revision_tag(struct tag **in_params)
393{
394 u32 rev = 0;
wdenkcb99da52005-01-12 00:15:14 +0000395 u32 get_board_rev(void);
396
397 rev = get_board_rev();
wdenkcb99da52005-01-12 00:15:14 +0000398 params->hdr.tag = ATAG_REVISION;
399 params->hdr.size = tag_size (tag_revision);
400 params->u.revision.rev = rev;
401 params = tag_next (params);
402}
403#endif /* CONFIG_REVISION_TAG */
404
405
wdenk86765902003-12-06 23:55:10 +0000406static void setup_end_tag (bd_t *bd)
wdenkc6097192002-11-03 00:24:07 +0000407{
wdenk86765902003-12-06 23:55:10 +0000408 params->hdr.tag = ATAG_NONE;
409 params->hdr.size = 0;
wdenkc6097192002-11-03 00:24:07 +0000410}
411
412#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */