Import 2.3.49pre2
[davej-history.git] / arch / mips / dec / prom / identify.c
blob6acacc1c4e8e217845ae4918f316aa107b61963d
1 /*
2 * identify.c: machine identification code.
4 * Copyright (C) 1998 Harald Koerfgen and Paul M. Antoine
6 * $Id: identify.c,v 1.2 1999/10/09 00:00:58 ralf Exp $
7 */
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/string.h>
12 #include <asm/bootinfo.h>
14 #include "dectypes.h"
15 #include "prom.h"
17 extern char *(*prom_getenv)(char *);
18 extern int (*prom_printf)(char *, ...);
19 extern int (*rex_getsysid)(void);
21 extern unsigned long mips_machgroup;
22 extern unsigned long mips_machtype;
24 void __init prom_identify_arch (unsigned int magic)
26 unsigned char dec_cpunum, dec_firmrev, dec_etc;
27 int dec_systype;
28 unsigned long dec_sysid;
30 if (magic != REX_PROM_MAGIC) {
31 dec_sysid = simple_strtoul(prom_getenv("systype"), (char **)0, 0);
32 } else {
33 dec_sysid = rex_getsysid();
34 if (dec_sysid == 0) {
35 prom_printf("Zero sysid returned from PROMs! Assuming PMAX-like machine.\n");
36 dec_sysid = 1;
40 dec_cpunum = (dec_sysid & 0xff000000) >> 24;
41 dec_systype = (dec_sysid & 0xff0000) >> 16;
42 dec_firmrev = (dec_sysid & 0xff00) >> 8;
43 dec_etc = dec_sysid & 0xff;
45 /* We're obviously one of the DEC machines */
46 mips_machgroup = MACH_GROUP_DEC;
49 * FIXME: This may not be an exhaustive list of DECStations/Servers!
50 * Put all model-specific initialisation calls here.
52 prom_printf("This DECstation is a ");
54 switch (dec_systype) {
55 case DS2100_3100:
56 prom_printf("DS2100/3100\n");
57 mips_machtype = MACH_DS23100;
58 break;
59 case DS5100: /* DS5100 MIPSMATE */
60 prom_printf("DS5100\n");
61 mips_machtype = MACH_DS5100;
62 break;
63 case DS5000_200: /* DS5000 3max */
64 prom_printf("DS5000/200\n");
65 mips_machtype = MACH_DS5000_200;
66 break;
67 case DS5000_1XX: /* DS5000/100 3min */
68 prom_printf("DS5000/1xx\n");
69 mips_machtype = MACH_DS5000_1XX;
70 break;
71 case DS5000_2X0: /* DS5000/240 3max+ */
72 prom_printf("DS5000/2x0\n");
73 mips_machtype = MACH_DS5000_2X0;
74 break;
75 case DS5000_XX: /* Personal DS5000/2x */
76 prom_printf("Personal DS5000/xx\n");
77 mips_machtype = MACH_DS5000_XX;
78 break;
79 case DS5800: /* DS5800 Isis */
80 prom_printf("DS5800\n");
81 mips_machtype = MACH_DS5800;
82 break;
83 case DS5400: /* DS5400 MIPSfair */
84 prom_printf("DS5400\n");
85 mips_machtype = MACH_DS5400;
86 break;
87 case DS5500: /* DS5500 MIPSfair-2 */
88 prom_printf("DS5500\n");
89 mips_machtype = MACH_DS5500;
90 break;
91 default:
92 prom_printf("unknown, id is %x", dec_systype);
93 mips_machtype = MACH_DSUNKNOWN;
94 break;