allow coexistance of N build and AC build.
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / mips / arc / identify.c
blob661d80ecbbdeeb57adf6cdf8875a1bb6d365bef1
1 /*
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
4 * for more details.
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>
22 struct smatch {
23 char *arcname;
24 char *liname;
25 int group;
26 int type;
27 int flags;
30 static struct smatch mach_table[] = {
31 { "SGI-IP22",
32 "SGI Indy",
33 MACH_GROUP_SGI,
34 MACH_SGI_IP22,
35 PROM_FLAG_ARCS
36 }, { "SGI-IP27",
37 "SGI Origin",
38 MACH_GROUP_SGI,
39 MACH_SGI_IP27,
40 PROM_FLAG_ARCS
41 }, { "SGI-IP28",
42 "SGI IP28",
43 MACH_GROUP_SGI,
44 MACH_SGI_IP28,
45 PROM_FLAG_ARCS
46 }, { "SGI-IP30",
47 "SGI Octane",
48 MACH_GROUP_SGI,
49 MACH_SGI_IP30,
50 PROM_FLAG_ARCS
51 }, { "SGI-IP32",
52 "SGI O2",
53 MACH_GROUP_SGI,
54 MACH_SGI_IP32,
55 PROM_FLAG_ARCS
56 }, { "Microsoft-Jazz",
57 "Jazz MIPS_Magnum_4000",
58 MACH_GROUP_JAZZ,
59 MACH_MIPS_MAGNUM_4000,
61 }, { "PICA-61",
62 "Jazz Acer_PICA_61",
63 MACH_GROUP_JAZZ,
64 MACH_ACER_PICA_61,
66 }, { "RM200PCI",
67 "SNI RM200_PCI",
68 MACH_GROUP_SNI_RM,
69 MACH_SNI_RM200_PCI,
70 PROM_FLAG_DONT_FREE_TEMP
71 }, {
72 "RM200PCI-R5K",
73 "SNI RM200_PCI-R5K",
74 MACH_GROUP_SNI_RM,
75 MACH_SNI_RM200_PCI,
76 PROM_FLAG_DONT_FREE_TEMP,
80 int prom_flags;
82 static struct smatch * __init string_to_mach(const char *s)
84 int i;
86 for (i = 0; i < ARRAY_SIZE(mach_table); i++) {
87 if (!strcmp(s, mach_table[i].arcname))
88 return &mach_table[i];
91 panic("Yeee, could not determine architecture type <%s>", s);
94 char *system_type;
96 const char *get_system_type(void)
98 return system_type;
101 void __init prom_identify_arch(void)
103 pcomponent *p;
104 struct smatch *mach;
105 const char *iname;
108 * The root component tells us what machine architecture we have here.
110 p = ArcGetChild(PROM_NULL_COMPONENT);
111 if (p == NULL) {
112 #ifdef CONFIG_SGI_IP27
113 /* IP27 PROM misbehaves, seems to not implement ARC
114 GetChild(). So we just assume it's an IP27. */
115 iname = "SGI-IP27";
116 #else
117 iname = "Unknown";
118 #endif
119 } else
120 iname = (char *) (long) p->iname;
122 printk("ARCH: %s\n", iname);
123 mach = string_to_mach(iname);
124 system_type = mach->liname;
126 mips_machgroup = mach->group;
127 mips_machtype = mach->type;
128 prom_flags = mach->flags;