1aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre/* 2aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * Tag parsing. 3aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * 4aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * Copyright (C) 1995-2001 Russell King 5aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * 6aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * This program is free software; you can redistribute it and/or modify 7aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * it under the terms of the GNU General Public License version 2 as 8aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * published by the Free Software Foundation. 9aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre */ 10aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 11aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre/* 12aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * This is the traditional way of passing data to the kernel at boot time. Rather 13aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * than passing a fixed inflexible structure to the kernel, we pass a list 14aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * of variable-sized tags to the kernel. The first tag must be a ATAG_CORE 15aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * tag for the list to be recognised (to distinguish the tagged list from 16aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * a param_struct). The list is terminated with a zero-length tag (this tag 17aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * is not parsed in any way). 18aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre */ 19aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 20aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <linux/init.h> 21aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <linux/kernel.h> 22aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <linux/fs.h> 23aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <linux/root_dev.h> 24aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <linux/screen_info.h> 251c2f87c22566cd057bc8cde10c37ae9da1a1bb76Laura Abbott#include <linux/memblock.h> 26aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 27aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <asm/setup.h> 28aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <asm/system_info.h> 29aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <asm/page.h> 30aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include <asm/mach/arch.h> 31aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 32aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#include "atags.h" 33aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 34aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; 35aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 36aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#ifndef MEM_SIZE 37aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#define MEM_SIZE (16*1024*1024) 38aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#endif 39aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 40aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic struct { 41aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tag_header hdr1; 42aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tag_core core; 43aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tag_header hdr2; 44aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tag_mem32 mem; 45aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tag_header hdr3; 46aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} default_tags __initdata = { 47aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre { tag_size(tag_core), ATAG_CORE }, 48aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre { 1, PAGE_SIZE, 0xff }, 49aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre { tag_size(tag_mem32), ATAG_MEM }, 50aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre { MEM_SIZE }, 51aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre { 0, ATAG_NONE } 52aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre}; 53aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 54aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_core(const struct tag *tag) 55aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 56aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tag->hdr.size > 2) { 57aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if ((tag->u.core.flags & 1) == 0) 58aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre root_mountflags &= ~MS_RDONLY; 59aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre ROOT_DEV = old_decode_dev(tag->u.core.rootdev); 60aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre } 61aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return 0; 62aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 63aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 64aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_CORE, parse_tag_core); 65aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 66aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_mem32(const struct tag *tag) 67aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 68aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return arm_add_memory(tag->u.mem.start, tag->u.mem.size); 69aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 70aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 71aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_MEM, parse_tag_mem32); 72aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 73aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) 74aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_videotext(const struct tag *tag) 75aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 76aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_x = tag->u.videotext.x; 77aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_y = tag->u.videotext.y; 78aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_page = tag->u.videotext.video_page; 79aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_mode = tag->u.videotext.video_mode; 80aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_cols = tag->u.videotext.video_cols; 81aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_ega_bx = tag->u.videotext.video_ega_bx; 82aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_lines = tag->u.videotext.video_lines; 83aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_isVGA = tag->u.videotext.video_isvga; 84aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre screen_info.orig_video_points = tag->u.videotext.video_points; 85aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return 0; 86aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 87aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 88aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_VIDEOTEXT, parse_tag_videotext); 89aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#endif 90aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 91aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#ifdef CONFIG_BLK_DEV_RAM 92aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_ramdisk(const struct tag *tag) 93aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 94aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre extern int rd_size, rd_image_start, rd_prompt, rd_doload; 95aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 96aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre rd_image_start = tag->u.ramdisk.start; 97aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre rd_doload = (tag->u.ramdisk.flags & 1) == 0; 98aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre rd_prompt = (tag->u.ramdisk.flags & 2) == 0; 99aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 100aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tag->u.ramdisk.size) 101aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre rd_size = tag->u.ramdisk.size; 102aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 103aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return 0; 104aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 105aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 106aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_RAMDISK, parse_tag_ramdisk); 107aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#endif 108aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 109aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_serialnr(const struct tag *tag) 110aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 111aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre system_serial_low = tag->u.serialnr.low; 112aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre system_serial_high = tag->u.serialnr.high; 113aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return 0; 114aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 115aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 116aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_SERIAL, parse_tag_serialnr); 117aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 118aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_revision(const struct tag *tag) 119aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 120aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre system_rev = tag->u.revision.rev; 121aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return 0; 122aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 123aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 124aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_REVISION, parse_tag_revision); 125aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 126aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag_cmdline(const struct tag *tag) 127aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 128aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#if defined(CONFIG_CMDLINE_EXTEND) 129aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre strlcat(default_command_line, " ", COMMAND_LINE_SIZE); 130aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre strlcat(default_command_line, tag->u.cmdline.cmdline, 131aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre COMMAND_LINE_SIZE); 132aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#elif defined(CONFIG_CMDLINE_FORCE) 1338b521cb2947d8811b4cf7fc6a7a6ebde35218243Joe Perches pr_warn("Ignoring tag cmdline (using the default kernel command line)\n"); 134aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#else 135aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre strlcpy(default_command_line, tag->u.cmdline.cmdline, 136aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre COMMAND_LINE_SIZE); 137aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#endif 138aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return 0; 139aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 140aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 141aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre__tagtable(ATAG_CMDLINE, parse_tag_cmdline); 142aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 143aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre/* 144aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * Scan the tag table for this tag, and call its parse function. 145aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * The tag table is built by the linker from all the __tagtable 146aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * declarations. 147aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre */ 148aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic int __init parse_tag(const struct tag *tag) 149aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 150aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre extern struct tagtable __tagtable_begin, __tagtable_end; 151aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tagtable *t; 152aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 153aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre for (t = &__tagtable_begin; t < &__tagtable_end; t++) 154aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tag->hdr.tag == t->tag) { 155aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre t->parse(tag); 156aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre break; 157aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre } 158aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 159aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return t < &__tagtable_end; 160aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 161aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 162aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre/* 163aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * Parse all tags in the list, checking both the global and architecture 164aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * specific tag tables. 165aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre */ 166aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic void __init parse_tags(const struct tag *t) 167aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 168aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre for (; t->hdr.size; t = tag_next(t)) 169aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (!parse_tag(t)) 170aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre printk(KERN_WARNING 171aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre "Ignoring unrecognised tag 0x%08x\n", 172aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre t->hdr.tag); 173aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 174aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 175aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitrestatic void __init squash_mem_tags(struct tag *tag) 176aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 177aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre for (; tag->hdr.size; tag = tag_next(tag)) 178aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tag->hdr.tag == ATAG_MEM) 179aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre tag->hdr.tag = ATAG_NONE; 180aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 181aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 182ff69a4c855066592f9e293cff8f54813614dd544Russell Kingconst struct machine_desc * __init 183ff69a4c855066592f9e293cff8f54813614dd544Russell Kingsetup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr) 184aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre{ 185aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre struct tag *tags = (struct tag *)&default_tags; 186ff69a4c855066592f9e293cff8f54813614dd544Russell King const struct machine_desc *mdesc = NULL, *p; 187aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre char *from = default_command_line; 188aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 189aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre default_tags.mem.start = PHYS_OFFSET; 190aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 191aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre /* 192aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * locate machine in the list of supported machines. 193aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre */ 194aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre for_each_machine_desc(p) 195aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (machine_nr == p->nr) { 196aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre printk("Machine: %s\n", p->name); 197aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre mdesc = p; 198aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre break; 199aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre } 200aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 201aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (!mdesc) { 202aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre early_print("\nError: unrecognized/unsupported machine ID" 203aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre " (r1 = 0x%08x).\n\n", machine_nr); 204aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre dump_machine_table(); /* does not return */ 205aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre } 206aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 207aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (__atags_pointer) 208aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre tags = phys_to_virt(__atags_pointer); 209aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre else if (mdesc->atag_offset) 210aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre tags = (void *)(PAGE_OFFSET + mdesc->atag_offset); 211aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 212aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#if defined(CONFIG_DEPRECATED_PARAM_STRUCT) 213aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre /* 214aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * If we have the old style parameters, convert them to 215aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre * a tag list. 216aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre */ 217aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tags->hdr.tag != ATAG_CORE) 218aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre convert_to_tag_list(tags); 219aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre#endif 220aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tags->hdr.tag != ATAG_CORE) { 221aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre early_print("Warning: Neither atags nor dtb found\n"); 222aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre tags = (struct tag *)&default_tags; 223aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre } 224aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 225aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (mdesc->fixup) 2261c2f87c22566cd057bc8cde10c37ae9da1a1bb76Laura Abbott mdesc->fixup(tags, &from); 227aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 228aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre if (tags->hdr.tag == ATAG_CORE) { 2291c2f87c22566cd057bc8cde10c37ae9da1a1bb76Laura Abbott if (memblock_phys_mem_size()) 230aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre squash_mem_tags(tags); 231aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre save_atags(tags); 232aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre parse_tags(tags); 233aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre } 234aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 235aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre /* parse_early_param needs a boot_command_line */ 236aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre strlcpy(boot_command_line, from, COMMAND_LINE_SIZE); 237aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre 238aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre return mdesc; 239aa783b6fd60b3844e199b1c2d2f4068f3caa1358Nicolas Pitre} 240