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