xref: /netbsd/sys/arch/vax/uba/uba_common.h (revision 7a092e0d)
1 /*	$NetBSD: uba_common.h,v 1.6 2008/11/19 15:39:10 hans Exp $ */
2 /*-
3  * Copyright (c) 1982, 1986 The Regents of the University of California.
4  * All rights reserved.
5  * (c) UNIX System Laboratories, Inc.
6  * All or some portions of this file are derived from material licensed
7  * to the University of California by American Telephone and Telegraph
8  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
9  * the permission of UNIX System Laboratories, Inc.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *	@(#)ubareg.h	7.8 (Berkeley) 5/9/91
36  */
37 
38 /*
39  * VAX-specific parts of the Unibus softc.
40  */
41 struct uba_regs;
42 
43 struct	uba_vsoftc {
44 	struct	uba_softc uv_sc;/* Common vars from dev/qbus/ubavar.h */
45 	struct	vax_bus_dma_tag uv_dmat;
46 	struct	vax_sgmap uv_sgmap;
47 	int	uv_size;	/* Size of UBA addressable memory */
48 	paddr_t uv_addr;	/* Physical address of map registers */
49 	struct	uba_regs *uv_uba;/* Where applicable */
50 	int	uh_ibase;
51 	int	uh_zvtime;
52 	int	uh_zvtotal;
53 	int	uh_zvcnt;
54 };
55 
56 /*
57  * Size of unibus memory address space in pages
58  * (also number of map registers).
59  */
60 #define UBAPAGES	496
61 #define UBAIOADDR	0760000	 /* start of I/O page */
62 #define UBAIOPAGES	16
63 
64 /*
65  * DW780/DW750 hardware registers
66  */
67 struct uba_regs {
68 	volatile int	uba_cnfgr;	/* configuration register */
69 	volatile int	uba_cr;		/* control register */
70 	volatile int	uba_sr;		/* status register */
71 	volatile int	uba_dcr;	/* diagnostic control register */
72 	volatile int	uba_fmer;	/* failed map entry register */
73 	volatile int	uba_fubar;	/* failed UNIBUS address register */
74 	int		pad1[2];
75 	volatile int	uba_brsvr[4];
76 	volatile int	uba_brrvr[4];	/* receive vector registers */
77 	volatile int	uba_dpr[16];	/* buffered data path register */
78 	int		pad2[480];
79 	struct pte	uba_map[UBAPAGES]; /* unibus map register */
80 	int		pad3[UBAIOPAGES]; /* no maps for device address space */
81 };
82 
83 void	uba_dma_init(struct uba_vsoftc *);
84