2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * identify.c: identify machine by looking up system identifier
8 * Copyright (C) 1998 Thomas Bogendoerfer
10 * This code is based on arch/mips/sgi/kernel/system.c, which is
12 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
14 #include <linux/config.h>
15 #include <linux/init.h>
16 #include <linux/kernel.h>
17 #include <linux/types.h>
18 #include <linux/string.h>
20 #include <asm/sgialib.h>
21 #include <asm/bootinfo.h>
31 static struct smatch mach_table[] = {
52 }, { "Microsoft-Jazz",
53 "Jazz MIPS_Magnum_4000",
55 MACH_MIPS_MAGNUM_4000,
66 PROM_FLAG_DONT_FREE_TEMP
72 static struct smatch * __init string_to_mach(const char *s)
76 for (i = 0; i < (sizeof(mach_table) / sizeof (mach_table[0])); i++) {
77 if (!strcmp(s, mach_table[i].arcname))
78 return &mach_table[i];
81 panic("Yeee, could not determine architecture type <%s>", s);
86 const char *get_system_type(void)
91 void __init prom_identify_arch(void)
98 * The root component tells us what machine architecture we have here.
100 p = ArcGetChild(PROM_NULL_COMPONENT);
102 #ifdef CONFIG_SGI_IP27
103 /* IP27 PROM misbehaves, seems to not implement ARC
104 GetChild(). So we just assume it's an IP27. */
110 iname = (char *) (long) p->iname;
112 printk("ARCH: %s\n", iname);
113 mach = string_to_mach(iname);
114 system_type = mach->liname;
116 mips_machgroup = mach->group;
117 mips_machtype = mach->type;
118 prom_flags = mach->flags;