xref: /openbsd-src/sys/arch/sparc64/dev/sbusvar.h (revision d874cce4b1d9fe6b41c9e4f2117a77d8a4a37b92)
1*d874cce4Sray /*	$OpenBSD: sbusvar.h,v 1.10 2008/06/26 05:42:13 ray Exp $	*/
22a7ff519Sjason /*	$NetBSD: sbusvar.h,v 1.7 1999/06/05 05:30:43 mrg Exp $ */
32a7ff519Sjason 
42a7ff519Sjason /*-
52a7ff519Sjason  * Copyright (c) 1998 The NetBSD Foundation, Inc.
62a7ff519Sjason  * All rights reserved.
72a7ff519Sjason  *
82a7ff519Sjason  * This code is derived from software contributed to The NetBSD Foundation
92a7ff519Sjason  * by Paul Kranenburg.
102a7ff519Sjason  *
112a7ff519Sjason  * Redistribution and use in source and binary forms, with or without
122a7ff519Sjason  * modification, are permitted provided that the following conditions
132a7ff519Sjason  * are met:
142a7ff519Sjason  * 1. Redistributions of source code must retain the above copyright
152a7ff519Sjason  *    notice, this list of conditions and the following disclaimer.
162a7ff519Sjason  * 2. Redistributions in binary form must reproduce the above copyright
172a7ff519Sjason  *    notice, this list of conditions and the following disclaimer in the
182a7ff519Sjason  *    documentation and/or other materials provided with the distribution.
192a7ff519Sjason  *
202a7ff519Sjason  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
212a7ff519Sjason  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
222a7ff519Sjason  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
232a7ff519Sjason  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
242a7ff519Sjason  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
252a7ff519Sjason  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
262a7ff519Sjason  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
272a7ff519Sjason  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
282a7ff519Sjason  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
292a7ff519Sjason  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
302a7ff519Sjason  * POSSIBILITY OF SUCH DAMAGE.
312a7ff519Sjason  */
322a7ff519Sjason 
332a7ff519Sjason /*
342a7ff519Sjason  * Copyright (c) 1992, 1993
352a7ff519Sjason  *	The Regents of the University of California.  All rights reserved.
362a7ff519Sjason  *
372a7ff519Sjason  * This software was developed by the Computer Systems Engineering group
382a7ff519Sjason  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
392a7ff519Sjason  * contributed to Berkeley.
402a7ff519Sjason  *
412a7ff519Sjason  * All advertising materials mentioning features or use of this software
422a7ff519Sjason  * must display the following acknowledgement:
432a7ff519Sjason  *	This product includes software developed by the University of
442a7ff519Sjason  *	California, Lawrence Berkeley Laboratory.
452a7ff519Sjason  *
462a7ff519Sjason  * Redistribution and use in source and binary forms, with or without
472a7ff519Sjason  * modification, are permitted provided that the following conditions
482a7ff519Sjason  * are met:
492a7ff519Sjason  * 1. Redistributions of source code must retain the above copyright
502a7ff519Sjason  *    notice, this list of conditions and the following disclaimer.
512a7ff519Sjason  * 2. Redistributions in binary form must reproduce the above copyright
522a7ff519Sjason  *    notice, this list of conditions and the following disclaimer in the
532a7ff519Sjason  *    documentation and/or other materials provided with the distribution.
5429295d1cSmillert  * 3. Neither the name of the University nor the names of its contributors
552a7ff519Sjason  *    may be used to endorse or promote products derived from this software
562a7ff519Sjason  *    without specific prior written permission.
572a7ff519Sjason  *
582a7ff519Sjason  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
592a7ff519Sjason  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
602a7ff519Sjason  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
612a7ff519Sjason  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
622a7ff519Sjason  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
632a7ff519Sjason  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
642a7ff519Sjason  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
652a7ff519Sjason  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
662a7ff519Sjason  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
672a7ff519Sjason  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
682a7ff519Sjason  * SUCH DAMAGE.
692a7ff519Sjason  *
702a7ff519Sjason  *	@(#)sbusvar.h	8.1 (Berkeley) 6/11/93
712a7ff519Sjason  */
722a7ff519Sjason 
732a7ff519Sjason #ifndef _SBUS_VAR_SPARC64_H_
742a7ff519Sjason #define _SBUS_VAR_SPARC64_H_
752a7ff519Sjason 
762a7ff519Sjason #include <machine/bus.h>
772a7ff519Sjason 
782a7ff519Sjason #include <sparc64/dev/iommuvar.h>
792a7ff519Sjason 
802a7ff519Sjason /*
812a7ff519Sjason  * Most devices are configured according to information kept in
822a7ff519Sjason  * the FORTH PROMs.  In particular, we extract the `name', `reg',
832a7ff519Sjason  * and `address' properties of each device attached to the mainbus;
842a7ff519Sjason  * other drives may also use this information.  The mainbus itself
852a7ff519Sjason  * (which `is' the CPU, in some sense) gets just the node, with a
862a7ff519Sjason  * fake name ("mainbus").
872a7ff519Sjason  */
882a7ff519Sjason 
89d277156aSsobrado /* variables per SBus */
902a7ff519Sjason struct sbus_softc {
912a7ff519Sjason 	struct	device		sc_dev;		/* base device */
922a7ff519Sjason 	bus_space_tag_t		sc_bustag;
93eb79e960Shenric 	bus_space_handle_t	sc_bh;
942a7ff519Sjason 	bus_dma_tag_t		sc_dmatag;
952a7ff519Sjason 	int			sc_clockfreq;	/* clock frequency (in Hz) */
962a7ff519Sjason 	struct sbus_range	*sc_range;
972a7ff519Sjason 	int			sc_nrange;
982a7ff519Sjason 	int			sc_burst;	/* burst transfer sizes supported */
992a7ff519Sjason 	int			*sc_intr2ipl;	/* Interrupt level translation */
1002a7ff519Sjason 	int			*sc_intr_compat;/* `intr' property to sbus compat */
1012a7ff519Sjason 
1022a7ff519Sjason 	int			sc_ign;		/* Interrupt group number for this sysio */
1032a7ff519Sjason 	struct iommu_state	sc_is;		/* IOMMU state, see iommureg.h */
104eb79e960Shenric 	struct strbuf_ctl	sc_sb;		/* Streaming buffer control */
105eb79e960Shenric 	int64_t			sc_flush;	/* Streaming buffer flush */
1068ecc2cf6Smiod 	struct sbus_softc	*sc_master;	/* main SBus */
1072a7ff519Sjason };
1082a7ff519Sjason 
109c4071fd1Smillert bus_addr_t sbus_bus_addr(bus_space_tag_t, u_int, u_int);
110f5b79df6Sjason 
1112a7ff519Sjason #endif /* _SBUS_VAR_SPARC64_H_ */
112eb79e960Shenric 
113