master
 1/*	$NetBSD: idprom.h,v 1.3 2008/04/28 20:23:58 martin Exp $	*/
 2
 3/*-
 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
 5 * All rights reserved.
 6 *
 7 * This code is derived from software contributed to The NetBSD Foundation
 8 * by Adam Glass.
 9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef _DEV_SUN_IDPROM_H_
33#define	_DEV_SUN_IDPROM_H_
34
35/*
36 * structure/definitions for the 32 byte id prom found in all suns.
37 */
38
39struct idprom {
40	uint8_t  idp_format;		/* format identifier (== 1) */
41	uint8_t  idp_machtype;		/* machine type */
42	uint8_t  idp_etheraddr[6];	/* Ethernet address */
43	uint32_t idp_date;		/* date of manufacture */
44	uint8_t  idp_serialnum[3];	/* serial number / host ID */
45	uint8_t  idp_checksum;		/* xor of everything else */
46	/* Note: The rest is excluded from the checksum! */
47	uint8_t  idp_reserved[16];
48};
49
50#define IDPROM_VERSION 1
51#define IDPROM_SIZE (sizeof(struct idprom))
52#define IDPROM_CKSUM_SIZE 16
53
54/* High nibble identifies the architecture. */
55#define IDM_ARCH_MASK	0xf0
56#define IDM_ARCH_SUN2	0x00
57#define IDM_ARCH_SUN3	0x10
58#define IDM_ARCH_SUN4   0x20
59#define IDM_ARCH_SUN3X	0x40
60#define IDM_ARCH_SUN4C	0x50
61#define IDM_ARCH_SUN4M	0x70
62
63/* Low nibble identifies the implementation. */
64#define IDM_IMPL_MASK 0x0f
65
66/* Values of idp_machtype we might see. */
67#define	ID_SUN2_120	0x01	/* Sun2 Multibus */
68#define	ID_SUN2_50	0x02	/* Sun2 VME */
69
70#define	ID_SUN3_160	0x11 	/* Carrera */
71#define	ID_SUN3_50	0x12 	/* M25 */
72#define	ID_SUN3_260	0x13 	/* Sirius */
73#define	ID_SUN3_110	0x14 	/* Prism */
74#define	ID_SUN3_60	0x17 	/* Sun3F */
75#define	ID_SUN3_E	0x18 	/* Sun3E */
76
77#define	ID_SUN3X_470	0x41	/* Pegasus */
78#define	ID_SUN3X_80	0x42	/* Hydra */
79
80#define	ID_SUN4_100	0x22	/* Sun 4/100 */
81#define	ID_SUN4_200	0x21	/* Sun 4/200 */
82#define	ID_SUN4_300	0x23	/* Sun 4/300 */
83#define	ID_SUN4_400	0x24	/* Sun 4/400 */
84
85#if defined(_KERNEL) || defined(_STANDALONE)
86
87extern struct idprom identity_prom;
88extern u_char cpu_machine_id;
89
90void idprom_etheraddr(u_char *);
91void idprom_init(void);
92
93#endif	/* _KERNEL || _STANDALONE */
94
95#endif /* ! _DEV_SUN_IDPROM_H_ */