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/init.h>
15 #include <linux/kernel.h>
16 #include <linux/types.h>
17 #include <linux/string.h>
19 #include <asm/sgialib.h>
20 #include <asm/bootinfo.h>
30 static struct smatch mach_table
[] = {
56 }, { "Microsoft-Jazz",
57 "Jazz MIPS_Magnum_4000",
59 MACH_MIPS_MAGNUM_4000
,
70 PROM_FLAG_DONT_FREE_TEMP
76 static struct smatch
* __init
string_to_mach(const char *s
)
80 for (i
= 0; i
< ARRAY_SIZE(mach_table
); i
++) {
81 if (!strcmp(s
, mach_table
[i
].arcname
))
82 return &mach_table
[i
];
85 panic("Yeee, could not determine architecture type <%s>", s
);
90 const char *get_system_type(void)
95 void __init
prom_identify_arch(void)
102 * The root component tells us what machine architecture we have here.
104 p
= ArcGetChild(PROM_NULL_COMPONENT
);
106 #ifdef CONFIG_SGI_IP27
107 /* IP27 PROM misbehaves, seems to not implement ARC
108 GetChild(). So we just assume it's an IP27. */
114 iname
= (char *) (long) p
->iname
;
116 printk("ARCH: %s\n", iname
);
117 mach
= string_to_mach(iname
);
118 system_type
= mach
->liname
;
120 mips_machgroup
= mach
->group
;
121 mips_machtype
= mach
->type
;
122 prom_flags
= mach
->flags
;