aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/arc/identify.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/mips/arc/identify.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/mips/arc/identify.c')
-rw-r--r--arch/mips/arc/identify.c119
1 files changed, 119 insertions, 0 deletions
diff --git a/arch/mips/arc/identify.c b/arch/mips/arc/identify.c
new file mode 100644
index 000000000000..0dd7a345eb79
--- /dev/null
+++ b/arch/mips/arc/identify.c
@@ -0,0 +1,119 @@
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.
5 *
6 * identify.c: identify machine by looking up system identifier
7 *
8 * Copyright (C) 1998 Thomas Bogendoerfer
9 *
10 * This code is based on arch/mips/sgi/kernel/system.c, which is
11 *
12 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
13 */
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>
19
20#include <asm/sgialib.h>
21#include <asm/bootinfo.h>
22
23struct smatch {
24 char *arcname;
25 char *liname;
26 int group;
27 int type;
28 int flags;
29};
30
31static struct smatch mach_table[] = {
32 { "SGI-IP22",
33 "SGI Indy",
34 MACH_GROUP_SGI,
35 MACH_SGI_IP22,
36 PROM_FLAG_ARCS
37 }, { "SGI-IP27",
38 "SGI Origin",
39 MACH_GROUP_SGI,
40 MACH_SGI_IP27,
41 PROM_FLAG_ARCS
42 }, { "SGI-IP28",
43 "SGI IP28",
44 MACH_GROUP_SGI,
45 MACH_SGI_IP28,
46 PROM_FLAG_ARCS
47 }, { "SGI-IP32",
48 "SGI O2",
49 MACH_GROUP_SGI,
50 MACH_SGI_IP32,
51 PROM_FLAG_ARCS
52 }, { "Microsoft-Jazz",
53 "Jazz MIPS_Magnum_4000",
54 MACH_GROUP_JAZZ,
55 MACH_MIPS_MAGNUM_4000,
56 0
57 }, { "PICA-61",
58 "Jazz Acer_PICA_61",
59 MACH_GROUP_JAZZ,
60 MACH_ACER_PICA_61,
61 0
62 }, { "RM200PCI",
63 "SNI RM200_PCI",
64 MACH_GROUP_SNI_RM,
65 MACH_SNI_RM200_PCI,
66 PROM_FLAG_DONT_FREE_TEMP
67 }
68};
69
70int prom_flags;
71
72static struct smatch * __init string_to_mach(const char *s)
73{
74 int i;
75
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];
79 }
80
81 panic("Yeee, could not determine architecture type <%s>", s);
82}
83
84char *system_type;
85
86const char *get_system_type(void)
87{
88 return system_type;
89}
90
91void __init prom_identify_arch(void)
92{
93 pcomponent *p;
94 struct smatch *mach;
95 const char *iname;
96
97 /*
98 * The root component tells us what machine architecture we have here.
99 */
100 p = ArcGetChild(PROM_NULL_COMPONENT);
101 if (p == NULL) {
102#ifdef CONFIG_SGI_IP27
103 /* IP27 PROM misbehaves, seems to not implement ARC
104 GetChild(). So we just assume it's an IP27. */
105 iname = "SGI-IP27";
106#else
107 iname = "Unknown";
108#endif
109 } else
110 iname = (char *) (long) p->iname;
111
112 printk("ARCH: %s\n", iname);
113 mach = string_to_mach(iname);
114 system_type = mach->liname;
115
116 mips_machgroup = mach->group;
117 mips_machtype = mach->type;
118 prom_flags = mach->flags;
119}