]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/sparc64/sbus/sbusvar.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / sparc64 / sbus / sbusvar.h
1 /*-
2  * Copyright (c) 1998 The NetBSD Foundation, Inc.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to The NetBSD Foundation
6  * by Paul Kranenburg.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. All advertising materials mentioning features or use of this software
17  *    must display the following acknowledgement:
18  *        This product includes software developed by the NetBSD
19  *        Foundation, Inc. and its contributors.
20  * 4. Neither the name of The NetBSD Foundation nor the names of its
21  *    contributors may be used to endorse or promote products derived
22  *    from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
25  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
28  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  */
36 /*-
37  * Copyright (c) 1992, 1993
38  *      The Regents of the University of California.  All rights reserved.
39  *
40  * This software was developed by the Computer Systems Engineering group
41  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
42  * contributed to Berkeley.
43  *
44  * All advertising materials mentioning features or use of this software
45  * must display the following acknowledgement:
46  *      This product includes software developed by the University of
47  *      California, Lawrence Berkeley Laboratory.
48  *
49  * Redistribution and use in source and binary forms, with or without
50  * modification, are permitted provided that the following conditions
51  * are met:
52  * 1. Redistributions of source code must retain the above copyright
53  *    notice, this list of conditions and the following disclaimer.
54  * 2. Redistributions in binary form must reproduce the above copyright
55  *    notice, this list of conditions and the following disclaimer in the
56  *    documentation and/or other materials provided with the distribution.
57  * 4. Neither the name of the University nor the names of its contributors
58  *    may be used to endorse or promote products derived from this software
59  *    without specific prior written permission.
60  *
61  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
62  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
63  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
64  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
65  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
66  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
67  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
68  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
69  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
70  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
71  * SUCH DAMAGE.
72  *
73  *      from: @(#)sbusvar.h     8.1 (Berkeley) 6/11/93
74  *      from: NetBSD: sbusvar.h,v 1.7 1999/06/05 05:30:43 mrg Exp
75  *
76  * $FreeBSD$
77  */
78
79 #ifndef _SPARC64_SBUS_SBUSVAR_H_
80 #define _SPARC64_SBUS_SBUSVAR_H_
81
82 /*
83  * Macros for probe order
84  */
85 #define SBUS_ORDER_FIRST        10
86 #define SBUS_ORDER_NORMAL       20
87
88 /*
89  * PROM-reported DMA burst sizes for the SBus
90  */
91 #define SBUS_BURST_1            (1 << 0)
92 #define SBUS_BURST_2            (1 << 1)
93 #define SBUS_BURST_4            (1 << 2)
94 #define SBUS_BURST_8            (1 << 3)
95 #define SBUS_BURST_16           (1 << 4)
96 #define SBUS_BURST_32           (1 << 5)
97 #define SBUS_BURST_64           (1 << 6)
98 #define SBUS_BURST_MASK         ((1 << SBUS_BURST_SIZE) - 1)
99 #define SBUS_BURST_SIZE         16
100 #define SBUS_BURST64_MASK       (SBUS_BURST_MASK << SBUS_BURST64_SHIFT)
101 #define SBUS_BURST64_SHIFT      16
102
103 /* Used if no burst sizes are specified for the bus. */
104 #define SBUS_BURST_DEF \
105         (SBUS_BURST_1 | SBUS_BURST_2 | SBUS_BURST_4 | SBUS_BURST_8 |    \
106         SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64)
107 #define SBUS_BURST64_DEF \
108         (SBUS_BURST_8 | SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64)
109
110 enum sbus_device_ivars {
111         SBUS_IVAR_BURSTSZ,
112         SBUS_IVAR_CLOCKFREQ,
113         SBUS_IVAR_IGN,
114         SBUS_IVAR_SLOT,
115 };
116
117 /*
118  * Simplified accessors for sbus devices
119  */
120 #define SBUS_ACCESSOR(var, ivar, type) \
121         __BUS_ACCESSOR(sbus, var, SBUS, ivar, type)
122
123 SBUS_ACCESSOR(burstsz,          BURSTSZ,        int)
124 SBUS_ACCESSOR(clockfreq,        CLOCKFREQ,      int)
125 SBUS_ACCESSOR(ign,              IGN,            int)
126 SBUS_ACCESSOR(slot,             SLOT,           int)
127
128 #undef SBUS_ACCESSOR
129
130 #endif /* _SPARC64_SBUS_SBUSVAR_H_ */