2 * system.c: Probe the system type using ARCS prom interface library.
4 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
6 * $Id: system.c,v 1.7 1998/10/18 22:55:34 tsbogend Exp $
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/types.h>
11 #include <linux/string.h>
14 #include <asm/sgialib.h>
15 #include <asm/bootinfo.h>
17 enum sgi_mach sgimach
;
24 static struct smatch sgi_cputable
[] = {
25 { "MIPS-R2000", CPU_R2000
},
26 { "MIPS-R3000", CPU_R3000
},
27 { "MIPS-R3000A", CPU_R3000A
},
28 { "MIPS-R4000", CPU_R4000SC
},
29 { "MIPS-R4400", CPU_R4400SC
},
30 { "MIPS-R4600", CPU_R4600
},
31 { "MIPS-R8000", CPU_R8000
},
32 { "MIPS-R5000", CPU_R5000
},
33 { "MIPS-R5000A", CPU_R5000A
}
36 #define NUM_CPUS 9 /* for now */
38 __initfunc(static int string_to_cpu(char *s
))
42 for(i
= 0; i
< NUM_CPUS
; i
++) {
43 if(!strcmp(s
, sgi_cputable
[i
].name
))
44 return sgi_cputable
[i
].type
;
46 prom_printf("\nYeee, could not determine MIPS cpu type <%s>\n", s
);
47 prom_printf("press a key to reboot\n");
54 * We' call this early before loadmmu(). If we do the other way around
55 * the firmware will crash and burn.
57 __initfunc(void sgi_sysinit(void))
59 pcomponent
*p
, *toplev
, *cpup
= 0;
63 /* The root component tells us what machine architecture we
66 p
= prom_getchild(PROM_NULL_COMPONENT
);
68 /* Now scan for cpu(s). */
69 toplev
= p
= prom_getchild(p
);
75 prom_printf("\nYeee, SGI MP not ready yet\n");
76 prom_printf("press a key to reboot\n");
80 printk("CPU: %s ", p
->iname
);
82 cputype
= string_to_cpu(cpup
->iname
);
84 p
= prom_getsibling(p
);
87 prom_printf("\nYeee, could not find cpu ARCS component\n");
88 prom_printf("press a key to reboot\n");
92 p
= prom_getchild(cpup
);
98 printk("FPU<%s> ", p
->iname
);
129 p
= prom_getsibling(p
);