wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
| 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 |
wdenk | 29e7f5a | 2004-03-12 00:14:09 +0000 | [diff] [blame] | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 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 |
wdenk | 29e7f5a | 2004-03-12 00:14:09 +0000 | [diff] [blame] | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 21 | * |
| 22 | */ |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <command.h> |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 26 | #include <image.h> |
| 27 | #include <zlib.h> |
| 28 | #include <asm/byteorder.h> |
| 29 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 30 | DECLARE_GLOBAL_DATA_PTR; |
| 31 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 32 | #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ |
| 33 | defined (CONFIG_CMDLINE_TAG) || \ |
| 34 | defined (CONFIG_INITRD_TAG) || \ |
wdenk | bc01dd5 | 2004-01-02 16:05:07 +0000 | [diff] [blame] | 35 | defined (CONFIG_SERIAL_TAG) || \ |
| 36 | defined (CONFIG_REVISION_TAG) || \ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 37 | defined (CONFIG_VFD) || \ |
| 38 | defined (CONFIG_LCD) |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 39 | static void setup_start_tag (bd_t *bd); |
| 40 | |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 41 | # ifdef CONFIG_SETUP_MEMORY_TAGS |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 42 | static void setup_memory_tags (bd_t *bd); |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 43 | # endif |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 44 | static void setup_commandline_tag (bd_t *bd, char *commandline); |
| 45 | |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 46 | # ifdef CONFIG_INITRD_TAG |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 47 | static void setup_initrd_tag (bd_t *bd, ulong initrd_start, |
| 48 | ulong initrd_end); |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 49 | # endif |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 50 | static void setup_end_tag (bd_t *bd); |
| 51 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 52 | # if defined (CONFIG_VFD) || defined (CONFIG_LCD) |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 53 | static void setup_videolfb_tag (gd_t *gd); |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 54 | # endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 55 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 56 | static struct tag *params; |
| 57 | #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ |
| 58 | |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 59 | extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 60 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 61 | void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], |
Marian Balakowicz | 61fde55 | 2008-02-27 11:01:04 +0100 | [diff] [blame] | 62 | bootm_headers_t *images) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 63 | { |
Marian Balakowicz | dbdd16a | 2008-02-04 08:28:09 +0100 | [diff] [blame] | 64 | bd_t *bd = gd->bd; |
| 65 | char *s; |
| 66 | int machid = bd->bi_arch_number; |
| 67 | void (*theKernel)(int zero, int arch, uint params); |
Marian Balakowicz | df8ff33 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 68 | int ret; |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 69 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 70 | #ifdef CONFIG_CMDLINE_TAG |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 71 | char *commandline = getenv ("bootargs"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 72 | #endif |
| 73 | |
Kumar Gala | 93467bc | 2008-08-15 08:24:36 -0500 | [diff] [blame] | 74 | theKernel = (void (*)(int, int, uint))images->ep; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 75 | |
Uwe Kleine-König | 533937d | 2008-01-30 09:08:49 +0100 | [diff] [blame] | 76 | s = getenv ("machid"); |
| 77 | if (s) { |
| 78 | machid = simple_strtoul (s, NULL, 16); |
| 79 | printf ("Using machid 0x%x from environment\n", machid); |
| 80 | } |
| 81 | |
Heiko Schocher | 8a8ec53 | 2007-07-13 09:54:17 +0200 | [diff] [blame] | 82 | show_boot_progress (15); |
wdenk | 384ae02 | 2002-11-05 00:17:55 +0000 | [diff] [blame] | 83 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 84 | debug ("## Transferring control to Linux (at address %08lx) ...\n", |
| 85 | (ulong) theKernel); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 86 | |
| 87 | #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ |
| 88 | defined (CONFIG_CMDLINE_TAG) || \ |
| 89 | defined (CONFIG_INITRD_TAG) || \ |
wdenk | bc01dd5 | 2004-01-02 16:05:07 +0000 | [diff] [blame] | 90 | defined (CONFIG_SERIAL_TAG) || \ |
| 91 | defined (CONFIG_REVISION_TAG) || \ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 92 | defined (CONFIG_LCD) || \ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 93 | defined (CONFIG_VFD) |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 94 | setup_start_tag (bd); |
wdenk | bc01dd5 | 2004-01-02 16:05:07 +0000 | [diff] [blame] | 95 | #ifdef CONFIG_SERIAL_TAG |
| 96 | setup_serial_tag (¶ms); |
| 97 | #endif |
| 98 | #ifdef CONFIG_REVISION_TAG |
| 99 | setup_revision_tag (¶ms); |
| 100 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 101 | #ifdef CONFIG_SETUP_MEMORY_TAGS |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 102 | setup_memory_tags (bd); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 103 | #endif |
| 104 | #ifdef CONFIG_CMDLINE_TAG |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 105 | setup_commandline_tag (bd, commandline); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 106 | #endif |
| 107 | #ifdef CONFIG_INITRD_TAG |
Kumar Gala | fffb143 | 2008-08-15 08:24:37 -0500 | [diff] [blame^] | 108 | if (images->rd_start && images->rd_end) |
| 109 | setup_initrd_tag (bd, images->rd_start, images->rd_end); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 110 | #endif |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 111 | #if defined (CONFIG_VFD) || defined (CONFIG_LCD) |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 112 | setup_videolfb_tag ((gd_t *) gd); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 113 | #endif |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 114 | setup_end_tag (bd); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 115 | #endif |
| 116 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 117 | /* we assume that the kernel is in place */ |
| 118 | printf ("\nStarting kernel ...\n\n"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 119 | |
wdenk | 29e7f5a | 2004-03-12 00:14:09 +0000 | [diff] [blame] | 120 | #ifdef CONFIG_USB_DEVICE |
| 121 | { |
| 122 | extern void udc_disconnect (void); |
| 123 | udc_disconnect (); |
| 124 | } |
| 125 | #endif |
| 126 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 127 | cleanup_before_linux (); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 128 | |
Uwe Kleine-König | 533937d | 2008-01-30 09:08:49 +0100 | [diff] [blame] | 129 | theKernel (0, machid, bd->bi_boot_params); |
Marian Balakowicz | df8ff33 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 130 | /* does not return */ |
| 131 | return; |
| 132 | |
| 133 | error: |
Kumar Gala | 026e4ac | 2008-08-11 09:20:53 -0500 | [diff] [blame] | 134 | do_reset (cmdtp, flag, argc, argv); |
Marian Balakowicz | df8ff33 | 2008-03-12 10:33:00 +0100 | [diff] [blame] | 135 | return; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | |
| 139 | #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ |
| 140 | defined (CONFIG_CMDLINE_TAG) || \ |
| 141 | defined (CONFIG_INITRD_TAG) || \ |
wdenk | bc01dd5 | 2004-01-02 16:05:07 +0000 | [diff] [blame] | 142 | defined (CONFIG_SERIAL_TAG) || \ |
| 143 | defined (CONFIG_REVISION_TAG) || \ |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 144 | defined (CONFIG_LCD) || \ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 145 | defined (CONFIG_VFD) |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 146 | static void setup_start_tag (bd_t *bd) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 147 | { |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 148 | params = (struct tag *) bd->bi_boot_params; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 149 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 150 | params->hdr.tag = ATAG_CORE; |
| 151 | params->hdr.size = tag_size (tag_core); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 152 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 153 | params->u.core.flags = 0; |
| 154 | params->u.core.pagesize = 0; |
| 155 | params->u.core.rootdev = 0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 156 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 157 | params = tag_next (params); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 161 | #ifdef CONFIG_SETUP_MEMORY_TAGS |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 162 | static void setup_memory_tags (bd_t *bd) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 163 | { |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 164 | int i; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 165 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 166 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { |
| 167 | params->hdr.tag = ATAG_MEM; |
| 168 | params->hdr.size = tag_size (tag_mem32); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 169 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 170 | params->u.mem.start = bd->bi_dram[i].start; |
| 171 | params->u.mem.size = bd->bi_dram[i].size; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 172 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 173 | params = tag_next (params); |
| 174 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 175 | } |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 176 | #endif /* CONFIG_SETUP_MEMORY_TAGS */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 177 | |
| 178 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 179 | static void setup_commandline_tag (bd_t *bd, char *commandline) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 180 | { |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 181 | char *p; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 182 | |
wdenk | f16b516 | 2004-03-23 21:43:07 +0000 | [diff] [blame] | 183 | if (!commandline) |
| 184 | return; |
| 185 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 186 | /* eat leading white space */ |
| 187 | for (p = commandline; *p == ' '; p++); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 188 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 189 | /* skip non-existent command lines so the kernel will still |
| 190 | * use its default command line. |
| 191 | */ |
| 192 | if (*p == '\0') |
| 193 | return; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 194 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 195 | params->hdr.tag = ATAG_CMDLINE; |
| 196 | params->hdr.size = |
| 197 | (sizeof (struct tag_header) + strlen (p) + 1 + 4) >> 2; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 198 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 199 | strcpy (params->u.cmdline.cmdline, p); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 200 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 201 | params = tag_next (params); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | |
wdenk | 699b13a | 2002-11-03 18:03:52 +0000 | [diff] [blame] | 205 | #ifdef CONFIG_INITRD_TAG |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 206 | static void setup_initrd_tag (bd_t *bd, ulong initrd_start, ulong initrd_end) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 207 | { |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 208 | /* an ATAG_INITRD node tells the kernel where the compressed |
| 209 | * ramdisk can be found. ATAG_RDIMG is a better name, actually. |
| 210 | */ |
wdenk | 19c8fb7 | 2004-04-18 22:26:17 +0000 | [diff] [blame] | 211 | params->hdr.tag = ATAG_INITRD2; |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 212 | params->hdr.size = tag_size (tag_initrd); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 213 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 214 | params->u.initrd.start = initrd_start; |
| 215 | params->u.initrd.size = initrd_end - initrd_start; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 216 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 217 | params = tag_next (params); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 218 | } |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 219 | #endif /* CONFIG_INITRD_TAG */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 220 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 221 | |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 222 | #if defined (CONFIG_VFD) || defined (CONFIG_LCD) |
| 223 | extern ulong calc_fbsize (void); |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 224 | static void setup_videolfb_tag (gd_t *gd) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 225 | { |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 226 | /* An ATAG_VIDEOLFB node tells the kernel where and how large |
| 227 | * the framebuffer for video was allocated (among other things). |
| 228 | * Note that a _physical_ address is passed ! |
| 229 | * |
| 230 | * We only use it to pass the address and size, the other entries |
| 231 | * in the tag_videolfb are not of interest. |
| 232 | */ |
| 233 | params->hdr.tag = ATAG_VIDEOLFB; |
| 234 | params->hdr.size = tag_size (tag_videolfb); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 235 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 236 | params->u.videolfb.lfb_base = (u32) gd->fb_base; |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 237 | /* Fb size is calculated according to parameters for our panel |
| 238 | */ |
| 239 | params->u.videolfb.lfb_size = calc_fbsize(); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 240 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 241 | params = tag_next (params); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 242 | } |
wdenk | 9ca7bbc | 2004-10-09 23:25:58 +0000 | [diff] [blame] | 243 | #endif /* CONFIG_VFD || CONFIG_LCD */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 244 | |
wdenk | a21ad7b | 2005-05-19 22:39:42 +0000 | [diff] [blame] | 245 | #ifdef CONFIG_SERIAL_TAG |
| 246 | void setup_serial_tag (struct tag **tmp) |
| 247 | { |
| 248 | struct tag *params = *tmp; |
| 249 | struct tag_serialnr serialnr; |
| 250 | void get_board_serial(struct tag_serialnr *serialnr); |
| 251 | |
| 252 | get_board_serial(&serialnr); |
| 253 | params->hdr.tag = ATAG_SERIAL; |
| 254 | params->hdr.size = tag_size (tag_serialnr); |
| 255 | params->u.serialnr.low = serialnr.low; |
| 256 | params->u.serialnr.high= serialnr.high; |
| 257 | params = tag_next (params); |
| 258 | *tmp = params; |
| 259 | } |
| 260 | #endif |
| 261 | |
wdenk | cb99da5 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 262 | #ifdef CONFIG_REVISION_TAG |
| 263 | void setup_revision_tag(struct tag **in_params) |
| 264 | { |
| 265 | u32 rev = 0; |
wdenk | cb99da5 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 266 | u32 get_board_rev(void); |
| 267 | |
| 268 | rev = get_board_rev(); |
wdenk | cb99da5 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 269 | params->hdr.tag = ATAG_REVISION; |
| 270 | params->hdr.size = tag_size (tag_revision); |
| 271 | params->u.revision.rev = rev; |
| 272 | params = tag_next (params); |
| 273 | } |
| 274 | #endif /* CONFIG_REVISION_TAG */ |
| 275 | |
| 276 | |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 277 | static void setup_end_tag (bd_t *bd) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 278 | { |
wdenk | 8676590 | 2003-12-06 23:55:10 +0000 | [diff] [blame] | 279 | params->hdr.tag = ATAG_NONE; |
| 280 | params->hdr.size = 0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ |