xref: /titanic_41/usr/src/uts/intel/sys/obpdefs.h (revision e49962a00eea60555f3c78ebf58a9a641590802c)
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 /*
37  * This file is intended as standalone inclusion by non-prom library
38  * functions that need it.
39  */
40 
41 typedef int	ihandle_t;		/* 1275 device instance number */
42 typedef int	phandle_t;		/* 1275 device tree node ptr */
43 typedef	phandle_t pnode_t;
44 
45 /*
46  * Device type matching
47  */
48 
49 #define	OBP_NONODE	((pnode_t)0)
50 #define	OBP_BADNODE	((pnode_t)-1)
51 
52 /*
53  * Property Defines
54  */
55 
56 #define	OBP_NAME		"name"
57 #define	OBP_REG			"reg"
58 #define	OBP_INTR		"intr"
59 #define	OBP_RANGES		"ranges"
60 #define	OBP_INTERRUPTS		"interrupts"
61 #define	OBP_COMPATIBLE		"compatible"
62 #define	OBP_STATUS		"status"
63 #define	OBP_BOARDNUM		"board#"
64 
65 #define	OBP_MAC_ADDR		"mac-address"
66 #define	OBP_STDINPATH		"stdin-path"
67 #define	OBP_STDOUTPATH		"stdout-path"
68 #define	OBP_IDPROM		"idprom"
69 
70 #define	OBP_DEVICETYPE		"device_type"
71 #define	OBP_DISPLAY		"display"
72 #define	OBP_NETWORK		"network"
73 #define	OBP_BYTE		"byte"
74 #define	OBP_BLOCK		"block"
75 #define	OBP_SERIAL		"serial"
76 #define	OBP_HIERARCHICAL	"hierarchical"
77 #define	OBP_CPU			"cpu"
78 #define	OBP_ADDRESS		"address"
79 
80 /*
81  * OBP status values defines
82  */
83 #define	OBP_ST_OKAY		"okay"
84 #define	OBP_ST_DISABLED		"disabled"
85 #define	OBP_ST_FAIL		"fail"
86 
87 /*
88  * Max size of a path component and a property name (not value)
89  * These are standard definitions.
90  */
91 #define	OBP_MAXDRVNAME		32	/* defined in P1275 */
92 #define	OBP_MAXPROPNAME		32	/* defined in P1275 */
93 
94 /*
95  *
96  * NB: Max pathname length is a platform-dependent parameter.
97  */
98 #define	OBP_MAXPATHLEN		256	/* Platform dependent */
99 
100 /*
101  *  Every OBP node must have a `/' followed by at least 2 chars,
102  *  so we can deduce the maxdepth of any OBP tree to be
103  *  OBP_MAXPATHNAME/3.  This is a good first swag.
104  */
105 
106 #define	OBP_STACKDEPTH		(OBP_MAXPATHLEN/3)
107 
108 #ifdef	__cplusplus
109 }
110 #endif
111 
112 #endif	/* _SYS_OBPDEFS_H */
113