190618Stmm/*-
290618Stmm * Copyright (c) 1998 The NetBSD Foundation, Inc.
390618Stmm * All rights reserved.
490618Stmm *
590618Stmm * This code is derived from software contributed to The NetBSD Foundation
690618Stmm * by Paul Kranenburg.
790618Stmm *
890618Stmm * Redistribution and use in source and binary forms, with or without
990618Stmm * modification, are permitted provided that the following conditions
1090618Stmm * are met:
1190618Stmm * 1. Redistributions of source code must retain the above copyright
1290618Stmm *    notice, this list of conditions and the following disclaimer.
1390618Stmm * 2. Redistributions in binary form must reproduce the above copyright
1490618Stmm *    notice, this list of conditions and the following disclaimer in the
1590618Stmm *    documentation and/or other materials provided with the distribution.
1690618Stmm *
1790618Stmm * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1890618Stmm * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1990618Stmm * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2090618Stmm * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2190618Stmm * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2290618Stmm * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2390618Stmm * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2490618Stmm * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2590618Stmm * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2690618Stmm * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2790618Stmm * POSSIBILITY OF SUCH DAMAGE.
2890618Stmm */
29139825Simp/*-
3090618Stmm * Copyright (c) 1992, 1993
3190618Stmm *	The Regents of the University of California.  All rights reserved.
3290618Stmm *
3390618Stmm * This software was developed by the Computer Systems Engineering group
3490618Stmm * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
3590618Stmm * contributed to Berkeley.
3690618Stmm *
3790618Stmm * All advertising materials mentioning features or use of this software
3890618Stmm * must display the following acknowledgement:
3990618Stmm *	This product includes software developed by the University of
4090618Stmm *	California, Lawrence Berkeley Laboratory.
4190618Stmm *
4290618Stmm * Redistribution and use in source and binary forms, with or without
4390618Stmm * modification, are permitted provided that the following conditions
4490618Stmm * are met:
4590618Stmm * 1. Redistributions of source code must retain the above copyright
4690618Stmm *    notice, this list of conditions and the following disclaimer.
4790618Stmm * 2. Redistributions in binary form must reproduce the above copyright
4890618Stmm *    notice, this list of conditions and the following disclaimer in the
4990618Stmm *    documentation and/or other materials provided with the distribution.
5090618Stmm * 4. Neither the name of the University nor the names of its contributors
5190618Stmm *    may be used to endorse or promote products derived from this software
5290618Stmm *    without specific prior written permission.
5390618Stmm *
5490618Stmm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
5590618Stmm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5690618Stmm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5790618Stmm * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5890618Stmm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5990618Stmm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
6090618Stmm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
6190618Stmm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
6290618Stmm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
6390618Stmm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6490618Stmm * SUCH DAMAGE.
6590618Stmm *
6690618Stmm *	from: @(#)sbusvar.h	8.1 (Berkeley) 6/11/93
67219567Smarius *	from: NetBSD: sbusvar.h,v 1.15 2008/04/28 20:23:36 martin Exp
6890618Stmm *
6990618Stmm * $FreeBSD$
7090618Stmm */
7190618Stmm
7290618Stmm#ifndef _SPARC64_SBUS_SBUSVAR_H_
73190112Smarius#define	_SPARC64_SBUS_SBUSVAR_H_
7490618Stmm
7590618Stmm/*
76146391Smarius * Macros for probe order
77146391Smarius */
78146391Smarius#define	SBUS_ORDER_FIRST	10
79146391Smarius#define	SBUS_ORDER_NORMAL	20
80146391Smarius
81146391Smarius/*
8290618Stmm * PROM-reported DMA burst sizes for the SBus
8390618Stmm */
84190112Smarius#define	SBUS_BURST_1		(1 << 0)
85190112Smarius#define	SBUS_BURST_2		(1 << 1)
86190112Smarius#define	SBUS_BURST_4		(1 << 2)
87190112Smarius#define	SBUS_BURST_8		(1 << 3)
88190112Smarius#define	SBUS_BURST_16		(1 << 4)
89190112Smarius#define	SBUS_BURST_32		(1 << 5)
90190112Smarius#define	SBUS_BURST_64		(1 << 6)
91190112Smarius#define	SBUS_BURST_MASK		((1 << SBUS_BURST_SIZE) - 1)
92190112Smarius#define	SBUS_BURST_SIZE		16
93190112Smarius#define	SBUS_BURST64_MASK	(SBUS_BURST_MASK << SBUS_BURST64_SHIFT)
94190112Smarius#define	SBUS_BURST64_SHIFT	16
9590618Stmm
9690618Stmm/* Used if no burst sizes are specified for the bus. */
9790618Stmm#define	SBUS_BURST_DEF \
9890618Stmm	(SBUS_BURST_1 | SBUS_BURST_2 | SBUS_BURST_4 | SBUS_BURST_8 | 	\
99190112Smarius	SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64)
100190112Smarius#define	SBUS_BURST64_DEF \
101190112Smarius	(SBUS_BURST_8 | SBUS_BURST_16 | SBUS_BURST_32 | SBUS_BURST_64)
10290618Stmm
10390618Stmmenum sbus_device_ivars {
10490618Stmm	SBUS_IVAR_BURSTSZ,
10590618Stmm	SBUS_IVAR_CLOCKFREQ,
106146391Smarius	SBUS_IVAR_IGN,
10790618Stmm	SBUS_IVAR_SLOT,
10890618Stmm};
10990618Stmm
11090618Stmm/*
11190618Stmm * Simplified accessors for sbus devices
11290618Stmm */
113190112Smarius#define	SBUS_ACCESSOR(var, ivar, type) \
11490618Stmm	__BUS_ACCESSOR(sbus, var, SBUS, ivar, type)
11590618Stmm
11690618StmmSBUS_ACCESSOR(burstsz,		BURSTSZ,	int)
11790618StmmSBUS_ACCESSOR(clockfreq,	CLOCKFREQ,	int)
118146391SmariusSBUS_ACCESSOR(ign,		IGN,		int)
11990618StmmSBUS_ACCESSOR(slot,		SLOT,		int)
12090618Stmm
121102146Smux#undef SBUS_ACCESSOR
12290618Stmm
12390618Stmm#endif /* _SPARC64_SBUS_SBUSVAR_H_ */
124