xref: /titanic_52/usr/src/uts/sun/sys/obpdefs.h (revision 9113a79cf228b8f7bd509b1328adf88659dfe218)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_OBPDEFS_H
28 #define	_SYS_OBPDEFS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	OBP_PSEUDO_ROMVEC_VERSION	5555
37 
38 typedef	int		ihandle_t;
39 typedef	int		phandle_t;
40 typedef	phandle_t	pnode_t;
41 
42 /*
43  * Device type matching
44  */
45 
46 #define	OBP_NONODE	((pnode_t)0)
47 #define	OBP_BADNODE	((pnode_t)-1)
48 
49 /*
50  * Property Defines
51  */
52 
53 #define	OBP_NAME		"name"
54 #define	OBP_REG			"reg"
55 #define	OBP_INTR		"intr"
56 #define	OBP_RANGES		"ranges"
57 #define	OBP_INTERRUPTS		"interrupts"
58 #define	OBP_COMPATIBLE		"compatible"
59 #define	OBP_STATUS		"status"
60 #define	OBP_BOARDNUM		"board#"
61 
62 #define	OBP_MAC_ADDR		"mac-address"
63 #define	OBP_STDINPATH		"stdin-path"
64 #define	OBP_STDOUTPATH		"stdout-path"
65 #define	OBP_IDPROM		"idprom"
66 
67 #define	OBP_DEVICETYPE		"device_type"
68 #define	OBP_DISPLAY		"display"
69 #define	OBP_NETWORK		"network"
70 #define	OBP_BYTE		"byte"
71 #define	OBP_BLOCK		"block"
72 #define	OBP_SERIAL		"serial"
73 #define	OBP_HIERARCHICAL	"hierarchical"
74 #define	OBP_IPI			"ipi3"
75 #define	OBP_CPU			"cpu"
76 #define	OBP_ADDRESS		"address"
77 
78 /*
79  * OBP status values defines
80  */
81 #define	OBP_ST_OKAY		"okay"
82 #define	OBP_ST_DISABLED		"disabled"
83 #define	OBP_ST_FAIL		"fail"
84 
85 /*
86  * Max size of a path component and a property name (not value)
87  * These are standard definitions.
88  */
89 #define	OBP_MAXDRVNAME		32	/* defined in P1275 */
90 #define	OBP_MAXPROPNAME		32	/* defined in P1275 */
91 
92 /*
93  * NB: Max pathname length is a platform-dependent parameter.
94  * Also note that this parameter is used to define the crpconfig
95  * structure in cpr.h. The cprconfig structure is currently
96  * consumed by other consolidations. Care should be take before
97  * changing this parameter value.
98  */
99 #define	OBP_MAXPATHLEN		256	/* Platform dependent */
100 
101 /*
102  *  Every OBP node must have a `/' followed by at least 2 chars,
103  *  so we can deduce the maxdepth of any OBP tree to be
104  *  OBP_MAXPATHNAME/3.  This is a good first swag.
105  */
106 
107 #define	OBP_STACKDEPTH		(OBP_MAXPATHLEN/3)
108 
109 #define	ROMVEC_BLKSIZE		512	/* XXX */
110 
111 /*
112  *  OBP Module mailbox messages for MP's
113  *
114  *	00..7F	: power-on self test
115  *
116  *	80..8F	: active in boot prom (at the "ok" prompt)
117  *
118  *	90..EF  : idle in boot prom
119  *
120  *	F0	: active in application
121  *
122  *	F1..FA	: reserved for future use
123  *
124  *	FB	: One processor exited to the PROM via op_exit(),
125  *		  call to prom_stopcpu() requested.
126  *
127  *	FC	: One processor entered the PROM via op_enter(),
128  *		  call to prom_idlecpu() requested.
129  *
130  *	FD	: One processor hit a BREAKPOINT,
131  *		  call to prom_idlecpu() requested.
132  *
133  *	FE	: One processor got a WATCHDOG RESET
134  *		  call to prom_stopcpu() requested.
135  *
136  *	FF	: This processor not available.
137  *
138  */
139 
140 #define	OBP_MB_IDLE_LOW		((unsigned char)(0x90))
141 #define	OBP_MB_IDLE_HIGH	((unsigned char)(0xef))
142 
143 #define	OBP_MB_IS_IDLE(s)	(((s) >= OBP_MB_IDLE_LOW) && \
144 				    ((s) <= OBP_MB_IDLE_HIGH))
145 
146 #define	OBP_MB_ACTIVE		((unsigned char)(0xf0))
147 #define	OBP_MB_EXIT_STOP	((unsigned char)(0xfb))
148 #define	OBP_MB_ENTER_IDLE	((unsigned char)(0xfc))
149 #define	OBP_MB_BRKPT_IDLE	((unsigned char)(0xfd))
150 #define	OBP_MB_WATCHDOG_STOP	((unsigned char)(0xfe))
151 
152 /*
153  * The possible values for "*romp->v_insource" and "*romp->v_outsink" are
154  * listed below.  These may be extended in the future.  Your program should
155  * cope with this gracefully (e.g. by continuing to vector through the ROM
156  * I/O routines if these are set in a way you don't understand).
157  */
158 #define	INKEYB		0	/* Input from parallel keyboard. */
159 #define	INUARTA		1	/* Input or output to Uart A.	*/
160 #define	INUARTB		2	/* Input or output to Uart B.	*/
161 #define	INUARTC		3	/* Input or output to Uart C.	*/
162 #define	INUARTD		4	/* Input or output to Uart D.	*/
163 #define	OUTSCREEN	0	/* Output to frame buffer.	*/
164 #define	OUTUARTA	1	/* Input or output to Uart A.	*/
165 #define	OUTUARTB	2	/* Input or output to Uart B.	*/
166 #define	OUTUARTC	3	/* Input or output to Uart C.	*/
167 #define	OUTUARTD	4	/* Input or output to Uart D.	*/
168 
169 /*
170  * Structure set up by the boot command to pass arguments to the booted
171  * program.
172  */
173 struct bootparam {
174 	char	*bp_argv[8];	/* String arguments.			*/
175 	char	bp_strings[100]; /* String table for string arguments.	*/
176 	char	bp_dev[2];	/* Device name.				*/
177 	int	bp_ctlr;	/* Controller Number.			*/
178 	int	bp_unit;	/* Unit Number.				*/
179 	int	bp_part;	/* Partition/file Number.		*/
180 	char	*bp_name;	/* File name.  Points into "bp_strings"	*/
181 	struct boottab *bp_boottab; /* Points to table entry for device	*/
182 };
183 
184 #ifdef	__cplusplus
185 }
186 #endif
187 
188 #endif	/* _SYS_OBPDEFS_H */
189