xref: /netbsd-src/sys/arch/newsmips/newsmips/machid.h (revision 18d4eede3402827d776030ff7cf3315cb9e1039e)
1 /*	$NetBSD: machid.h,v 1.7 2018/10/14 00:10:11 tsutsui Exp $	*/
2 /*
3  * Copyright (c) 1992, 1993
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * from: $Hdr: machid.h,v 4.300 91/06/09 06:35:19 root Rel41 $ SONY
34  *
35  *	@(#)machid.h	8.1 (Berkeley) 6/11/93
36  */
37 
38 #ifndef __MACHID__
39 #define __MACHID__ 1
40 
41 /*
42  * machine id number definition.
43  */
44 #define	ICK001	1
45 #define	ICK00X	2
46 #define	NWS799	3
47 #define	NWS800	4
48 #define	NWS801	5
49 #define	NWS802	6
50 #define	NWS711	7
51 #define	NWS721	8
52 #define	NWS1850	9
53 #define	NWS810	10
54 #define	NWS811	11
55 #define	NWS1830	12
56 #define	NWS1750	13
57 #define	NWS1720	14
58 #define	NWS1930	15
59 #define	NWS1960	16
60 #define	NWS712	17
61 #define	NWS1860	18
62 #define	PWS1630	19
63 #define	NWS820	20
64 #define	NWS821	21
65 #define	NWS1760	22
66 #define	NWS1710	23
67 #define	NWS830	30
68 #define	NWS831	31
69 #define	NWS841	41
70 #define	PWS1570	52
71 #define	PWS1590	54
72 #define	NWS1520	56
73 #define	PWS1550	73
74 #define	PWS1520	74
75 #define	PWS1560	75
76 #define	NWS1530	76
77 #define	NWS1580	77
78 #define	NWS1510	78
79 #define	NWS1410	81
80 #define	NWS1450	85
81 #define	NWS1460	86
82 #define	NWS891	91
83 #define	NWS911	111
84 #define	NWS921	121
85 #define	NWB235	235
86 #define	NWB235A	236
87 #define	NWXRES	255
88 
89 #ifdef __mips__
90 #define	MACHID_MODEL(X)		(((X)>>18)&0x1f)
91 #define	MACHID_SERIAL(X)	((X)&0x3ffff)
92 #else /* __mips__ */
93 #define	MACHID_MODEL(X)		(((X)>>16)&0xff)
94 #define	MACHID_SERIAL(X)	((X)&0xffff)
95 #endif /* __mips__ */
96 
97 #ifndef LOCORE
98 
99 /*
100  * MPU board id number definition.
101  */
102 #define MPU0 0				/* not used */
103 #define MPU1 1				/* ICKI */
104 #define MPU2 2				/* 799/801/810/811/820/821 */
105 #define MPU3 3				/* 802/830/841/911/921 */
106 #define MPU4 4				/* 711 */
107 #define MPU5 5				/* 1830/1850/1860/1930/1960 */
108 #define MPU6 6				/* 712/721 */
109 #define MPU7 7				/* 14XX/15XX */
110 #define MPU8 8				/* 16XX/17XX */
111 #define MPU9 9				/*  */
112 
113 struct machid {
114 /*00*/	u_short	m_pwb;			/* MPU board number */
115 /*02*/	u_short	m_model;		/* MPU dependent model code */
116 /*04*/	u_int	m_serial;		/* machine serial number */
117 /*08*/	u_int	m_reserve0;
118 /*0c*/	u_int	m_reserve1;
119 /*10*/
120 };
121 
122 union omachid {
123 /*00*/	struct om_field {
124 		u_int	fi_reserve:2,
125 			fi_pwb:7,	/* MPU (printed wired) board number */
126 			fi_model:5,	/* MPU dependent model code */
127 			fi_serial:18;	/* machine serial number */
128 	} om_fi;
129 /*00*/	u_int	om_data;
130 /*04*/
131 };
132 
133 struct machine_type {
134 /*00*/	int	m_model_id;
135 /*04*/	char	*m_model_name;
136 /*08*/	char	*m_machine_name;
137 /*0c*/	char	*m_maincpu;
138 /*10*/	char	*m_subcpu;
139 /*14*/	char	*m_fpa;
140 /*18*/	int	m_board_id;
141 /*1c*/	int	m_cachecntl;
142 /*20*/	int	m_maxusers;		/* not used */
143 /*24*/	int	m_dcachesize;		/* not used */
144 /*28*/	int	m_icachesize;		/* not used */
145 /*2c*/
146 };
147 
148 #if defined(news700) || defined(news800) || defined(news1700) || defined(news1800)
149 struct idrom {
150 /*00*/	unsigned char	id_model;
151 /*01*/	unsigned char	id_serial[2];
152 /*03*/	unsigned char	id_lot;
153 /*04*/	unsigned char	id_reserved[2];
154 /*06*/	unsigned char	id_chksum0[2];
155 /*08*/	unsigned char	id_ether[6];
156 /*0e*/	unsigned char	id_chksum1[2];
157 /*10*/
158 };
159 #endif /* news700 || news800 || news1700 || news1800 */
160 
161 #if defined(news1200) || defined(news3400) || defined(news3800) || defined(news5000) || defined(news4000)
162 struct idrom {
163 /*00*/	unsigned char	id_id;          	/* always 0xff */
164 /*01*/	unsigned char	id_netid[5];    	/* network ID */
165 /*06*/	unsigned short	id_csum1;       	/* checksum 1 */
166 /*08*/	unsigned char	id_macadrs[6];  	/* MAC (ethernet) address */
167 /*0e*/	unsigned short	id_csum2;       	/* checksum 2 */
168 /*10*/	unsigned short	id_boardid;     	/* CPU board ID */
169 /*12*/	unsigned short	id_modelid;     	/* model ID */
170 /*14*/	unsigned int	id_serial;      	/* serial number */
171 /*18*/	unsigned short	id_year;
172 /*1a*/	unsigned short	id_month;
173 /*1c*/	unsigned char	id_zone[4];
174 /*20*/	char		id_board[16];
175 /*30*/	char		id_model[16];
176 /*40*/	char		id_machine[16];
177 /*50*/	char		id_cpu[16];
178 /*60*/	char		id_iop[16];
179 /*70*/	unsigned char	id_reserved[12];
180 /*7c*/	unsigned int	id_csum3;
181 /*80*/
182 };
183 #endif /* news1200 || news3400 || news3800 || news5000 || news4000 */
184 
185 #endif /* !LOCORE */
186 
187 #endif /* __MACHID__ */
188